From b7c3da0297dca2a124562b088d2d51a5c309ca5a Mon Sep 17 00:00:00 2001 From: psharda Date: Sat, 29 Jul 2023 14:56:58 +0200 Subject: [PATCH] if rho = 0, pres is 0 --- src/EOS.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 4f16634f9..e931217f2 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -251,7 +251,12 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputePressure(am if constexpr (gamma_ != 1.0) { chem_eos_t estate; estate.rho = rho; - estate.e = Eint / rho; + // if rho is 0, pass 0 to state.e + if (rho == 0.0) { + estate.e = 0; + } else { + estate.e = Eint / rho; + } estate.mu = mean_molecular_weight_ / C::m_u; eos(eos_input_re, estate); P = estate.p;