Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_GetFlowSolution.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: read initial flow solution from file, initialize dependent
26 ! variables and module specific data.
27 !
28 ! Description: none.
29 !
30 ! Input: regions = dimensions, user input.
31 !
32 ! Output: regions = mixture and module variables.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLO_GetFlowSolution.F90,v 1.9 2009/10/30 15:26:29 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflo_getflowsolution( regions )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
54 
55 #ifdef INRT
57 #endif
58 #ifdef PLAG
60 #endif
61 #ifdef PEUL
63 #endif
64 #ifdef RADI
66 #endif
67 #ifdef SPEC
68  USE modinterfacesspecies, ONLY : spec_readsolution, spec_initsolution
69 #endif
70 #ifdef TURB
72 #endif
73 #ifdef PERI
75 #ifdef RFLO
76  USE peri_modhybriddes, ONLY : peri_rflo_readmean
77 #endif
78 #endif
79  USE moderror
80  USE modmpi
81  USE modparameters
82  IMPLICIT NONE
83 
84 #include "Indexing.h"
85 
86 ! ... parameters
87  TYPE (t_region), POINTER :: regions(:)
88 
89 ! ... loop variables
90  INTEGER :: ireg, ilev, ibc, iec, original_format
91 
92 ! ... local variables
93  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend, icoff, ijcoff
94 
95  TYPE(t_global), POINTER :: global
96 
97 !******************************************************************************
98 
99  global => regions(1)%global
100 
101  CALL registerfunction( global,'RFLO_GetFlowSolution',&
102  'RFLO_GetFlowSolution.F90' )
103 
104 ! read/receive solution for all regions on this processor
105 
106  IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
107  WRITE(stdout,'(A)') solver_name//' - mixture'
108 
109 #ifndef GENX
110  CALL rflo_readsolution( regions )
111  CALL rflo_readrandomstate( regions )
112 #ifdef PLAG
113  CALL plag_readsolution( regions )
114 #endif
115 #ifdef PEUL
116  CALL peul_readsolution( regions )
117 #endif
118 #ifdef SPEC
119  CALL spec_readsolution( regions )
120 #endif
121 #ifdef TURB
122  IF (global%turbActive) THEN
123  IF ((global%flowType == flow_unsteady .AND. &
124  global%timeStamp > 0._rfreal) .OR. &
125  (global%flowType == flow_steady .AND. &
126  global%currentIter > 0)) THEN
127  CALL turb_rflo_readsolution( regions )
128  ENDIF
129 #ifdef PERI
130  IF (global%flowType == flow_unsteady) THEN
131  CALL peri_rflo_readmean( regions )
132  ENDIF
133 #endif
134  ENDIF ! turbActive
135 #endif
136 #endif
137 
138 #ifdef GENX
139 #ifdef NATIVE_MP_IO
140  original_format = global%solutFormat
141  global%gridFormat = format_ascii
142  global%solutFormat = format_ascii
143 #ifdef PLAG
144  CALL plag_readsolution( regions )
145 #endif
146 #ifdef PEUL
147  CALL peul_readsolution( regions )
148 #endif
149 #ifdef SPEC
150  CALL spec_readsolution( regions )
151 #endif
152 #ifdef TURB
153  IF (global%turbActive) THEN
154  IF ((global%flowType == flow_unsteady .AND. &
155  global%timeStamp > 0._rfreal) .OR. &
156  (global%flowType == flow_steady .AND. &
157  global%currentIter > 0)) THEN
158  CALL turb_rflo_readsolution( regions )
159  ENDIF
160 #ifdef PERI
161  IF (global%flowType == flow_unsteady) THEN
162  CALL peri_rflo_readmean( regions )
163  ENDIF
164 #endif
165  ENDIF ! turbActive
166 #endif
167 #endif
168 #endif
169 
170 
171 ! loop over all regions - get variables for physical modules
172 
173  DO ireg=1,global%nRegions
174  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
175  regions(ireg)%active==active) THEN ! on my processor
176 
177  CALL rflo_initnoncvsolution( regions(ireg) )
178 
179 #ifdef INRT
180  IF (global%inrtUsed) THEN
181  IF (regions(ireg)%inrtInput%twoDAverage /= 0) THEN
182  CALL inrt_twodimaverage(regions(ireg))
183  END IF
184  END IF ! inrtUsed
185 #endif
186 
187 #ifdef PEUL
188  IF (global%peulUsed) &
189  CALL peul_initsolution( ireg,regions(ireg) )
190 #endif
191 #ifdef RADI
192  IF (regions(ireg)%mixtInput%radiUsed) &
193  CALL radi_initsolution( ireg,regions(ireg) )
194 #endif
195 #ifdef SPEC
196  CALL spec_initsolution( ireg,regions(ireg) )
197 #endif
198 #ifdef PERI
199  IF (regions(ireg)%periInput%flowKind /= off) THEN
200  CALL peri_initsolution( regions,ireg )
201  ENDIF
202 #endif
203 
204 ! --- calculate derived values for the mixture
205 
206  DO ilev=1,regions(ireg)%nGridLevels
207  CALL rflo_getdimensdummy( regions(ireg),ilev,idcbeg,idcend, &
208  jdcbeg,jdcend,kdcbeg,kdcend )
209  CALL rflo_getcelloffset( regions(ireg),ilev,icoff,ijcoff )
210  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icoff,ijcoff)
211  iec = indijk(idcend,jdcend,kdcend,icoff,ijcoff)
212  CALL mixtureproperties( regions(ireg),ibc,iec,.true. )
213  ENDDO
214 
215 ! --- convert mdot into density*velocity for injection boundaries
216 
217  CALL rflo_bcondinjectioninit( regions(ireg) )
218 
219 ! --- get values for external BC`s
220 
221 #ifdef GENX
222  IF (global%timeStamp>0._rfreal .AND. &
223  regions(ireg)%mixtInput%externalBc) THEN ! only if restart
224  CALL rflo_getboundaryvalues( regions(ireg) )
225  ENDIF
226 #else
227  IF (regions(ireg)%mixtInput%externalBc) THEN
228  CALL rflo_getboundaryvalues( regions(ireg) )
229  ENDIF
230 #endif
231 
232 ! --- initialize Lagrangian particle solution field based on mixture properties
233 
234 #ifdef PLAG
235  IF (global%plagUsed) &
236  CALL plag_initsolution( ireg,regions(ireg) )
237 #endif
238 
239 ! --- initiate turbulence solution based on mixture properties
240 
241 #ifdef TURB
242  IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
243  (regions(ireg)%mixtInput%turbModel /= turb_model_none)) THEN
244  CALL turb_initsolution( regions(ireg) )
245  ENDIF
246 #endif
247 
248  ENDIF ! region on this processor and active
249  ENDDO ! iReg
250 
251 ! calculate reference values for limiter (upwind schene)
252 
253  CALL rflo_limiterreference( regions )
254 
255 ! finalize
256 
257  CALL deregisterfunction( global )
258 
259 END SUBROUTINE rflo_getflowsolution
260 
261 !******************************************************************************
262 !
263 ! RCS Revision history:
264 !
265 ! $Log: RFLO_GetFlowSolution.F90,v $
266 ! Revision 1.9 2009/10/30 15:26:29 mtcampbe
267 ! #ifdef bugfix
268 !
269 ! Revision 1.8 2009/10/26 00:19:31 mtcampbe
270 ! Updates for completion of NATIVE_MP_IO
271 !
272 ! Revision 1.7 2008/12/06 08:44:27 mtcampbe
273 ! Updated license.
274 !
275 ! Revision 1.6 2008/11/19 22:17:38 mtcampbe
276 ! Added Illinois Open Source License/Copyright
277 !
278 ! Revision 1.5 2006/03/22 03:03:01 wasistho
279 ! added call to RFLO_InitNonCvSolution
280 !
281 ! Revision 1.4 2006/01/25 01:42:14 wasistho
282 ! call bcondInjectionInit also in Genx
283 !
284 ! Revision 1.3 2005/03/07 05:04:32 wasistho
285 ! install hybrid DESSA turbulence model
286 !
287 ! Revision 1.2 2004/12/28 22:48:49 wasistho
288 ! moved RFLO_Bcond* and RFLO_BoundaryCond* routines into RFLO_ModBoundaryConditions
289 !
290 ! Revision 1.1 2004/11/29 20:51:39 wasistho
291 ! lower to upper case
292 !
293 ! Revision 1.37 2004/07/02 22:27:59 jiao
294 ! Changed not to read solutions from native file formats if in GEN3.
295 !
296 ! Revision 1.36 2004/06/19 03:29:11 wasistho
297 ! removed argument iReg in TURB_InitSolution
298 !
299 ! Revision 1.35 2004/03/11 03:31:46 wasistho
300 ! changed rocturb nomenclature
301 !
302 ! Revision 1.34 2004/03/05 22:09:02 jferry
303 ! created global variables for peul, plag, and inrt use
304 !
305 ! Revision 1.33 2004/03/02 21:47:29 jferry
306 ! Added After Update interactions
307 !
308 ! Revision 1.32 2003/11/21 22:35:51 fnajjar
309 ! Update Random Number Generator
310 !
311 ! Revision 1.31 2003/11/20 16:40:39 mdbrandy
312 ! Backing out RocfluidMP changes from 11-17-03
313 !
314 ! Revision 1.27 2003/09/26 21:44:28 fnajjar
315 ! Modified ModInterfaces calls to proper physical modules
316 !
317 ! Revision 1.26 2003/08/28 20:35:14 wasistho
318 ! excluced ModInterfacesTurbulence,Radiation,Periodic from ModInterfaces
319 !
320 ! Revision 1.25 2003/08/11 20:16:22 wasistho
321 ! distinguish steady and unsteady in reading turb. solution
322 !
323 ! Revision 1.24 2003/08/08 02:09:05 wasistho
324 ! fixed turb. restart for steady flow
325 !
326 ! Revision 1.23 2003/08/01 22:14:51 wasistho
327 ! turbWrite to turbActive
328 !
329 ! Revision 1.22 2003/07/22 02:57:30 wasistho
330 ! prepare more accurate rocturb restart
331 !
332 ! Revision 1.21 2003/07/17 01:03:05 wasistho
333 ! initial activation rocrad
334 !
335 ! Revision 1.20 2003/05/15 02:57:04 jblazek
336 ! Inlined index function.
337 !
338 ! Revision 1.19 2003/04/09 15:05:05 jferry
339 ! added check that particles are used before calling PLAG routines
340 !
341 ! Revision 1.18 2003/03/29 03:30:04 wasistho
342 ! install ROCPERI
343 !
344 ! Revision 1.17 2003/03/11 16:04:19 jferry
345 ! Enclosed USE statements for multi-physics routines within ifdefs
346 !
347 ! Revision 1.16 2003/02/11 22:53:19 jferry
348 ! Initial import of Rocsmoke
349 !
350 ! Revision 1.15 2002/12/04 15:38:53 f-najjar
351 ! Change calling sequence for PLAG_InitSolution after mixture properties
352 !
353 ! Revision 1.14 2002/10/16 18:56:15 jblazek
354 ! Within GenX, BC data at t>0 are obtained in GetFlowSolution.
355 !
356 ! Revision 1.13 2002/10/16 18:30:38 jblazek
357 ! Within GenX, BC data at t=0 are updated in FlowSolver before calling
358 ! the time-stepping routine.
359 !
360 ! Revision 1.12 2002/10/04 19:33:18 jblazek
361 ! Corrected one more bug in GenX restart.
362 !
363 ! Revision 1.11 2002/10/03 21:25:39 jblazek
364 ! Changed init. of burnig boundaries for GenX.
365 !
366 ! Revision 1.10 2002/10/02 22:21:59 jiao
367 ! Debugged GenX restart.
368 !
369 ! Revision 1.9 2002/09/20 22:22:36 jblazek
370 ! Finalized integration into GenX.
371 !
372 ! Revision 1.8 2002/09/17 22:51:23 jferry
373 ! Removed Fast Eulerian particle type
374 !
375 ! Revision 1.7 2002/09/05 17:40:21 jblazek
376 ! Variable global moved into regions().
377 !
378 ! Revision 1.6 2002/08/24 03:16:37 wasistho
379 ! put safety within #ifdef TURB
380 !
381 ! Revision 1.5 2002/08/16 21:33:48 jblazek
382 ! Changed interface to MixtureProperties.
383 !
384 ! Revision 1.4 2002/07/16 21:34:37 jblazek
385 ! Prefixed screen output with SOLVER_NAME.
386 !
387 ! Revision 1.3 2002/06/12 21:56:29 jblazek
388 ! Added read/write solution for physical modules.
389 !
390 ! Revision 1.2 2002/06/07 16:40:37 jblazek
391 ! Grid & solution for all regions in one file.
392 !
393 ! Revision 1.1 2002/02/25 22:36:52 jblazek
394 ! Simplified solver initialization routine.
395 !
396 !******************************************************************************
397 
398 
399 
400 
401 
402 
403 
subroutine plag_readsolution(regions)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcend
subroutine rflo_limiterreference(regions)
subroutine peul_readsolution(regions)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getflowsolution(regions)
subroutine, public rflo_initnoncvsolution(region)
subroutine peul_initsolution(iReg, region)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
subroutine rflo_readsolution(regions)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kdcbeg
subroutine turb_rflo_readsolution(regions)
subroutine inrt_twodimaverage(region)
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcbeg
subroutine rflo_getboundaryvalues(region)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcend
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcbeg
subroutine turb_initsolution(region)
subroutine rflo_readrandomstate(regions)
subroutine mixtureproperties(region, inBeg, inEnd, gasUpdate)
subroutine plag_initsolution(iReg, region)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine peri_initsolution(regions, iReg)
subroutine, public rflo_bcondinjectioninit(region)