Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ViscousFluxesMP.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: Calculate the viscous fluxes for the RocfluidMP framework.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! region Data of current region.
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! *****************************************************************************
37 !
38 ! $Id: ViscousFluxesMP.F90,v 1.9 2008/12/06 08:44:10 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003-2006 by the University of Illinois
41 !
42 ! *****************************************************************************
43 
44 SUBROUTINE viscousfluxesmp(region)
45 
46  USE moddatatypes
47  USE moderror
48  USE modparameters
49  USE modbndpatch, ONLY: t_patch
50  USE moddatastruct, ONLY: t_region
51  USE modglobal, ONLY: t_global
52  USE moderror
53  USE modparameters
54 
55 #ifdef SPEC
56 #ifdef RFLU
62 #endif
63 #endif
64 
65 !#ifdef PEUL
66 ! USE ModInterfaces, ONLY : PEUL_ViscousFluxes
67 !#endif
68 
69 #ifdef SPEC
70 #ifdef RFLU
72 #endif
73 #endif
74 
75  IMPLICIT NONE
76 
77 ! *****************************************************************************
78 ! Definitions and declarations
79 ! *****************************************************************************
80 
81 ! =============================================================================
82 ! Arguments
83 ! =============================================================================
84 
85  TYPE(t_region), TARGET :: region
86 
87 ! =============================================================================
88 ! Locals
89 ! =============================================================================
90 
91  TYPE(t_global), POINTER :: global
92 #ifdef RFLU
93  TYPE(t_patch), POINTER :: ppatch
94  INTEGER :: errorflag,ipatch,ispec
95  INTEGER, DIMENSION(:), ALLOCATABLE :: varinfospec
96  TYPE(t_region), POINTER :: pregion
97 #endif
98 
99 ! *****************************************************************************
100 ! Start
101 ! *****************************************************************************
102 
103  global => region%global
104 
105  CALL registerfunction( global,'ViscousFluxesMP',&
106  'ViscousFluxesMP.F90' )
107 
108 ! *****************************************************************************
109 ! Compute viscous fluxes
110 ! *****************************************************************************
111 
112 ! =============================================================================
113 ! Mixture
114 ! =============================================================================
115 
116  CALL viscousfluxes( region )
117 
118 !#ifdef PEUL
119 ! IF (global%peulUsed) CALL PEUL_ViscousFluxes( region )
120 !#endif
121 
122 #ifdef SPEC
123 ! =============================================================================
124 ! Species
125 ! =============================================================================
126 
127  IF ( global%specUsed .EQV. .true. ) THEN
128 #ifdef RFLU
129  pregion => region
130 
131  CALL rflu_scalarconvertcvcons2prim(pregion,pregion%spec%cv, &
132  pregion%spec%cvState)
133 
134  ALLOCATE(varinfospec(pregion%specInput%nSpecies),stat=errorflag)
135  global%error = errorflag
136  IF ( global%error /= err_none ) THEN
137  CALL errorstop(global,err_allocate,__line__,'varInfoSpec')
138  END IF ! global%error
139 
140  DO ispec = 1,pregion%specInput%nSpecies
141  varinfospec(ispec) = v_spec_var1 + ispec - 1
142  END DO ! iSpec
143 
144  CALL rflu_computegradfaceswrapper(pregion,1,pregion%specInput%nSpecies, &
145  1,pregion%specInput%nSpecies, &
146  pregion%spec%cv,pregion%spec%gradFace)
147 
148  IF ( pregion%grid%nFacesConstr > 0 ) THEN
149  CALL rflu_computegradfacesconstr(pregion,1,pregion%specInput%nSpecies, &
150  1,pregion%specInput%nSpecies, &
151  varinfospec,pregion%spec%cv, &
152  pregion%spec%gradFace)
153  END IF ! pRegion%grid%nFacesConstr
154 
155  DO ipatch = 1,pregion%grid%nPatches
156  ppatch => pregion%patches(ipatch)
157 
158  IF ( rflu_decideneedbgradface(pregion,ppatch) .EQV. .true. ) THEN
159 
160  CALL rflu_computegradbfaceswrapper(pregion,ppatch,1, &
161  pregion%specInput%nSpecies,1, &
162  pregion%specInput%nSpecies, &
163  pregion%spec%cv, &
164  ppatch%spec%gradFace)
165  IF ( ppatch%cReconst /= constr_none ) THEN
166  CALL rflu_computebfgradconstrwrapper(pregion,ppatch,1, &
167  pregion%specInput%nSpecies,1, &
168  pregion%specInput%nSpecies, &
169  varinfospec,pregion%spec%cv, &
170  ppatch%spec%gradFace)
171  END IF ! pPatch%cReconst
172  END IF ! RFLU_DecideNeedBGradFace
173  END DO ! iPatch
174 
175 
176  DEALLOCATE(varinfospec,stat=errorflag)
177  global%error = errorflag
178  IF ( global%error /= err_none ) THEN
179  CALL errorstop(global,err_deallocate,__line__,'varInfoSpec')
180  END IF ! global%error
181 
182  CALL rflu_scalarviscousfluxes(pregion,pregion%specInput%nSpecies, &
183  pregion%spec%tv,pregion%spec%gradFace, &
184  pregion%spec%diss)
185  CALL rflu_scalarconvertcvprim2cons(pregion,pregion%spec%cv, &
186  pregion%spec%cvState)
187 #endif
188  END IF ! global%specUsed
189 #endif
190 
191 ! *****************************************************************************
192 ! End
193 ! *****************************************************************************
194 
195  CALL deregisterfunction(global)
196 
197 END SUBROUTINE viscousfluxesmp
198 
199 ! *****************************************************************************
200 !
201 ! RCS Revision history:
202 !
203 ! $Log: ViscousFluxesMP.F90,v $
204 ! Revision 1.9 2008/12/06 08:44:10 mtcampbe
205 ! Updated license.
206 !
207 ! Revision 1.8 2008/11/19 22:17:24 mtcampbe
208 ! Added Illinois Open Source License/Copyright
209 !
210 ! Revision 1.7 2006/08/19 15:38:39 mparmar
211 ! Moved region%spec%bGradFace to patch%spec%gradFace
212 !
213 ! Revision 1.6 2006/04/15 16:53:50 haselbac
214 ! Added IF on cReconst flag on patch
215 !
216 ! Revision 1.5 2006/04/07 15:19:15 haselbac
217 ! Removed tabs
218 !
219 ! Revision 1.4 2006/04/07 14:39:43 haselbac
220 ! Changed calls to bface grad routines, now inside patch loop
221 !
222 ! Revision 1.3 2005/10/30 21:46:23 haselbac
223 ! Bug fix: Updated calls to CompGrad routines
224 !
225 ! Revision 1.2 2005/10/05 13:49:37 haselbac
226 ! Adapted to new face grads, cosmetics
227 !
228 ! Revision 1.1 2004/12/01 16:52:19 haselbac
229 ! Initial revision after changing case
230 !
231 ! Revision 1.12 2004/07/28 15:29:18 jferry
232 ! created global variable for spec use
233 !
234 ! Revision 1.11 2004/03/05 22:09:00 jferry
235 ! created global variables for peul, plag, and inrt use
236 !
237 ! Revision 1.10 2004/01/29 22:52:51 haselbac
238 ! Added viscous fluxes for species, some clean-up
239 !
240 ! Revision 1.9 2003/12/04 03:23:11 haselbac
241 ! Moved RFLU_Convert calls into viscousFluxes routine
242 !
243 ! Revision 1.8 2003/11/20 16:40:36 mdbrandy
244 ! Backing out RocfluidMP changes from 11-17-03
245 !
246 ! Revision 1.5 2003/10/03 20:44:02 haselbac
247 ! Corrected Rocflu code
248 !
249 ! Revision 1.4 2003/10/01 23:52:10 jblazek
250 ! Corrected bug in moving noslip wall BC and grid speeds.
251 !
252 ! Revision 1.3 2003/05/15 02:57:02 jblazek
253 ! Inlined index function.
254 !
255 ! Revision 1.2 2003/04/10 01:22:41 jblazek
256 ! Got rid of pRegion in ViscousFluxesMP.
257 !
258 ! Revision 1.1 2003/03/28 19:48:26 fnajjar
259 ! Initial import for RocfluidMP
260 !
261 ! *****************************************************************************
262 
263 
264 
265 
266 
267 
268 
subroutine, public rflu_computegradfaceswrapper(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad)
subroutine viscousfluxesmp(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_computegradfacesconstr(pRegion, iBegVar, iEndVar, iBegGrad, iEndGrad, varInfo, var, grad)
subroutine rflu_scalarviscousfluxes(pRegion, nVarScal, tvScal, gradScal, resScal)
subroutine, public rflu_computegradbfaceswrapper(pRegion, pPatch, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad)
subroutine, public rflu_scalarconvertcvprim2cons(pRegion, cvScal, cvScalStateCurrent)
subroutine viscousfluxes(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_scalarconvertcvcons2prim(pRegion, cvScal, cvScalStateCurrent)