Skip to content

Commit

Permalink
make n14 optional for detonation setup (#2656)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 authored Nov 22, 2023
1 parent b720d68 commit bc5fe8d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Exec/science/Detonation/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void problem_initialize ()
problem::in14 = network_spec_index("nitrogen-14");
problem::io16 = network_spec_index("oxygen-16");

if (problem::ihe4 < 0 || problem::ic12 < 0 || problem::in14 < 0 || problem::io16 < 0) {
if (problem::ihe4 < 0 || problem::ic12 < 0 || problem::io16 < 0) {
amrex::Error("ERROR: species indices not found");
}

Expand Down Expand Up @@ -51,9 +51,15 @@ void problem_initialize ()
}

problem::xn[problem::ic12] = amrex::max(problem::cfrac, problem::smallx);
problem::xn[problem::in14] = amrex::max(problem::nfrac, problem::smallx);
problem::xn[problem::io16] = amrex::max(problem::ofrac, problem::smallx);
problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::nfrac - problem::ofrac - (NumSpec - 3) * problem::smallx;

if (problem::in14 >= 0) {
problem::xn[problem::in14] = amrex::max(problem::nfrac, problem::smallx);
problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::nfrac - problem::ofrac - (NumSpec - 3) * problem::smallx;
}
else {
problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::ofrac - (NumSpec - 2) * problem::smallx;
}

// Set the ambient material

Expand Down

0 comments on commit bc5fe8d

Please sign in to comment.