Skip to content

Commit

Permalink
adjust ambient comp. and ensure eos_state.xn sums to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
brady-ryan committed Aug 1, 2024
1 parent 746ab48 commit 3f04cd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 1 addition & 6 deletions Exec/science/gradient_detonation/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void problem_initialize ()

problem::ambient_dens = problem::dens;
for (int n = 0; n < NumSpec; n++) {
problem::ambient_comp[n] = problem::xn_core[n] + problem::xn_env[n];
problem::ambient_comp[n] = problem::xn_env[n];
}

eos_t eos_state;
Expand All @@ -101,11 +101,6 @@ void problem_initialize ()
eos_state.xn[n] = problem::ambient_comp[n];
}

#ifdef AUX_THERMO
// set the aux quantities -- we need to do this if we are using the NSE network
set_aux_comp_from_X(eos_state);
#endif

eos_state.T = problem::T_l;

eos(eos_input_rt, eos_state);
Expand Down
10 changes: 10 additions & 0 deletions Exec/science/gradient_detonation/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ void problem_initialize_state_data (int i, int j, int k,
eos_state.xn[n] = problem::xn_core[n] + problem::xn_env[n];
}

// normalize eos_state.xn
Real sum_xn = 0.0_rt;
for (int n = 0; n < NumSpec; n++) {
sum_xn += eos_state.xn[n]
}

for (int n = 0; n < NumSpec; n++) {
eos_state.xn[n] /= sum_xn;
}

eos(eos_input_rt, eos_state);

state(i,j,k,UMX) = state(i,j,k,URHO) * (problem::vel - 2 * problem::vel * (1.0_rt - sigma));
Expand Down

0 comments on commit 3f04cd1

Please sign in to comment.