Skip to content

Commit

Permalink
use microphysics eos
Browse files Browse the repository at this point in the history
  • Loading branch information
psharda committed Jul 28, 2023
1 parent 04c26d7 commit 9dcf491
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/PassiveScalar/test_scalars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ template <> void RadhydroSimulation<ScalarProblem>::setInitialConditionsOnGrid(q
state_cc(i, j, k, HydroSystem<ScalarProblem>::x1Momentum_index) = rho * vx;
state_cc(i, j, k, HydroSystem<ScalarProblem>::x2Momentum_index) = 0.;
state_cc(i, j, k, HydroSystem<ScalarProblem>::x3Momentum_index) = 0.;
state_cc(i, j, k, HydroSystem<ScalarProblem>::energy_index) = P / (gamma - 1.) + 0.5 * rho * (vx * vx);
state_cc(i, j, k, HydroSystem<ScalarProblem>::internalEnergy_index) = P / (gamma - 1.);
state_cc(i, j, k, HydroSystem<ScalarProblem>::energy_index) = quokka::EOS<ScalarProblem>::ComputeEintFromPres(rho, P) + 0.5 * rho * (vx * vx);
state_cc(i, j, k, HydroSystem<ScalarProblem>::internalEnergy_index) = quokka::EOS<ScalarProblem>::ComputeEintFromPres(rho, P);
state_cc(i, j, k, HydroSystem<ScalarProblem>::scalar0_index) = scalar;
});
}
Expand Down Expand Up @@ -120,8 +120,8 @@ void RadhydroSimulation<ScalarProblem>::computeReferenceSolution(amrex::MultiFab
stateExact(i, j, k, HydroSystem<ScalarProblem>::x1Momentum_index) = rho * vx;
stateExact(i, j, k, HydroSystem<ScalarProblem>::x2Momentum_index) = 0.;
stateExact(i, j, k, HydroSystem<ScalarProblem>::x3Momentum_index) = 0.;
stateExact(i, j, k, HydroSystem<ScalarProblem>::energy_index) = P / (gamma - 1.) + 0.5 * rho * (vx * vx);
stateExact(i, j, k, HydroSystem<ScalarProblem>::internalEnergy_index) = P / (gamma - 1.);
stateExact(i, j, k, HydroSystem<ScalarProblem>::energy_index) = quokka::EOS<ScalarProblem>::ComputeEintFromPres(rho, P) + 0.5 * rho * (vx * vx);
stateExact(i, j, k, HydroSystem<ScalarProblem>::internalEnergy_index) = quokka::EOS<ScalarProblem>::ComputeEintFromPres(rho, P);
stateExact(i, j, k, HydroSystem<ScalarProblem>::scalar0_index) = scalar;
});
}
Expand Down Expand Up @@ -166,7 +166,7 @@ void RadhydroSimulation<ScalarProblem>::computeReferenceSolution(amrex::MultiFab
const auto s = val_exact.at(HydroSystem<ScalarProblem>::scalar0_index)[i];
const auto vx = xmom / rho;
const auto Eint = E - 0.5 * rho * (vx * vx);
const auto P = (quokka::EOS_Traits<ScalarProblem>::gamma - 1.) * Eint;
const auto P = quokka::EOS<ScalarProblem>::ComputePressure(rho, Eint);
d_exact.push_back(rho);
vx_exact.push_back(vx);
P_exact.push_back(P);
Expand All @@ -180,7 +180,7 @@ void RadhydroSimulation<ScalarProblem>::computeReferenceSolution(amrex::MultiFab
const auto fs = values.at(HydroSystem<ScalarProblem>::scalar0_index)[i];
const auto fvx = fxmom / frho;
const auto fEint = fE - 0.5 * frho * (fvx * fvx);
const auto fP = (quokka::EOS_Traits<ScalarProblem>::gamma - 1.) * fEint;
const auto fP = quokka::EOS<ScalarProblem>::ComputePressure(frho, fEint);
d_final.push_back(frho);
vx_final.push_back(fvx);
P_final.push_back(fP);
Expand Down

0 comments on commit 9dcf491

Please sign in to comment.