67 INTEGER,
INTENT(IN) :: nvarscal
68 REAL(RFREAL),
DIMENSION(:,:),
INTENT(IN) :: cvscal
69 REAL(RFREAL),
DIMENSION(:,:),
INTENT(INOUT) :: resscal
70 REAL(RFREAL),
DIMENSION(:,:,:),
INTENT(IN) :: gradcellscal
71 TYPE(t_region
),
POINTER :: pregion
77 CHARACTER(CHRLEN) :: rcsidentstring
78 INTEGER :: c1,c2,ifc,ivarscal
79 REAL(RFREAL) :: dx1,dx2,dy1,dy2,dz1,dz2,flx,mf,mfn,mfp,sl,sr,xc,yc,zc
80 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmf
82 TYPE(t_grid),
POINTER :: pgrid
88 rcsidentstring =
'$RCSfile: RFLU_ScalarSecond.F90,v $ $Revision: 1.4 $'
90 global => pregion%global
93 'RFLU_ScalarSecond.F90')
99 IF ( pregion%mixtInput%indMfMixt /= 1 )
THEN
100 CALL
errorstop(global,err_indmfmixt_invalid,__line__)
107 pgrid => pregion%grid
108 pmf => pregion%mixt%mfMixt
114 DO ifc = 1,pgrid%nFaces
115 c1 = pgrid%f2c(1,ifc)
116 c2 = pgrid%f2c(2,ifc)
122 xc = pgrid%fc(xcoord,ifc)
123 yc = pgrid%fc(ycoord,ifc)
124 zc = pgrid%fc(zcoord,ifc)
126 dx1 = xc - pgrid%cofg(xcoord,c1)
127 dy1 = yc - pgrid%cofg(ycoord,c1)
128 dz1 = zc - pgrid%cofg(zcoord,c1)
130 dx2 = xc - pgrid%cofg(xcoord,c2)
131 dy2 = yc - pgrid%cofg(ycoord,c2)
132 dz2 = zc - pgrid%cofg(zcoord,c2)
139 mfp =
max(mf,0.0_rfreal)
140 mfn =
min(mf,0.0_rfreal)
146 DO ivarscal = 1,nvarscal
147 sl = cvscal(ivarscal,c1)
148 sr = cvscal(ivarscal,c2)
150 sl = sl + gradcellscal(xcoord,ivarscal,c1)*dx1 &
151 + gradcellscal(ycoord,ivarscal,c1)*dy1 &
152 + gradcellscal(zcoord,ivarscal,c1)*dz1
154 sr = sr + gradcellscal(xcoord,ivarscal,c2)*dx2 &
155 + gradcellscal(ycoord,ivarscal,c2)*dy2 &
156 + gradcellscal(zcoord,ivarscal,c2)*dz2
158 flx = mfp*sl + mfn*sr
160 resscal(ivarscal,c1) = resscal(ivarscal,c1) + flx
161 resscal(ivarscal,c2) = resscal(ivarscal,c2) - flx
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine registerfunction(global, funName, fileName)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine rflu_scalarsecond(pRegion, nVarScal, cvScal, gradCellScal, resScal)
subroutine deregisterfunction(global)