Skip to content

Commit

Permalink
remove the normalization of rhoX in the SDC Newton solver (#2606)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Oct 7, 2023
1 parent fb5ad00 commit bbd6706
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
rho_e_sdc_source -6.1984065959e+22 6.3082607681e+21
Temp_sdc_source 0 0
rho_He4_sdc_source -543231.29383 78510.973919
rho_C12_sdc_source -1694.4890575 10.073635147
rho_C12_sdc_source -1694.4890575 10.073635142
rho_O16_sdc_source -0.0098093776861 7.1506350196e-06
rho_Fe56_sdc_source -5.4492579275e-05 7.8513247889e-06
pressure 1.4155320805e+22 4.2608130858e+22
kineng 3.2091279198e-13 1.6647276226e+18
kineng 5.228354476e-13 1.6647276226e+18
soundspeed 212069503.63 257404342.21
Gamma_1 1.5601126452 1.5885713572
MachNumber 5.3425093423e-18 0.0086982771596
MachNumber 6.8192135042e-18 0.0086982771596
entropy 348439780.9 349209883.57
magvort 0 0.00018541051835
magvort 6.3108872418e-30 0.00018541051835
divu -0.1163387912 0.55816306007
eint_E 4.5262357143e+16 6.9937847678e+16
eint_e 4.5262357143e+16 6.9937843728e+16
Expand All @@ -49,11 +49,11 @@
z_velocity 0 0
t_sound_t_enuc 0.00023710316663 0.0195732693
enuc 2.9131490847e+15 4.5102586513e+17
magvel 1.1329833044e-09 2067446.1363
radvel -0.00067837531107 2067446.1363
circvel 0 11.820124028
magmom 0.00056649165215 1.6422547233e+12
magvel 1.446147223e-09 2067446.1363
radvel -0.00067837194793 2067446.1363
circvel 0 11.820144682
magmom 0.00072307361144 1.6422547233e+12
angular_momentum_x -0 -0
angular_momentum_y 0 0
angular_momentum_z -1.2410862711e+14 1.2410862711e+14
angular_momentum_z -1.2410862734e+14 1.2410862747e+14

14 changes: 1 addition & 13 deletions Source/sdc/sdc_newton_solve.H
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,13 @@ f_sdc_jac(const Real dt_m,

burn_state.y[SEDEN] = 0.0_rt;

// normalize the species
auto sum_rhoX = 0.0_rt;
for (int n = 0; n < NumSpec; ++n) {
// TODO: this should have a rho weighting on small_x
burn_state.y[SFS+n] = amrex::max(network_rp::small_x, burn_state.y[SFS+n]);
sum_rhoX += burn_state.y[SFS+n];
}

for (int n = 0; n < NumSpec; ++n) {
burn_state.y[SFS+n] *= burn_state.y[SRHO] / sum_rhoX;
}

// compute the temperature -- this can be removed shortly, since
// we already do this in single_zone_react_source

burn_state.rho = burn_state.y[SRHO];
burn_state.T = T_old; // initial guess
for (int n = 0; n < NumSpec; ++n) {
burn_state.xn[n] = burn_state.y[SFS+n] / burn_state.y[SRHO];
burn_state.xn[n] = std::max(network_rp::small_x, std::min(1.0_rt, burn_state.y[SFS+n] / burn_state.y[SRHO]));
}
#if NAUX_NET > 0
amrex::Error("error: aux data not currently supported in true SDC");
Expand Down

0 comments on commit bbd6706

Please sign in to comment.