Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the subchandra second pert #2553

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Exec/science/subchandra/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void problem_initialize_state_data (int i, int j, int k,

// add a perturbation at the north pole

Real t0 = state(i,j,k,UTEMP);
Real T0 = state(i,j,k,UTEMP);

// perturbation is on the vertical-axis

Expand All @@ -92,8 +92,10 @@ void problem_initialize_state_data (int i, int j, int k,
// convolve the temperature perturbation with the amount of He
Real X_he = burn_state.xn[problem::ihe4];

state(i,j,k,UTEMP) = t0 * (1.0_rt + X_he * problem::pert_temp_factor *
(0.150e0_rt * (1.0_rt + std::tanh(2.0_rt - r1))));
Real Tpert = T0 * (1.0_rt + X_he * problem::pert_temp_factor *
(0.150e0_rt * (1.0_rt + std::tanh(2.0_rt - r1))));

Real dT = Tpert - T0;


#if AMREX_SPACEDIM == 3
Expand All @@ -120,14 +122,17 @@ void problem_initialize_state_data (int i, int j, int k,

// we are assuming here that the 2 perturbations don't overlap

state(i,j,k,UTEMP) = t0 * (1.0_rt + X_he * problem::second_pert_temp_factor *
(0.150e0_rt * (1.0_rt + std::tanh(2.0_rt - r2))));
Tpert = T0 * (1.0_rt + X_he * problem::second_pert_temp_factor *
(0.150e0_rt * (1.0_rt + std::tanh(2.0_rt - r2))));

dT += (Tpert - T0);

}
#endif

burn_state.rho = state(i,j,k,URHO);
burn_state.T = state(i,j,k,UTEMP);
burn_state.T = T0 + dT;

// we don't need to refill xn, since it still holds unchanged from above

eos(eos_input_rt, burn_state);
Expand Down