67 TYPE(t_region
),
POINTER :: pregion
73 CHARACTER(CHRLEN) :: rcsidentstring
75 INTEGER :: bctype,c1,distrib,errorflag,i2dvals,icont,icvmass,ifc, &
76 ipatch,itile,ncont,npatches
78 INTEGER,
POINTER,
DIMENSION(:) :: bf2c,pcvtilemass
80 REAL(RFREAL) :: area,cp,heatcapsum,heatcapsumr,injcvelratio,&
81 massfluxlimit,massfluxsum,massfluxsumr,minj, &
82 nm,nx,ny,nz,rhomixtbcond,tinj,tiletemp,tilevelnrm
83 REAL(RFREAL),
POINTER,
DIMENSION(:) :: injcmassfluxratio, injctemp, specheat
84 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: cv, fn, prhs, vals
87 TYPE(t_patch),
POINTER :: ppatch
91 REAL(RFREAL) :: heatcapratio,massfluxratio,rhoplag
98 rcsidentstring =
'$RCSfile: PLAG_RFLU_InjcTileCalcRhs.F90,v $ $Revision: 1.8 $'
100 global => pregion%global
103 'PLAG_RFLU_InjcTileCalcRhs.F90')
109 ncont = pregion%plagInput%nCont
110 npatches = pregion%grid%nPatches
112 injcvelratio = pregion%plagInput%injcVelRatio
113 injcmassfluxratio => pregion%plagInput%injcMassFluxRatio
114 specheat => pregion%plagInput%spht
115 injctemp => pregion%plagInput%injcTemp
117 cv => pregion%mixt%cv
119 massfluxlimit = 1.0e-10_rfreal
127 ppatch => pregion%patches(ipatch)
128 vals => ppatch%mixt%vals
133 bctype = ppatch%bcType
134 distrib = ppatch%mixt%distrib
140 IF ( (bctype >= bc_injection .AND. bctype <= bc_injection + bc_range) .OR. &
141 (bctype >= bc_inflow .AND. bctype <= bc_inflow + bc_range) )
THEN
147 DO ifc = 1, ppatch%nBFaces
156 i2dvals = distrib * ifc
157 minj = vals(bcdat_inject_mfrate,i2dvals)
158 tinj = vals(bcdat_inject_temp ,i2dvals)
165 rhomixtbcond = cv(cv_mixt_dens,c1)
171 ptileplag => ppatch%tilePlag
173 prhs => ptileplag%rhs
174 pcvtilemass => ptileplag%cvTileMass
183 massfluxsum =
sum( minj * injcmassfluxratio(:) )
184 heatcapsum =
dot_product( specheat, minj * injcmassfluxratio(:) )
187 tilevelnrm = injcvelratio * minj / rhomixtbcond
191 icvmass = pcvtilemass(icont)
192 prhs(icvmass,itile) = -area *minj *injcmassfluxratio(icont)
195 prhs(cv_tile_momnrm,itile) = -area *massfluxsum *tilevelnrm
197 prhs(cv_tile_ener ,itile) = -area * &
198 ( 0.5_rfreal*massfluxsum*tilevelnrm**2 &
199 + heatcapsum *tiletemp )
205 CASE(bc_inflow_veltemp)
208 massfluxsum = 0.0_rfreal
209 heatcapsum = 0.0_rfreal
210 tilevelnrm = 0.0_rfreal
211 tiletemp = 0.0_rfreal
214 rhoplag = pregion%plagInput%dens(icont)
215 massfluxsum = massfluxsum + injcmassfluxratio(icont) *rhoplag
216 heatcapsum = heatcapsum + specheat(icont) *injcmassfluxratio(icont) *rhoplag
223 IF ( massfluxsum > massfluxlimit )
THEN
224 massfluxsumr = 1.0_rfreal/massfluxsum
225 heatcapsumr = 1.0_rfreal/heatcapsum
227 massfluxsumr = 1.0_rfreal
228 heatcapsumr = 1.0_rfreal
232 icvmass = pcvtilemass(icont)
233 rhoplag = pregion%plagInput%dens(icont)
235 massfluxratio = injcmassfluxratio(icont) *rhoplag *massfluxsumr
236 heatcapratio = injcmassfluxratio(icont) *rhoplag &
237 * specheat(icont) *heatcapsumr
239 tilevelnrm = tilevelnrm +massfluxratio *injcmassfluxratio(icont)
240 tiletemp = tiletemp +heatcapratio *injctemp(icont)
242 prhs(icvmass,itile) = -area * injcmassfluxratio(icont) *rhoplag
245 prhs(cv_tile_momnrm,itile) = -area *massfluxsum *tilevelnrm
247 prhs(cv_tile_ener ,itile) = -area * &
248 ( 0.5_rfreal*massfluxsum*tilevelnrm**2 &
249 + heatcapsum *tiletemp )
256 CALL
errorstop(global,err_reached_default,__line__)
subroutine plag_rflu_injctilecalcrhs(pRegion)
Tfloat sum() const
Return the sum of all the pixel values in an image.
subroutine registerfunction(global, funName, fileName)
subroutine errorstop(global, errorCode, errorLine, addMessage)
long double dot_product(pnt vec1, pnt vec2)
subroutine deregisterfunction(global)