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

Soret isothermal wall fix #391

Open
wants to merge 15 commits into
base: development
Choose a base branch
from

Conversation

ThomasHowarth
Copy link
Contributor

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.

@drummerdoc
Copy link

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));
Copy link
Contributor Author

@ThomasHowarth ThomasHowarth Jun 24, 2024

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on the punt. :)

@baperry2 baperry2 self-requested a review June 24, 2024 22:26
Copy link
Collaborator

@baperry2 baperry2 left a 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;
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wall boundary conditions (e.g. NoSlipWallIsothermal) do lead to wrong behaviour using the soret effect.
3 participants