Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UpdateBoundaryConditionsMP.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: update boundary conditions for RocfluidMP framework.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = data of all regions,
30 ! istage = current RK stage.
31 !
32 ! Output: regions%levels%mixt = new solution after one time step.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: UpdateBoundaryConditionsMP.F90,v 1.6 2008/12/06 08:44:10 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE updateboundaryconditionsmp( regions,istage )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modmpi
51  USE modparameters
52 #ifdef RFLO
58 
59 #ifdef TURB
62 #endif
63 !#ifdef PERI
64 ! USE PERI_ModHybridDES, ONLY : PERI_CoMeanCorrection
65 !#endif
66 #endif
67 
68 #ifdef PLAG
71 #endif
72 #ifdef PEUL
75 #endif
76 
77  IMPLICIT NONE
78 
79 #ifdef GENX
80  include 'roccomf90.h'
81 #endif
82 
83 ! ... parameters
84  TYPE(t_region), POINTER :: regions(:)
85 
86  INTEGER, INTENT(IN) :: istage
87 
88 ! ... loop variables
89  INTEGER :: ireg
90 
91 ! ... local variables
92  REAL(RFREAL) :: ark(5), trk(5), time, subdt, subtime
93 
94  TYPE(t_global), POINTER :: global
95 
96 #ifdef GENX
97  DOUBLE PRECISION :: alpha
98 #endif
99 
100 !******************************************************************************
101 
102  global => regions(1)%global
103 
104  CALL registerfunction( global,'UpdateBoundaryConditions',&
105  'UpdateBoundaryConditionsMP.F90' )
106 
107 ! get time-stepping coefficients ==============================================
108 
109  ark(:) = regions(1)%mixtInput%ark(:)
110  trk(:) = regions(1)%mixtInput%trk(:)
111 
112  IF (istage == 1) THEN
113  subdt = ark(1)*global%dtMin
114  subtime = global%currentTime + subdt
115  ELSE IF (istage == global%nrkSteps) THEN
116  subdt = (1.0_rfreal - ark(global%nrkSteps-1))*global%dtMin
117  subtime = global%currentTime + global%dtMin
118  ELSE
119  subdt = (ark(istage) - ark(istage - 1))*global%dtMin
120  subtime = global%currentTime + ark(istage)*global%dtMin
121  ENDIF ! istage
122 
123 ! update boundary conditions ------------------------------------------------
124 
125 #ifdef RFLO
126 #ifdef GENX
127  time = global%currentTime + global%dtMin*trk(istage)
128  alpha = (time-global%timeStamp)/global%dTimeSystem
129 
130 ! - send fluids density at interface
131  CALL com_call_function( global%genxHandleBc,2,alpha,1 )
132 
133  DO ireg=1,global%nRegions
134  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
135  regions(ireg)%active==active) THEN ! on my processor
136  IF (regions(ireg)%mixtInput%externalBc) THEN
137  CALL rflo_sendboundaryvaluesalpha( regions(ireg) )
138  ENDIF
139  ENDIF
140  ENDDO
141 
142 ! - get BC values at the interface; set BC values in dummy cells
143 
144  CALL com_call_function( global%genxHandleBc,2,alpha,2 )
145 #endif
146 
147  DO ireg=1,global%nRegions
148  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
149  regions(ireg)%active==active) THEN ! on my processor
150  IF (regions(ireg)%mixtInput%externalBc) THEN
151  CALL rflo_getboundaryvalues( regions(ireg) )
152  ENDIF
153  CALL updatetbc( regions(ireg),subtime,subdt,istage==global%nrkSteps )
154  CALL rflo_boundaryconditionsset( regions,ireg )
155 #ifdef PEUL
156  IF (global%peulUsed) &
157  CALL peul_boundaryconditionsset( regions,ireg )
158 #endif
159 #ifdef TURB
160  IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
161  (regions(ireg)%mixtInput%turbModel /= turb_model_none)) &
162  CALL turb_rflo_ransbndconditionsset( regions,ireg )
163 #endif
164  ENDIF
165  ENDDO
166 
167 ! - receive variables from other processors; send BC data to external driver --
168 
169  DO ireg=1,global%nRegions
170  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
171  regions(ireg)%active==active) THEN ! on my processor
172  CALL rflo_boundaryconditionsrecv( regions,ireg )
173 #ifdef PEUL
174  IF (global%peulUsed) &
175  CALL peul_boundaryconditionsrecv( regions,ireg )
176 #endif
177 #ifdef TURB
178  IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
179  (regions(ireg)%mixtInput%turbModel /= turb_model_none)) &
180  CALL turb_rflo_ransbndconditionsrecv( regions,ireg )
181 #endif
182  ENDIF
183  ENDDO
184 
185 ! - clear send requests -------------------------------------------------------
186 
187  DO ireg=1,global%nRegions
188  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
189  regions(ireg)%active==active) THEN ! on my processor
190  CALL rflo_clearsendrequests( regions,ireg,.false. )
191 #ifdef PEUL
192  IF (global%peulUsed) &
193  CALL peul_clearsendrequests( regions,ireg )
194 #endif
195 #ifdef TURB
196  IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
197  (regions(ireg)%mixtInput%turbModel /= turb_model_none)) &
198  CALL turb_rflo_ransclearsendrequests( regions,ireg )
199 #endif
200  ENDIF
201  ENDDO
202 
203 #ifdef PLAG
204  CALL plag_cecellswrapper( regions )
205 
206  CALL plag_patchupdatewrapper( regions )
207 #endif
208 
209 ! - post-BC operations of physical modules ------------------------------------
210 
211 #ifdef PERI
212 ! DO iReg=1,global%nRegions
213 ! IF (regions(iReg)%procid==global%myProcid .AND. & ! region active and
214 ! regions(iReg)%active==ACTIVE) THEN ! on my processor
215 ! IF (regions(iReg)%periInput%flowKind /= OFF) THEN
216 ! CALL PERI_CoMeanCorrection( regions(iReg) )
217 ! ENDIF
218 ! ENDIF
219 ! ENDDO
220 #endif
221 
222 #endif
223 
224 ! finalize ====================================================================
225 
226  CALL deregisterfunction( global )
227 
228 END SUBROUTINE updateboundaryconditionsmp
229 
230 !******************************************************************************
231 !
232 ! RCS Revision history:
233 !
234 ! $Log: UpdateBoundaryConditionsMP.F90,v $
235 ! Revision 1.6 2008/12/06 08:44:10 mtcampbe
236 ! Updated license.
237 !
238 ! Revision 1.5 2008/11/19 22:17:24 mtcampbe
239 ! Added Illinois Open Source License/Copyright
240 !
241 ! Revision 1.4 2005/04/17 05:21:22 wasistho
242 ! commented PERI_coMeanCorrection
243 !
244 ! Revision 1.3 2005/04/06 02:16:59 wasistho
245 ! mv call to PERI_CoMeanCorrection to UpdateBoundaryConditionsMP
246 !
247 ! Revision 1.2 2004/12/28 22:49:37 wasistho
248 ! moved RFLO_Bcond* and RFLO_BoundaryCond* routines into RFLO_ModBoundaryConditions
249 !
250 ! Revision 1.1 2004/12/01 16:51:56 haselbac
251 ! Initial revision after changing case
252 !
253 ! Revision 1.21 2004/03/27 03:02:36 wasistho
254 ! added ifdef RFLO within ifdef TURB
255 !
256 ! Revision 1.20 2004/03/11 03:32:25 wasistho
257 ! changed rocturb nomenclature
258 !
259 ! Revision 1.19 2004/03/05 22:09:00 jferry
260 ! created global variables for peul, plag, and inrt use
261 !
262 ! Revision 1.18 2004/02/26 21:01:48 haselbac
263 ! Removed istage argument from call to PLAG_PatchUpdateWrapper
264 !
265 ! Revision 1.17 2004/02/14 01:51:08 fnajjar
266 ! Removed WRITE statements surrounding PLAG_CECellsWrapper
267 !
268 ! Revision 1.16 2004/02/02 22:48:37 haselbac
269 ! Added ifdef RFLO - temporary measure
270 !
271 ! Revision 1.15 2004/01/26 23:38:18 fnajjar
272 ! Reinstated call to PLAG_CECellsWrapper
273 !
274 ! Revision 1.14 2004/01/16 21:14:26 fnajjar
275 ! Deactivated call to PLAG_CECellsWrapper as routine not complete
276 !
277 ! Revision 1.13 2003/11/21 22:33:33 fnajjar
278 ! Turned off comments
279 !
280 ! Revision 1.12 2003/11/20 16:40:35 mdbrandy
281 ! Backing out RocfluidMP changes from 11-17-03
282 !
283 ! Revision 1.9 2003/11/12 21:19:11 fnajjar
284 ! Added Corner-Edge cell routine
285 !
286 ! Revision 1.8 2003/10/03 20:13:12 wasistho
287 ! initial installation of turbModel SA and DES
288 !
289 ! Revision 1.7 2003/09/26 21:45:34 fnajjar
290 ! Modified ModInterfaces calls to proper physical modules
291 !
292 ! Revision 1.6 2003/07/03 21:48:44 jblazek
293 ! Implemented dual-time stepping.
294 !
295 ! Revision 1.5 2003/05/15 02:57:02 jblazek
296 ! Inlined index function.
297 !
298 ! Revision 1.4 2003/05/09 17:01:03 jiao
299 ! Renamed the COM_call_function_handlers to COM_call_function.
300 !
301 ! Revision 1.3 2003/04/10 01:22:41 jblazek
302 ! Got rid of pRegion in ViscousFluxesMP.
303 !
304 ! Revision 1.2 2003/04/09 14:19:29 fnajjar
305 ! Added routines to receive and clear requests for MPI-based rocsmoke
306 !
307 ! Revision 1.1 2003/03/28 19:48:05 fnajjar
308 ! Initial import for RocfluidMP
309 !
310 !******************************************************************************
311 
312 
313 
314 
315 
316 
317 
subroutine peul_boundaryconditionsset(regions, iReg)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine peul_clearsendrequests(regions, iReg)
subroutine turb_rflo_ransbndconditionsrecv(regions, iReg)
subroutine updateboundaryconditionsmp(regions, istage)
subroutine rflo_sendboundaryvaluesalpha(region)
subroutine updatetbc(region, t, dt, final)
Definition: UpdateTbc.F90:43
subroutine, public rflo_boundaryconditionsrecv(regions, iReg)
subroutine rflo_sendboundaryvalues(region, initialize)
subroutine peul_boundaryconditionsrecv(regions, iReg)
subroutine rflo_getboundaryvalues(region)
subroutine rflo_clearsendrequests(regions, iReg, geometry)
subroutine, public rflo_boundaryconditionsset(regions, iReg)
subroutine turb_rflo_ransclearsendrequests(regions, iReg)
unsigned char alpha() const
Definition: Color.h:75
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine plag_patchupdatewrapper(regions)
subroutine plag_cecellswrapper(regions)
subroutine turb_rflo_ransbndconditionsset(regions, iReg)