def jacLowDiss(WL, WR, n): assert WL.shape == WR.shape == n.shape[:1] + (4, ) qL, pL, uL, cL = gask(WL) qR, pR, uR, cR = gask(WR) qL_WL, pL_WL, uL_WL, cL_WL = jacGask(WL) qR_WR, pR_WR, uR_WR, cR_WR = jacGask(WR) uE, pE, WE = 0.5 * (uL + uR), 0.5 * (pL + pR), 0.5 * (WL + WR) uDotN = (uE * n).sum(1) uDotN_WL = 0.5 * (uL_WL * n[:, :, newaxis]).sum(1) uDotN_WR = 0.5 * (uR_WR * n[:, :, newaxis]).sum(1) # flux = WE * uDotN[:,newaxis] flux_WL = 0.5 * uDotN[:,newaxis,newaxis] * eye(4) \ + WE[:,:,newaxis] * uDotN_WL[:,newaxis,:] flux_WR = 0.5 * uDotN[:,newaxis,newaxis] * eye(4) \ + WE[:,:,newaxis] * uDotN_WR[:,newaxis,:] # flux[:,1:3] += pE[:,newaxis] * n flux_WL[:, 1:3, :] += 0.5 * pL_WL[:, newaxis, :] * n[:, :, newaxis] flux_WR[:, 1:3, :] += 0.5 * pR_WR[:, newaxis, :] * n[:, :, newaxis] # flux[:,3] += pE * uDotN flux_WL[:, 3, :] += 0.5 * pL_WL * uDotN[:, newaxis] + pE[:, newaxis] * uDotN_WL flux_WR[:, 3, :] += 0.5 * pR_WR * uDotN[:, newaxis] + pE[:, newaxis] * uDotN_WR return flux_WL, flux_WR
def fluxLowDiss(WL, WR, n): assert WL.shape == WR.shape == n.shape[:1] + (4, ) qL, pL, uL, cL = gask(WL) qR, pR, uR, cR = gask(WR) uE, pE, WE = 0.5 * (uL + uR), 0.5 * (pL + pR), 0.5 * (WL + WR) uDotN = (uE * n).sum(1) flux = WE * uDotN[:, newaxis] flux[:, 1:3] += pE[:, newaxis] * n flux[:, 3] += pE * uDotN return flux
def fluxLowDiss(WL, WR, n): assert WL.shape == WR.shape == n.shape[:1] + (4,) qL, pL, uL, cL = gask(WL) qR, pR, uR, cR = gask(WR) uE, pE, WE = 0.5 * (uL + uR), 0.5 * (pL + pR), 0.5 * (WL + WR) uDotN = (uE * n).sum(1) flux = WE * uDotN[:,newaxis] flux[:,1:3] += pE[:,newaxis] * n flux[:,3] += pE * uDotN return flux
def jacLowDiss(WL, WR, n): assert WL.shape == WR.shape == n.shape[:1] + (4,) qL, pL, uL, cL = gask(WL) qR, pR, uR, cR = gask(WR) qL_WL, pL_WL, uL_WL, cL_WL = jacGask(WL) qR_WR, pR_WR, uR_WR, cR_WR = jacGask(WR) uE, pE, WE = 0.5 * (uL + uR), 0.5 * (pL + pR), 0.5 * (WL + WR) uDotN = (uE * n).sum(1) uDotN_WL = 0.5 * (uL_WL * n[:,:,newaxis]).sum(1) uDotN_WR = 0.5 * (uR_WR * n[:,:,newaxis]).sum(1) # flux = WE * uDotN[:,newaxis] flux_WL = 0.5 * uDotN[:,newaxis,newaxis] * eye(4) \ + WE[:,:,newaxis] * uDotN_WL[:,newaxis,:] flux_WR = 0.5 * uDotN[:,newaxis,newaxis] * eye(4) \ + WE[:,:,newaxis] * uDotN_WR[:,newaxis,:] # flux[:,1:3] += pE[:,newaxis] * n flux_WL[:,1:3,:] += 0.5* pL_WL[:,newaxis,:] * n[:,:,newaxis] flux_WR[:,1:3,:] += 0.5* pR_WR[:,newaxis,:] * n[:,:,newaxis] # flux[:,3] += pE * uDotN flux_WL[:,3,:] += 0.5* pL_WL * uDotN[:,newaxis] + pE[:,newaxis] * uDotN_WL flux_WR[:,3,:] += 0.5* pR_WR * uDotN[:,newaxis] + pE[:,newaxis] * uDotN_WR return flux_WL, flux_WR
def computeEntropy(W): q, p, u, c = gask(W) nR = 8.314 / 29E-3 return (5./2 * log(p) - 7./2 * log(W[:,0])) * nR
def computeMach(W): q, p, u, c = gask(W) return sqrt((u**2).sum(1)) / c
def computePt(W): q, p, u, c = gask(W) M = computeMach(W) return p * (1 + 0.2 * M*M)**(7./2)
def computeP(W): q, p, u, c = gask(W) return p
def computeEntropy(W): q, p, u, c = gask(W) nR = 8.314 / 29E-3 return (5. / 2 * log(p) - 7. / 2 * log(W[:, 0])) * nR
def computePt(W): q, p, u, c = gask(W) M = computeMach(W) return p * (1 + 0.2 * M * M)**(7. / 2)