From 301d71d0f1d9f5a35032252c246950356e835589 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 26 Jul 2023 14:05:50 +0200 Subject: [PATCH 1/2] compute pressure --- EOS/primordial_chem/actual_eos.H | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EOS/primordial_chem/actual_eos.H b/EOS/primordial_chem/actual_eos.H index 650cb72636..3070fee1de 100644 --- a/EOS/primordial_chem/actual_eos.H +++ b/EOS/primordial_chem/actual_eos.H @@ -266,6 +266,11 @@ void actual_eos (I input, T& state) state.e = eint; } + Real pressure = state.rho * eint / sum_gammasinv; + if constexpr (has_pressure::value) { + state.p = pressure; + } + Real dedT = sum_gammasinv * sum_Abarinv * gasconstant; if constexpr (has_energy::value) { state.dedT = dedT; From 8a627847f891ab8c0eb8ce859c56c95a9e41bde8 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 26 Jul 2023 14:39:21 +0200 Subject: [PATCH 2/2] move pressure within constexpr --- EOS/primordial_chem/actual_eos.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EOS/primordial_chem/actual_eos.H b/EOS/primordial_chem/actual_eos.H index 3070fee1de..27951bf530 100644 --- a/EOS/primordial_chem/actual_eos.H +++ b/EOS/primordial_chem/actual_eos.H @@ -266,8 +266,8 @@ void actual_eos (I input, T& state) state.e = eint; } - Real pressure = state.rho * eint / sum_gammasinv; if constexpr (has_pressure::value) { + Real pressure = state.rho * eint / sum_gammasinv; state.p = pressure; }