Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RkUpdateMP.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 conserved variable fields for RocfluidMP framework.
26 !
27 ! Description: none.
28 !
29 ! Input: region = data of current region,
30 ! iReg = index of currect region,
31 ! istage = RK current stage.
32 !
33 ! Output: region%levels%*%cv,rhs = new solution after one time step.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RkUpdateMP.F90,v 1.9 2008/12/06 08:44:10 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rkupdatemp( region,iReg,istage )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50  USE modmixture, ONLY : t_mixt
51 #ifdef RFLO
52 #ifdef PEUL
53  USE modparteul, ONLY : t_peul
54 #endif
55 #endif
56 #ifdef RFLU
57  USE modspecies, ONLY : t_spec
58 
60 #endif
61  USE moderror
62  USE modparameters
63  USE modbndpatch, ONLY: t_patch
64 
66 
67 #ifdef RFLO
69 
70 #include "Indexing.h"
71 #endif
72 
73 #ifdef PLAG
75 #endif
76 
77 #ifdef PERI
79 #endif
80 
81 #ifdef TURB
83 #endif
84 
85  IMPLICIT NONE
86 
87 ! ... parameters
88  TYPE(t_region), INTENT(INOUT), TARGET :: region
89  INTEGER, INTENT(IN) :: ireg, istage
90 
91 ! ... local variables
92 #ifdef RFLO
93  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
94  INTEGER :: ilev, icoff, ijcoff
95 #endif
96  INTEGER :: ibc, iec
97 
98  LOGICAL :: peulused, plagused, specused, periused, turbused
99 
100  TYPE(t_mixt), POINTER :: mixt
101 #ifdef RFLO
102 #ifdef PEUL
103  TYPE(t_peul), POINTER :: peul
104 #endif
105 #endif
106 #ifdef RFLU
107  TYPE(t_spec), POINTER :: spec
108 #endif
109  TYPE(t_global), POINTER :: global
110 
111  INTEGER :: ipatch
112  TYPE(t_patch), POINTER :: ppatch
113 !******************************************************************************
114 
115  global => region%global
116 
117  CALL registerfunction( global,'RKUpdateMP',&
118  'RkUpdateMP.F90' )
119 
120 ! set flags ===================================================================
121 
122  peulused = global%peulUsed
123  plagused = global%plagUsed
124  specused = global%specUsed
125 
126 #ifdef PERI
127  periused = (region%periInput%flowKind /= off)
128 #else
129  periused = .false.
130 #endif
131 
132 #ifdef TURB
133  turbused = (region%mixtInput%flowModel == flow_navst) .AND. &
134  (region%mixtInput%turbModel /= turb_model_none)
135 #else
136  turbused = .false.
137 #endif
138 
139  region%irkStep = istage
140 
141 ! get dimensions and pointers -------------------------------------------------
142 
143 #ifdef RFLO
144  ilev = region%currLevel
145  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
146  jdcbeg,jdcend,kdcbeg,kdcend )
147  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
148 
149  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icoff,ijcoff)
150  iec = indijk(idcend,jdcend,kdcend,icoff,ijcoff)
151  mixt => region%levels(ilev)%mixt
152 #ifdef PEUL
153  peul => region%levels(ilev)%peul
154 #endif
155 #endif
156 
157 #ifdef RFLU
158  ibc = 1
159  iec = region%grid%nCellsTot
160  mixt => region%mixt
161  spec => region%spec
162 #endif
163 
164 ! update solution for flow itself and all multiphysics modules ----------------
165 
166  IF ( region%mixtInput%frozenFlag .EQV. .false. ) THEN
167  CALL rkupdategeneric(region,var_type_cell,istage,ibc,iec,1,cv_mixt_neqs, &
168  mixt%cv,mixt%cvOld,mixt%rhs,mixt%rhsSum)
169  END IF ! region%mixtInput%frozenFlag
170 
171 #ifdef RFLU
172 ! loop over patches in a region and update boundary variables -------------
173  DO ipatch = 1,region%grid%nPatches
174  ppatch => region%patches(ipatch)
175 
176  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
177  CALL rkupdategeneric(region,var_type_point,istage,1,ppatch%nBFaces, &
178  1,cv_mixt_neqs,ppatch%mixt%cv,ppatch%mixt%cvOld, &
179  ppatch%mixt%rhs,ppatch%mixt%rhsSum)
180 
181  END IF ! pPatch%bcKind
182  END DO ! iPatch
183 #endif
184 
185 #ifdef RFLO
186 #ifdef PEUL
187  IF ( peulused ) THEN
188  CALL rkupdategeneric(region,var_type_cell,istage,ibc,iec,1,peul%nCv, &
189  peul%cv,peul%cvOld,peul%rhs,peul%rhsSum)
190  END IF ! peulUsed
191 #endif
192 #endif
193 
194 #ifdef RFLU
195 #ifdef SPEC
196  IF ( specused ) THEN
197  CALL rkupdategeneric(region,var_type_cell,istage,ibc,iec,1, &
198  region%specInput%nSpecies,spec%cv,spec%cvOld, &
199  spec%rhs,spec%rhsSum)
200  END IF ! specUsed
201 #endif
202 #endif
203 
204 #ifdef PLAG
205  IF ( plagused ) THEN
206  CALL plag_rkupdatewrapper(region,ireg,istage)
207  END IF ! plagUsed
208 #endif
209 
210 #ifdef PERI
211  IF ( periused ) THEN
212  CALL peri_solutionupdate(region)
213  END IF ! periUsed
214 #endif
215 
216 #ifdef TURB
217  IF ( turbused ) THEN
218  CALL turb_solutionupdate(region,istage,ibc,iec)
219  END IF ! turbUsed
220 #endif
221 
222 ! finalize ====================================================================
223 
224  CALL deregisterfunction( global )
225 
226 END SUBROUTINE rkupdatemp
227 
228 !******************************************************************************
229 !
230 ! RCS Revision history:
231 !
232 ! $Log: RkUpdateMP.F90,v $
233 ! Revision 1.9 2008/12/06 08:44:10 mtcampbe
234 ! Updated license.
235 !
236 ! Revision 1.8 2008/11/19 22:17:23 mtcampbe
237 ! Added Illinois Open Source License/Copyright
238 !
239 ! Revision 1.7 2006/08/19 15:38:33 mparmar
240 ! Added update of Runge-Kutta scheme for boundary arrays
241 !
242 ! Revision 1.6 2006/02/13 21:00:58 wasistho
243 ! added ifdef PEUL
244 !
245 ! Revision 1.5 2005/11/10 22:20:38 fnajjar
246 ! ACH: Added IF on frozenFlag
247 !
248 ! Revision 1.4 2005/04/06 02:16:49 wasistho
249 ! mv call to PERI_CoMeanCorrection to UpdateBoundaryConditionsMP
250 !
251 ! Revision 1.3 2005/03/11 04:22:57 wasistho
252 ! commented PERI_coMeanCorrection temporarily while in testing
253 !
254 ! Revision 1.2 2005/03/07 05:05:04 wasistho
255 ! install hybrid DESSA turbulence model
256 !
257 ! Revision 1.1 2004/12/01 16:51:11 haselbac
258 ! Initial revision after changing case
259 !
260 ! Revision 1.21 2004/11/17 23:44:27 wasistho
261 ! used generic RK-update for rocturb
262 !
263 ! Revision 1.20 2004/11/17 16:25:11 haselbac
264 ! Added varType to interface of RkUpdateGeneric
265 !
266 ! Revision 1.19 2004/07/28 15:29:18 jferry
267 ! created global variable for spec use
268 !
269 ! Revision 1.18 2004/07/23 22:43:15 jferry
270 ! Integrated rocspecies into rocinteract
271 !
272 ! Revision 1.17 2004/03/05 22:09:00 jferry
273 ! created global variables for peul, plag, and inrt use
274 !
275 ! Revision 1.16 2004/03/03 23:55:08 jferry
276 ! Made module calls more uniform
277 !
278 ! Revision 1.15 2004/03/02 21:50:30 jferry
279 ! Changed rkInit and rkUpdate routines to call generic procedures
280 !
281 ! Revision 1.14 2004/02/26 21:01:45 haselbac
282 ! Removed ifdef RFLO around PLAG_rkUpdateWrapper
283 !
284 ! Revision 1.13 2004/02/02 22:48:32 haselbac
285 ! Added ifdef RFLO - temporary measure
286 !
287 ! Revision 1.12 2003/11/25 21:01:44 haselbac
288 ! Added rocspecies support with rkUpdateGeneric routine
289 !
290 ! Revision 1.11 2003/11/20 16:40:35 mdbrandy
291 ! Backing out RocfluidMP changes from 11-17-03
292 !
293 ! Revision 1.8 2003/09/26 21:45:34 fnajjar
294 ! Modified ModInterfaces calls to proper physical modules
295 !
296 ! Revision 1.7 2003/08/28 20:32:10 wasistho
297 ! excluced ModInterfacesTurbulence,Radiation,Periodic from ModInterfaces
298 !
299 ! Revision 1.6 2003/08/14 01:46:30 wasistho
300 ! fixed ifdef around TURB_solutionUpdate
301 !
302 ! Revision 1.5 2003/08/06 15:53:09 wasistho
303 ! added vorticities computation
304 !
305 ! Revision 1.4 2003/07/08 21:21:36 jblazek
306 ! Modified start up procedure for dual-time stepping.
307 !
308 ! Revision 1.3 2003/05/15 02:57:02 jblazek
309 ! Inlined index function.
310 !
311 ! Revision 1.2 2003/04/05 01:58:45 wasistho
312 ! install ROCPERI
313 !
314 ! Revision 1.1 2003/03/28 19:47:19 fnajjar
315 ! Initial import for RocfluidMP
316 !
317 !******************************************************************************
318 
319 
320 
321 
322 
323 
324 
**********************************************************************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 rkupdategeneric(region, varType, iStage, icBeg, icEnd, ivBeg, ivEnd, cv, cvOld, rhs, rhsSum)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
subroutine plag_rkupdatewrapper(region, iReg, istage)
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 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 turb_solutionupdate(region, istage, ibc, iec)
subroutine peri_solutionupdate(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 rkupdatemp(region, iReg, istage)
Definition: RkUpdateMP.F90:45
subroutine deregisterfunction(global)
Definition: ModError.F90:469