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

DivU constraint with arbitrary sources #428

Merged
merged 9 commits into from
Oct 22, 2024

Conversation

dmontgomeryNREL
Copy link
Contributor

This PR updates the divu constraint to be compatible with arbitrary source terms. This is necessary for system closure in any model that introduces external sources on density (e.g. Spray). This should be consistent with the user defined sources proposed in PR #427.

@dmontgomeryNREL
Copy link
Contributor Author

After further review, it appears that the current divu constraint works for arbitrary source terms. I restored the code from this PR to the most recent commit in development, but added some additional clarification in the Docs derivation.

@baperry2
Copy link
Collaborator

@dmontgomeryNREL can you add a comment in the compute_divu source code with a brief explanation as well?

@drummerdoc - here is the derivation from @dmontgomeryNREL and I that supports this, can you take a quick look and make sure you also agree because it's an important point.

Screenshot 2024-10-21 at 1 06 40 PM
Screenshot 2024-10-21 at 1 06 48 PM
Screenshot 2024-10-21 at 1 06 53 PM

@dmontgomeryNREL
Copy link
Contributor Author

@dmontgomeryNREL can you add a comment in the compute_divu source code with a brief explanation as well?
Done!

@drummerdoc
Copy link

drummerdoc commented Oct 21, 2024

In (23) above, Ym is the mass fraction of the local gas (same as the Ym in (32)), correct? Note that this says that mass is added at the local composition. Where do you account for mass being added at a different composition (like an evaporating fuel) - if that's even possible.... taking a minute to wrap my head around this.

@baperry2
Copy link
Collaborator

$Y_m$ is the local composition. Note Equation 23 is just a mathematical rearrangement using the product rule.

The physical meaning is more apparent in Equation 24, which is the complete equation for $DY_m/Dt$. That equation has two source terms that give appropriate behavior for the affect on $Y_m$: \dot{S}_{\rho Y_m} - Y_m\dot{S}_{\rho}

Consider an H2O drop evaporating into pure N2, so $Y_{N2} =1$, $Y_{H2O} = 0$, and \dot{S}_{\rho Y_N2} = 0 and \dot{S}_{\rho Y_H2O} = \dot{S}_{\rho}. For N2, the first term is 0 so the mass fraction is decreasing due to H2O evaporating. For H2O, the second term is 0 so the mass fraction is increasing.

@drummerdoc
Copy link

The subtlety is the blending that occurs between the ambient composition and that of the source, yet the sum of the mass fractions has to remain 1. In chemical reactions, a preferential loss of a given species occurs while respecting a conservation of atoms, so nothing really vanishes or appears, just switches bonds. Here, like at an inflow boundary, we are adding specific atoms, and then we re-normalize so that the sum of the new Ym's again equal 1. The head-hurting part is how to do that consistently as a volumetric source and make sure that when we get to the end of the time step that you have properly accounted for the injection of all the added atoms. Maybe there's nothing weird here, but I can certainly imagine some sanity checks to ensure detailed conservation is being satisfied properly. Let's try to add something like that in zero or one dimension as a regression test - maybe as a later PR.

@baperry2
Copy link
Collaborator

I think the bookkeeping should all be fine because we do things in terms sources of rhoYs for the actual effect on the transported species. In testing this PR out I didn't see any issues with species conservation, just stuff relating to divu as described in #429.

So I think this PR is good to go, although we may need to revisit some aspects.

@baperry2 baperry2 merged commit aebd221 into AMReX-Combustion:development Oct 22, 2024
25 checks passed
@dmontgomeryNREL dmontgomeryNREL deleted the divuConstraint branch October 23, 2024 03:50
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.

3 participants