diff --git a/core/eos.c b/core/eos.c index 358bb0e..a35924e 100644 --- a/core/eos.c +++ b/core/eos.c @@ -159,10 +159,12 @@ double EOS_enthalpy_rho0_u(double rho, double u, const double *extra) { double EOS_entropy_rho0_u(double rho, double u, const double *extra) { double ent; -#if EOS == EOS_TYPE_GAMMA_GASPRESS - ent = EOS_Gamma_Gaspress_entropy_rho0_u(rho, u); -#elif EOS == EOS_TYPE_GAMMA_RADPRESS - ent = EOS_Gamma_Radpress_entropy_rho0_u(rho, u); +#if EOS == EOS_TYPE_GAMMA + #if EOS_GAMMA == GASPRESS + ent = EOS_Gamma_Gaspress_entropy_rho0_u(rho, u); + #elif EOS_GAMMA == RADPRESS + ent = EOS_Gamma_Radpress_entropy_rho0_u(rho, u); + #endif #elif EOS == EOS_TYPE_POLYTROPE ent = EOS_Poly_entropy_rho0_u(rho, u, poly_K, poly_gam); #elif EOS == EOS_TYPE_TABLE diff --git a/core/fixup.c b/core/fixup.c index d027ed4..2791a9f 100644 --- a/core/fixup.c +++ b/core/fixup.c @@ -229,7 +229,7 @@ void fixup1zone( fixup_passive(i, j, k, pv, pv_prefloor); #endif -#if ELECTRONS && EOS == EOS_TYPE_GAMMA_GASPRESS +#if ELECTRONS && EOS == EOS_TYPE_GAMMA && GAMMA_EOS == GASPRESS // Reset entropy after floors pv[KTOT] = EOS_Gamma_Gaspress_entropy_rho0_u(pv[RHO], pv[UU]); @@ -240,6 +240,10 @@ void fixup1zone( pv[UU] = KTOTMAX * pow(pv[RHO], gam) / (gam - 1.); pv[KTOT] = KTOTMAX; } + +#elif ELECTRONS && EOS == EOS_TYPE_GAMMA && GAMMA_EOS == RADPRESS + // Reset entropy after floors + pv[KTOT] = EOS_Gamma_Radpress_entropy_rho0_u(pv[RHO], pv[UU]); #endif // ELECTRONS // Limit gamma with respect to normal observer diff --git a/core/io.c b/core/io.c index ed3a82a..fb8f2d4 100644 --- a/core/io.c +++ b/core/io.c @@ -730,7 +730,7 @@ void dump() { #endif // RADIATION #endif // METRIC -#if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK +#if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK WRITE_HDR(gam, TYPE_DBL); #endif // GAMMA #if EOS == EOS_TYPE_POLYTROPE @@ -1099,7 +1099,7 @@ void restart_write(int restart_type) { #endif // METRIC // EOS -#if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK +#if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK WRITE_HDR(gam, TYPE_DBL); #endif // GAMMA EOS #if EOS == EOS_TYPE_POLYTROPE @@ -1381,7 +1381,7 @@ void restart_read(char *fname) { READ_HDR(cour, TYPE_DBL); -#if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK +#if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK READ_HDR(gam, TYPE_DBL); #endif // EOS diff --git a/core/main.c b/core/main.c index fedc7c1..0773642 100644 --- a/core/main.c +++ b/core/main.c @@ -59,12 +59,11 @@ int main(int argc, char *argv[]) { #endif #if EOS == EOS_TYPE_GAMMA fprintf(stdout, " * IDEAL GAS EOS *\n"); - #endif - #if EOS == EOS_TYPE_GAMMA_GASPRESS - fprintf(stdout, " * GAS-PRESSURE DOMINATED EOS *\n"); - #endif - #if EOS == EOS_TYPE_GAMMA_RADPRESS - fprintf(stdout, " * RADIATION-PRESSURE DOMINATED EOS *\n"); + #if EOS_GAMMA == GASPRESS + fprintf(stdout, " * GAS-PRESSURE DOMINATED IDEAL GAS EOS *\n"); + #elif EOS_GAMMA == RADPRESS + fprintf(stdout, " * RADIATION-PRESSURE DOMINATED IDEAL GAS EOS *\n"); + #endif #endif #if RADIATION == RADTYPE_LIGHT fprintf(stdout, " * RADIATION: PHOTON TRANSPORT *\n"); diff --git a/core/phys.c b/core/phys.c index fbbcc4d..b181d15 100644 --- a/core/phys.c +++ b/core/phys.c @@ -211,7 +211,7 @@ void mhd_vchar(double *Pr, struct of_state *q, struct of_geom *geom, int js, bsq = dot(q->bcon, q->bcov); rho = fabs(Pr[RHO] + SMALL); u = Pr[UU]; -#if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK +#if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK u = fabs(u + SMALL); #endif ef = EOS_enthalpy_rho0_u(rho, u, extra); diff --git a/core/utop.c b/core/utop.c index 3c946b9..a3e9224 100644 --- a/core/utop.c +++ b/core/utop.c @@ -161,7 +161,7 @@ int Utoprim(double U[NVAR], struct of_geom *geom, double prim[NVAR]) { // Return without updating non-B primitives if (rho0 < 0) return (5); -#if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK +#if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK if (u < 0) return (5); #endif diff --git a/prob/torus_cbc/build.py b/prob/torus_cbc/build.py index 57bdffc..2cbc96f 100644 --- a/prob/torus_cbc/build.py +++ b/prob/torus_cbc/build.py @@ -163,9 +163,9 @@ EOS_GAMMA = "GASPRESS" GAMMA = 5./3. else: - print("Using the default gas-pressure dominated ideal gas EoS. - You can choose gas-pressure dominated (add flag -gammagaspress), - radiation-pressure dominated (add flag -gammaradpress).") + print('Using the default gas-pressure dominated ideal gas EoS.', + 'You can choose gas-pressure dominated (add flag -gammagaspress)', + 'radiation-pressure dominated (add flag -gammaradpress).') EOS_GAMMA = "GASPRESS" GAMMA = 4./3. else: @@ -175,9 +175,9 @@ ENTROPY = float(sys.argv[sys.argv.index('-ent') + 1]) else: ENTROPY = 4 - if EOS_TYPE == "EOS_TYPE_GAMMA" and EOS_GAMMA == "RADPRESS": - print("Using the default initial entropy = 4.", end=' ') - print("Entropy is a required parameter in setting up radiation-pressure dominated disks.") + if EOS_TYPE == "EOS_TYPE_GAMMA" and EOS_GAMMA == "RADPRESS": + print('Using the default initial entropy = 4.', + 'Entropy is a required parameter in setting up radiation-pressure dominated disks.') bhl.report_var('ENTROPY',ENTROPY) @@ -186,8 +186,8 @@ else: KAPPA_EOS = 1.e-3 if EOS_TYPE == "EOS_TYPE_GAMMA" and EOS_GAMMA == "GASPRESS": - print("Using the default initial kappa = 1.e-3.", end=' ') - print("kappa is a required parameter in setting up gas-pressure dominated disks.") + print('Using the default initial kappa = 1.e-3.', + 'kappa is a required parameter in setting up gas-pressure dominated disks.') if CLASSIC: # classic harm disk # Rmax and rho fixed