From 53f8e27a88dbf9d895c59127543efd9572415fbf Mon Sep 17 00:00:00 2001 From: mac/cli Date: Sun, 21 Jul 2024 21:34:54 -0400 Subject: [PATCH] runs but wrong --- examples/2019-Li-snap/straka-thermo.yaml | 14 ++++++++++++++ examples/2019-Li-snap/straka.cpp | 4 +++- examples/2019-Li-snap/straka.inp | 13 ++++++------- src/snap/thermodynamics/thermodynamics.cpp | 2 +- tests/CMakeLists.txt | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 examples/2019-Li-snap/straka-thermo.yaml diff --git a/examples/2019-Li-snap/straka-thermo.yaml b/examples/2019-Li-snap/straka-thermo.yaml new file mode 100644 index 00000000..35e97ab5 --- /dev/null +++ b/examples/2019-Li-snap/straka-thermo.yaml @@ -0,0 +1,14 @@ + +phases: + - name: gas + thermo: ideal-moist + species: [atm] + kinetics: condensation + reactions: none + +species: + - name: atm + composition: {O: 0.42, N: 1.56, Ar: 0.01} + thermo: + model: constant-cp + cp0: 29.1 J/mol/K diff --git a/examples/2019-Li-snap/straka.cpp b/examples/2019-Li-snap/straka.cpp index 1f85e659..7ddceafa 100644 --- a/examples/2019-Li-snap/straka.cpp +++ b/examples/2019-Li-snap/straka.cpp @@ -191,12 +191,14 @@ void Diffusion(MeshBlock *pmb, Real const time, Real const dt, // first and then it instantiates all MeshBlocks inside it. Therefore, this // subroutine runs before any MeshBlock. void Mesh::InitUserMeshData(ParameterInput *pin) { + auto pthermo = Thermodynamics::GetInstance(); + // The program specific forcing parameters are set here. // They come from the input file, which is parsed by the ParameterInput class Real gamma = pin->GetReal("hydro", "gamma"); K = pin->GetReal("problem", "K"); p0 = pin->GetReal("problem", "p0"); - Rd = pin->GetReal("thermodynamics", "Rd"); + Rd = pthermo->GetRd(); cp = gamma / (gamma - 1.) * Rd; // This line code enrolls the forcing function we wrote in diff --git a/examples/2019-Li-snap/straka.inp b/examples/2019-Li-snap/straka.inp index c908b6f8..65be8dc1 100644 --- a/examples/2019-Li-snap/straka.inp +++ b/examples/2019-Li-snap/straka.inp @@ -9,22 +9,22 @@ tasklist = TimeIntegratorTaskList file_type = hst # History data dump -dt = 300. # time increment between outputs +dt = 3. # time increment between outputs file_type = netcdf # Binary data dump variable = prim # variables to be output -dt = 300. # time increment between outputs +dt = 3. # time increment between outputs file_type = netcdf variable = uov -dt = 300. +dt = 3. file_type = netcdf variable = diag -dt = 300. +dt = 3.