Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RkInitMP.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: set initial solution field for first RK stage.
26 !
27 ! Description: none.
28 !
29 ! Input: region = data of current region,
30 ! istage = current RK stage.
31 !
32 ! Output: region%levels%*%cvOld,diss = initializations for new time step.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RkInitMP.F90,v 1.6 2008/12/06 08:44:10 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003-2005 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rkinitmp( region, istage )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE modmixture, ONLY : t_mixt
50 #ifdef RFLO
51 #ifdef PEUL
52  USE modparteul, ONLY : t_peul
53 #endif
54 #endif
55 #ifdef RFLU
56  USE modspecies, ONLY : t_spec
57 #endif
58  USE moderror
59  USE modparameters
60  USE modbndpatch, ONLY: t_patch
61 
62  USE modinterfaces, ONLY : rkinitgeneric
63 #ifdef RFLU
64  USE modinterfaces, ONLY : rkinitsd
65 
67 #endif
68 #ifdef RFLO
71 
72 #include "Indexing.h"
73 #endif
74 
75 #ifdef PLAG
77 #endif
78 
79 #ifdef TURB
81 #endif
82 
83  IMPLICIT NONE
84 
85 ! ... parameters
86  TYPE(t_region), INTENT(INOUT), TARGET :: region
87  INTEGER, INTENT(IN) :: istage
88 
89 ! ... local variables
90 #ifdef RFLO
91  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
92  INTEGER :: ilev, icoff, ijcoff
93 #endif
94  INTEGER :: ibc, iec
95 
96  LOGICAL :: movegrid, peulused, specused, plagused, turbused
97 
98  TYPE(t_mixt), POINTER :: mixt
99 #ifdef RFLO
100 #ifdef PEUL
101  TYPE(t_peul), POINTER :: peul
102 #endif
103 #endif
104 #ifdef RFLU
105  TYPE(t_spec), POINTER :: spec
106 #endif
107  TYPE(t_global), POINTER :: global
108 
109  INTEGER :: ipatch
110  TYPE(t_patch), POINTER :: ppatch
111 
112 !******************************************************************************
113 
114  global => region%global
115 
116  CALL registerfunction( global,'RKInitMP',&
117  'RkInitMP.F90' )
118 
119 ! set flags ===================================================================
120 
121  peulused = global%peulUsed
122  plagused = global%plagUsed
123  specused = global%specUsed
124 
125 #ifdef TURB
126  turbused = (region%mixtInput%flowModel == flow_navst) .AND. &
127  (region%mixtInput%turbModel /= turb_model_none)
128 #else
129  turbused = .false.
130 #endif
131 
132  movegrid = region%mixtInput%moveGrid
133 
134 ! get dimensions and pointers -------------------------------------------------
135 
136 #ifdef RFLO
137  ilev = region%currLevel
138  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
139  jdcbeg,jdcend,kdcbeg,kdcend )
140  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
141 
142  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icoff,ijcoff)
143  iec = indijk(idcend,jdcend,kdcend,icoff,ijcoff)
144  mixt => region%levels(ilev)%mixt
145 #ifdef PEUL
146  peul => region%levels(ilev)%peul
147 #endif
148 #endif
149 
150 #ifdef RFLU
151  ibc = 1
152  iec = region%grid%nCellsTot
153  mixt => region%mixt
154  spec => region%spec
155 #endif
156 
157 ! initialize for flow itself and all multiphysics modules ---------------------
158 
159  CALL rkinitgeneric(region,istage,ibc,iec,1,cv_mixt_neqs, &
160  mixt%cv,mixt%cvOld,mixt%diss)
161 
162 #ifdef RFLU
163 ! loop over patches in a region and initialize boundary variables -------------
164  DO ipatch = 1,region%grid%nPatches
165  ppatch => region%patches(ipatch)
166 
167  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
168  CALL rkinitgeneric(region,istage,1,ppatch%nBFaces,1,cv_mixt_neqs, &
169  ppatch%mixt%cv,ppatch%mixt%cvOld,ppatch%mixt%rhs)
170  END IF ! pPatch%bcKind
171  END DO ! iPatch
172 #endif
173 
174 #ifdef RFLO
175 #ifdef PEUL
176  IF ( peulused ) THEN
177  CALL rkinitgeneric(region,istage,ibc,iec,1,peul%nCv, &
178  peul%cv,peul%cvOld,peul%diss)
179  END IF ! peulUsed
180 #endif
181 #endif
182 
183 #ifdef RFLU
184 #ifdef SPEC
185  IF ( specused ) THEN
186  CALL rkinitgeneric(region,istage,ibc,iec,1,region%specInput%nSpecies, &
187  spec%cv,spec%cvOld,spec%diss)
188  END IF ! specUsed
189 #endif
190  SELECT CASE ( region%mixtInput%indSd )
191 
192  CASE (0)
193  CALL rkinitsd(region, 0, 1,1,sd_zmom-sd_xmom+1,mixt%sd)
194 
195  CASE (1)
196  CALL rkinitsd(region,ibc,iec,1,sd_zmom-sd_xmom+1,mixt%sd)
197 
198  CASE default
199  CALL errorstop(global,err_reached_default,__line__)
200 
201  END SELECT ! indSd
202 #endif
203 
204 #ifdef PLAG
205  IF ( plagused ) THEN
206  CALL plag_rkinit(region,istage)
207  END IF ! plagUsed
208 #endif
209 
210 #ifdef TURB
211  IF ( turbused ) THEN
212  CALL turb_rkinit(region,istage)
213  ENDIF ! turbUsed
214 #endif
215 
216 ! scale grid speeds (volume change) -------------------------------------------
217 
218 #ifdef RFLO
219  IF ( movegrid .EQV. .true. ) THEN
220  CALL scalegridspeeds(region)
221  END IF ! moveGrid
222 #endif
223 
224 ! finalize ====================================================================
225 
226  CALL deregisterfunction( global )
227 
228 END SUBROUTINE rkinitmp
229 
230 !******************************************************************************
231 !
232 ! RCS Revision history:
233 !
234 ! $Log: RkInitMP.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:23 mtcampbe
239 ! Added Illinois Open Source License/Copyright
240 !
241 ! Revision 1.4 2006/08/19 15:38:31 mparmar
242 ! Added initialization of Runge-Kutta scheme for boundary arrays
243 !
244 ! Revision 1.3 2006/02/13 21:00:51 wasistho
245 ! added ifdef PEUL
246 !
247 ! Revision 1.2 2005/03/31 16:30:04 haselbac
248 ! Replaced nSd by parameters
249 !
250 ! Revision 1.1 2004/12/01 16:51:04 haselbac
251 ! Initial revision after changing case
252 !
253 ! Revision 1.19 2004/07/30 22:47:33 jferry
254 ! Implemented Equilibrium Eulerian method for Rocflu
255 !
256 ! Revision 1.18 2004/07/28 15:29:18 jferry
257 ! created global variable for spec use
258 !
259 ! Revision 1.17 2004/07/23 22:43:15 jferry
260 ! Integrated rocspecies into rocinteract
261 !
262 ! Revision 1.16 2004/04/14 02:06:42 haselbac
263 ! No longer call ScaleGridSpeeds for RFLU
264 !
265 ! Revision 1.15 2004/03/05 22:09:00 jferry
266 ! created global variables for peul, plag, and inrt use
267 !
268 ! Revision 1.14 2004/03/03 23:55:08 jferry
269 ! Made module calls more uniform
270 !
271 ! Revision 1.13 2004/03/02 21:50:30 jferry
272 ! Changed rkInit and rkUpdate routines to call generic procedures
273 !
274 ! Revision 1.12 2004/02/26 21:13:06 wasistho
275 ! changed TURB_ransRkInit to TURB_rkInit
276 !
277 ! Revision 1.11 2004/02/26 21:01:43 haselbac
278 ! Removed ifdef RFLO around PLAG_rkInitMP
279 !
280 ! Revision 1.10 2004/02/02 22:48:21 haselbac
281 ! Added ifdef RFLO - temporary measure
282 !
283 ! Revision 1.9 2003/11/25 21:01:43 haselbac
284 ! Added rocspecies support with rkInitGeneric routine
285 !
286 ! Revision 1.8 2003/11/20 16:40:35 mdbrandy
287 ! Backing out RocfluidMP changes from 11-17-03
288 !
289 ! Revision 1.5 2003/10/03 20:12:53 wasistho
290 ! initial installation of turbModel SA and DES
291 !
292 ! Revision 1.4 2003/10/01 23:52:09 jblazek
293 ! Corrected bug in moving noslip wall BC and grid speeds.
294 !
295 ! Revision 1.3 2003/09/26 21:45:34 fnajjar
296 ! Modified ModInterfaces calls to proper physical modules
297 !
298 ! Revision 1.2 2003/05/15 02:57:02 jblazek
299 ! Inlined index function.
300 !
301 ! Revision 1.1 2003/03/28 19:46:59 fnajjar
302 ! Initial import for RocfluidMP
303 !
304 !******************************************************************************
305 
306 
307 
308 
309 
310 
311 
**********************************************************************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 registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
LOGICAL function, public rflu_nscbc_decidehavenscbc(pRegion)
**********************************************************************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 plag_rkinit(region, iStage)
Definition: PLAG_RkInit.F90:43
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 rkinitsd(region, icBeg, icEnd, ivBeg, ivEnd, sd)
Definition: RkInitSD.F90:50
**********************************************************************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 errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine rkinitgeneric(region, iStage, icBeg, icEnd, ivBeg, ivEnd, cv, cvOld, diss)
subroutine rkinitmp(region, istage)
Definition: RkInitMP.F90:44
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine scalegridspeeds(region)
subroutine turb_rkinit(region, istage)
Definition: TURB_RkInit.F90:45