From 8bf9585e365e4f1dc4b65ece0ff0ff17572a590b Mon Sep 17 00:00:00 2001 From: cgilet Date: Thu, 20 Jun 2024 14:41:51 -0400 Subject: [PATCH] Have code determine when to use InitialPressureProject --- src/incflo.H | 1 - src/incflo.cpp | 4 +++- src/setup/init.cpp | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/incflo.H b/src/incflo.H index 8863c4d5..80bec610 100644 --- a/src/incflo.H +++ b/src/incflo.H @@ -361,7 +361,6 @@ private: // Initial projection / iterations bool m_do_initial_proj = true; - bool m_do_initial_pressure_proj = false; int m_initial_iterations = 3; // Use Boussinesq approximation for buoyancy? diff --git a/src/incflo.cpp b/src/incflo.cpp index 33823686..fc1c93f3 100644 --- a/src/incflo.cpp +++ b/src/incflo.cpp @@ -76,7 +76,9 @@ void incflo::InitData () if (m_do_initial_proj) { InitialProjection(); - if (m_do_initial_pressure_proj) { + if (!m_constant_density + && std::abs(m_gravity.sum()) > std::numeric_limits::epsilon() + && !(m_ro_0 > std::numeric_limits::epsilon()) ) { InitialPressureProjection(); } } diff --git a/src/setup/init.cpp b/src/setup/init.cpp index 519477ca..686c05e1 100644 --- a/src/setup/init.cpp +++ b/src/setup/init.cpp @@ -38,7 +38,6 @@ void incflo::ReadParameters () pp.query("steady_state_tol", m_steady_state_tol); pp.query("initial_iterations", m_initial_iterations); pp.query("do_initial_proj", m_do_initial_proj); - pp.query("do_initial_pressure_proj", m_do_initial_pressure_proj); pp.query("fixed_dt", m_fixed_dt); pp.query("cfl", m_cfl);