Open biboyd opened 7 months ago
do you see the same differences if you run with maestro.evolve_base_state = 0
?
Yes, the behavior is the same
okay. I am not sure if this is a bug or a feature ;) The way these different reconstruction methods work is written out here: https://amrex-astro.github.io/MAESTROeX/docs/pert.html
we should see if the code agrees with what is written there.
it would also be interesting to try to reproduce this in the old Fortran MAESTRO. Assuming we can still get it to compile...
Was able to get the last MAESTRO release to compile, looks better though you can still see some differences
I looked over all the code in DensityAdvance, MakeRhoXFlux, MaestroRhoHT.cpp
, and then ModifyScalForce
and MakeEdgeScal
and compared to the old Maestro and I don't see any obvious issues.
I think the next step would be to run the same problem in each for one step and have the codes print out the interface states so we can compare.
I setup a small version of this problem (48 x 80 cells) and walked through the density advance, printing out the components that go into the flux construction in both MAESTRO and MAESTROeX for a single zone. I ran without enthalpy (use_tfromp=1) and with base state evolution disabled.
Looking at the results of modify_scal_force, make_edge_scal, and make_rhoxflux, they all seem consistent for species_pred_type = 1 and species_pred_type = 3.
I still need to dig into the update_scal stuff.
Here's a comparison with burning disabled using 144 x 240 zones and species_pred_type = 3
MAESTRO is left, MAESTROeX is right
what's interesting is that I can get old (Fortran) MAESTRO to abort in the first step if I try running with species_pred_type = 2
with this inputs file:
and a slight change to the perturbation:
$ git diff .
diff --git a/Exec/TEST_PROBLEMS/reacting_bubble/init_perturb.f90 b/Exec/TEST_PROBLEMS/reacting_bubble/init_perturb.f90
index 04c68ce5..bd14a8de 100644
--- a/Exec/TEST_PROBLEMS/reacting_bubble/init_perturb.f90
+++ b/Exec/TEST_PROBLEMS/reacting_bubble/init_perturb.f90
@@ -69,8 +69,14 @@ contains
eos_state%T = temp
eos_state%p = p0_init
eos_state%rho = s0_init(rho_comp)
- eos_state%xn(:) = s0_init(spec_comp:spec_comp+nspec-1)/s0_init(rho_comp)
+ if (r1 < 1.0 .or. r2 < 1.0 .or. r3 < 1.0) then
+ eos_state%xn(1) = 0.0d0
+ eos_state%xn(2) = 0.7d0
+ eos_state%xn(3) = 0.3d0
+ else
+ eos_state%xn(:) = s0_init(spec_comp:spec_comp+nspec-1)/s0_init(rho_comp)
+ endif
call eos(eos_input_tp, eos_state)
dens_pert = eos_state%rho
but MAESTROeX runs...
okay... I think it is an averaging thing
Here's old Fortran MAESTRO running inputs_2d_C
with species_pred_type = 3
with 2 different resolutions.
On the left is 144 x 240 zones on the right is the default 384 x 640 zones.
what I think we are seeing is that this problem has very strong, local perturbations, which affects the average base state more at coarse resolutions. And the different pred types interact with the averaging in different ways.
The species prediction (set by
species_pred_type
) type2
and3
differ in behavior from type1
in a peculiar way. This can be seen in many problems but here is the difference intest_problems/reacting_bubble
.Problem
To recreate compile and run:
Output
Slices of
('boxlib', 'tpert')
.species_pred_type=1
on the left,2
in the center, and3
on the right.