Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_RFLU_SourceTerms_GL.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 cavitation source terms.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region data
31 !
32 ! Output: None.
33 !
34 ! Notes: Calculate vapor saturation pressure based from Goff (1957).
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: SPEC_RFLU_SourceTerms_GL.F90,v 1.5 2008/12/06 08:44:40 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2006 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE spec_rflu_sourceterms_gl(pRegion)
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY: t_region
48  USE modglobal, ONLY: t_global
49  USE moderror
50  USE modparameters
51 
57 
58  IMPLICIT NONE
59 
60 ! ******************************************************************************
61 ! Declarations and definitions
62 ! ******************************************************************************
63 
64 ! ==============================================================================
65 ! Arguments
66 ! ==============================================================================
67 
68  TYPE(t_region), POINTER :: pregion
69  TYPE(t_global), POINTER :: global
70 
71 ! ==============================================================================
72 ! Locals
73 ! ==============================================================================
74 
75  CHARACTER(CHRLEN) :: rcsidentstring
76  INTEGER :: icg
77  REAL(RFREAL):: bp,bt,cavno,cvg,cvl,cvv,dinf,fac,fvol,k,kf,kv,linf,n,p, &
78  pinfpe,po,pv,rg,rhov,rhol,ro,rv,ryl,sv,t,tauf,tauv,to,ts, &
79  vinf,vlinf,vfv
80  REAL(RFREAL), DIMENSION(:), POINTER :: vol
81  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcvmixt,pcvspec,pdvmixt,rhsmixt, &
82  rhsspec
83 
84 ! ******************************************************************************
85 ! Start
86 ! ******************************************************************************
87 
88  rcsidentstring = &
89  '$RCSfile: SPEC_RFLU_SourceTerms_GL.F90,v $ $Revision: 1.5 $'
90 
91  global => pregion%global
92 
93  CALL registerfunction(global,'SPEC_RFLU_SourceTerms_GL',&
94  'SPEC_RFLU_SourceTerms_GL.F90')
95 
96 ! ******************************************************************************
97 ! Set pointers and variables
98 ! ******************************************************************************
99 
100  pcvmixt => pregion%mixt%cv
101  pcvspec => pregion%spec%cv
102  pdvmixt => pregion%mixt%dv
103 
104  rhsmixt => pregion%mixt%rhs
105  rhsspec => pregion%spec%rhs
106 
107  vol => pregion%grid%vol
108 
109 ! ******************************************************************************
110 ! Define constants
111 ! ******************************************************************************
112 
113  ro = global%refDensityLiq
114  po = global%refPressLiq
115  to = global%refTempLiq
116  bp = global%refBetaPLiq
117  bt = global%refBetaTLiq
118  cvl = global%refCvLiq
119 
120  rg = mixtperf_r_m(pregion%specInput%specType(1)%pMaterial%molw)
121  cvg = mixtperf_cv_cpr(pregion%specInput%specType(1)%pMaterial%spht,rg)
122 
123  rv = mixtperf_r_m(pregion%specInput%specType(2)%pMaterial%molw)
124  cvv = mixtperf_cv_cpr(pregion%specInput%specType(2)%pMaterial%spht,rv)
125 
126  fac = 1.5_rfreal/global%dtMin
127 
128  DO icg = 1,pregion%grid%nCellsTot
129  p = pdvmixt(dv_mixt_pres,icg)
130  t = pdvmixt(dv_mixt_temp,icg)
131  ryl = pcvmixt(cv_mixt_dens,icg) - pcvspec(1,icg) - pcvspec(2,icg)
132 
133  ts = 273.16_rfreal ! steam point temperature in K
134  pv = 100.0_rfreal*(10.0_rfreal**(10.79574_rfreal*(1.0_rfreal-ts/t) &
135  - 5.02800_rfreal*log10(t/ts) &
136  + 1.50475e-04_rfreal*(1.0_rfreal &
137  - 10.0_rfreal**(-8.2969_rfreal*(t/ts-1.0_rfreal))) &
138  + 0.42873e-03_rfreal &
139  * (10.0_rfreal**(4.76955*(1.0_rfreal-ts/t))-1.0_rfreal) &
140  + 0.78614))
141 
142 ! ******************************************************************************
143 ! Model 1
144 ! ******************************************************************************
145 
146  dinf = 882.655_rfreal ! Hard Coded for Now
147  vinf = 23.728_rfreal
148  linf = 2.0e-03_rfreal
149  vlinf = vinf/linf
150  pinfpe = 0.5_rfreal*dinf*vinf*vinf
151  cavno = 0.4_rfreal ! 0.3, 0.2
152  tauv = 0.00001_rfreal ! base line rate (b=.001),
153  tauf = 0.00001_rfreal ! faster: bx10, slower: bx0.1
154 
155  kf = ((0.5_rfreal*( sign(1.0_rfreal,p-pv) &
156  - 1.0_rfreal)*(p-pv))/(tauf*(pinfpe)))*vlinf
157  kv = ((0.5_rfreal*(-sign(1.0_rfreal,p-pv) &
158  - 1.0_rfreal)*(p-pv))/(tauv*(pinfpe)))*vlinf
159 
160  sv = kf*ryl + kv*pcvspec(2,icg)
161 
162  rhsspec(2,icg) = rhsspec(2,icg) - vol(icg)*sv
163 
164 ! ******************************************************************************
165 ! Model 2
166 ! ******************************************************************************
167 
168 ! rhol = MixtLiq_D_DoBpPPoBtTTo(ro,Bp,Bt,P,po,T,to)
169 ! rhov = MixtPerf_D_PRT(P,Rv,T)
170 ! vfv = rYl/rhol
171 !
172 ! N = 1.0_RFREAL ! bubble number density
173 ! K = 3.85_RFREAL*(rhol/SQRT(rhov))*(N**0.333_RFREAL)
174 !
175 ! Sv = SIGN(1.0_RFREAL,P-Pv)*K*(vfv**0.666_RFREAL)*SQRT(ABS(P-Pv))
176 ! rhsSpec(2,icg) = rhsSpec(2,icg) - vol(icg)*Sv
177  END DO ! icg
178 
179 ! ******************************************************************************
180 ! End
181 ! ******************************************************************************
182 
183  CALL deregisterfunction(global)
184 
185 END SUBROUTINE spec_rflu_sourceterms_gl
186 
187 ! ******************************************************************************
188 !
189 ! RCS Revision history:
190 !
191 ! $Log: SPEC_RFLU_SourceTerms_GL.F90,v $
192 ! Revision 1.5 2008/12/06 08:44:40 mtcampbe
193 ! Updated license.
194 !
195 ! Revision 1.4 2008/11/19 22:17:53 mtcampbe
196 ! Added Illinois Open Source License/Copyright
197 !
198 ! Revision 1.3 2006/04/07 15:19:25 haselbac
199 ! Removed tabs
200 !
201 ! Revision 1.2 2006/03/30 20:52:40 haselbac
202 ! Cosmetics
203 !
204 ! Revision 1.1 2006/03/26 20:21:05 haselbac
205 ! Initial revision
206 !
207 ! ******************************************************************************
208 
209 
210 
211 
212 
213 
214 
real(rfreal) function mixtperf_r_m(M)
Definition: MixtPerf_R.F90:54
static SURF_BEGIN_NAMESPACE double sign(double x)
j indices k indices k
Definition: Indexing.h:6
subroutine spec_rflu_sourceterms_gl(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
real(rfreal) function mixtperf_d_prt(P, R, T)
Definition: MixtPerf_D.F90:71
real(rfreal) function mixtperf_r_cpg(Cp, G)
Definition: MixtPerf_R.F90:39
const NT & n
real(rfreal) function mixtliq_d_dobpppobttto(Dz, Bp, Bt, P, Po, T, To)
Definition: MixtLiq_D.F90:40
subroutine deregisterfunction(global)
Definition: ModError.F90:469
real(rfreal) function mixtperf_cv_cpr(Cp, R)
Definition: MixtPerf_Cv.F90:39