Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BcondOutflowPerf.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 outflow 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: bcOpt = boundary treatment: subsonic, supersonic, or mixed
34 ! pout = given static outlet pressure
35 ! sx/y/zn = components of ortho-normalized face vector (outward facing)
36 ! cpgas = specific heat at constant pressure (boundary cell)
37 ! mol = molecular mass at boundary cell
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 !
43 ! Output: rhob = density at boundary
44 ! rhou/v/wb = density * velocity components at boundary
45 ! rhoeb = density * total energy at boundary
46 !
47 ! Notes: this condition is valid only for thermally and calorically
48 ! perfect gas (supersonic outflow valid for all gases).
49 !
50 !******************************************************************************
51 !
52 ! $Id: BcondOutflowPerf.F90,v 1.4 2008/12/06 08:44:08 mtcampbe Exp $
53 !
54 ! Copyright: (c) 2002 by the University of Illinois
55 !
56 !******************************************************************************
57 
58 SUBROUTINE bcondoutflowperf( bcOpt,pout,sxn,syn,szn,cpgas,mol, &
59  rho,rhou,rhov,rhow,rhoe,press, &
60  rhob,rhoub,rhovb,rhowb,rhoeb )
61 
62  USE moddatatypes
63  USE modparameters
66 
67  IMPLICIT NONE
68 
69 ! ... parameters
70  INTEGER :: bcopt
71 
72  REAL(RFREAL) :: pout
73  REAL(RFREAL) :: rho, rhou, rhov, rhow, rhoe, press
74  REAL(RFREAL) :: sxn, syn, szn, cpgas, mol
75  REAL(RFREAL) :: rhob, rhoub, rhovb, rhowb, rhoeb
76 
77 ! ... local variables
78  REAL(RFREAL) :: csound, rgas, gamma, gam1, u, v, w, mach, rrhoc, deltp, &
79  ub, vb, wb, vnd
80 
81 !******************************************************************************
82 ! gas properties; velocity components; Mach number
83 
84  rgas = mixtperf_r_m( mol )
85  gamma = mixtperf_g_cpr( cpgas,rgas )
86  gam1 = gamma - 1.0_rfreal
87 
88  u = rhou/rho
89  v = rhov/rho
90  w = rhow/rho
91  csound = mixtperf_c_dgp( rho,gamma,press )
92  mach = sqrt(u*u+v*v+w*w)/csound
93 
94 ! subsonic flow ---------------------------------------------------------------
95 
96  IF (mach < 1.0_rfreal .AND. &
97  (bcopt == bcopt_subsonic .OR. bcopt == bcopt_mixed)) THEN
98  rrhoc = 1.0_rfreal/(rho*csound)
99  deltp = press - pout
100  rhob = rho - deltp/(csound*csound)
101  ub = u + sxn*deltp*rrhoc
102  vb = v + syn*deltp*rrhoc
103  wb = w + szn*deltp*rrhoc
104 
105 ! - special treatment to prevent "deltp" from changing the sign
106 ! of velocity components. This may happen for very small u, v, w.
107 
108  vnd = ub*sxn + vb*syn + wb*szn
109  IF ( vnd < 0.0_rfreal ) THEN ! inflow at outflow boundary
110  ub = sign(1.0_rfreal,u)*max(abs(ub),abs(u))
111  vb = sign(1.0_rfreal,v)*max(abs(vb),abs(v))
112  wb = sign(1.0_rfreal,w)*max(abs(wb),abs(w))
113  END IF ! vnd
114 
115  rhoub = rhob*ub
116  rhovb = rhob*vb
117  rhowb = rhob*wb
118  rhoeb = rhob*mixtperf_eo_dgpuvw( rhob,gamma,pout,ub,vb,wb )
119 
120 ! supersonic flow -------------------------------------------------------------
121 
122  ELSE
123  rhob = rho
124  rhoub = rhou
125  rhovb = rhov
126  rhowb = rhow
127  rhoeb = rhoe
128  END IF ! mach
129 
130 END SUBROUTINE bcondoutflowperf
131 
132 !******************************************************************************
133 !
134 ! RCS Revision history:
135 !
136 ! $Log: BcondOutflowPerf.F90,v $
137 ! Revision 1.4 2008/12/06 08:44:08 mtcampbe
138 ! Updated license.
139 !
140 ! Revision 1.3 2008/11/19 22:17:22 mtcampbe
141 ! Added Illinois Open Source License/Copyright
142 !
143 ! Revision 1.2 2006/03/26 20:21:09 haselbac
144 ! Fix mistake in declarations
145 !
146 ! Revision 1.1 2004/12/01 16:48:04 haselbac
147 ! Initial revision after changing case
148 !
149 ! Revision 1.5 2003/11/20 16:40:35 mdbrandy
150 ! Backing out RocfluidMP changes from 11-17-03
151 !
152 ! Revision 1.2 2002/06/22 00:49:50 jblazek
153 ! Modified interfaces to BC routines.
154 !
155 ! Revision 1.1 2002/06/10 21:19:34 haselbac
156 ! Initial revision
157 !
158 !******************************************************************************
159 
160 
161 
162 
163 
164 
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
static SURF_BEGIN_NAMESPACE double sign(double x)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
real(rfreal) function mixtperf_c_dgp(D, G, P)
Definition: MixtPerf_C.F90:56
double sqrt(double d)
Definition: double.h:73
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
subroutine bcondoutflowperf(bcOpt, pout, sxn, syn, szn, cpgas, mol, rho, rhou, rhov, rhow, rhoe, press, rhob, rhoub, rhovb, rhowb, rhoeb)
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