Beispiel #1
0
def generate_everything_for_UnitTesting():
    # First define hydrodynamical quantities
    u4U = ixp.declarerank1("u4U", DIM=4)
    B_tildeU = ixp.declarerank1("B_tildeU", DIM=3)

    # Then ADM quantities
    gammaDD = ixp.declarerank2("gammaDD", "sym01", DIM=3)
    betaU = ixp.declarerank1("betaU", DIM=3)
    alpha = sp.symbols('alpha', real=True)

    # Then numerical constant
    sqrt4pi = sp.symbols('sqrt4pi', real=True)

    # First compute stress-energy tensor T4UU and T4UD:
    import GRHD.equations as GHeq
    GHeq.compute_sqrtgammaDET(gammaDD)
    compute_B_notildeU(GHeq.sqrtgammaDET, B_tildeU)
    compute_smallb4U(gammaDD, betaU, alpha, u4U, B_notildeU, sqrt4pi)
    compute_smallb4U_with_driftvU_for_FFE(gammaDD, betaU, alpha, u4U,
                                          B_notildeU, sqrt4pi)
    compute_smallbsquared(gammaDD, betaU, alpha, smallb4U)

    compute_TEM4UU(gammaDD, betaU, alpha, smallb4U, smallbsquared, u4U)
    compute_TEM4UD(gammaDD, betaU, alpha, TEM4UU)

    # Compute conservative variables in terms of primitive variables
    GHeq.compute_S_tildeD(alpha, GHeq.sqrtgammaDET, TEM4UD)
    global S_tildeD
    S_tildeD = GHeq.S_tildeD

    # Next compute fluxes of conservative variables
    GHeq.compute_S_tilde_fluxUD(alpha, GHeq.sqrtgammaDET, TEM4UD)
    global S_tilde_fluxUD
    S_tilde_fluxUD = GHeq.S_tilde_fluxUD

    # Then declare derivatives & compute g4DDdD
    gammaDD_dD = ixp.declarerank3("gammaDD_dD", "sym01", DIM=3)
    betaU_dD = ixp.declarerank2("betaU_dD", "nosym", DIM=3)
    alpha_dD = ixp.declarerank1("alpha_dD", DIM=3)
    GHeq.compute_g4DD_zerotimederiv_dD(gammaDD, betaU, alpha, gammaDD_dD,
                                       betaU_dD, alpha_dD)

    # Finally compute source terms on tau_tilde and S_tilde equations
    GHeq.compute_S_tilde_source_termD(alpha, GHeq.sqrtgammaDET,
                                      GHeq.g4DD_zerotimederiv_dD, TEM4UU)
    global S_tilde_source_termD
    S_tilde_source_termD = GHeq.S_tilde_source_termD
Beispiel #2
0
def generate_everything_for_UnitTesting():
    # First define hydrodynamical quantities
    u4U = ixp.declarerank1("u4U", DIM=4)
    rho_b, P, epsilon = sp.symbols('rho_b P epsilon', real=True)
    B_tildeU = ixp.declarerank1("B_tildeU", DIM=3)

    # Then ADM quantities
    gammaDD = ixp.declarerank2("gammaDD", "sym01", DIM=3)
    KDD = ixp.declarerank2("KDD", "sym01", DIM=3)
    betaU = ixp.declarerank1("betaU", DIM=3)
    alpha = sp.symbols('alpha', real=True)

    # Then numerical constant
    sqrt4pi = sp.symbols('sqrt4pi', real=True)

    # First compute smallb4U & smallbsquared from BtildeU, which are needed
    #      for GRMHD stress-energy tensor T4UU and T4UD:
    GRHD.compute_sqrtgammaDET(gammaDD)
    GRFFE.compute_B_notildeU(GRHD.sqrtgammaDET, B_tildeU)
    GRFFE.compute_smallb4U(gammaDD, betaU, alpha, u4U, GRFFE.B_notildeU,
                           sqrt4pi)
    GRFFE.compute_smallbsquared(gammaDD, betaU, alpha, GRFFE.smallb4U)

    # Then compute the GRMHD stress-energy tensor:
    compute_GRMHD_T4UU(gammaDD, betaU, alpha, rho_b, P, epsilon, u4U,
                       GRFFE.smallb4U, GRFFE.smallbsquared)
    compute_GRMHD_T4UD(gammaDD, betaU, alpha, GRHDT4UU, GRFFET4UU)

    # Compute conservative variables in terms of primitive variables
    global rho_star, tau_tilde, S_tildeD
    GRHD.compute_rho_star(alpha, GRHD.sqrtgammaDET, rho_b, u4U)
    GRHD.compute_tau_tilde(alpha, GRHD.sqrtgammaDET, T4UU, GRHD.rho_star)
    GRHD.compute_S_tildeD(alpha, GRHD.sqrtgammaDET, T4UD)
    rho_star = GRHD.rho_star
    tau_tilde = GRHD.tau_tilde
    S_tildeD = GRHD.S_tildeD

    # Then compute v^i from u^mu
    GRHD.compute_vU_from_u4U__no_speed_limit(u4U)

    # Next compute fluxes of conservative variables
    global rho_star_fluxU, tau_tilde_fluxU, S_tilde_fluxUD
    GRHD.compute_rho_star_fluxU(GRHD.vU, GRHD.rho_star)
    GRHD.compute_tau_tilde_fluxU(alpha, GRHD.sqrtgammaDET, GRHD.vU, T4UU,
                                 GRHD.rho_star)
    GRHD.compute_S_tilde_fluxUD(alpha, GRHD.sqrtgammaDET, T4UD)
    rho_star_fluxU = GRHD.rho_star_fluxU
    tau_tilde_fluxU = GRHD.tau_tilde_fluxU
    S_tilde_fluxUD = GRHD.S_tilde_fluxUD

    # Then declare derivatives & compute g4DD_zerotimederiv_dD
    gammaDD_dD = ixp.declarerank3("gammaDD_dD", "sym01", DIM=3)
    betaU_dD = ixp.declarerank2("betaU_dD", "nosym", DIM=3)
    alpha_dD = ixp.declarerank1("alpha_dD", DIM=3)
    GRHD.compute_g4DD_zerotimederiv_dD(gammaDD, betaU, alpha, gammaDD_dD,
                                       betaU_dD, alpha_dD)

    # Then compute source terms on tau_tilde and S_tilde equations
    global s_source_term, S_tilde_source_termD
    GRHD.compute_s_source_term(KDD, betaU, alpha, GRHD.sqrtgammaDET, alpha_dD,
                               T4UU)
    GRHD.compute_S_tilde_source_termD(alpha, GRHD.sqrtgammaDET,
                                      GRHD.g4DD_zerotimederiv_dD, T4UU)
    s_source_term = GRHD.s_source_term
    S_tilde_source_termD = GRHD.S_tilde_source_termD