Skip to content

Commit

Permalink
Fixes that allow wdmerger to run with the NSE table
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz committed Sep 8, 2023
1 parent f6adf9d commit ed2353d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
14 changes: 14 additions & 0 deletions Exec/science/wdmerger/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void problem_initialize_state_data (int i, int j, int k,
for (int n = 0; n < NumSpec; ++n) {
zone_state.xn[n] = interpolate_3d(pos, dx, model::ispec + n, problem::nsub, 0);
}
#ifdef AUX_THERMO
set_aux_comp_from_X(zone_state);
#endif

eos(eos_input_rt, zone_state);

Expand All @@ -79,6 +82,9 @@ void problem_initialize_state_data (int i, int j, int k,
for (int n = 0; n < NumSpec; ++n) {
zone_state.xn[n] = interpolate_3d(pos, dx, model::ispec + n, problem::nsub, 1);
}
#ifdef AUX_THERMO
set_aux_comp_from_X(zone_state);
#endif

eos(eos_input_rt, zone_state);

Expand All @@ -91,6 +97,9 @@ void problem_initialize_state_data (int i, int j, int k,
for (int n = 0; n < NumSpec; ++n) {
zone_state.xn[n] = ambient::ambient_state[UFS+n] / ambient::ambient_state[URHO];
}
#ifdef AUX_THERMO
set_aux_comp_from_X(zone_state);
#endif

}

Expand All @@ -101,6 +110,11 @@ void problem_initialize_state_data (int i, int j, int k,
for (int n = 0; n < NumSpec; ++n) {
state(i,j,k,UFS+n) = zone_state.rho * zone_state.xn[n];
}
#ifdef NAUX_NET > 0
for (int n = 0; n < NumAux; ++n) {
state(i,j,k,UFX+n) = zone_state.rho * zone_state.aux[n];
}
#endif

// Set the velocities in each direction to zero by default.

Expand Down
9 changes: 5 additions & 4 deletions Exec/science/wdmerger/wdmerger_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ void set_small ()
for (int n = 0; n < NumSpec; ++n) {
eos_state.xn[n] = ambient::ambient_state[UFS+n] / ambient::ambient_state[URHO];
}
#ifdef AUX_THERMO
set_aux_comp_from_X(eos_state);
#endif

eos(eos_input_rt, eos_state);

Expand Down Expand Up @@ -536,10 +539,8 @@ void binary_setup ()
for (int n = 0; n < NumSpec; ++n) {
eos_state.xn[n] = ambient::ambient_state[UFS+n] / ambient::ambient_state[URHO];
}
#if NAUX_NET > 0
for (int n = 0; n < NumAux; ++n) {
eos_state.aux[n] = ambient::ambient_state[UFX+n] / ambient::ambient_state[URHO];
}
#ifdef AUX_THERMO
set_aux_comp_from_X(eos_state);
#endif

eos(eos_input_rt, eos_state);
Expand Down
6 changes: 6 additions & 0 deletions Util/model_parser_cxx/model_parser.H
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ void establish_hse (Real& mass_want, Real& central_density_want, Real& radius,
for (int n = 0; n < NumSpec; ++n) {
eos_state.xn[n] = model.state(0, model::ispec + n);
}
#ifdef AUX_THERMO
set_aux_comp_from_X(eos_state);
#endif

eos(eos_input_rt, eos_state);

Expand Down Expand Up @@ -346,6 +349,9 @@ void establish_hse (Real& mass_want, Real& central_density_want, Real& radius,
eos_state.xn[n] = model.state(i, model::ispec + n);
}
}
#ifdef AUX_THERMO
set_aux_comp_from_X(eos_state);
#endif

Real g = -C::Gconst * M_enclosed / (std::pow(rl, 2));

Expand Down

0 comments on commit ed2353d

Please sign in to comment.