52 gradcellscal,valscal,resscal)
72 INTEGER,
INTENT(IN) :: nvarscal
73 REAL(RFREAL),
DIMENSION(:,:),
INTENT(IN) :: cvscal
74 REAL(RFREAL),
DIMENSION(:,:),
INTENT(INOUT) :: resscal
75 REAL(RFREAL),
DIMENSION(:,:,:),
INTENT(IN) :: gradcellscal
77 TYPE(t_patch),
POINTER :: ppatch
78 TYPE(t_region
),
POINTER :: pregion
84 CHARACTER(CHRLEN) :: rcsidentstring
85 INTEGER :: c1,bctype,distscal,ifc,ivarscal
86 REAL(RFREAL) ::
dx,
dy,
dz,flx,mf,sl
87 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmfmixt
88 REAL(RFREAL),
DIMENSION(:,:),
POINTER ::
rhs
90 TYPE(t_grid),
POINTER :: pgrid
96 rcsidentstring =
'$RCSfile: RFLU_ScalarSecondPatch.F90,v $ $Revision: 1.8 $'
98 global => pregion%global
101 'RFLU_ScalarSecondPatch.F90')
107 IF ( pregion%mixtInput%indMfMixt /= 1 )
THEN
108 CALL
errorstop(global,err_indmfmixt_invalid,__line__)
115 pgrid => pregion%grid
116 pmfmixt => ppatch%mfMixt
118 bctype = ppatch%bcType
119 distscal = valscal%distrib
125 SELECT CASE ( bctype )
131 CASE ( bc_inflow_totang,bc_inflow_veltemp )
132 DO ifc = 1,ppatch%nBFaces
133 c1 = ppatch%bf2c(ifc)
137 DO ivarscal = 1,nvarscal
138 flx = mf*valscal%vals(ivarscal,distscal*ifc)
140 resscal(ivarscal,c1) = resscal(ivarscal,c1) + flx
149 DO ifc = 1,ppatch%nBFaces
150 c1 = ppatch%bf2c(ifc)
152 dx = ppatch%fc(xcoord,ifc) - pgrid%cofg(xcoord,c1)
153 dy = ppatch%fc(ycoord,ifc) - pgrid%cofg(ycoord,c1)
154 dz = ppatch%fc(zcoord,ifc) - pgrid%cofg(zcoord,c1)
158 DO ivarscal = 1,nvarscal
159 sl = cvscal(ivarscal,c1)
161 sl = sl + gradcellscal(xcoord,ivarscal,c1)*
dx &
162 + gradcellscal(ycoord,ivarscal,c1)*
dy &
163 + gradcellscal(zcoord,ivarscal,c1)*
dz
167 resscal(ivarscal,c1) = resscal(ivarscal,c1) + flx
181 CASE ( bc_noslipwall_hflux,bc_noslipwall_temp )
188 DO ifc = 1,ppatch%nBFaces
189 c1 = ppatch%bf2c(ifc)
193 IF ( mf > 0.0_rfreal )
THEN
194 dx = ppatch%fc(xcoord,ifc) - pgrid%cofg(xcoord,c1)
195 dy = ppatch%fc(ycoord,ifc) - pgrid%cofg(ycoord,c1)
196 dz = ppatch%fc(zcoord,ifc) - pgrid%cofg(zcoord,c1)
198 DO ivarscal = 1,nvarscal
199 sl = cvscal(ivarscal,c1)
201 sl = sl + gradcellscal(xcoord,ivarscal,c1)*
dx &
202 + gradcellscal(ycoord,ivarscal,c1)*
dy &
203 + gradcellscal(zcoord,ivarscal,c1)*
dz
207 resscal(ivarscal,c1) = resscal(ivarscal,c1) + flx
210 DO ivarscal = 1,nvarscal
211 flx = mf*valscal%vals(ivarscal,distscal*ifc)
213 resscal(ivarscal,c1) = resscal(ivarscal,c1) + flx
222 CASE ( bc_injection )
223 DO ifc = 1,ppatch%nBFaces
224 c1 = ppatch%bf2c(ifc)
228 DO ivarscal = 1,nvarscal
229 flx = mf*valscal%vals(ivarscal,distscal*ifc)
231 resscal(ivarscal,c1) = resscal(ivarscal,c1) + flx
239 CASE ( bc_periodic, &
248 CALL
errorstop(global,err_reached_default,__line__)
subroutine rflu_scalarsecondpatch(pRegion, pPatch, nVarScal, cvScal, gradCellScal, valScal, resScal)
subroutine registerfunction(global, funName, fileName)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)