Skip to content

Commit

Permalink
runs but wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
chengcli committed Jul 22, 2024
1 parent 2770f5f commit 53f8e27
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
14 changes: 14 additions & 0 deletions examples/2019-Li-snap/straka-thermo.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion examples/2019-Li-snap/straka.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions examples/2019-Li-snap/straka.inp
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ tasklist = TimeIntegratorTaskList

<output1>
file_type = hst # History data dump
dt = 300. # time increment between outputs
dt = 3. # time increment between outputs

<output2>
file_type = netcdf # Binary data dump
variable = prim # variables to be output
dt = 300. # time increment between outputs
dt = 3. # time increment between outputs

<output3>
file_type = netcdf
variable = uov
dt = 300.
dt = 3.

<output4>
file_type = netcdf
variable = diag
dt = 300.
dt = 3.

<time>
cfl_number = 0.9 # The Courant, Friedrichs, & Lewy (CFL) Number
Expand Down Expand Up @@ -57,9 +57,6 @@ ox3_bc = periodic # outer-X3 boundary flag
grav_acc1 = -9.8
gamma = 1.4 # gamma = C_p/C_v

<thermodynamics>
Rd = 287.

<problem>
dT = -15.
xc = 0.
Expand All @@ -70,4 +67,6 @@ p0 = 1.E5
Ts = 300.
K = 75.

thermodynamics_config = straka-thermo.yaml

diagnostics = div,curl
2 changes: 1 addition & 1 deletion src/snap/thermodynamics/thermodynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Thermodynamics const* Thermodynamics::InitFromAthenaInput(ParameterInput* pin) {
Application::Logger app("snap");
app->Log("Initialize Thermodynamics");

return fromYAMLInput(pin->GetString("thermodynamics", input_key));
return fromYAMLInput(pin->GetString("problem", input_key));
}

void Thermodynamics::Destroy() {
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ endif()

if (${NVAPOR} EQUAL 0)
if (NOT HYDROSTATIC OR NOT DEFINED HYDROSTATIC)
setup_test(test_convective_adjustment)
#setup_test(test_convective_adjustment)
endif()
endif()

Expand Down

0 comments on commit 53f8e27

Please sign in to comment.