From c8ac6fd7c42f74a3dbe69d0893380368cfa6284a Mon Sep 17 00:00:00 2001 From: Piyush Sharda Date: Fri, 4 Aug 2023 16:34:19 +0800 Subject: [PATCH] make Gconst a runtime parameter with a default value --- src/RadhydroSimulation.hpp | 8 +++++++- tests/StarCluster.in | 2 ++ tests/StarCluster_AMR.in | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/RadhydroSimulation.hpp b/src/RadhydroSimulation.hpp index 319357724..0b6311229 100644 --- a/src/RadhydroSimulation.hpp +++ b/src/RadhydroSimulation.hpp @@ -123,7 +123,7 @@ template class RadhydroSimulation : public AMRSimulation &BCs_cc, amrex::Vector &BCs_fc) : AMRSimulation(BCs_cc, BCs_fc) @@ -316,6 +316,12 @@ template void RadhydroSimulation::readParmParse( hpp.query("artificial_viscosity_coefficient", artificialViscosityK_); } + // set gravity runtime parameter + { + amrex::ParmParse hpp("gravity"); + hpp.query("Gconst", Gconst_); + } + // set cooling runtime parameters { amrex::ParmParse hpp("cooling"); diff --git a/tests/StarCluster.in b/tests/StarCluster.in index bb7ea76a8..dbd1e3121 100644 --- a/tests/StarCluster.in +++ b/tests/StarCluster.in @@ -25,6 +25,8 @@ cfl = 0.2 max_timesteps = 300 stop_time = 0.5 # t_ff = 0.55 +gravity.Gconst = 1.0 #gravitational constant + do_reflux = 1 do_subcycle = 0 diff --git a/tests/StarCluster_AMR.in b/tests/StarCluster_AMR.in index 6e8134f23..42cb9fb39 100644 --- a/tests/StarCluster_AMR.in +++ b/tests/StarCluster_AMR.in @@ -25,6 +25,8 @@ cfl = 0.2 max_timesteps = 10000 stop_time = 0.5 # t_ff = 0.55 +gravity.Gconst = 1.0 #gravitational constant + do_reflux = 1 do_subcycle = 0