-
Notifications
You must be signed in to change notification settings - Fork 32
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
Soret isothermal wall fix #391
base: development
Are you sure you want to change the base?
Soret isothermal wall fix #391
Conversation
Is it possible to check in the test case? |
@@ -917,7 +993,7 @@ PeleLM::differentialDiffusionUpdate( | |||
GetVecOfConstPtrs( | |||
getDensityVect(AmrNewTime)), // this triggers proper scaling by density | |||
GetVecOfConstPtrs(getDiffusivityVect(AmrNewTime)), 0, bcRecSpec, | |||
NUM_SPECIES - NUM_IONS, 0, m_dt); | |||
NUM_SPECIES - NUM_IONS, 0, m_dt, GetVecOfConstPtrs(spec_boundary)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably isn't correct for the boundary MF to be compatible with EFIELD, any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having looked at the mechanisms with ions, the E species has a non-zero Soret coefficient (probably unsurprising), so this probably needs a little bit of thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to the idea of just putting an abort for the combination of Efield+Soret+Isothermal and punting on this until someone needs that particular corner case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on the punt. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThomasHowarth thanks for figuring this out and adding the test case. After this PR gets merged, I can submit a separate PR to have the case run in testing suite including a check on species balance.
I've been trying out the test case. I got rid of dt_shrink to take larger timesteps and make errors more visible. This fix does drastically reduce, but not quite eliminate, species imbalance errors tracked through temporals/tempSpecies
. The remaining imbalance is small enough that I'm not very concerned, but I also don't get why conservation isn't quite exact (it doesn't seem to improve by tightening the diffusion solve tolerances).
A couple comments:
- Can the same fix be applied to the EB version of diffuse_scalar? That wouldn't eliminate the issue of isothermal EBs, but would at least allow EB simulations with isothermal domain boundaries and Soret.
- It appears that the updated BCs are not applied when diffusion fluxes are computed to compute divu. This should not affect species conservation and with the chi correction on divu, it should not affect the results in the limit of converged SDC iterations.
auto eos = pele::physics::PhysicsType::eos(); | ||
amrex::Real Xt[NUM_SPECIES] = {0.0}; | ||
amrex::Real a = 0.0; | ||
amrex::Print() << prob_parm.fuelID << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove print statements
amrex::ParmParse pp_pele("peleLM"); | ||
std::string fuelName = ""; | ||
pp_pele.get("fuel_name", fuelName); | ||
amrex::Print() << "H2_ID 1 " << H2_ID << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print statement
This PR addresses #389 . Happy to discuss any of the implementation, and let me know if you can see spots for improvement/clarity. Currently, I've not implemented the necessary changes required for EB.