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