Skip to content

Commit 7652796

Browse files
authored
Fix analytic Jacobian in ignition_chamulak (#1294)
The conversion back to d/dY form was missing the multiplication by A for the d/dX terms. Also, the J(ash, net_ienuc) term was missing.
1 parent 9af506c commit 7652796

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

networks/ignition_chamulak/actual_rhs.H

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,13 @@ void actual_jac (burn_t& state, MatrixType& jac)
184184
(dens * rate * xc12tmp * xc12tmp * dsc1212dt +
185185
dens * sc1212 * xc12tmp * xc12tmp * dratedt);
186186

187+
jac(Ash, net_ienuc) = -jac(C12, net_ienuc);
188+
187189
// Convert back to molar form
188190

189191
for (int i = 1; i <= neqs; ++i) {
190192
for (int j = 1; j <= NumSpec; ++j) {
193+
jac(i,j) *= aion[j-1];
191194
jac(j,i) *= aion_inv[j-1];
192195
}
193196
}
@@ -207,6 +210,7 @@ void actual_jac (burn_t& state, MatrixType& jac)
207210
// Convert to d / de
208211

209212
jac(C12, net_ienuc) = temperature_to_energy_jacobian(state, jac(C12, net_ienuc));
213+
jac(Ash, net_ienuc) = temperature_to_energy_jacobian(state, jac(Ash, net_ienuc));
210214
jac(net_ienuc, net_ienuc) = temperature_to_energy_jacobian(state, jac(net_ienuc, net_ienuc));
211215
}
212216

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AMReX (23.07-24-g01b750d909b0) initialized
1+
AMReX (23.07-7-g88f03408f18a-dirty) initialized
22
starting the single zone burn...
33
Maximum Time (s): 0.01585
44
State Density (g/cm^3): 1000000000
@@ -12,21 +12,21 @@ RHS at t = 0
1212
ash 0.01230280576
1313
------------------------------------
1414
successful? 1
15-
- Hnuc = 5.162791463e+17
16-
- added e = 8.183024469e+15
17-
- final T = 1424869952
15+
- Hnuc = 5.27728638e+17
16+
- added e = 8.364498912e+15
17+
- final T = 1433703794
1818
------------------------------------
1919
e initial = 1.253426044e+18
20-
e final = 1.261609069e+18
20+
e final = 1.261790543e+18
2121
------------------------------------
2222
new mass fractions:
23-
C12 0.966535706
24-
O16 1.000003322e-30
25-
ash 0.033464294
23+
C12 0.9657902582
24+
O16 1e-30
25+
ash 0.03420974184
2626
------------------------------------
2727
species creation rates:
28-
omegadot(C12): -2.111311924
29-
omegadot(O16): 2.096110914e-34
30-
omegadot(ash): 2.111311924
31-
number of steps taken: 384
32-
AMReX (23.07-24-g01b750d909b0) finalized
28+
omegadot(C12): -2.158343334
29+
omegadot(O16): 3.315374916e-44
30+
omegadot(ash): 2.158343334
31+
number of steps taken: 381
32+
AMReX (23.07-7-g88f03408f18a-dirty) finalized

unit_test/test_rhs/ci-benchmarks/chamulak.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
Xold_oxygen-16 0.05 0.4
1111
Xold_ash 0.05 0.4
1212
Edot 9.3682885505e-53 6.584051211e+27
13-
J_carbon-12_carbon-12 -5030352847.9 -3.2218541118e-70
13+
J_carbon-12_carbon-12 -60364234175 -3.8662249342e-69
1414
J_oxygen-16_carbon-12 0 0
15-
J_ash_carbon-12 2.1479027412e-70 3353568565.3
16-
J_E_carbon-12 9.3682885505e-52 1.4631224913e+28
15+
J_ash_carbon-12 2.5774832894e-69 40242822783
16+
J_E_carbon-12 1.1241946261e-50 1.7557469896e+29
1717
J_carbon-12_oxygen-16 0 0
1818
J_oxygen-16_oxygen-16 0 0
1919
J_ash_oxygen-16 0 0
@@ -24,6 +24,6 @@
2424
J_E_ash -0 -0
2525
J_carbon-12_E -4.4154660816e-08 -7.3754668622e-85
2626
J_oxygen-16_E 0 0
27-
J_ash_E 0 0
27+
J_ash_E 4.9169779082e-85 2.9436440544e-08
2828
J_E_E 2.1445881583e-66 1.2842772523e+11
2929

0 commit comments

Comments
 (0)