9 SUBROUTINE uniformrhs( numDim, gridSizes, numPoints, opInterval, gridMetric, &
10 numStencils, numStencilValues, stencilSizes, stencilStarts, &
11 stencilOffsets, stencilWeights, stencilID, numTransport, &
12 numPointsApply,applyPoints, &
13 rhoBuffer,rhoVBuffer,rhoEBuffer,transportBuffer,velHat, &
14 pressureBuffer, rhsBuffer)
18 INTEGER(KIND=4),
INTENT(IN) :: numDim, numStencils, numStencilValues, numComponents, numTransport
19 INTEGER(KIND=8),
INTENT(IN) :: gridSizes(numdim), numPoints, numPointsApply
20 INTEGER(KIND=8),
INTENT(IN) :: opInterval(2*numdim), applyPoints(numpointsapply)
21 INTEGER(KIND=4),
INTENT(IN) :: stencilSizes(numstencils),stencilStarts(numstencils)
22 INTEGER(KIND=4),
INTENT(IN) :: stencilOffsets(numvalues)
23 INTEGER(KIND=4),
INTENT(IN) :: stencilID(numpoints)
24 REAL(KIND=8),
INTENT(IN) :: stencilWeights(numvalues)
25 REAL(KIND=8),
INTENT(IN) :: velHat(numdim*numpoints)
26 REAL(KIND=8),
INTENT(IN) :: rhoBuffer(numpoints)
27 REAL(KIND=8),
INTENT(IN) :: rhoVBuffer(numdim*numpoints)
28 REAL(KIND=8),
INTENT(IN) :: rhoEBuffer(numpoints)
29 REAL(KIND=8),
INTENT(IN) :: transportBuffer(numtransport*numpoints)
30 REAL(KIND=8),
INTENT(IN) :: pressureBuffer(numpoints)
31 REAL(KIND=8),
INTENT(OUT) :: rhsBuffer(numdim*numpoints)
34 INTEGER :: iDim, numComponents
35 INTEGER(KIND=8) :: iPoint,iX,iY,iZ,iStart,iEnd,jStart,jEnd,kStart,kEnd
36 INTEGER(KIND=8) :: xIndex,zIndex,yIndex,yzIndex,xSize,ySize,zSize
37 INTEGER(KIND=8) :: iPoint2, iPoint3, pointOffset
46 pointoffset = (idim-1)*numpoints
48 DO ipoint = 1, numpointsapply
49 pointindex = applypoints(ipoint)
50 vectorpointindex = pointindex + pointoffset
51 flux(pointindex) = rhobuffer(pointindex) * velhat(vectorpointindex)
54 CALL applyoperator(region, ng, ifirstderiv, i, flux, dflux, .false., 0)
57 if(nd == 2 .and. i == 1 .and.
grid%XYZ(ii,1) <
grid%DRmin) dflux(ii)=0d0
59 rhs(ii,1) =
rhs(ii,1) - dflux(ii)
61 Call save_patch_deriv(region, ng, 1, i, dflux)
75 flux(ii) = cv(ii,ip1) * uvwhat(ii,j) + mt1(ii,t2mapji) * dv(ii,1)
77 call apply_operator_box(region, ng, ifirstderiv, j, flux, dflux, .false., 0)
82 rhs(ii,ip1) =
rhs(ii,ip1) - dflux(ii)
84 Call save_patch_deriv(region, ng, i+1, j, dflux)
98 flux(ii) = cv(ii,ip1) * uvwhat(ii,j)
100 call apply_operator_box(region, ng, ifirstderiv, j, flux, dflux, .false., 0)
102 if(nd == 2 .and. j == 1 .and.
grid%XYZ(ii,1) <
grid%DRmin) dflux(ii)=0d0
103 rhs(ii,ip1) =
rhs(ii,ip1) - dflux(ii)
105 Call save_patch_deriv(region, ng, i+1, j, dflux)
107 flux(ii) = mt0(ii,t2mapji) * (dv(ii,1) - 1d0/input%GamRef)
109 call apply_operator_box(region, ng, ifirstderiv, j, flux, dflux, .false., 0)
111 dflux(ii) = dflux(ii)*jac0(ii)*invjac(ii)
114 rhs(ii,ip1) =
rhs(ii,ip1) - dflux(ii)
127 flux(ii) = (cv(ii,ndp2) + dv(ii,1)) * uvwhat(ii,i) - xi_tau(ii,i) * dv(ii,1)
129 call apply_operator_box(region, ng, ifirstderiv, i, flux, dflux, .false., 0)
132 if(nd == 2 .and. i == 1 .and.
grid%XYZ(ii,1) <
grid%DRmin) dflux(ii)=0d0
134 rhs(ii,ndp2) =
rhs(ii,ndp2) - dflux(ii)
136 Call save_patch_deriv(region, ng, ndp2, i, dflux)
146 flux(ii) = auxvars(ii,k) * uvwhat(ii,i)
148 call apply_operator_box(region, ng, ifirstderiv, i, flux, dflux, .false., 0)
151 if(nd == 2 .and. i == 1 .and.
grid%XYZ(ii,1) <
grid%DRmin) dflux(ii)=0d0
153 rhs_auxvars(ii,k) = rhs_auxvars(ii,k) - dflux(ii)
160 Call ns_rhs_axisymmetric_hopital(ng, nc, nauxvars, nd, ifirstderiv, region,
grid, input, flux, dflux, mt0, invjac_tau, jac0, invjac,
rhs, rhs_auxvars, cv, dv, auxvars, 0)
172 source = 0.1_dp * exp(-(log(2.0_dp))*( ((xyz(i,1)-4.0_dp)**2+xyz(i,2)**2)/(0.4_dp)**2 )) &
173 * dsin(4.0_dp * twopi * time(i)) * invjac(i)
174 rhs(i,4) =
rhs(i,4) + source / (gv(i,1)-1.0_dp)
180 if (usemetricidentities == true)
then 188 rhs(ii,1) =
rhs(ii,1) + cv(ii,2) * ident(ii,1) &
189 + cv(ii,3) * ident(ii,2)
190 rhs(ii,2) =
rhs(ii,2) + dv(ii,1) * ident(ii,1)
191 rhs(ii,3) =
rhs(ii,3) + dv(ii,1) * ident(ii,2)
192 rhs(ii,4) =
rhs(ii,4) + (cv(ii,4) + dv(ii,1)) * cv(ii,2)/cv(ii,1) * ident(ii,1) &
193 + (cv(ii,4) + dv(ii,1)) * cv(ii,3)/cv(ii,1) * ident(ii,2)
196 else if( nd == 3 )
then 202 rhs(ii,1) =
rhs(ii,1) + cv(ii,2) * ident(ii,1) &
203 + cv(ii,3) * ident(ii,2) &
204 + cv(ii,4) * ident(ii,3)
205 rhs(ii,2) =
rhs(ii,2) + dv(ii,1) * ident(ii,1)
206 rhs(ii,3) =
rhs(ii,3) + dv(ii,1) * ident(ii,2)
207 rhs(ii,4) =
rhs(ii,4) + dv(ii,1) * ident(ii,3)
208 rhs(ii,5) =
rhs(ii,5) + (cv(ii,5) + dv(ii,1)) * cv(ii,2)/cv(ii,1) * ident(ii,1) &
209 + (cv(ii,5) + dv(ii,1)) * cv(ii,3)/cv(ii,1) * ident(ii,2) &
210 + (cv(ii,5) + dv(ii,1)) * cv(ii,4)/cv(ii,1) * ident(ii,3)
219 if (froude > 0.0_dp)
then 220 norm(1) = sin(gravity_angle_phi) * cos(gravity_angle_theta) * invfroude
221 norm(2) = sin(gravity_angle_phi) * sin(gravity_angle_theta) * invfroude
229 rhs(i,2) =
rhs(i,2) + cv(i,1) * norm(1) * invjac(i)
230 rhs(i,3) =
rhs(i,3) + cv(i,1) * norm(2) * invjac(i)
233 else if( nd == 3 )
then 235 norm(3) = cos(gravity_angle_phi) * invfroude
240 rhs(i,2) =
rhs(i,2) + cv(i,1) * norm(1) * invjac(i)
241 rhs(i,3) =
rhs(i,3) + cv(i,1) * norm(2) * invjac(i)
242 rhs(i,4) =
rhs(i,4) + cv(i,1) * norm(3) * invjac(i)
252 END SUBROUTINE eulerrhs
subroutine uniformrhs(numDim, gridSizes, numPoints, fullInterval, opInterval, gridMetric, numStencils, numStencilValues, stencilSizes, stencilStarts, stencilOffsets, stencilWeights, stencilID, rhoBuffer, rhoVBuffer, rhoEBuffer, velHat, pressureBuffer, rhoRHS, rhoVRHS, rhoERHS)
subroutine applyoperator(numDim, dimSizes, numComponents, numPoints, opDir, opInterval, numStencils, stencilSizes, stencilStarts, numValues, stencilWeights, stencilOffsets, stencilID, U, dU)
applyoperator applies an operator specified as a stencil set to the provided state data ...