Add implicit-temperature Rosenbrock averaged-tendency mode#733
Draft
haakon-e wants to merge 1 commit into
Draft
Conversation
Member
Author
|
This change is part of the following stack:
Change managed by git-spice. |
This was referenced Jun 14, 2026
3877f3b to
060db2d
Compare
060db2d to
bc7f5f3
Compare
The species-only RosenbrockAverage advances the local temperature explicitly between substeps from the latent heat of the realized species increment, so the partial of the tendency with respect to T is outside the species Jacobian. The vapor -> latent-heat -> temperature -> saturation -> exchange-flux feedback is then operator-split and rings about the saturation limit at coarse substeps (decaying). Add RosenbrockAverageImplicitT for the 1M and 2M+P3 configurations, which promotes T into the implicitly-solved state. The state is augmented with T as a final component (MicroState1MT, dim 5; MicroState2MP3T, dim 9), and a joint species+temperature tendency appends the latent-heating rate dT/dt -- the rate form of the existing between-substep update, so an explicit integration of the augmented tendency reproduces the explicit-T trajectory. With T differentiated, the Jacobian gains the latent-heating row and the Clausius-Clapeyron column (the saturation-dependence of the relaxation rates), so the thermal feedback sits inside the same L-stable one-stage solve as the species exchange and the split ringing is removed; no separate between-substep T update is done. The dimension-generic Rosenbrock kernel is reused unchanged at N = 5 / 9. The temperature channel is always present in the channel mask (T is far above the near-empty threshold) and equilibration gives it its own ~250-scale row, so the species/temperature scale split stays conditioned in Float32. The existing modes are untouched. Relax the temperature argument of G_func_liquid / G_func_ice from a pinned element type to untyped so a dual temperature flows through the 1M deposition, sublimation and evaporation rates; the air-properties element type still keys the numerical guards, so concrete-temperature callers are unchanged.
bc7f5f3 to
258ece7
Compare
This file contains hidden or 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
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.
What this adds
This adds a Rosenbrock averaged-tendency mode that treats temperature implicitly, for both the 1-moment and 2-moment + P3 configurations. The species-only mode advances the local temperature explicitly between substeps from the latent heat of the realized increment, so the dependence of the tendency on temperature sits outside the species Jacobian and the vapor-to-latent-heat-to-temperature-to-saturation feedback is operator-split, which rings about the saturation limit at coarse substeps. Promoting temperature into the implicitly-solved state removes that splitting.
How
The state is augmented with temperature as a final component (a nine-component 2-moment + P3 state and a five-component 1-moment state), and a joint species-and-temperature tendency appends the latent-heating rate, which is the rate form of the existing between-substep temperature update, so an explicit integration of the augmented tendency reproduces the explicit-temperature trajectory. With temperature differentiated, the Jacobian gains the latent-heating row and the saturation-dependence (Clausius-Clapeyron) column, so the thermal feedback is solved inside the same L-stable one-stage step as the species exchange and no separate between-substep temperature update is done. The dimension-generic kernel is reused unchanged at the new state sizes. This also relaxes the temperature argument of the deposition, sublimation, and evaporation rate helpers (G_func_liquid and G_func_ice) so a dual temperature flows through them, with the air-properties element type still keying the guards, so concrete-temperature callers are unchanged. The existing modes are untouched.
Validation
Reproducing the operator-split ringing diagnostic, the implicit-temperature mode removes the sign-flip oscillation where the explicit-temperature mode rings, and it converges monotonically against a fine augmented-explicit reference for both schemes and both precisions. In an extreme large-substep cold-deposition case the explicit-temperature temperature diverges by hundreds of kelvin while the implicit-temperature temperature stays bounded. One honest limit: a single very large step still shows single-step linearization error, which is one-stage method truncation error rather than operator splitting, and is cured by more substeps.
Testing
New tests cover trajectory reproduction, convergence, ringing removal, degeneracy and finiteness, zero allocation, and JET, for both schemes. The existing test set passes unchanged, including the paths that exercise the relaxed temperature signatures.
Notes
Draft, top of the stack.