Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BcondFarfieldPerf.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: set far field boundary condition for one cell.
26 !
27 ! Description: the subsonic boundary condition is based on non-reflecting,
28 ! characteristics method of Whitfield and Janus: Three-Dimensional
29 ! Unsteady Euler Equations Solution Using Flux Vector Splitting.
30 ! AIAA Paper 84-1552, 1984. The supersonic boundary condition
31 ! consists of simple extrapolation.
32 !
33 ! Input: machInf = given Mach number at "infinity"
34 ! alphaInf = angle of attack
35 ! betaInf = slip angle
36 ! pInf = given static pressure
37 ! tInf = given static temperature
38 ! rho = density at boundary cell
39 ! rhou/v/w = density * velocity components at boundary cell
40 ! rhoe = density * total energy at boundary cell
41 ! press = static pressure at boundary cell
42 ! sx/y/zn = components of ortho-normalized face vector (outward facing)
43 ! csound = speed of sound at boundary cell
44 ! cpgas = specific heat at constant pressure (boundary cell)
45 ! mol = molecular mass at boundary cell
46 !
47 ! Output: rhob = density at boundary
48 ! rhou/v/wb = density * velocity components at boundary
49 ! rhoeb = density * total energy at boundary
50 ! pb = pressure at boundary
51 !
52 ! Notes: this condition is valid only for a thermally and calorically
53 ! perfect gas (supersonic in/outflow valid for all gases).
54 !
55 !******************************************************************************
56 !
57 ! $Id: BcondFarfieldPerf.F90,v 1.3 2008/12/06 08:44:08 mtcampbe Exp $
58 !
59 ! Copyright: (c) 2002 by the University of Illinois
60 !
61 !******************************************************************************
62 
63 SUBROUTINE bcondfarfieldperf( machInf,alphaInf,betaInf,pInf,tInf, &
64  sxn,syn,szn,cpgas,mol, &
65  rho,rhou,rhov,rhow,rhoe,press, &
66  rhob,rhoub,rhovb,rhowb,rhoeb,pb )
67 
68  USE moddatatypes
69  USE modparameters
73 
74  IMPLICIT NONE
75 
76 ! ... parameters
77  REAL(RFREAL) :: machinf, alphainf, betainf, pinf, tinf
78  REAL(RFREAL) :: rho, rhou, rhov, rhow, rhoe, press
79  REAL(RFREAL) :: sxn, syn, szn, cpgas, mol
80  REAL(RFREAL) :: rhob, rhoub, rhovb, rhowb, rhoeb, pb
81 
82 ! ... local variables
83  REAL(RFREAL) :: rgas, gamma, rhoinf, qinf, uinf, vinf, winf
84  REAL(RFREAL) :: re, ue, ve, we, pe, qn, crho0
85  REAL(RFREAL) :: ra, ua, va, wa, pa, sgn, csound
86 
87 !******************************************************************************
88 ! gas properties
89 
90  rgas = mixtperf_r_m( mol )
91  gamma = mixtperf_g_cpr( cpgas,rgas )
92 
93 ! flow values at "infinity"
94 
95  rhoinf = mixtperf_d_prt( pinf,rgas,tinf )
96  qinf = machinf * mixtperf_c_grt( gamma,rgas,tinf )
97  uinf = qinf * cos(alphainf) * cos(betainf)
98  vinf = qinf * sin(alphainf) * cos(betainf)
99  winf = qinf * sin(betainf)
100 
101 ! flow values at a reference location (= interior cell)
102 
103  re = rho
104  ue = rhou/rho
105  ve = rhov/rho
106  we = rhow/rho
107  pe = press
108  qn = sxn*ue + syn*ve + szn*we
109 
110 ! subsonic flow (qn<0: inflow / qn>0: outflow)
111 
112  IF (machinf < 1._rfreal) THEN
113  csound = mixtperf_c_dgp( re,gamma,pe )
114  crho0 = csound*re
115 
116  IF (qn < 0._rfreal) THEN
117  ra = rhoinf
118  ua = uinf
119  va = vinf
120  wa = winf
121  pa = pinf
122  sgn = -1._rfreal
123  pb = 0.5_rfreal*(pa+pe-crho0*(sxn*(ua-ue)+syn*(va-ve)+szn*(wa-we)))
124  ELSE
125  ra = re
126  ua = ue
127  va = ve
128  wa = we
129  pa = pe
130  sgn = +1._rfreal
131  pb = pinf
132  ENDIF
133  rhob = ra + (pb-pa)/(csound*csound)
134  rhoub = rhob*(ua+sgn*sxn*(pa-pb)/crho0)
135  rhovb = rhob*(va+sgn*syn*(pa-pb)/crho0)
136  rhowb = rhob*(wa+sgn*szn*(pa-pb)/crho0)
137  rhoeb = rhob*mixtperf_eo_dgpuvw( rhob,gamma,pb,rhoub/rhob,rhovb/rhob, &
138  rhowb/rhob )
139 
140 ! supersonic flow (qn<0: inflow / qn>0: outflow)
141 
142  ELSE
143  IF (qn < 0._rfreal) THEN
144  rhob = rhoinf
145  rhoub = rhoinf*uinf
146  rhovb = rhoinf*vinf
147  rhowb = rhoinf*winf
148  rhoeb = rhob*mixtperf_eo_dgpvm( rhoinf,gamma,pinf,qinf )
149  pb = pinf
150  ELSE
151  rhob = rho
152  rhoub = rhou
153  rhovb = rhov
154  rhowb = rhow
155  rhoeb = rhoe
156  pb = press
157  ENDIF
158  ENDIF
159 
160 END SUBROUTINE bcondfarfieldperf
161 
162 !******************************************************************************
163 !
164 ! RCS Revision history:
165 !
166 ! $Log: BcondFarfieldPerf.F90,v $
167 ! Revision 1.3 2008/12/06 08:44:08 mtcampbe
168 ! Updated license.
169 !
170 ! Revision 1.2 2008/11/19 22:17:22 mtcampbe
171 ! Added Illinois Open Source License/Copyright
172 !
173 ! Revision 1.1 2004/12/01 16:47:53 haselbac
174 ! Initial revision after changing case
175 !
176 ! Revision 1.6 2003/11/20 16:40:35 mdbrandy
177 ! Backing out RocfluidMP changes from 11-17-03
178 !
179 ! Revision 1.3 2002/06/29 23:05:19 jblazek
180 ! Removed gam1 because not used.
181 !
182 ! Revision 1.2 2002/06/22 00:49:50 jblazek
183 ! Modified interfaces to BC routines.
184 !
185 ! Revision 1.1 2002/06/10 21:19:34 haselbac
186 ! Initial revision
187 !
188 !******************************************************************************
189 
190 
191 
192 
193 
194 
real(rfreal) function mixtperf_eo_dgpvm(D, G, P, Vm)
Definition: MixtPerf_E.F90:55
real(rfreal) function mixtperf_p_deogvm2(D, Eo, G, Vm2)
Definition: MixtPerf_P.F90:39
real(rfreal) function mixtperf_r_m(M)
Definition: MixtPerf_R.F90:54
subroutine bcondfarfieldperf(machInf, alphaInf, betaInf, pInf, tInf, sxn, syn, szn, cpgas, mol, rho, rhou, rhov, rhow, rhoe, press, rhob, rhoub, rhovb, rhowb, rhoeb, pb)
real(rfreal) function mixtperf_c_dgp(D, G, P)
Definition: MixtPerf_C.F90:56
real(rfreal) function mixtperf_d_prt(P, R, T)
Definition: MixtPerf_D.F90:71
NT & sin
real(rfreal) function mixtperf_c_grt(G, R, T)
Definition: MixtPerf_C.F90:86
real(rfreal) function mixtperf_eo_dgpuvw(D, G, P, U, V, W)
Definition: MixtPerf_E.F90:40
real(rfreal) function mixtperf_g_cpr(Cp, R)
Definition: MixtPerf_G.F90:39
NT & cos