Repository navigation
Add a mean gas temperature source (thermostat) beside the mean pressure gradient - #2182
sbryngelson wants to merge 1 commit into
Conversation
|
Claude Code Review Head SHA: 8c43223 Files changed:
Findings: |
…re gradient mean_qdot adds a uniform heat source per volume to the energy equation. mean_temp with mean_temp_gain holds the mass-averaged temperature T_b = sum(rho T dV)/sum(rho dV) with the same integral controller as mean_mflux, scaled by the mean rho*c_v; it acts on T, so gas heat release lowers the source needed. Chemistry only. The two mean sources share the once-per-step reduction, the controller update, the history-file open and the validator gain check; mean_temp.dat logs t, T_b, the mixing-cup T, qdot and the volume. Immersed boundaries are rejected by the validator.
8c43223 to
ff25f33
Compare
|
NVIDIA + NVHPC hand test: wingtip (Georgia Tech), NVIDIA A100 80GB PCIe (compute capability 8.0), nvfortran 25.11 (NVHPC) with OpenACC,
AMD GPU case optimization: Tuolumne (LLNL), AMD Instinct MI300A (gfx942), amdflang (AFAR 24.3.0, LLVMFlang 24) with OpenMP offload. NVHPC case-optimization results follow when they finish. Posted with Claude Code (AI). Case optimization on NVIDIA + NVHPC (wingtip, A100, nvfortran 25.11, OpenACC): Case optimization on NVIDIA + NVHPC with OpenMP offload (wingtip, A100, nvfortran 25.11), |
Lines of Code
|
Adds a mean gas temperature source (thermostat) beside the mean pressure gradient, for chemistry flows in a periodic domain.
Stacked on #2177 (the mean pressure gradient and its controller). Only the top commit is this PR; I will rebase once #2177 merges.
mean_qdotmean_tempT_b*; enables the controllermean_temp_gainG, required withmean_temp,0 < G < 4/3mean_qdotis added to the energy equation. Withmean_tempset, the source is updated once per step from the mass-averaged temperatureT_b = sum(rho T dV)/sum(rho dV),qdot^{n+1} = qdot^n + (G <rho c_v>/dt)(T_b* - 2 T_b^n + T_b^{n-1}),the same integral controller as
mean_mflux, scaled by the volume-meanrho c_v. It acts on the temperature, so gas heat release lowers the source needed and the controller holdsT_b*net of chemistry (qdotcan become negative).mean_temp.datlogst,T_b, the mixing-cup temperature,qdotand the volume. Chemistry only; Cartesian and periodic in every active direction; immersed boundaries are rejected by the validator (same reason as #2177).Shared code
The two mean sources share the once-per-step volume reduction (one MPI allreduce for both), the controller update (
s_mean_controller), the history-file open (s_open_history) and the validator gain check, so the mean pressure gradient is now a call into the same helper rather than its own copy.Verification
GPU, current master plus #2177 plus this change:
Chemistrysubset (24 tests) passes.1D -> Chemistry -> Perfect Reactor -> Thermostat -> Heat Sourceand... -> Temperature Controller(the periodic autoigniting H2/O2 reactor at 1600 K withmean_qdot = 1e9 W/m^3, and withmean_temp = 1250 K,G = 0.5). Against the unforced reactor the initial state is identical and the final state moves the right way: the heat source raises the final pressure by 3% and the radical species by about 30%; the controller cools toward 1250 K, lowering the final pressure by 22% and the radicals by about 99%.--gpu mp, compile-only:simulationbuilds clean.Not in this PR: the self-similar variant for thermally developed wall-bounded flow (
mean_temp_wall), which needs conductivity and an x stencil; I will open it separately.This PR was made with Claude Code (AI).