Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BcondInjectionPerf.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 injection boundary condition for one cell.
26 !
27 ! Description: none.
28 !
29 ! Input: distrib = 0: BC values constant, 1: BC values varying
30 ! minj = injection mass flux
31 ! tinj = injection temperature
32 ! rhoVrel = density * relative velocity (V-inj - boundary movement)
33 ! p = static pressure (boundary cell)
34 ! sx/y/zn = components of ortho-normalized face vector (outward facing)
35 ! cpgas = specific heat at constant pressure (boundary cell)
36 ! mm = molecular mass at boundary cell
37 !
38 ! Output: rhob = density at boundary
39 ! rhou/v/wb = density * velocity components at boundary
40 ! rhoeb = density * total energy at boundary
41 ! pb = pressure at boundary
42 ! u/v/winj = components of injection velocity
43 !
44 ! Notes: this condition is valid only for thermally and calorically
45 ! perfect gas. It is also assumed that for distrib==BCDAT_CONSTANT the
46 ! relative velocity is identical to injection velocity.
47 !
48 !******************************************************************************
49 !
50 ! $Id: BcondInjectionPerf.F90,v 1.3 2008/12/06 08:44:08 mtcampbe Exp $
51 !
52 ! Copyright: (c) 2002 by the University of Illinois
53 !
54 !******************************************************************************
55 
56 SUBROUTINE bcondinjectionperf( distrib,minj,tinj,rhoVrel,sxn,syn,szn, &
57  cpgas,mm,p,rhob,rhoub,rhovb,rhowb,rhoeb,pb, &
58  uinj,vinj,winj )
59 
60  USE moddatatypes
61  USE modparameters
64 
65  IMPLICIT NONE
66 
67 ! ... parameters
68  INTEGER, INTENT(IN) :: distrib
69 
70  REAL(RFREAL), INTENT(IN) :: cpgas, minj, tinj, rhovrel(3), mm, &
71  sxn, syn, szn, p
72  REAL(RFREAL), INTENT(OUT) :: rhob, rhoub, rhovb, rhowb, rhoeb, pb, &
73  uinj, vinj, winj
74 
75 ! ... local variables
76  REAL(RFREAL) :: g, qb, rgas, ub, vb, wb
77 
78 !******************************************************************************
79 ! gas properties
80 
81  rgas = mixtperf_r_m( mm )
82  g = mixtperf_g_cpr( cpgas,rgas )
83 
84 ! set boundary values
85 
86  pb = p
87  rhob = mixtperf_d_prt( pb,rgas,tinj )
88 
89  qb = -minj/rhob
90  uinj = qb*sxn
91  vinj = qb*syn
92  winj = qb*szn
93 
94  IF (distrib == bcdat_constant) THEN
95  ub = uinj
96  vb = vinj
97  wb = winj
98  ELSE
99  ub = rhovrel(1)/rhob
100  vb = rhovrel(2)/rhob
101  wb = rhovrel(3)/rhob
102  ENDIF
103 
104  rhoeb = rhob * mixtperf_eo_dgpuvw( rhob,g,pb,ub,vb,wb )
105  rhoub = rhob*ub
106  rhovb = rhob*vb
107  rhowb = rhob*wb
108 
109 END SUBROUTINE bcondinjectionperf
110 
111 !******************************************************************************
112 !
113 ! RCS Revision history:
114 !
115 ! $Log: BcondInjectionPerf.F90,v $
116 ! Revision 1.3 2008/12/06 08:44:08 mtcampbe
117 ! Updated license.
118 !
119 ! Revision 1.2 2008/11/19 22:17:22 mtcampbe
120 ! Added Illinois Open Source License/Copyright
121 !
122 ! Revision 1.1 2004/12/01 16:48:00 haselbac
123 ! Initial revision after changing case
124 !
125 ! Revision 1.6 2003/11/20 16:40:35 mdbrandy
126 ! Backing out RocfluidMP changes from 11-17-03
127 !
128 ! Revision 1.3 2002/09/27 00:26:17 jblazek
129 ! Changed for moving boundaries.
130 !
131 ! Revision 1.2 2002/06/22 00:49:50 jblazek
132 ! Modified interfaces to BC routines.
133 !
134 ! Revision 1.1 2002/06/10 21:19:34 haselbac
135 ! Initial revision
136 !
137 !******************************************************************************
138 
139 
140 
141 
142 
143 
real(rfreal) function mixtperf_r_m(M)
Definition: MixtPerf_R.F90:54
subroutine bcondinjectionperf(distrib, minj, tinj, rhoVrel, sxn, syn, szn, cpgas, mm, p, rhob, rhoub, rhovb, rhowb, rhoeb, pb, uinj, vinj, winj)
real(rfreal) function mixtperf_d_prt(P, R, T)
Definition: MixtPerf_D.F90:71
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
unsigned char g() const
Definition: Color.h:69