From 3bbb8c373902bed8b4f4f31f418a5046cdc71646 Mon Sep 17 00:00:00 2001 From: dinatraykova Date: Mon, 5 Aug 2024 14:17:30 +0200 Subject: [PATCH] Add missing conformal factor in tau --- Examples/Fluid_Kerr_merged/ConservedQuantities.hpp | 4 +++- Examples/Fluid_Kerr_merged/Fluxes.hpp | 3 ++- Examples/Fluid_Kerr_merged/InitialFluidData.impl.hpp | 3 ++- Examples/Fluid_Kerr_merged/Sources.hpp | 5 +++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Examples/Fluid_Kerr_merged/ConservedQuantities.hpp b/Examples/Fluid_Kerr_merged/ConservedQuantities.hpp index 50ddbf4cc..02e32c349 100644 --- a/Examples/Fluid_Kerr_merged/ConservedQuantities.hpp +++ b/Examples/Fluid_Kerr_merged/ConservedQuantities.hpp @@ -32,8 +32,10 @@ void PtoC(const data_t P_of_rho, vars_t &vars) data_t hh = 1. + vars.eps + P_of_rho / vars.rho; data_t rho_conformal = vars.rho / pow(chi_regularised, 1.5); + data_t P_conformal = P_of_rho / pow(chi_regularised, 1.5); + vars.D = rho_conformal * sqrt(WW); - vars.tau = rho_conformal * hh * WW - P_of_rho - vars.D; + vars.tau = rho_conformal * hh * WW - P_conformal - vars.D; // S_j (note lower index) = - n^a T_ai FOR(i) { vars.Sj[i] = rho_conformal * hh * WW * vi_D[i]; } diff --git a/Examples/Fluid_Kerr_merged/Fluxes.hpp b/Examples/Fluid_Kerr_merged/Fluxes.hpp index fe7af5e10..b5ec9bb7a 100644 --- a/Examples/Fluid_Kerr_merged/Fluxes.hpp +++ b/Examples/Fluid_Kerr_merged/Fluxes.hpp @@ -42,6 +42,7 @@ vars_t compute_flux(const data_t P_of_rho, const vars_t &vars, data_t hh = 1. + vars.eps + P_of_rho / vars.rho; data_t rho_conformal = vars.rho / pow(vars.chi, 1.5); + data_t P_conformal = P_of_rho / pow(chi_regularised, 1.5); FOR(j) { @@ -49,7 +50,7 @@ vars_t compute_flux(const data_t P_of_rho, const vars_t &vars, vars.lapse * rho_conformal * hh * WW * vars.vi[idir] * vi_D[j] - vars.shift[idir] * vars.Sj[j]; FOR(k) - out.Sj[j] += vars.lapse * P_of_rho * h_UU[idir][k] * vars.h[j][k]; + out.Sj[j] += vars.lapse * P_conformal * h_UU[idir][k] * vars.h[j][k]; } out.tau = vars.lapse * (Sj_U[idir] - vars.D * vars.vi[idir]) - diff --git a/Examples/Fluid_Kerr_merged/InitialFluidData.impl.hpp b/Examples/Fluid_Kerr_merged/InitialFluidData.impl.hpp index fff87ee83..1a7a07668 100644 --- a/Examples/Fluid_Kerr_merged/InitialFluidData.impl.hpp +++ b/Examples/Fluid_Kerr_merged/InitialFluidData.impl.hpp @@ -45,9 +45,10 @@ void InitialFluidData::compute(Cell current_cell) const data_t hh = 1. + matter_vars.eps + P_of_rho / matter_vars.rho; data_t rho_conformal = matter_vars.rho / pow(chi_regularised, 1.5); + data_t P_conformal = P_of_rho / pow(chi_regularised, 1.5); matter_vars.D = rho_conformal * sqrt(WW); - matter_vars.tau = rho_conformal * hh * WW - P_of_rho - matter_vars.D; + matter_vars.tau = rho_conformal * hh * WW - P_conformal - matter_vars.D; FOR(i) { diff --git a/Examples/Fluid_Kerr_merged/Sources.hpp b/Examples/Fluid_Kerr_merged/Sources.hpp index 26250e586..c69c10c46 100644 --- a/Examples/Fluid_Kerr_merged/Sources.hpp +++ b/Examples/Fluid_Kerr_merged/Sources.hpp @@ -29,6 +29,7 @@ vars_t compute_source(const data_t P_of_rho, const vars_t &vars, data_t hh = 1. + vars.eps + P_of_rho / vars.rho; data_t rho_conformal = vars.rho / pow(chi_regularised, 1.5); + data_t P_conformal = P_of_rho / pow(chi_regularised, 1.5); out.D = 0.; FOR(j) @@ -44,7 +45,7 @@ vars_t compute_source(const data_t P_of_rho, const vars_t &vars, vars.h[i][k] * d1.chi[j] / chi_regularised) * (rho_conformal * hh * WW * vars.vi[i] * vars.vi[k] / chi_regularised + - P_of_rho * h_UU[i][k]); + P_conformal * h_UU[i][k]); } } } @@ -54,7 +55,7 @@ vars_t compute_source(const data_t P_of_rho, const vars_t &vars, out.tau += vars.lapse * (vars.A[i][j] + vars.h[i][j] / 3. * vars.K) * (rho_conformal * hh * WW * vars.vi[i] * vars.vi[j] / chi_regularised + - P_of_rho * h_UU[i][j]) - + P_conformal * h_UU[i][j]) - vars.chi * h_UU[i][j] * vars.Sj[i] * d1.lapse[j]; }