-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add basic operator split capability in ReactingFlow #291
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…eps. building not tested
Since temperature equation is rho * Cp * DT/Dt = rhs, in the operator split method, the temperatureSubstep method must use dT = dt * rhs / (rho * Cp), where rhs contains the local terms that have been split out (here just rxn term from heatOfFormation). After this fix, using bdfOrder = 1 but otherwise no change to test/inputs/input.reactSingleRx.ini produces a good match to previous results.
Current implementation does not support higher order schemes, so be sure user doesn't run that way. NB: Required adding the order to the temporalSchemeCoefficients struct b/c otherwise the model classes (in particular ReactingFlow here) only know the coefficients, not the order. The coefficients cannot be used for this check b/c the first step is always a BDF1 step.
so that we can choose not to use it. Previous implementation split the source terms even when using a single substep.
Since the species ParGridFunction objects (specifically, Yn_gf_ and Yn_next_gf_) are sized for a single species, but Vector objects (Yn_ and Yn_next_) hold all species, the previous species update in the operator split scheme was broken. In particular, the sequence Yn_next_gf_.SetFromTrueDofs(Yn_); Yn_next_gf_.GetTrueDofs(Yn_next_); does behave as intended, meaning that it does not overwrite all entries of Yn_next_ with the values in Yn_, because Yn_next_gf_ is only sized for 1 species. This commit fixes this problem by avoiding use of the species ParGridFunction objects during the operation.
And move unsteady thermo pressure term into the operator split piece.
trevilo
commented
Jul 23, 2024
trevilo
commented
Jul 23, 2024
trevilo
commented
Jul 23, 2024
trevilo
commented
Jul 23, 2024
trevilo
commented
Jul 23, 2024
trevilo
commented
Jul 23, 2024
trevilo
commented
Jul 23, 2024
trevilo
commented
Jul 23, 2024
Mainly updating comments and deleting dead code that was commented out.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an operator splitting implementation intended to support stiff reactions. Specifically, we use Lie splitting within
ReactingFlow
. The 'spatial' terms, specifically advection-diffusion, are discretized with backward Euler. The 'reaction' terms, including the source term in the temperature equation due to chemical reactions, are discretized with forward Euler at a user-specified subdivision of the advection-diffusion time step. This allows the time step seen by the chemistry to be set arbitrarily small, enabling stable integration of stiff reactions, without affecting the time step of the advection-diffusion component of the system.