Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 27, 2023
1 parent 1c64f8e commit 6d31572
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/hydro_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,22 @@ template <typename problem_t>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE auto HydroSystem<problem_t>::ComputeSoundSpeed(amrex::Array4<const amrex::Real> const &cons, int i, int j, int k)
-> amrex::Real
{
const auto rho = cons(i, j, k, density_index);
const auto px = cons(i, j, k, x1Momentum_index);
const auto py = cons(i, j, k, x2Momentum_index);
const auto pz = cons(i, j, k, x3Momentum_index);
const auto E = cons(i, j, k, energy_index); // *total* gas energy per unit volume
const auto vx = px / rho;
const auto vy = py / rho;
const auto vz = pz / rho;
const auto kinetic_energy = 0.5 * rho * (vx * vx + vy * vy + vz * vz);
const auto thermal_energy = E - kinetic_energy;

amrex::GpuArray<Real, nmscalars_> massScalars = RadSystem<problem_t>::ComputeMassScalars(cons, i, j, k);
amrex::Real P = quokka::EOS<problem_t>::ComputePressure(rho, thermal_energy, massScalars);
const auto rho = cons(i, j, k, density_index);
const auto px = cons(i, j, k, x1Momentum_index);
const auto py = cons(i, j, k, x2Momentum_index);
const auto pz = cons(i, j, k, x3Momentum_index);
const auto E = cons(i, j, k, energy_index); // *total* gas energy per unit volume
const auto vx = px / rho;
const auto vy = py / rho;
const auto vz = pz / rho;
const auto kinetic_energy = 0.5 * rho * (vx * vx + vy * vy + vz * vz);
const auto thermal_energy = E - kinetic_energy;

amrex::GpuArray<Real, nmscalars_> massScalars = RadSystem<problem_t>::ComputeMassScalars(cons, i, j, k);
amrex::Real P = quokka::EOS<problem_t>::ComputePressure(rho, thermal_energy, massScalars);
amrex::Real cs = quokka::EOS<problem_t>::ComputeSoundSpeed(rho, P, massScalars);

return cs;
return cs;
}

template <typename problem_t>
Expand Down Expand Up @@ -658,8 +658,8 @@ void HydroSystem<problem_t>::EnforceLimits(amrex::Real const densityFloor, amrex
// recompute gas energy (to prevent P < 0)
amrex::Real const Eint_star = Etot - 0.5 * rho_new * vsq;

amrex::GpuArray<Real, nmscalars_> massScalars = RadSystem<problem_t>::ComputeMassScalars(state[bx], i, j, k);
amrex::Real const P_star = quokka::EOS<problem_t>::ComputePressure(rho_new, Eint_star, massScalars);
amrex::GpuArray<Real, nmscalars_> massScalars = RadSystem<problem_t>::ComputeMassScalars(state[bx], i, j, k);
amrex::Real const P_star = quokka::EOS<problem_t>::ComputePressure(rho_new, Eint_star, massScalars);
amrex::Real P_new = P_star;
if (P_star < pressureFloor) {
P_new = pressureFloor;
Expand Down Expand Up @@ -856,9 +856,9 @@ void HydroSystem<problem_t>::ComputeFluxes(amrex::MultiFab &x1Flux_mf, amrex::Mu
const double eint_L = x1LeftState(i, j, k, pressure_index);
const double eint_R = x1RightState(i, j, k, pressure_index);
amrex::GpuArray<Real, nmscalars_> massScalars = RadSystem<problem_t>::ComputeMassScalars(x1LeftState, i, j, k);
P_L = quokka::EOS<problem_t>::ComputePressure(rho_L, eint_L*rho_L, massScalars);
P_L = quokka::EOS<problem_t>::ComputePressure(rho_L, eint_L * rho_L, massScalars);
amrex::GpuArray<Real, nmscalars_> massScalars = RadSystem<problem_t>::ComputeMassScalars(x1RightState, i, j, k);
P_R = quokka::EOS<problem_t>::ComputePressure(rho_R, eint_R*rho_R, massScalars);
P_R = quokka::EOS<problem_t>::ComputePressure(rho_R, eint_R * rho_R, massScalars);

// auxiliary Eint is actually (auxiliary) specific internal energy
Eint_L = rho_L * x1LeftState(i, j, k, primEint_index);
Expand Down

0 comments on commit 6d31572

Please sign in to comment.