10 numDim,bufferSizes,numPointsBuffer,patchNormalDir,patchSizes, &
11 numPointsPatch,numPatchPointsOp,patchPointsOp,gridType,gridMetric,&
12 jacobianDeterminant,bcParams,gasParams,rhoBuffer,rhoVBuffer, &
13 rhoEBuffer,viscousFluxBuffer,numscalar,scalarBuffer, &
14 rhoRHS,rhoVRHS,rhoERHS,scalarRHS, &
15 rhoTarget,rhoVTarget,rhoETarget,scalarTarget)
19 INTEGER(KIND=4) :: numDim,numscalar,patchNormalDir,gridType
20 INTEGER(KIND=8) :: numPointsBuffer,bufferSizes(numdim)
21 INTEGER(KIND=8) :: patchSizes(numdim),numPointsPatch
22 INTEGER(KIND=8) :: numPatchPointsOp
23 INTEGER(KIND=8) :: patchPointsOp(numpatchpointsop)
24 REAL(KIND=8) :: gridMetric(numdim*numdim*numpointsbuffer)
25 REAL(KIND=8) :: jacobianDeterminant(numpointsbuffer)
26 REAL(KIND=8) :: bcParams(3),gasParams(5)
27 REAL(KIND=8) :: rhoBuffer(numpointsbuffer)
28 REAL(KIND=8) :: rhoVBuffer(numdim*numpointsbuffer)
29 REAL(KIND=8) :: rhoEBuffer(numpointsbuffer)
30 REAL(KIND=8) :: viscousFluxBuffer((numdim+2)*numpointsbuffer)
31 REAL(KIND=8) :: scalarBuffer(numscalar*numpointsbuffer)
32 REAL(KIND=8) :: rhoRHS(numpointsbuffer)
33 REAL(KIND=8) :: rhoVRHS(numdim*numpointsbuffer)
34 REAL(KIND=8) :: rhoERHS(numpointsbuffer)
35 REAL(KIND=8) :: scalarRHS(numscalar*numpointsbuffer)
36 REAL(KIND=8) :: rhoTarget(numpointsbuffer)
37 REAL(KIND=8) :: rhoVTarget(numdim*numpointsbuffer)
38 REAL(KIND=8) :: rhoETarget(numpointsbuffer)
39 REAL(KIND=8) :: scalarTarget(numscalar*numpointsbuffer)
45 INTEGER(4) :: ND, nAuxVars, jj, iDim, iDir
46 INTEGER(8) :: Nc, l0, iPoint, pointIndex, metricOffset
47 INTEGER(4) :: normDir, sgn
48 REAL(8) :: dsgn, sndspdref2, invtempref, tempref, gamref, spcGasConst
49 REAL(8) :: XI_X, XI_Y, XI_Z, XI_T, bndry_h,sbpBoundaryWeight
50 REAL(8) :: XI_X_TILDE, XI_Y_TILDE, XI_Z_TILDE, gridJacobian
51 REAL(8) :: rhoFac, penaltyFac, scalarPenaltyFac, scalarDiff
53 REAL(8),
POINTER :: XIX(:)
55 REAL(8),
POINTER :: pnorm_vec(:)
56 REAL(8),
POINTER :: Lambda(:,:), gI1(:), uB(:), Tinv(:,:), Tmat(:,:)
57 REAL(8),
POINTER :: Aprime(:,:), gI2(:), matX(:,:), penalty(:) ,correction(:)
58 REAL(8) :: norm_vec(3), gamma, ucon, ubAux,xh
59 REAL(8) :: sigmaI1, sigmaI2, sigmaAux, Sfactor, ibfac_local
60 REAL(8) :: spd_snd, RE, REInv, SAT_sigmaI2_FF, SAT_sigmaI1_FF
77 normdir = abs(patchnormaldir)
78 sgn = normdir / patchnormaldir
91 spcgasconst= gasparams(3)
92 sndspdref2 = gasparams(5)*gasparams(5)
93 tempref = gasparams(4)
97 IF(re .gt. 0) reinv = 1.0_8/re
102 sat_sigmai1_ff = bcparams(1)
103 sat_sigmai2_ff = bcparams(2)
104 sbpboundaryweight = bcparams(3)
120 ALLOCATE(gi1(nd+2), ub(nd+2), tmat(nd+2,nd+2), tinv(nd+2,nd+2), penalty(nd+2),correction(nd+2))
121 ALLOCATE(gi2(nd+2), aprime(nd+2,nd+2), lambda(nd+2,nd+2), matx(nd+2,nd+2), pnorm_vec(nd))
127 xix(normdir) = gridmetric(normdir)
129 gridjacobian = jacobiandeterminant(1)
131 metricoffset = (normdir-1)*numpointsbuffer
133 metricoffset = (normdir-1)*numdim*numpointsbuffer
139 DO ipoint = 1, numpatchpointsop
140 l0 = patchpointsop(ipoint) + 1
151 xix(idir) = gridmetric(metricoffset + (idir-1)*numpointsbuffer +l0)
153 gridjacobian = jacobiandeterminant(l0)
155 xix(normdir) = gridmetric(metricoffset + l0)
156 gridjacobian = jacobiandeterminant(l0)
171 xi_x = xi_x * gridjacobian
172 xi_y = xi_y * gridjacobian
173 xi_z = xi_z * gridjacobian
174 xi_t = xi_t * gridjacobian
177 xh = sqrt((xi_x*xi_x)+(xi_y*xi_y)+(xi_z*xi_z))
179 xi_x_tilde = xi_x * bndry_h
180 xi_y_tilde = xi_y * bndry_h
181 xi_z_tilde = xi_z * bndry_h
185 sigmai1 = -sat_sigmai1_ff * dsgn
189 ub(1) = rhobuffer(l0)
191 ub(1+idim) = rhovbuffer(l0+(idim-1)*numpointsbuffer)
193 ub(numdim+2) = rhoebuffer(l0)
197 gi1(1) = rhotarget(l0)
199 gi1(1+idim) = rhovtarget(l0+(idim-1)*numpointsbuffer)
201 gi1(numdim+2) = rhoetarget(l0)
204 norm_vec(1:3) = (/ xi_x_tilde, xi_y_tilde, xi_z_tilde /)
205 pnorm_vec(:) = norm_vec(1:nd) * xh
234 spd_snd = lambda(nd+1,nd+1) - ucon
239 lambda(jj,jj) = max(lambda(jj,jj),0.0_8)
243 lambda(jj,jj) = min(lambda(jj,jj),0.0_8)
250 ucon < 0.0_8 .and. ucon + spd_snd > 0.0_8)
then 251 lambda(nd+2,nd+1) = lambda(nd+2,nd+1) - ucon - spd_snd
253 else if (sgn == -1 .and. &
254 ucon > 0.0_8 .and. ucon - spd_snd < 0.0_8)
then 255 lambda(nd+1,nd+2) = lambda(nd+1,nd+2) - ucon + spd_snd
259 matx = matmul(lambda,tinv)
262 aprime = matmul(tmat,matx)
265 ub(1:nd+2) = ub(1:nd+2) - gi1(1:nd+2)
268 gi2(1:nd+2) = matmul(aprime,ub)
270 penaltyfac = sbpboundaryweight*sigmai1
271 correction(:) = penaltyfac*gi2(:)
276 rhorhs(l0) = rhorhs(l0) + correction(1)
278 pointindex = l0 + (idim-1)*numpointsbuffer
279 rhovrhs(pointindex) = rhovrhs(pointindex) + correction(1+idim)
281 rhoerhs(l0) = rhoerhs(l0) + correction(numdim+2)
290 IF(numscalar > 0)
THEN 291 If (dsgn * ucon > 0)
Then 292 sfactor = ucon * ibfac_local * penaltyfac
293 rhofac = rhobuffer(l0)/rhotarget(l0)
294 scalarpenaltyfac = sfactor*rhofac
296 pointindex = (jj-1)*numpointsbuffer + l0
297 scalardiff = (scalarbuffer(pointindex) - scalartarget(pointindex))
298 scalarrhs(pointindex) = scalarrhs(pointindex) + scalarpenaltyfac * scalardiff
309 sigmai2 = dsgn * sat_sigmai2_ff*sbpboundaryweight/bndry_h
317 ub(:) = viscousfluxbuffer(l0) * xi_x_tilde
319 ub(:) = ub(:) + viscousfluxbuffer(l0) * xi_y_tilde
321 ub(:) = ub(:) + viscousfluxbuffer(l0) * xi_z_tilde
324 penalty(:) = sigmai2 * (ub(:) - gi2(:))
327 rhorhs(l0) = rhorhs(l0) + ibfac_local * penalty(1)
329 pointindex = l0 + (idim-1)*numpointsbuffer
330 rhovrhs(pointindex) = rhovrhs(pointindex) + ibfac_local*penalty(1+idim)
332 rhoerhs(l0) = rhoerhs(l0) + ibfac_local * penalty(numdim+2)
345 DEALLOCATE(correction)
346 DEALLOCATE(gi1, ub, tmat, tinv, penalty)
347 DEALLOCATE(gi2, aprime, lambda, matx, pnorm_vec)
354 numDim,bufferSizes,numPointsBuffer,patchNormalDir,patchSizes, &
355 numPointsPatch,numPatchPointsOp,patchPointsOp,gridType, &
356 gridMetric,jacobianDeterminant,bcParams,gasParams, &
357 rhoBuffer,rhoVBuffer,rhoEBuffer,numscalar,scalarBuffer, &
358 rhoRHS,rhoVRHS,rhoERHS, scalarRHS,rhoTarget,rhoVTarget, &
359 rhoETarget,scalarTarget)
363 INTEGER(KIND=4) :: numDim,numscalar,patchNormalDir,gridType
364 INTEGER(KIND=8) :: numPointsBuffer,bufferSizes(numdim)
365 INTEGER(KIND=8) :: patchSizes(numdim),numPointsPatch
366 INTEGER(KIND=8) :: numPatchPointsOp
367 INTEGER(KIND=8) :: patchPointsOp(numpatchpointsop)
368 REAL(KIND=8) :: gridMetric(numdim*numdim*numpointsbuffer)
369 REAL(KIND=8) :: jacobianDeterminant(numpointsbuffer)
370 REAL(KIND=8) :: bcParams(3),gasParams(5)
371 REAL(KIND=8) :: rhoBuffer(numpointsbuffer)
372 REAL(KIND=8) :: rhoVBuffer(numdim*numpointsbuffer)
373 REAL(KIND=8) :: rhoEBuffer(numpointsbuffer)
374 REAL(KIND=8) :: scalarBuffer(numscalar*numpointsbuffer)
375 REAL(KIND=8) :: rhoRHS(numpointsbuffer)
376 REAL(KIND=8) :: rhoVRHS(numdim*numpointsbuffer)
377 REAL(KIND=8) :: rhoERHS(numpointsbuffer)
378 REAL(KIND=8) :: scalarRHS(numscalar*numpointsbuffer)
379 REAL(KIND=8) :: rhoTarget(numpointsbuffer)
380 REAL(KIND=8) :: rhoVTarget(numdim*numpointsbuffer)
381 REAL(KIND=8) :: rhoETarget(numpointsbuffer)
382 REAL(KIND=8) :: scalarTarget(numscalar*numpointsbuffer)
386 INTEGER(4) :: ND, nAuxVars, jj, iDim, iDir
387 INTEGER(8) :: Nc, l0, iPoint, pointIndex,metricOffset
388 INTEGER(4) :: normDir, sgn
395 REAL(8) :: dsgn, sndspdref2, invtempref, tempref, gamref, spcGasConst
396 REAL(8) :: XI_X, XI_Y, XI_Z, XI_T, bndry_h,sbpBoundaryWeight
397 REAL(8) :: XI_X_TILDE, XI_Y_TILDE, XI_Z_TILDE, gridJacobian
398 REAL(8) :: rhoFac, penaltyFac, scalarPenaltyFac, scalarDiff
400 REAL(8),
POINTER :: XIX(:), bVelocity(:), vWall(:), vWallTarget(:), vTarget(:)
402 REAL(8),
POINTER :: pnorm_vec(:)
407 REAL(8),
POINTER :: Lambda(:,:), gI1(:), uB(:), Tinv(:,:), Tmat(:,:)
409 REAL(8),
POINTER :: Aprime(:,:), gI2(:), matX(:,:), penalty(:) ,correction(:)
412 REAL(8) :: norm_vec(3), gamma, uCon, ubAux, specRad, vDotXi, xh
413 REAL(8) :: sigmaI1, sigmaI2, sigmaAux, Sfactor, ibfac_local
414 REAL(8) :: spd_snd, RE, REInv, SAT_sigmaI1,pressureTarget
454 normdir = abs(patchnormaldir)
455 sgn = normdir / patchnormaldir
468 gamref = gasparams(2)
469 spcgasconst= gasparams(3)
470 sndspdref2 = gasparams(5)*gasparams(5)
471 tempref = gasparams(4)
478 sat_sigmai1 = bcparams(1)
479 sbpboundaryweight = bcparams(2)
484 ALLOCATE(xix(4),vwall(nd),bvelocity(nd),vwalltarget(nd),vtarget(nd))
485 ALLOCATE(gi1(nd+2), ub(nd+2), tmat(nd+2,nd+2), tinv(nd+2,nd+2), penalty(nd+2),correction(nd+2))
486 ALLOCATE(gi2(nd+2), aprime(nd+2,nd+2), lambda(nd+2,nd+2), matx(nd+2,nd+2), pnorm_vec(nd))
490 xix(normdir) = gridmetric(normdir)
492 gridjacobian = jacobiandeterminant(1)
494 metricoffset = (normdir-1)*numpointsbuffer
496 metricoffset = (normdir-1)*numdim*numpointsbuffer
515 DO ipoint = 1, numpatchpointsop
517 l0 = patchpointsop(ipoint) + 1
536 xix(idir) = gridmetric(metricoffset + (idir-1)*numpointsbuffer +l0)
538 gridjacobian = jacobiandeterminant(l0)
540 xix(normdir) = gridmetric(metricoffset + l0)
541 gridjacobian = jacobiandeterminant(l0)
545 xi_x = xix(1) * gridjacobian
546 xi_y = xix(2) * gridjacobian
547 xi_z = xix(3) * gridjacobian
548 xi_t = xix(4) * gridjacobian
551 xh = sqrt( (xi_x * xi_x) + (xi_y * xi_y) + (xi_z * xi_z) )
553 xi_x_tilde = xi_x * bndry_h
554 xi_y_tilde = xi_y * bndry_h
555 xi_z_tilde = xi_z * bndry_h
559 norm_vec(1:3) = (/ xi_x_tilde, xi_y_tilde, xi_z_tilde /)
560 pnorm_vec(:) = norm_vec(1:nd) * xh
564 sigmai1 = -sat_sigmai1 * dsgn
571 ub(1) = rhobuffer(l0)
574 ub(1+idim) = rhovbuffer(l0+(idim-1)*numpointsbuffer)
575 bvelocity(idim) = rhovbuffer(l0+(idim-1)*numpointsbuffer)/rhobuffer(l0)
576 vdotxi = vdotxi + bvelocity(idim)*xix(idim)*gridjacobian*bndry_h
578 ub(numdim+2) = rhoebuffer(l0)
580 vwall(1:numdim) = vdotxi*norm_vec(1:numdim)
582 vwalltarget(1:numdim) = 0.0_8
587 vtarget(idim) = bvelocity(idim) - ( vwall(idim) - vwalltarget(idim) )
594 gi1(numdim+2) = ub(numdim+2)
596 gi1(1+idim) = gi1(1) * vtarget(idim)
597 gi1(numdim+2) = gi1(numdim+2) + 0.5_8*gi1(1)*(vtarget(idim)**2 - bvelocity(idim)**2)
627 lambda(jj,jj) = max(lambda(jj,jj),0.0_8)
628 specrad = max(abs(lambda(jj,jj)),abs(specrad))
632 lambda(jj,jj) = min(lambda(jj,jj),0.0_8)
633 specrad = max(abs(lambda(jj,jj)),abs(specrad))
652 matx = matmul(lambda,tinv)
655 aprime = matmul(tmat,matx)
658 ub(1:nd+2) = ub(1:nd+2) - gi1(1:nd+2)
661 gi2(1:nd+2) = matmul(aprime,ub)
663 penaltyfac = sbpboundaryweight*sigmai1
664 correction(:) = penaltyfac*gi2(:)
667 rhorhs(l0) = rhorhs(l0) + ibfac_local * correction(1)
669 pointindex = l0 + (idim-1)*numpointsbuffer
670 rhovrhs(pointindex) = rhovrhs(pointindex) + ibfac_local*correction(1+idim)
672 rhoerhs(l0) = rhoerhs(l0) + ibfac_local * correction(numdim+2)
680 IF(numscalar > 0)
THEN 681 If (dsgn * ucon > 0)
Then 682 sfactor = -ucon * dsgn * ibfac_local * sbpboundaryweight
684 pointindex = (jj-1)*numpointsbuffer + l0
685 scalarrhs(pointindex) = scalarrhs(pointindex) + sfactor*scalarbuffer(pointindex)
712 DEALLOCATE(xix,vwall,bvelocity,vwalltarget,vtarget)
713 DEALLOCATE(gi1, ub, tmat, tinv, penalty, correction)
714 DEALLOCATE(gi2, aprime, lambda, matx, pnorm_vec)
721 numDim,bufferSizes,numPointsBuffer,patchNormalDir,patchSizes, &
722 numPointsPatch,numPatchPointsOp,patchPointsOp,gridType, &
723 gridMetric,jacobianDeterminant,bcParams,gasParams, &
724 rhoBuffer,rhoVBuffer,rhoEBuffer,numscalar,scalarBuffer, &
725 rhoRHS,rhoVRHS,rhoERHS, scalarRHS,rhoTarget,rhoVTarget, &
726 rhoETarget,scalarTarget,muBuffer,lambdaBuffer)
730 INTEGER(KIND=4) :: numDim,numscalar,patchNormalDir,gridType
731 INTEGER(KIND=8) :: numPointsBuffer,bufferSizes(numdim)
732 INTEGER(KIND=8) :: patchSizes(numdim),numPointsPatch
733 INTEGER(KIND=8) :: numPatchPointsOp
734 INTEGER(KIND=8) :: patchPointsOp(numpatchpointsop)
735 REAL(KIND=8) :: gridMetric(numdim*numdim*numpointsbuffer)
736 REAL(KIND=8) :: jacobianDeterminant(numpointsbuffer)
737 REAL(KIND=8) :: bcParams(4),gasParams(6)
738 REAL(KIND=8) :: rhoBuffer(numpointsbuffer)
739 REAL(KIND=8) :: rhoVBuffer(numdim*numpointsbuffer)
740 REAL(KIND=8) :: rhoEBuffer(numpointsbuffer)
741 REAL(KIND=8) :: scalarBuffer(numscalar*numpointsbuffer)
742 REAL(KIND=8) :: rhoRHS(numpointsbuffer)
743 REAL(KIND=8) :: rhoVRHS(numdim*numpointsbuffer)
744 REAL(KIND=8) :: rhoERHS(numpointsbuffer)
745 REAL(KIND=8) :: scalarRHS(numscalar*numpointsbuffer)
746 REAL(KIND=8) :: rhoTarget(numpointsbuffer)
747 REAL(KIND=8) :: rhoVTarget(numdim*numpointsbuffer)
748 REAL(KIND=8) :: rhoETarget(numpointsbuffer)
749 REAL(KIND=8) :: scalarTarget(numscalar*numpointsbuffer)
750 REAL(KIND=8) :: muBuffer(numpointsbuffer)
751 REAL(KIND=8) :: lambdaBuffer(numpointsbuffer)
755 INTEGER(4) :: ND, nAuxVars, jj, iDim, iDir
756 INTEGER(8) :: Nc, l0, iPoint, pointIndex, metricOffset
757 INTEGER(4) :: normDir, sgn
758 INTEGER(4) :: numDebugPoints, iDebugPoint,debugPoints(6)
765 REAL(8) :: dsgn, sndspdref2, invtempref, tempref, gamref, spcGasConst
766 REAL(8) :: XI_X, XI_Y, XI_Z, XI_T, bndry_h,sbpBoundaryWeight, bcWallTemp
767 REAL(8) :: XI_X_TILDE, XI_Y_TILDE, XI_Z_TILDE, gridJacobian
768 REAL(8) :: rhoFac, penaltyFac, scalarPenaltyFac, scalarDiff
770 REAL(8),
POINTER :: XIX(:), bVelocity(:), vWall(:), vWallTarget(:), vTarget(:)
772 REAL(8),
POINTER :: pnorm_vec(:)
777 REAL(8),
POINTER :: Lambda(:,:), gI1(:), uB(:), Tinv(:,:), Tmat(:,:)
779 REAL(8),
POINTER :: Aprime(:,:), gI2(:), matX(:,:), penalty(:) ,correction(:)
782 REAL(8) :: norm_vec(3), gamma, uCon, ubAux, specRad, vDotXi, xh
783 REAL(8) :: sigmaI1, sigmaI2, sigmaAux, Sfactor, ibfac_local, T_wall
784 REAL(8) :: spd_snd, RE, REInv, SAT_sigmaI1, SAT_sigmaI2, pressureTarget
785 REAL(8) :: viscousPenaltyScale
825 normdir = abs(patchnormaldir)
826 sgn = normdir / patchnormaldir
839 gamref = gasparams(2)
840 spcgasconst= gasparams(3)
841 sndspdref2 = gasparams(5)*gasparams(5)
842 tempref = gasparams(4)
846 viscouspenaltyscale = gasparams(6)
850 sat_sigmai1 = bcparams(1)
851 sat_sigmai2 = bcparams(2)
852 bcwalltemp = bcparams(3)
853 sbpboundaryweight = bcparams(4)
861 ALLOCATE(xix(4),vwall(nd),bvelocity(nd),vwalltarget(nd),vtarget(nd))
862 ALLOCATE(gi1(nd+2), ub(nd+2), tmat(nd+2,nd+2), tinv(nd+2,nd+2), penalty(nd+2),correction(nd+2))
863 ALLOCATE(gi2(nd+2), aprime(nd+2,nd+2), lambda(nd+2,nd+2), matx(nd+2,nd+2), pnorm_vec(nd))
867 xix(normdir) = gridmetric(normdir)
869 gridjacobian = jacobiandeterminant(1)
871 metricoffset = (normdir-1)*numpointsbuffer
873 metricoffset = (normdir-1)*numdim*numpointsbuffer
889 debugpoints(1) = 91427
890 debugpoints(2) = 91428
891 debugpoints(3) = 91678
892 debugpoints(4) = 114268
893 debugpoints(5) = 114269
894 debugpoints(6) = 114018
897 DO ipoint = 1, numpatchpointsop
899 l0 = patchpointsop(ipoint) + 1
917 xix(idir) = gridmetric(metricoffset + (idir-1)*numpointsbuffer +l0)
919 gridjacobian = jacobiandeterminant(l0)
921 xix(normdir) = gridmetric(metricoffset + l0)
922 gridjacobian = jacobiandeterminant(l0)
927 xi_x = xix(1) * gridjacobian
928 xi_y = xix(2) * gridjacobian
929 xi_z = xix(3) * gridjacobian
930 xi_t = xix(4) * gridjacobian
933 xh = sqrt( (xi_x * xi_x) + (xi_y * xi_y) + (xi_z * xi_z) )
935 xi_x_tilde = xi_x * bndry_h
936 xi_y_tilde = xi_y * bndry_h
937 xi_z_tilde = xi_z * bndry_h
941 norm_vec(1:3) = (/ xi_x_tilde, xi_y_tilde, xi_z_tilde /)
942 pnorm_vec(:) = norm_vec(1:nd) * xh
945 sigmai1 = -sat_sigmai1 * dsgn
952 ub(1) = rhobuffer(l0)
955 ub(1+idim) = rhovbuffer(l0+(idim-1)*numpointsbuffer)
956 bvelocity(idim) = rhovbuffer(l0+(idim-1)*numpointsbuffer)/rhobuffer(l0)
958 vdotxi = vdotxi + bvelocity(idim)*norm_vec(idim)
960 ub(numdim+2) = rhoebuffer(l0)
962 vwall(1:numdim) = vdotxi*norm_vec(1:numdim)
964 vwalltarget(1:numdim) = 0.0_8
969 vtarget(idim) = bvelocity(idim) - ( vwall(idim) - vwalltarget(idim) )
977 gi1(numdim+2) = ub(numdim+2)
979 gi1(1+idim) = gi1(1) * vtarget(idim)
980 gi1(numdim+2) = gi1(numdim+2) + 0.5_8*gi1(1)*(vtarget(idim)**2 - bvelocity(idim)**2)
1024 If ( sgn == 1 )
Then 1026 lambda(jj,jj) = max(lambda(jj,jj),0.0_8)
1027 specrad = max(abs(lambda(jj,jj)),abs(specrad))
1031 lambda(jj,jj) = min(lambda(jj,jj),0.0_8)
1032 specrad = max(abs(lambda(jj,jj)),abs(specrad))
1052 matx = matmul(lambda,tinv)
1055 aprime = matmul(tmat,matx)
1058 ub(1:nd+2) = ub(1:nd+2) - gi1(1:nd+2)
1061 gi2(1:nd+2) = matmul(aprime,ub)
1063 penaltyfac = sbpboundaryweight*sigmai1
1064 correction(:) = penaltyfac*gi2(:)
1083 rhorhs(l0) = rhorhs(l0) + ibfac_local * correction(1)
1085 pointindex = l0 + (idim-1)*numpointsbuffer
1086 rhovrhs(pointindex) = rhovrhs(pointindex) + ibfac_local*correction(1+idim)
1088 rhoerhs(l0) = rhoerhs(l0) + ibfac_local * correction(numdim+2)
1096 IF(numscalar > 0)
THEN 1097 If (dsgn * ucon > 0)
Then 1098 sfactor = -ucon * dsgn * ibfac_local * sbpboundaryweight
1099 Do jj = 1, numscalar
1100 pointindex = (jj-1)*numpointsbuffer + l0
1101 scalarrhs(pointindex) = scalarrhs(pointindex) + sfactor*scalarbuffer(pointindex)
1111 ub(1) = rhobuffer(l0)
1113 ub(1+idim) = rhovbuffer(l0+(idim-1)*numpointsbuffer)
1115 ub(numdim+2) = rhoebuffer(l0)
1120 t_wall = bcwalltemp / tempref
1124 gi2(1) = rhobuffer(l0)
1130 gi2(2:idim+1) = 0.0_8
1143 IF (t_wall < 0)
THEN 1144 gi2(numdim+2) = rhoetarget(l0)
1146 gi2(numdim+2) = gi2(1) * t_wall * spcgasconst / (gamref-1) &
1147 + 0.5_8 * sum(gi2(2:idim+1)**2) / gi2(1)
1153 sigmai2 = -sat_sigmai2
1157 penaltyfac = (sbpboundaryweight/bndry_h)**2*sigmai2/4.0_8 * &
1158 reinv*viscouspenaltyscale*max(mubuffer(l0),lambdabuffer(l0))/gi2(1)
1164 penalty(:) = penaltyfac * (ub(1:nd+2) - gi2(1:nd+2))
1170 rhorhs(l0) = rhorhs(l0) + ibfac_local * penalty(1)
1172 pointindex = l0 + (idim-1)*numpointsbuffer
1173 rhovrhs(pointindex) = rhovrhs(pointindex) + ibfac_local*penalty(1+idim)
1175 rhoerhs(l0) = rhoerhs(l0) + ibfac_local * penalty(numdim+2)
1203 DEALLOCATE(xix,vwall,bvelocity,vwalltarget,vtarget)
1204 DEALLOCATE(gi1, ub, tmat, tinv, penalty, correction)
1205 DEALLOCATE(gi2, aprime, lambda, matx, pnorm_vec)
1211 SUBROUTINE roe_mat(numDim,inCV,outCV, &
1212 gamma,normDir,tMat,tInv,lambda,status)
1216 INTEGER(4),
INTENT(IN) :: numDim
1217 REAL(8),
INTENT(IN) :: inCV(numdim+2), outCV(numdim+2)
1218 REAL(8),
INTENT(IN) :: gamma, normDir(numdim)
1219 REAL(8),
INTENT(OUT) :: tMat((numdim+2)*(numdim+2)),tInv((numdim+2)*(numdim+2)),lambda(numdim+2)
1220 INTEGER(4),
INTENT(OUT) :: status
1222 REAL(8) :: gammaM1,uCon,alpha,beta,phi2,theta,denomRoe,xiX,xiY,xiZ
1223 REAL(8) :: xiXTilde,xiYTilde,xiZTilde
1224 REAL(8) :: rhoIn,rhoV1In,rhoV2In,rhoV3In,rhoM1In,rhoEIn
1225 REAL(8) :: rhoOut,rhoV1Out,rhoV2Out,rhoV3Out,rhoM1Out,rhoEOut
1226 REAL(8) :: inV1,inV2,inV3,outV1,outV2,outV3
1227 REAL(8) :: inKE,inIE,inP,inH
1228 REAL(8) :: outKE,outIE,outP,outH
1229 REAL(8) :: ccRoe,bbRoe,v1Roe,v2Roe,v3Roe,hRoe,keRoe
1230 REAL(8) :: soundSpeedRoe
1235 IF(numdim == 1 .OR. numdim > 3)
THEN 1241 gammam1 = gamma - 1.0_8
1250 inv1 = rhom1in*rhov1in
1251 inv2 = rhom1in*rhov2in
1253 IF(numdim == 2)
THEN 1259 inv3 = rhom1in*rhov3in
1261 inke = 0.5_8 * (inv1**2 + inv2**2 + inv3**2)
1262 inie = rhom1in*rhoein - inke
1263 inp = gammam1*rhoin*inie
1264 inh = (gamma/gammam1)*inp/rhoin + inke
1271 rhom1out = 1.0/rhoout
1272 outv1 = rhom1out*rhov1out
1273 outv2 = rhom1out*rhov2out
1274 IF(numdim == 2)
THEN 1280 outv3 = rhom1out*rhov3out
1282 outke = 0.5_8 * (outv1**2 + outv2**2 + outv3**2)
1283 outie = rhom1out*rhoeout - outke
1284 outp = gammam1*rhoout*outie
1285 outh = (gamma/gammam1)*outp/rhoout + outke
1288 ccroe = sqrt(rhoout/rhoin)
1289 bbroe = 1.0_8 / (1.0_8 + ccroe)
1290 v1roe = (inv1 + outv1 * ccroe) * bbroe
1291 v2roe = (inv2 + outv2 * ccroe) * bbroe
1292 v3roe = (inv3 + outv3 * ccroe) * bbroe
1293 hroe = (inh + outh*ccroe)*bbroe
1294 keroe = 0.5_8 * (v1roe**2 + v2roe**2 + v3roe**2)
1296 IF((hroe - keroe) <= 0.0_8)
THEN 1297 write (*,
'(5(a,E20.8,1X))')
"gamma = ", gamma,
", inKE = ", inke,
", inIE = ", inie, &
1298 ", inP = ", inp,
", inH = ", inh
1303 soundspeedroe = sqrt(gammam1*(hroe - keroe))
1309 IF(numdim == 3) xiz = normdir(3)
1310 denomroe = 1.0_8 / sqrt(xix**2 + xiy**2 + xiz**2)
1311 xixtilde = xix * denomroe
1312 xiytilde = xiy * denomroe
1313 xiztilde = xiz * denomroe
1315 ucon = v1roe*xix + v2roe*xiy + v3roe*xiz
1318 alpha = 0.5_8*rhoin/soundspeedroe
1319 beta = 1.0_8/(rhoin*soundspeedroe)
1320 theta = xixtilde*v1roe + xiytilde*v2roe + xiztilde*v3roe
1321 phi2 = 0.5_8*(gammam1)*(v1roe**2 + v2roe**2 + v3roe**2)
1328 lambda(numdim+1) = ucon + soundspeedroe * sqrt(xix**2 + xiy**2 + xiz**2)
1329 lambda(numdim+2) = ucon - soundspeedroe * sqrt(xix**2 + xiy**2 + xiz**2)
1331 if (numdim == 2)
then 1336 tmat(4) = phi2/gammam1
1339 tmat(6) = xiytilde*rhoin
1340 tmat(7) = -xixtilde*rhoin
1341 tmat(8) = rhoin*(xiytilde*v1roe - xixtilde*v2roe)
1344 tmat(10) = alpha*(v1roe + xixtilde*soundspeedroe)
1345 tmat(11) = alpha*(v2roe + xiytilde*soundspeedroe)
1346 tmat(12) = alpha*((phi2 + soundspeedroe**2)/gammam1 + soundspeedroe*theta)
1349 tmat(14) = alpha*(v1roe - xixtilde*soundspeedroe)
1350 tmat(15) = alpha*(v2roe - xiytilde*soundspeedroe)
1351 tmat(16) = alpha*((phi2 + soundspeedroe**2)/gammam1 - soundspeedroe*theta)
1353 tinv(1) = 1.0_8 - phi2 / soundspeedroe**2
1354 tinv(2) = -(xiytilde * v1roe - xixtilde * v2roe) / rhoin
1355 tinv(3) = beta * (phi2 - soundspeedroe * theta)
1356 tinv(4) = beta * (phi2 + soundspeedroe * theta)
1358 tinv(5) = gammam1 * v1roe / soundspeedroe**2
1359 tinv(6) = xiytilde / rhoin
1360 tinv(7) = beta * (xixtilde * soundspeedroe - gammam1 * v1roe)
1361 tinv(8) = -beta * (xixtilde * soundspeedroe + gammam1 * v1roe)
1363 tinv(9) = gammam1 * v2roe / soundspeedroe**2
1364 tinv(10) = -xixtilde / rhoin
1365 tinv(11) = beta * (xiytilde * soundspeedroe - gammam1 * v2roe)
1366 tinv(12) = -beta * (xiytilde * soundspeedroe + gammam1 * v2roe)
1368 tinv(13) = -gammam1 / soundspeedroe**2
1370 tinv(15) = beta * gammam1
1371 tinv(16) = beta * gammam1
1373 ELSE IF (numdim == 3)
THEN 1377 tmat(2) = xixtilde * v1roe
1378 tmat(3) = xixtilde * v2roe + xiztilde * rhoin
1379 tmat(4) = xixtilde * v3roe - xiytilde * rhoin
1380 tmat(5) = xixtilde * phi2 / gammam1 + rhoin * (xiztilde * v2roe - xiytilde * v3roe)
1383 tmat(7) = xiytilde * v1roe - xiztilde * rhoin
1384 tmat(8) = xiytilde * v2roe
1385 tmat(9) = xiytilde * v3roe + xixtilde * rhoin
1386 tmat(10) = xiytilde * phi2 / gammam1 + rhoin * (xixtilde * v3roe - xiztilde * v1roe)
1389 tmat(12) = xiztilde * v1roe + xiytilde * rhoin
1390 tmat(13) = xiztilde * v2roe - xixtilde * rhoin
1391 tmat(14) = xiztilde * v3roe
1392 tmat(15) = xiztilde * phi2 / gammam1 + rhoin * (xiytilde * v1roe - xixtilde * v2roe)
1395 tmat(17) = alpha * (v1roe + xixtilde * soundspeedroe)
1396 tmat(18) = alpha * (v2roe + xiytilde * soundspeedroe)
1397 tmat(19) = alpha * (v3roe + xiztilde * soundspeedroe)
1398 tmat(20) = alpha * ((phi2 + soundspeedroe**2)/gammam1 + soundspeedroe * theta)
1401 tmat(22) = alpha * (v1roe - xixtilde * soundspeedroe)
1402 tmat(23) = alpha * (v2roe - xiytilde * soundspeedroe)
1403 tmat(24) = alpha * (v3roe - xiztilde * soundspeedroe)
1404 tmat(25) = alpha * ((phi2 + soundspeedroe**2)/gammam1 - soundspeedroe * theta)
1406 tinv(1) = xixtilde * (1.0_8 - phi2 / soundspeedroe**2) - (xiztilde * v2roe - xiytilde * v3roe) / rhoin
1407 tinv(2) = xiytilde * (1.0_8 - phi2 / soundspeedroe**2) - (xixtilde * v3roe - xiztilde * v1roe) / rhoin
1408 tinv(3) = xiztilde * (1.0_8 - phi2 / soundspeedroe**2) - (xiytilde * v1roe - xixtilde * v2roe) / rhoin
1409 tinv(4) = beta * (phi2 - soundspeedroe * theta)
1410 tinv(5) = beta * (phi2 + soundspeedroe * theta)
1412 tinv(6) = xixtilde * gammam1 * v1roe / soundspeedroe**2
1413 tinv(7) = -xiztilde / rhoin + xiytilde * gammam1 * v1roe / soundspeedroe**2
1414 tinv(8) = xiytilde / rhoin + xiztilde * gammam1 * v1roe / soundspeedroe**2
1415 tinv(9) = beta * (xixtilde * soundspeedroe - gammam1 * v1roe)
1416 tinv(10) = -beta * (xixtilde * soundspeedroe + gammam1 * v1roe)
1418 tinv(11) = xiztilde / rhoin + xixtilde * gammam1 * v2roe / soundspeedroe**2
1419 tinv(12) = xiytilde * gammam1 * v2roe / soundspeedroe**2
1420 tinv(13) = -xixtilde / rhoin + xiztilde * gammam1 * v2roe / soundspeedroe**2
1421 tinv(14) = beta * (xiytilde * soundspeedroe - gammam1 * v2roe)
1422 tinv(15) = -beta * (xiytilde * soundspeedroe + gammam1 * v2roe)
1424 tinv(16) = -xiytilde / rhoin + xixtilde * gammam1 * v3roe / soundspeedroe**2
1425 tinv(17) = xixtilde / rhoin + xiytilde * gammam1 * v3roe / soundspeedroe**2
1426 tinv(18) = xiztilde * gammam1 * v3roe / soundspeedroe**2
1427 tinv(19) = beta * (xiztilde * soundspeedroe - gammam1 * v3roe)
1428 tinv(20) = -beta * (xiztilde * soundspeedroe + gammam1 * v3roe)
1430 tinv(21) = -xixtilde * gammam1 / soundspeedroe**2
1431 tinv(22) = -xiytilde * gammam1 / soundspeedroe**2
1432 tinv(23) = -xiztilde * gammam1 / soundspeedroe**2
1433 tinv(24) = beta * gammam1
1434 tinv(25) = beta * gammam1
1450 Real(8),
Pointer :: u_in(:), u_out(:), tmat(:,:), tinv(:,:), norm(:), lambda(:,:)
1451 Real(8) :: gamma, rho_in, ux_in, uy_in, uz_in, ke_in, p_in, en_in, h_in
1452 Real(8) :: gm1, rho_out, ux_out, uy_out, uz_out, ke_out, p_out, en_out, h_out
1453 Real(8) :: cc, bb, ux_Roe, uy_Roe, uz_Roe, h_Roe, ke_Roe, spd_snd_Roe, T_Roe, en_Roe
1454 Real(8) :: XI_X_TILDE, XI_Y_TILDE, XI_Z_TILDE, ucon, rho, alpha, theta, beta, phi2
1455 Real(8) :: XI_X, XI_Y, XI_Z, XI_T, denom, GAMREF, Up, Um
1457 Integer :: N, ND, jj, i, j, counter,ii
1458 Logical,
dimension(ND+2) :: BWORK
1459 Integer,
dimension(ND+2) :: order
1462 CHARACTER(len=1) :: JOBVL, JOBVR
1463 INTEGER :: INFO, LDA, LDVL, LDVR, LWORK,M
1464 Real(8),
dimension(ND+2,ND+2) :: A, VL, VR,B,LAM, Pmat
1465 Real(8),
dimension(ND+2) :: WI, WR
1466 Real(8),
dimension(300) :: WORK
1468 integer,
dimension(ND+2) :: IPIV
1498 ux_in = u_in(2) / rho_in; uy_in = 0.0_8; uz_in = 0.0_8
1499 if (nd >= 2) uy_in = u_in(3) / rho_in
1500 if (nd == 3) uz_in = u_in(4) / rho_in
1501 ke_in = 0.5_8 * (ux_in**2 + uy_in**2 + uz_in**2)
1502 en_in = u_in(nd+2)/rho_in - ke_in
1503 p_in = gm1 * rho_in * en_in
1504 h_in = (gamma / gm1) * p_in / rho_in + ke_in
1508 ux_out = u_out(2) / rho_out; uy_out = 0.0_8; uz_out = 0.0_8
1509 if (nd >= 2) uy_out = u_out(3) / rho_out
1510 if (nd == 3) uz_out = u_out(4) / rho_out
1511 ke_out = 0.5_8 * (ux_out**2 + uy_out**2 + uz_out**2)
1512 en_out = u_out(nd+2)/rho_out - ke_out
1513 p_out = gm1 * rho_out * en_out
1514 h_out = (gamma / gm1) * p_out / rho_out + ke_out
1517 cc = sqrt(rho_out / rho_in)
1518 bb = 1.0_8 / (1.0_8 + cc)
1519 ux_roe = (ux_in + ux_out * cc) * bb
1520 uy_roe = (uy_in + uy_out * cc) * bb
1521 uz_roe = (uz_in + uz_out * cc) * bb
1522 h_roe = ( h_in + h_out * cc) * bb
1523 ke_roe = 0.5_8 * (ux_roe**2 + uy_roe**2 + uz_roe**2)
1524 spd_snd_roe = sqrt(gamma/gamref * gm1*(h_roe - ke_roe))
1527 t_roe = gamma*(en_in + en_out * cc) * bb
1528 en_roe = t_roe/gamma
1531 xi_x = norm(1); xi_y = 0.0_8; xi_z = 0.0_8
1532 if (nd >= 2) xi_y = norm(2)
1533 if (nd == 3) xi_z = norm(3)
1534 denom = 1.0_8 / sqrt(xi_x**2 + xi_y**2 + xi_z**2)
1535 xi_x_tilde = xi_x * denom
1536 xi_y_tilde = xi_y * denom
1537 xi_z_tilde = xi_z * denom
1541 theta = xi_x * ux_roe + xi_y * uy_roe + xi_z * uz_roe
1542 phi2 = 0.5_8 * (gamma - 1.0_8) * (ux_roe**2 + uy_roe**2 + uz_roe**2)
1551 a(2,1) = xi_x * ( t_roe / gamref * (gamref - 1.0_8) - (gm1 * en_roe - phi2)) - theta * ux_roe
1552 a(2,2) = xi_t + theta - xi_x * (gamma - 2.0_8) * ux_roe
1553 a(2,3) = xi_y * ux_roe - gm1 * xi_x * uy_roe
1556 a(3,1) = xi_y * ( t_roe / gamref * (gamref - 1.0_8) - (gm1 * en_roe - phi2)) - theta * uy_roe
1557 a(3,2) = xi_x * uy_roe - gm1 * xi_y * ux_roe
1558 a(3,3) = xi_t + theta - xi_y * (gamma - 2.0_8) * uy_roe
1561 a(4,1) = theta * (2.0_8 * phi2 - gamma * (en_roe + ke_roe))
1562 a(4,2) = xi_x * (t_roe / gamref * (gamref - 1.0_8) + en_roe + phi2 / gm1 ) - gm1 * theta * ux_roe
1563 a(4,3) = xi_y * (t_roe / gamref * (gamref - 1.0_8) + en_roe + phi2 / gm1 ) - gm1 * theta * uy_roe
1564 a(4,4) = xi_t + gamma * theta
1566 else if (nd == 3)
then 1574 a(2,1) = xi_x * ( t_roe / gamref * (gamref - 1.0_8) - (gm1 * en_roe - phi2)) - theta * ux_roe
1575 a(2,2) = xi_t + theta - xi_x * (gamma - 2.0_8) * ux_roe
1576 a(2,3) = xi_y * ux_roe - gm1 * xi_x * uy_roe
1577 a(2,4) = xi_z * ux_roe - gm1 * xi_x * uz_roe
1580 a(3,1) = xi_y * ( t_roe / gamref * (gamref - 1.0_8) - (gm1 * en_roe - phi2)) - theta * uy_roe
1581 a(3,2) = xi_x * uy_roe - gm1 * xi_y * ux_roe
1582 a(3,3) = xi_t + theta - xi_y * (gamma - 2.0_8) * uy_roe
1583 a(3,4) = xi_z * uy_roe - gm1 * xi_y * uz_roe
1586 a(4,1) = xi_z * ( t_roe / gamref * (gamref - 1.0_8) - (gm1 * en_roe - phi2)) - theta * uz_roe
1587 a(4,2) = xi_x * uz_roe - gm1 * xi_z * ux_roe
1588 a(4,3) = xi_y * uz_roe - gm1 * xi_z * uy_roe
1589 a(4,4) = xi_t + theta - xi_z * (gamma - 2.0_8) * uz_roe
1592 a(5,1) = theta * (2.0_8 * phi2 - gamma * (en_roe + ke_roe))
1593 a(5,2) = xi_x * (t_roe / gamref * (gamref - 1.0_8) + en_roe + phi2 / gm1 ) - gm1 * theta * ux_roe
1594 a(5,3) = xi_y * (t_roe / gamref * (gamref - 1.0_8) + en_roe + phi2 / gm1 ) - gm1 * theta * uy_roe
1595 a(5,4) = xi_z * (t_roe / gamref * (gamref - 1.0_8) + en_roe + phi2 / gm1 ) - gm1 * theta * uz_roe
1596 a(5,5) = xi_t + gamma * theta
1611 ucon = ux_roe * xi_x + uy_roe * xi_y + uz_roe * xi_z
1612 up = ucon + 0.1_8 * spd_snd_roe * sqrt(xi_x**2 + xi_y**2 + xi_z**2)
1613 um = ucon - 0.1_8 * spd_snd_roe * sqrt(xi_x**2 + xi_y**2 + xi_z**2)
1619 if(wr(jj) .lt. up .and. wr(jj) .gt. um)
then 1621 counter = counter + 1
1622 lambda(counter,counter) = wr(jj)
1624 pmat(jj,counter) = 1.0_8
1625 elseif(wr(jj) .gt. ucon)
then 1626 lambda(nd+1,nd+1) = wr(jj)
1628 pmat(jj,nd+1) = 1.0_8
1629 elseif(wr(jj) .lt. ucon)
then 1630 lambda(nd+2,nd+2) = wr(jj)
1632 pmat(jj,nd+2) = 1.0_8
1636 tmat = matmul(vr,pmat)
1657 if(wi(i) .gt. tiny(wi(i)))
then 1658 tinv(i,i) = 1.0_8/wi(i)
1665 tinv = matmul(transpose(a),tinv)
1666 tinv = matmul(tinv,transpose(vl))
1678 Real(8) :: u_in(nd+2), u_out(nd+2), tmat(nd+2,nd+2), tinv(nd+2,nd+2), norm(nd), lambda(nd+2,nd+2)
1679 Real(8) :: gamma, rho_in, ux_in, uy_in, uz_in, ke_in, p_in, en_in, h_in
1680 Real(8) :: gm1, rho_out, ux_out, uy_out, uz_out, ke_out, p_out, en_out, h_out
1681 Real(8) :: cc, bb, ux_Roe, uy_Roe, uz_Roe, h_Roe, ke_Roe, spd_snd_Roe
1682 Real(8) :: XI_X_TILDE, XI_Y_TILDE, XI_Z_TILDE, ucon, rho, alpha, theta, beta, phi2
1683 Real(8) :: XI_X, XI_Y, XI_Z, denom
1684 Integer :: N, ND, jj
1694 ux_in = u_in(2) / rho_in; uy_in = 0.0_8; uz_in = 0.0_8
1695 if (nd >= 2) uy_in = u_in(3) / rho_in
1696 if (nd == 3) uz_in = u_in(4) / rho_in
1697 ke_in = 0.5_8 * (ux_in**2 + uy_in**2 + uz_in**2)
1698 en_in = u_in(nd+2)/rho_in - ke_in
1699 p_in = gm1 * rho_in * en_in
1700 h_in = (gamma / gm1) * p_in / rho_in + ke_in
1704 ux_out = u_out(2) / rho_out; uy_out = 0.0_8; uz_out = 0.0_8
1705 if (nd >= 2) uy_out = u_out(3) / rho_out
1706 if (nd == 3) uz_out = u_out(4) / rho_out
1707 ke_out = 0.5_8 * (ux_out**2 + uy_out**2 + uz_out**2)
1708 en_out = u_out(nd+2)/rho_out - ke_out
1709 p_out = gm1 * rho_out * en_out
1710 h_out = (gamma / gm1) * p_out / rho_out + ke_out
1713 cc = sqrt(rho_out / rho_in)
1714 bb = 1.0_8 / (1.0_8 + cc)
1715 ux_roe = (ux_in + ux_out * cc) * bb
1716 uy_roe = (uy_in + uy_out * cc) * bb
1717 uz_roe = (uz_in + uz_out * cc) * bb
1718 h_roe = ( h_in + h_out * cc) * bb
1719 ke_roe = 0.5_8 * (ux_roe**2 + uy_roe**2 + uz_roe**2)
1720 if (h_roe - ke_roe <= 0.0_8)
then 1722 write (*,
'(5(a,E20.8,1X))')
"SATUTIL:FORM_ROE_MATRICES: ERRONEOUS CONDITIONS: gamma = ", gamma,
", ke_in = ", &
1723 ke_in,
", en_in = ", en_in,
", p_in = ", p_in,
", h_in = ", h_in
1726 spd_snd_roe = sqrt(gm1*(h_roe - ke_roe))
1729 xi_x = norm(1); xi_y = 0.0_8; xi_z = 0.0_8
1730 if (nd >= 2) xi_y = norm(2)
1731 if (nd == 3) xi_z = norm(3)
1732 denom = 1.0_8 / sqrt(xi_x**2 + xi_y**2 + xi_z**2)
1733 xi_x_tilde = xi_x * denom
1734 xi_y_tilde = xi_y * denom
1735 xi_z_tilde = xi_z * denom
1746 ucon = ux_roe * xi_x + uy_roe * xi_y + uz_roe * xi_z
1751 alpha = 0.5_8 * rho / spd_snd_roe
1752 beta = 1.0_8 / (rho * spd_snd_roe)
1753 theta = xi_x_tilde * ux_roe + xi_y_tilde * uy_roe
1754 phi2 = 0.5_8 * (gamma - 1.0_8) * (ux_roe**2 + uy_roe**2)
1760 tmat(2,2) = xi_y_tilde * rho
1761 tmat(2,3) = alpha * (ux_roe + xi_x_tilde * spd_snd_roe)
1762 tmat(2,4) = alpha * (ux_roe - xi_x_tilde * spd_snd_roe)
1764 tmat(3,2) = -xi_x_tilde * rho
1765 tmat(3,3) = alpha * (uy_roe + xi_y_tilde * spd_snd_roe)
1766 tmat(3,4) = alpha * (uy_roe - xi_y_tilde * spd_snd_roe)
1767 tmat(4,1) = phi2 / (gamma - 1.0_8)
1768 tmat(4,2) = rho * (xi_y_tilde * ux_roe - xi_x_tilde * uy_roe)
1769 tmat(4,3) = alpha * ((phi2 + spd_snd_roe**2)/(gamma - 1.0_8) + spd_snd_roe * theta)
1770 tmat(4,4) = alpha * ((phi2 + spd_snd_roe**2)/(gamma - 1.0_8) - spd_snd_roe * theta)
1772 tinv(1,1) = 1.0_8 - phi2 / spd_snd_roe**2
1773 tinv(1,2) = (gamma - 1.0_8) * ux_roe / spd_snd_roe**2
1774 tinv(1,3) = (gamma - 1.0_8) * uy_roe / spd_snd_roe**2
1775 tinv(1,4) = -(gamma - 1.0_8) / spd_snd_roe**2
1776 tinv(2,1) = -(xi_y_tilde * ux_roe - xi_x_tilde * uy_roe) / rho
1777 tinv(2,2) = xi_y_tilde / rho
1778 tinv(2,3) = -xi_x_tilde / rho
1780 tinv(3,1) = beta * (phi2 - spd_snd_roe * theta)
1781 tinv(3,2) = beta * (xi_x_tilde * spd_snd_roe - (gamma - 1.0_8) * ux_roe)
1782 tinv(3,3) = beta * (xi_y_tilde * spd_snd_roe - (gamma - 1.0_8) * uy_roe)
1783 tinv(3,4) = beta * (gamma - 1.0_8)
1784 tinv(4,1) = beta * (phi2 + spd_snd_roe * theta)
1785 tinv(4,2) = -beta * (xi_x_tilde * spd_snd_roe + (gamma - 1.0_8) * ux_roe)
1786 tinv(4,3) = -beta * (xi_y_tilde * spd_snd_roe + (gamma - 1.0_8) * uy_roe)
1787 tinv(4,4) = beta * (gamma - 1.0_8)
1792 lambda(jj,jj) = ucon
1794 lambda(nd+1,nd+1) = ucon + spd_snd_roe * sqrt(xi_x**2 + xi_y**2)
1795 lambda(nd+2,nd+2) = ucon - spd_snd_roe * sqrt(xi_x**2 + xi_y**2)
1797 else if (nd == 3)
then 1800 alpha = 0.5_8 * rho / spd_snd_roe
1801 beta = 1.0_8 / (rho * spd_snd_roe)
1802 theta = xi_x_tilde * ux_roe + xi_y_tilde * uy_roe + xi_z_tilde * uz_roe
1803 phi2 = 0.5_8 * (gamma - 1.0_8) * (ux_roe**2 + uy_roe**2 + uz_roe**2)
1805 tmat(1,1) = xi_x_tilde
1806 tmat(1,2) = xi_y_tilde
1807 tmat(1,3) = xi_z_tilde
1810 tmat(2,1) = xi_x_tilde * ux_roe
1811 tmat(2,2) = xi_y_tilde * ux_roe - xi_z_tilde * rho
1812 tmat(2,3) = xi_z_tilde * ux_roe + xi_y_tilde * rho
1813 tmat(2,4) = alpha * (ux_roe + xi_x_tilde * spd_snd_roe)
1814 tmat(2,5) = alpha * (ux_roe - xi_x_tilde * spd_snd_roe)
1815 tmat(3,1) = xi_x_tilde * uy_roe + xi_z_tilde * rho
1816 tmat(3,2) = xi_y_tilde * uy_roe
1817 tmat(3,3) = xi_z_tilde * uy_roe - xi_x_tilde * rho
1818 tmat(3,4) = alpha * (uy_roe + xi_y_tilde * spd_snd_roe)
1819 tmat(3,5) = alpha * (uy_roe - xi_y_tilde * spd_snd_roe)
1820 tmat(4,1) = xi_x_tilde * uz_roe - xi_y_tilde * rho
1821 tmat(4,2) = xi_y_tilde * uz_roe + xi_x_tilde * rho
1822 tmat(4,3) = xi_z_tilde * uz_roe
1823 tmat(4,4) = alpha * (uz_roe + xi_z_tilde * spd_snd_roe)
1824 tmat(4,5) = alpha * (uz_roe - xi_z_tilde * spd_snd_roe)
1825 tmat(5,1) = xi_x_tilde * phi2 / (gamma - 1.0_8) + rho * (xi_z_tilde * uy_roe - xi_y_tilde * uz_roe)
1826 tmat(5,2) = xi_y_tilde * phi2 / (gamma - 1.0_8) + rho * (xi_x_tilde * uz_roe - xi_z_tilde * ux_roe)
1827 tmat(5,3) = xi_z_tilde * phi2 / (gamma - 1.0_8) + rho * (xi_y_tilde * ux_roe - xi_x_tilde * uy_roe)
1828 tmat(5,4) = alpha * ((phi2 + spd_snd_roe**2)/(gamma - 1.0_8) + spd_snd_roe * theta)
1829 tmat(5,5) = alpha * ((phi2 + spd_snd_roe**2)/(gamma - 1.0_8) - spd_snd_roe * theta)
1831 tinv(1,1) = xi_x_tilde * (1.0_8 - phi2 / spd_snd_roe**2) - (xi_z_tilde * uy_roe - xi_y_tilde * uz_roe) / rho
1832 tinv(1,2) = xi_x_tilde * (gamma - 1.0_8) * ux_roe / spd_snd_roe**2
1833 tinv(1,3) = xi_z_tilde / rho + xi_x_tilde * (gamma - 1.0_8) * uy_roe / spd_snd_roe**2
1834 tinv(1,4) = -xi_y_tilde / rho + xi_x_tilde * (gamma - 1.0_8) * uz_roe / spd_snd_roe**2
1835 tinv(1,5) = -xi_x_tilde * (gamma - 1.0_8) / spd_snd_roe**2
1836 tinv(2,1) = xi_y_tilde * (1.0_8 - phi2 / spd_snd_roe**2) - (xi_x_tilde * uz_roe - xi_z_tilde * ux_roe) / rho
1837 tinv(2,2) = -xi_z_tilde / rho + xi_y_tilde * (gamma - 1.0_8) * ux_roe / spd_snd_roe**2
1838 tinv(2,3) = xi_y_tilde * (gamma - 1.0_8) * uy_roe / spd_snd_roe**2
1839 tinv(2,4) = xi_x_tilde / rho + xi_y_tilde * (gamma - 1.0_8) * uz_roe / spd_snd_roe**2
1840 tinv(2,5) = -xi_y_tilde * (gamma - 1.0_8) / spd_snd_roe**2
1841 tinv(3,1) = xi_z_tilde * (1.0_8 - phi2 / spd_snd_roe**2) - (xi_y_tilde * ux_roe - xi_x_tilde * uy_roe) / rho
1842 tinv(3,2) = xi_y_tilde / rho + xi_z_tilde * (gamma - 1.0_8) * ux_roe / spd_snd_roe**2
1843 tinv(3,3) = -xi_x_tilde / rho + xi_z_tilde * (gamma - 1.0_8) * uy_roe / spd_snd_roe**2
1844 tinv(3,4) = xi_z_tilde * (gamma - 1.0_8) * uz_roe / spd_snd_roe**2
1845 tinv(3,5) = -xi_z_tilde * (gamma - 1.0_8) / spd_snd_roe**2
1846 tinv(4,1) = beta * (phi2 - spd_snd_roe * theta)
1847 tinv(4,2) = beta * (xi_x_tilde * spd_snd_roe - (gamma - 1.0_8) * ux_roe)
1848 tinv(4,3) = beta * (xi_y_tilde * spd_snd_roe - (gamma - 1.0_8) * uy_roe)
1849 tinv(4,4) = beta * (xi_z_tilde * spd_snd_roe - (gamma - 1.0_8) * uz_roe)
1850 tinv(4,5) = beta * (gamma - 1.0_8)
1851 tinv(5,1) = beta * (phi2 + spd_snd_roe * theta)
1852 tinv(5,2) = -beta * (xi_x_tilde * spd_snd_roe + (gamma - 1.0_8) * ux_roe)
1853 tinv(5,3) = -beta * (xi_y_tilde * spd_snd_roe + (gamma - 1.0_8) * uy_roe)
1854 tinv(5,4) = -beta * (xi_z_tilde * spd_snd_roe + (gamma - 1.0_8) * uz_roe)
1855 tinv(5,5) = beta * (gamma - 1.0_8)
1860 lambda(jj,jj) = ucon
1862 lambda(nd+1,nd+1) = ucon + spd_snd_roe * sqrt(xi_x**2 + xi_y**2 + xi_z**2)
1863 lambda(nd+2,nd+2) = ucon - spd_snd_roe * sqrt(xi_x**2 + xi_y**2 + xi_z**2)
1870 sigmaDissipation,sigmaDilatation,dilatationRamp,dilatationCutoff, &
1875 INTEGER(KIND=4),
INTENT(IN) :: numDim
1876 INTEGER(KIND=8),
INTENT(IN) :: bufferSize(numdim), numPoints
1877 INTEGER(KIND=8),
INTENT(IN) :: bufferInterval(2*numdim)
1878 REAL(KIND=8),
INTENT(IN) :: sigmaDissipation,sigmaDilatation
1879 REAL(KIND=8),
INTENT(IN) :: dilatationRamp,dilatationCutoff
1880 REAL(KIND=8),
INTENT(IN) :: divV(numpoints)
1881 REAL(KIND=8),
INTENT(OUT) :: sigmaDiss(numpoints)
1883 INTEGER(KIND=8) :: I, J, K
1884 INTEGER(KIND=8) :: nPlane, zIndex, yIndex, yzIndex, bufferIndex, xSize
1885 INTEGER(KIND=8) :: iStart,iEnd,jStart,jEnd,kStart,kEnd
1887 istart = bufferinterval(1)
1888 iend = bufferinterval(2)
1889 xsize = buffersize(1)
1891 IF(numdim == 1)
THEN 1893 sigmadiss(i) = (sigmadissipation + &
1894 sigmadilatation*0.5_8*(1.0_8 + tanh(dilatationramp*(dilatationcutoff-divv(i)))))
1896 ELSE IF(numdim == 2)
THEN 1897 jstart = bufferinterval(3)
1898 jend = bufferinterval(4)
1900 yindex = (j-1)*xsize
1902 bufferindex = yindex + i
1903 sigmadiss(bufferindex) = (sigmadissipation + &
1904 sigmadilatation*0.5_8*(1.0_8 + tanh(dilatationramp*(dilatationcutoff-divv(bufferindex)))))
1907 ELSE IF(numdim == 3)
THEN 1908 jstart = bufferinterval(3)
1909 jend = bufferinterval(4)
1910 kstart = bufferinterval(5)
1911 kend = bufferinterval(6)
1912 nplane = xsize * buffersize(2)
1914 zindex = (k-1)*nplane
1916 yzindex = zindex + (j-1)*xsize
1918 bufferindex = yzindex + i
1919 sigmadiss(bufferindex) = (sigmadissipation + &
1920 sigmadilatation*0.5_8*(1.0_8 + tanh(dilatationramp*(dilatationcutoff-divv(bufferindex)))))
subroutine noslip_isothermal(numDim, bufferSizes, numPointsBuffer, patchNormalDir, patchSizes, numPointsPatch, numPatchPointsOp, patchPointsOp, gridType, gridMetric, jacobianDeterminant, bcParams, gasParams, rhoBuffer, rhoVBuffer, rhoEBuffer, numscalar, scalarBuffer, rhoRHS, rhoVRHS, rhoERHS, scalarRHS, rhoTarget, rhoVTarget, rhoETarget, scalarTarget, muBuffer, lambdaBuffer)
subroutine dissipationweight(numDim, bufferSize, numPoints, bufferInterval, sigmaDissipation, sigmaDilatation, dilatationRamp, dilatationCutoff, divV, sigmaDiss)
subroutine roe_mat(numDim, inCV, outCV, gamma, normDir, tMat, tInv, lambda, status)
integer(kind=4), parameter unirect
subroutine farfield(numDim, bufferSizes, numPointsBuffer, patchNormalDir, patchSizes, numPointsPatch, numPatchPointsOp, patchPointsOp, gridType, gridMetric, jacobianDeterminant, bcParams, gasParams, rhoBuffer, rhoVBuffer, rhoEBuffer, viscousFluxBuffer, numscalar, scalarBuffer, rhoRHS, rhoVRHS, rhoERHS, scalarRHS, rhoTarget, rhoVTarget, rhoETarget, scalarTarget)
subroutine slip_adiabatic(numDim, bufferSizes, numPointsBuffer, patchNormalDir, patchSizes, numPointsPatch, numPatchPointsOp, patchPointsOp, gridType, gridMetric, jacobianDeterminant, bcParams, gasParams, rhoBuffer, rhoVBuffer, rhoEBuffer, numscalar, scalarBuffer, rhoRHS, rhoVRHS, rhoERHS, scalarRHS, rhoTarget, rhoVTarget, rhoETarget, scalarTarget)
integer(kind=4), parameter curvilinear
integer(kind=4), parameter rectilinear
subroutine sat_form_roe_matrices_tp(u_in, u_out, ND, gamma, gamref, norm, tmat, tinv, lambda)
subroutine sat_form_roe_matrices(ND, u_in, u_out, gamma, norm, tmat, tinv, lambda)