Esempio n. 1
0
def dEdρ(ρ, p, A, MP):
    """ Returns the partial derivative of E by ρ (holding p,A constant)
    """
    G = gram(A)
    dC0dρ = dC_0dρ(ρ, MP)
    ret = mg.dedρ(ρ, p, MP) + dC0dρ / 4 * L2_2D(dev(G))
    return ret
Esempio n. 2
0
def temperature_hyp(S, A, HYP):
    G = gram(A)
    I3 = I_3(G)
    T0 = HYP.T0
    γ = HYP.γ
    cv = HYP.cv
    return T0 * I3**(γ / 2) * exp(S / cv)
Esempio n. 3
0
def total_energy_hyp(A, S, v, HYP):
    """ Returns the total energy, given the distortion tensor and entropy
    """
    G = gram(A)
    I1 = I_1(G)
    I2 = I_2(G)
    I3 = I_3(G)
    return U_1(I3, HYP) + U_2(I3, S, HYP) + W(I1, I2, I3, HYP) + dot(v, v) / 2
Esempio n. 4
0
def Sigma_hyp(ρ, A, S, HYP):
    """ Returns the total stress tensor
    """
    G = gram(A)
    I1 = I_1(G)
    I2 = I_2(G)
    I3 = I_3(G)
    GdedG = GdU_1dG(I3, HYP) + GdU_2dG(I3, S, HYP) + GdWdG(G, I1, I2, I3, HYP)
    return -2 * ρ * GdedG
Esempio n. 5
0
def dsigmadAdd(ρ, A, d, MP):
    """ Returns dσ_dj / dA_md, holding ρ constant.
        NOTE: Only valid for EOS with E_2A = cs^2/4 * |devG|^2
    """
    cs2 = c_s2(ρ, MP)
    G = gram(A)
    ret = AdevG(A, G)
    ret[:, d] *= 2
    ret += 1 / 3 * outer(A[:, d], G[d])
    ret += G[d, d] * A
    return -ρ * cs2 * ret.T
Esempio n. 6
0
def entropy_hyp(E, A, v, HYP):
    cv = HYP.cv
    T0 = HYP.T0
    γ = HYP.γ

    G = gram(A)
    I1 = I_1(G)
    I2 = I_2(G)
    I3 = I_3(G)

    U2 = E - (U_1(I3, HYP) + W(I1, I2, I3, HYP) + dot(v, v) / 2)
    return cv * log(1 + U2 / (cv * T0 * I3**(γ / 2)))
Esempio n. 7
0
def dsigmadA(ρ, A, MP):
    """ Returns T_ijmn = dσ_ij / dA_mn, holding ρ constant.
        NOTE: Only valid for EOS with E_2A = cs^2/4 * |devG|^2
    """
    cs2 = c_s2(ρ, MP)
    G = gram(A)
    AdevGT = AdevG(A, G).T
    GA = dot(G[:, :, None], A[:, None])
    ret = GA.swapaxes(0, 3) + GA.swapaxes(1, 3) - 2 / 3 * GA

    for i in range(3):
        ret[i, :, :, i] += AdevGT
        ret[:, i, :, i] += AdevGT

    return -ρ * cs2 * ret
Esempio n. 8
0
def pressure_hyp(ρ, A, S, HYP):
    G = gram(A)
    I1 = I_1(G)
    I2 = I_2(G)
    I3 = I_3(G)

    K0 = HYP.K0
    α = HYP.α
    cv = HYP.cv
    T0 = HYP.T0
    γ = HYP.γ
    b02 = HYP.b02
    β = HYP.β
    const = b02 / 2 * I3**(β / 2)

    ret = K0 / (2 * α) * (I3**α - I3**(α / 2))
    ret += cv * T0 * γ / 2 * (exp(S / cv) - 1) * I3**(γ / 2)
    ret += const * ((β / 2) * (I1**2 / 3 - I2))
    return 2 * ρ * ret
Esempio n. 9
0
def dEdA_s(ρ, A, MP):
    """ Returns the partial derivative of E by A (holding ρ,s constant)
    """
    cs2 = c_s2(ρ, MP)
    G = gram(A)
    return cs2 * AdevG(A, G)
Esempio n. 10
0
def dEdA(ρ, A, MP):
    """ Returns the partial derivative of E by A (holding ρ,s constant)
    """
    C0 = C_0(ρ, MP)
    G = gram(A)
    return C0 * AdevG(A, G)
Esempio n. 11
0
def E_2A(ρ, A, MP):
    """ Returns the mesoscale energy dependent on the distortion
    """
    C0 = C_0(ρ, MP)
    G = gram(A)
    return C0 / 4 * L2_2D(dev(G))
Esempio n. 12
0
 def G(self):
     return gram(self.A)