Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MixtureProperties.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 gas dynamic properties of the mixture.
26 !
27 ! Description: none.
28 !
29 ! Input: region = mixture variables and index pointers
30 ! inBeg = first value to update
31 ! inEnd = last value to update
32 ! gasUpdate = should the gas variables be also updated?
33 !
34 ! Output: mixt%dv = dependent variables (p, T, c)
35 ! mixt%tv = transport variables (viscosity, heat conductivity)
36 ! mixt%gv = gas variables (cp, molecular mass)
37 !
38 ! Notes: none.
39 !
40 !******************************************************************************
41 !
42 ! $Id: MixtureProperties.F90,v 1.4 2008/12/06 08:44:09 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2001 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE mixtureproperties( region,inBeg,inEnd,gasUpdate )
49 
50  USE moddatatypes
51  USE moddatastruct, ONLY : t_region
54  USE moderror
55  USE modparameters
56  IMPLICIT NONE
57 
58 ! ... parameters
59  INTEGER :: inbeg, inend
60 
61  LOGICAL :: gasupdate
62 
63  TYPE(t_region) :: region
64 
65 ! ... local variables
66  INTEGER :: ilev, indcp, indmol, gasmodel, viscmodel
67 
68  LOGICAL :: computetv
69 
70  REAL(RFREAL) :: prlam, reftemp, refvisc, suthcoef
71  REAL(RFREAL), POINTER :: cv(:,:), dv(:,:), gv(:,:), tv(:,:)
72 
73 !******************************************************************************
74 
75  CALL registerfunction( region%global,'MixtureProperties',&
76  'MixtureProperties.F90' )
77 
78 ! set local quantities to avoid duplicate calls -------------------------------
79 
80 #ifdef RFLO
81  ilev = region%currLevel
82  indcp = region%levels(ilev)%mixt%indCp
83  indmol = region%levels(ilev)%mixt%indMol
84  prlam = region%levels(ilev)%mixt%prLam
85  cv => region%levels(ilev)%mixt%cv
86  dv => region%levels(ilev)%mixt%dv
87  gv => region%levels(ilev)%mixt%gv
88  tv => region%levels(ilev)%mixt%tv
89 #endif
90 #ifdef RFLU
91  indcp = region%mixtInput%indCp
92  indmol = region%mixtInput%indMol
93  prlam = region%mixtInput%prLam
94  cv => region%mixt%cv
95  dv => region%mixt%dv
96  gv => region%mixt%gv
97  tv => region%mixt%tv
98 #endif
99 
100  gasmodel = region%mixtInput%gasModel
101  computetv = region%mixtInput%computeTv
102 
103  viscmodel = region%mixtInput%viscModel
104  refvisc = region%mixtInput%refVisc
105  reftemp = region%mixtInput%refTemp
106  suthcoef = region%mixtInput%suthCoef
107 
108 ! perfect gas -----------------------------------------------------------------
109 
110  IF (gasmodel == gas_model_tcperf) THEN
111 
112 ! - update gas variables
113 
114  IF (gasupdate) CALL perfgasgasvars( inbeg,inend,indcp,indmol, &
115  region%global%refCp, &
116  region%global%refGamma,cv,gv )
117 
118 ! - update dependent variables
119 
120  CALL perfgasdependentvars( inbeg,inend,indcp,indmol,cv,gv,dv )
121 
122 ! - update transport variables
123 
124  IF (computetv) THEN
125  CALL perfgastransportvars( inbeg,inend,indcp,indmol,viscmodel,prlam, &
126  refvisc,reftemp,suthcoef,cv,dv,gv,tv )
127  ENDIF
128 
129 ! -----------------------------------------------------------------------------
130 
131  ELSE
132  CALL errorstop( region%global,err_option_type,__line__,'Species model?' )
133  ENDIF
134 
135 ! finalize --------------------------------------------------------------------
136 
137  CALL deregisterfunction( region%global )
138 
139 END SUBROUTINE mixtureproperties
140 
141 !******************************************************************************
142 !
143 ! RCS Revision history:
144 !
145 ! $Log: MixtureProperties.F90,v $
146 ! Revision 1.4 2008/12/06 08:44:09 mtcampbe
147 ! Updated license.
148 !
149 ! Revision 1.3 2008/11/19 22:17:23 mtcampbe
150 ! Added Illinois Open Source License/Copyright
151 !
152 ! Revision 1.2 2005/10/31 21:09:34 haselbac
153 ! Changed specModel and SPEC_MODEL_NONE
154 !
155 ! Revision 1.1 2004/12/01 16:49:41 haselbac
156 ! Initial revision after changing case
157 !
158 ! Revision 1.13 2004/03/03 23:55:39 jferry
159 ! Allowed particles to be run with Euler case
160 !
161 ! Revision 1.12 2003/11/20 16:40:35 mdbrandy
162 ! Backing out RocfluidMP changes from 11-17-03
163 !
164 ! Revision 1.9 2003/05/15 02:57:02 jblazek
165 ! Inlined index function.
166 !
167 ! Revision 1.8 2003/04/10 23:26:48 fnajjar
168 ! Modified calling sequence for perfgasTransportVars with viscosity model
169 !
170 ! Revision 1.7 2002/09/09 13:59:13 haselbac
171 ! mixtInput now under regions
172 !
173 ! Revision 1.6 2002/09/05 17:40:20 jblazek
174 ! Variable global moved into regions().
175 !
176 ! Revision 1.5 2002/08/16 21:33:47 jblazek
177 ! Changed interface to MixtureProperties.
178 !
179 ! Revision 1.4 2002/07/05 23:20:46 jblazek
180 ! Corrected bug in perfgasDependentVars.F90; did some cosmetics.
181 !
182 ! Revision 1.3 2002/05/04 16:33:34 haselbac
183 ! Added RFLU statements
184 !
185 ! Revision 1.2 2002/01/23 03:51:24 jblazek
186 ! Added low-level time-stepping routines.
187 !
188 ! Revision 1.1 2002/01/10 00:02:06 jblazek
189 ! Added calculation of mixture properties.
190 !
191 !******************************************************************************
192 
193 
194 
195 
196 
197 
198 
subroutine perfgasdependentvars(inBeg, inEnd, indCp, indMol, cv, gv, dv)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine perfgastransportvars(inBeg, inEnd, indCp, indMol, viscModel, prLam, refVisc, refTemp, suthCoef, cv, dv, gv, tv)
subroutine perfgasgasvars(inBeg, inEnd, indCp, indMol, refCp, refGamma, cv, gv)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine mixtureproperties(region, inBeg, inEnd, gasUpdate)
subroutine deregisterfunction(global)
Definition: ModError.F90:469