Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ViscousFluxes.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: Compute viscous fluxes and add them to dissipation.
26 !
27 ! Description: Distinction made between laminar and turbulent (total)
28 ! viscous fluxes; laminar flux is computed by generic routine
29 ! ViscousFluxEddy if TurbModel is inactive,
30 ! else turbulent flux routine is called; upon output
31 ! viscous fluxes added to numerical dissipation fluxes
32 !
33 ! Input:
34 ! region Data of current region.
35 !
36 ! Output: None.
37 !
38 ! Notes: None.
39 !
40 ! ******************************************************************************
41 !
42 ! $Id: ViscousFluxes.F90,v 1.14 2008/12/06 08:44:10 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2001-2006 by the University of Illinois
45 !
46 ! ******************************************************************************
47 
48 SUBROUTINE viscousfluxes(region)
49 
50  USE moderror
51  USE modparameters
52  USE moddatatypes
53  USE modbndpatch, ONLY: t_patch
54  USE modglobal, ONLY: t_global
55  USE moddatastruct, ONLY: t_region
56  USE modbndpatch, ONLY: t_patch
57 
58 #ifdef RFLU
65 #endif
66 
67 #ifdef RFLO
69 #endif
70 #ifdef TURB
72 #endif
73  IMPLICIT NONE
74 
75 ! ******************************************************************************
76 ! Declarations and definitions
77 ! ******************************************************************************
78 
79 ! ==============================================================================
80 ! Arguments
81 ! ==============================================================================
82 
83  TYPE(t_region) :: region
84 
85 ! ==============================================================================
86 ! Locals
87 ! ==============================================================================
88 
89  INTEGER :: ilev, turbmodel
90 #ifdef RFLU
91  INTEGER :: ipatch
92  INTEGER :: varinfo(cv_mixt_xvel:cv_mixt_temp)
93 #endif
94 #ifdef RFLO
95  REAL(RFREAL), POINTER :: tv(:,:)
96 #endif
97 #ifdef RFLU
98  TYPE(t_patch), POINTER :: ppatch
99  TYPE(t_region), POINTER :: pregion
100 #endif
101  TYPE(t_global), POINTER :: global
102 
103 ! ******************************************************************************
104 ! Start
105 ! ******************************************************************************
106 
107  global => region%global
108 
109  CALL registerfunction(global,'ViscousFluxes',&
110  'ViscousFluxes.F90')
111 
112 ! ******************************************************************************
113 ! Define input parameters and gridlevel
114 ! ******************************************************************************
115 
116  turbmodel = region%mixtInput%turbModel
117 
118 #ifdef RFLO
119  ilev = region%currLevel
120  tv => region%levels(ilev)%mixt%tv
121 #endif
122 
123 ! ******************************************************************************
124 ! Add viscous residual from laminar or laminar+turbulent stress contributions
125 ! ******************************************************************************
126 
127 #ifdef RFLO
128  CALL rflo_calcgradvector( region,dv_mixt_uvel,dv_mixt_temp, &
129  gr_mixt_ux, gr_mixt_tz, &
130  region%levels(ilev)%mixt%dv, &
131  region%levels(ilev)%mixt%gradi, &
132  region%levels(ilev)%mixt%gradj, &
133  region%levels(ilev)%mixt%gradk )
134 
135  IF (turbmodel == turb_model_none) THEN ! only laminar
136  CALL rflo_viscousflux( region,tv_mixt_muel,tv_mixt_tcol,tv )
137  ELSE
138 #ifdef TURB
139  CALL turb_coviscousfluxes( region ) ! laminar + turbulent
140 #endif
141  ENDIF
142 #endif
143 
144 #ifdef RFLU
145  pregion => region%pRegion
146 
147  CALL rflu_convertcvcons2prim(pregion,cv_mixt_state_duvwt)
148 
149  varinfo(cv_mixt_xvel) = v_mixt_xvel
150  varinfo(cv_mixt_yvel) = v_mixt_yvel
151  varinfo(cv_mixt_zvel) = v_mixt_zvel
152  varinfo(cv_mixt_temp) = v_mixt_temp
153 
154  CALL rflu_computegradfaceswrapper(pregion,cv_mixt_xvel,cv_mixt_temp, &
155  grf_mixt_xvel,grf_mixt_temp, &
156  pregion%mixt%cv,pregion%mixt%gradFace)
157 
158  IF ( pregion%grid%nFacesConstr > 0 ) THEN
159  CALL rflu_computegradfacesconstr(pregion,cv_mixt_xvel,cv_mixt_temp, &
160  grf_mixt_xvel,grf_mixt_temp,varinfo, &
161  pregion%mixt%cv,pregion%mixt%gradFace)
162  END IF ! pRegion%grid%nFacesConstr
163 
164  DO ipatch = 1,pregion%grid%nPatches
165  ppatch => pregion%patches(ipatch)
166 
167  IF ( rflu_decideneedbgradface(pregion,ppatch) .EQV. .true. ) THEN
168 
169  CALL rflu_computegradbfaceswrapper(pregion,ppatch,cv_mixt_xvel, &
170  cv_mixt_temp,grbf_mixt_xvel, &
171  grbf_mixt_temp,pregion%mixt%cv, &
172  ppatch%mixt%gradFace)
173 
174  IF ( ppatch%cReconst /= constr_none ) THEN
175  CALL rflu_computebfgradconstrwrapper(pregion,ppatch,cv_mixt_xvel, &
176  cv_mixt_temp,grbf_mixt_xvel, &
177  grbf_mixt_temp,varinfo, &
178  pregion%mixt%cv, &
179  ppatch%mixt%gradFace)
180  END IF ! pPatch%cReconst
181  END IF ! RFLU_DecideNeedBGradFace
182  END DO ! iPatch
183 
184  IF ( turbmodel == turb_model_none ) THEN ! Only laminar
185  CALL rflu_enforceheatflux(pregion,pregion%mixt%tv,tv_mixt_tcol)
186  CALL rflu_viscousfluxes(pregion,pregion%mixt%tv,tv_mixt_muel,tv_mixt_tcol)
187  CALL rflu_viscousfluxespatches(pregion,pregion%mixt%tv,tv_mixt_muel, &
188  tv_mixt_tcol)
189  ELSE
190 #ifdef TURB
191  CALL turb_coviscousfluxes( pregion ) ! laminar + turbulent
192 #endif
193  END IF ! turbModel
194 
195  CALL rflu_convertcvprim2cons(pregion,cv_mixt_state_cons)
196 #endif
197 
198 ! ******************************************************************************
199 ! End
200 ! ******************************************************************************
201 
202  CALL deregisterfunction(region%global)
203 
204 END SUBROUTINE viscousfluxes
205 
206 ! ******************************************************************************
207 !
208 ! RCS Revision history:
209 !
210 ! $Log: ViscousFluxes.F90,v $
211 ! Revision 1.14 2008/12/06 08:44:10 mtcampbe
212 ! Updated license.
213 !
214 ! Revision 1.13 2008/11/19 22:17:24 mtcampbe
215 ! Added Illinois Open Source License/Copyright
216 !
217 ! Revision 1.12 2006/08/19 15:38:37 mparmar
218 ! Moved region%mixt%bGradFace to patch%mixt%gradFace
219 !
220 ! Revision 1.11 2006/04/15 16:53:35 haselbac
221 ! Added IF on cReconst flag on patch
222 !
223 ! Revision 1.10 2006/04/07 15:19:15 haselbac
224 ! Removed tabs
225 !
226 ! Revision 1.9 2006/04/07 14:39:22 haselbac
227 ! Changed calls to bface grad routines, now inside patch loop
228 !
229 ! Revision 1.8 2005/10/27 18:53:54 haselbac
230 ! Adapted to new cell grad routines
231 !
232 ! Revision 1.7 2005/10/14 14:02:47 haselbac
233 ! Added call to RFLU_EnforceHeatFlux
234 !
235 ! Revision 1.6 2005/10/05 13:49:57 haselbac
236 ! Adapted to new face grads, cosmetics
237 !
238 ! Revision 1.5 2005/05/16 20:39:51 haselbac
239 ! Now USE RFLU_ModViscousFlux
240 !
241 ! Revision 1.4 2005/03/09 14:52:04 haselbac
242 ! Cosmetics only
243 !
244 ! Revision 1.3 2005/01/05 01:45:44 haselbac
245 ! Added better comments
246 !
247 ! Revision 1.2 2005/01/05 01:43:31 haselbac
248 ! Added init of global coeffs, now also defined for all regions
249 !
250 ! Revision 1.1 2004/12/01 16:52:17 haselbac
251 ! Initial revision after changing case
252 !
253 ! Revision 1.30 2004/08/02 23:13:14 wasistho
254 ! mv libfloflu/viscousFluxEddy(Patch) to rocflo/RFLO_viscousFlux(Patch)
255 !
256 ! Revision 1.29 2004/07/03 01:26:59 wasistho
257 ! activate turbulent viscous fluxes in Rocflu
258 !
259 ! Revision 1.28 2004/03/13 03:09:52 wasistho
260 ! TURB_CoViscousFluxesFlo to TURB_CoViscousFluxes
261 !
262 ! Revision 1.27 2004/03/08 23:32:41 wasistho
263 ! changed turb file/routine name
264 !
265 ! Revision 1.26 2004/01/29 22:52:50 haselbac
266 ! Added ONLY to USE module statement
267 !
268 ! Revision 1.25 2003/12/04 03:23:10 haselbac
269 ! Added RFLU specific routines
270 !
271 ! Revision 1.24 2003/11/20 16:40:36 mdbrandy
272 ! Backing out RocfluidMP changes from 11-17-03
273 !
274 ! Revision 1.21 2003/10/03 20:49:45 haselbac
275 ! Renamed ip variable to iPatch
276 !
277 ! Revision 1.20 2003/08/28 20:32:33 wasistho
278 ! excluced ModInterfacesTurbulence,Radiation,Periodic from ModInterfaces
279 !
280 ! Revision 1.19 2003/05/15 02:57:02 jblazek
281 ! Inlined index function.
282 !
283 ! Revision 1.18 2003/04/10 01:22:41 jblazek
284 ! Got rid of pRegion in ViscousFluxesMP.
285 !
286 ! Revision 1.17 2002/12/12 02:54:40 wasistho
287 ! Added TURB_ViscousFluxes interface
288 !
289 ! Revision 1.16 2002/09/09 14:09:08 haselbac
290 ! mixtInput now under regions, added gradient routines
291 !
292 ! Revision 1.15 2002/09/05 17:40:20 jblazek
293 ! Variable global moved into regions().
294 !
295 ! Revision 1.13 2002/08/27 23:58:20 wasistho
296 ! TURB_TotalVisFluxes is set back to TURB_ViscousFluxes
297 !
298 ! Revision 1.12 2002/08/16 16:51:49 wasistho
299 ! TURB_ViscousFluxes renamed to TURB_TotalVisFluxes
300 !
301 ! Revision 1.11 2002/08/15 19:48:05 jblazek
302 ! Implemented grid deformation capability.
303 !
304 ! Revision 1.10 2002/08/01 01:34:04 wasistho
305 ! Included RFLU capability and changed CalcGradVelT
306 !
307 ! Revision 1.9 2002/07/29 17:13:08 jblazek
308 ! Clean up after RFLU and TURB.
309 !
310 ! Revision 1.8 2002/07/27 08:13:16 wasistho
311 ! prepared for rocturb implementation
312 !
313 ! Revision 1.7 2002/07/23 01:08:33 wasistho
314 ! Turbulent part of viscous flux moved to rocturb
315 !
316 ! Revision 1.6 2002/07/22 22:59:11 jblazek
317 ! Some more clean up.
318 !
319 ! Revision 1.5 2002/07/19 23:38:24 wasistho
320 ! made compliant with CODING RULE
321 !
322 ! Revision 1.4 2002/06/14 21:17:01 wasistho
323 ! Added #ifdef RFLO until RFLU ready
324 !
325 ! Revision 1.3 2002/05/21 01:51:56 wasistho
326 ! add viscous terms
327 !
328 ! Revision 1.1 2002/01/23 03:51:24 jblazek
329 ! Added low-level time-stepping routines.
330 !
331 ! ******************************************************************************
332 
333 
334 
335 
336 
337 
338 
subroutine, public rflu_computegradfaceswrapper(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad)
subroutine, public rflu_viscousfluxespatches(pRegion, tv, tvIndxVisc, tvIndxCond)
subroutine turb_coviscousfluxes(region)
LOGICAL function rflu_decideneedbgradface(pRegion, pPatch)
subroutine, public rflu_computebfgradconstrwrapper(pRegion, pPatch, iBegVar, iEndVar, iBegGrad, iEndGrad, varInfo, var, grad)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_enforceheatflux(pRegion, tv, tvIndxCond)
subroutine, public rflu_computegradfacesconstr(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, varInfo, var, grad)
subroutine, public rflu_computegradbfaceswrapper(pRegion, pPatch, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad)
subroutine, public rflu_convertcvcons2prim(pRegion, cvStateFuture)
subroutine, public rflu_convertcvprim2cons(pRegion, cvStateFuture)
subroutine viscousfluxes(region)
subroutine rflo_viscousflux(region, indxMu, indxTCo, tv)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_viscousfluxes(pRegion, tv, tvIndxVisc, tvIndxCond)
subroutine rflo_calcgradvector(region, iBegV, iEndV, iBegG, iEndG, var, gradi, gradj, gradk)