Example #1
0
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
Example #2
0
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
Example #3
0
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
Example #4
0
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
Example #5
0
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
Example #6
0
def computeMach(W):
    q, p, u, c = gask(W)
    return sqrt((u**2).sum(1)) / c
Example #7
0
def computePt(W):
    q, p, u, c = gask(W)
    M = computeMach(W)
    return p * (1 + 0.2 * M*M)**(7./2)
Example #8
0
def computeP(W):
    q, p, u, c = gask(W)
    return p
Example #9
0
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
Example #10
0
def computeMach(W):
    q, p, u, c = gask(W)
    return sqrt((u**2).sum(1)) / c
Example #11
0
def computePt(W):
    q, p, u, c = gask(W)
    M = computeMach(W)
    return p * (1 + 0.2 * M * M)**(7. / 2)
Example #12
0
def computeP(W):
    q, p, u, c = gask(W)
    return p