Repository navigation
Conversation
|
I checked the outlet changes on a straight duct and a converging-diverging nozzle, for air and for MDM using Peng–Robinson. These are fixed-wall flow cases. The translating bump used in #2943 served a different purpose: checking Galilean invariance. The table below records the initial version of this PR, before the later TurboRiemann and regression fixes. The latest results and CI status are in the update below.
The numbers are iterations to a log10 RMS density residual of −10. The ducts recover the prescribed pressure. The nozzle exits become supersonic, so the outlet then extrapolates the interior state rather than imposing 1000 Pa. This is not a general claim of faster convergence. The duct starts at Mach 0.3, with density and velocity specified at the inlet and an outlet pressure 5% below the initial pressure. The nozzle starts at Mach 0.9, with the same inlet type and an outlet target of 1000 Pa. Its throat/inlet area ratio is 0.8 and exit/throat ratio is 1.25. Both use first-order HLLC, implicit FGMRES/ILU, CFL 20, and two MPI ranks. The nozzle mesh check used 50×4, 100×8 and 200×16 cells. Between the medium and fine meshes, outlet-average pressure changed by 0.391% for air and 0.124% for MDM; mass flow changed by 0.00834% and 0.00250%. These checks cover those quantities on these cases, rather than establishing general mesh independence. Configurations, meshes, histories and runner and the original duct/nozzle cases are available. For example: I also repeated the ordinary air duct and MDM nozzle after merging develop; they still took 1403 and 3616 iterations. The relevant outlet, HLLC and EOS source files had not changed between the two develop versions. Commit and binary details are in the result records. These are selected local checks. Full CI is not yet green. The change assumes single-phase states; it does not add ordinary-outlet support for real gases or change Giles, FEM, NEMO or continuous-adjoint boundaries. Full adjoint flow validation is still outstanding. The separate Peng–Robinson inlet experiment below is not part of this PR. |
|
While testing the reservoir-fed MDM nozzle, I found a separate issue at the inlet. The Peng–Robinson conversion from enthalpy and entropy to a thermodynamic state stops on an absolute entropy tolerance. The resulting small density noise can prevent the residual from falling further: in this case it stayed near −8.8 through 20,000 iterations. A prototype stopping criterion based on the relative change in volume reaches −10 in 628 iterations, with the same outlet fix. The density and pressure fields change by only about 1e−10 relative to their maximum values. The focused EOS test fails seven assertions before the prototype change and passes all 56 afterward. That EOS change is not included in this PR. The plot compares the original and prototype inlet inversion, both using the repaired outlet. The patch and reservoir testcase are available for a separate review. This experiment covers single-phase Peng–Robinson states only. I have not checked the corresponding inlet sensitivities or other real-gas models. |
|
For a later change, would it be useful to support real gases with At present the ordinary outlet is restricted to ideal gases. It uses a numerical flux between the interior and reconstructed boundary states, while the Riemann outlet evaluates the physical flux at the reconstructed state. Allowing real gases therefore needs more than removing the configuration restriction: the ordinary outlet must also provide the EOS derivatives used by the numerical flux, and needs its own tests. The shared reconstruction in this PR could be reused for that work. I have kept ordinary real-gas outlet support out of this PR. |
|
I extended the fix to TurboRiemann static-pressure and radial-equilibrium outlets after reproducing the same pressure-reconstruction problem there. Both now use the existing shared helper; the radial-equilibrium pressure profile itself is unchanged. I also corrected a Riemann marker being looked up as a Giles marker, and removed a second subtraction of the moving-grid flux in the implicit path. For the fixed-wall nozzle checks:
I also investigated the failing CI jobs. Many individual cases pass; the failures include both solver aborts and changed reference values. Two fixes are included:
ThreadSanitizer also reported several threads entering the fatal-error handler at once. The new outlet error calls are now serialized. The remaining reference differences still need assessment. For the wedge case, the residual after 20 iterations changes, but develop and the fix both converge at iteration 48 and their final fields agree within 2.7e−12 relative to the field maxima. I have not replaced the regression reference values or assumed that all other differences have the same explanation. All three local unit suites pass in normal and four-thread builds. The outlet tests also pass with two MPI ranks and with two ranks × two threads. Forward and reverse reconstructed-state derivative checks each pass 2160 assertions, and differentiated solver compilation passes. The reverse derivative check uses AddressSanitizer. The complete CI matrix, including CoolProp and sanitizer regressions, is now running on the pushed commit. Nozzle cases, histories, fields and plot. Regression assessment and focused reproductions. Giles and mixing-plane reconstruction are unchanged. The radial profile is held fixed in the local implicit matrix. The tests cover frozen SST energy in the convective map, not a complete viscous turbomachinery flow. This remains a single-phase outlet change; full adjoint flow validation is outstanding. I added code comments explaining these assumptions and the reconstruction/Jacobian steps. CI note: the first completed reverse-mode ASAN build failed before compilation because fetching the Eigen submodule returned HTTP 500. Setup then stopped with Ninja missing. The other jobs are still running; GitHub did not accept a retry of that job. This is separate from the regression reference differences discussed above. |
Update 33 expected output rows from exact-mode runs of the finalized implementation. Preserve tolerances, iteration limits and ARM-specific references.
Update 40 stored rows reproduced independently with the exact CI binaries in their original execution modes. Keep tolerances, iteration counts, configuration and ARM-specific references unchanged.
The exact develop baseline diverges with CFL 500 and three BCGSTAB iterations. FGMRES converges on both develop and this branch with the same CFL, linear tolerance and iteration cap. Refresh the three affected serial, MPI and OpenMP regression snapshots after independent checks.



A large pressure drop at a Riemann outlet can produce a nonphysical reconstructed state. The ordinary outlet also classifies supersonic flow using total speed, so tangential velocity or grid motion can incorrectly switch off the prescribed pressure. TurboRiemann has the same pressure-reconstruction problem, a configuration lookup using the wrong marker type, and a duplicate moving-grid flux subtraction in its implicit path.
Ordinary, Riemann static-pressure and TurboRiemann static-pressure/radial-equilibrium outlets now use CFluidModel::ComputePressureOutletState. It follows the EOS isentrope, uses normal velocity relative to the grid, stops outward expansion at the sonic state, and extrapolates already-supersonic outflow. The ideal-gas path is analytic and evaluates the outlet EOS with SetTDState_Prho. The general-EOS path integrates density, thermal energy and normal velocity, evaluating each stage with SetTDState_rhoe. Brief walkthrough comments and the characteristic-boundary paper references are retained in CFluidModel.cpp. Radial-equilibrium pressure profiles are retained.
The implicit matrices retain boundary coupling through the existing outgoing characteristic projection, with the wave basis frozen during the implicit update. This is an approximate linearization; the residual still uses the nonlinear reconstructed state. The ordinary matrix includes both numerical-flux arguments, while Riemann/TurboRiemann project the physical boundary-flux Jacobian. Moving-grid transport and frozen SST energy are included. No case-specific damping constants or CFL changes are introduced.
Subsonic reverse flow uses the existing pressure-outlet closure of extrapolated entropy and tangential velocity. Flow with all characteristics incoming requires inlet data. New outlet fatal-error calls are serialized to avoid simultaneous OpenMP error reporting. Separate restart filenames prevent the laminar flatplate test from overwriting the supersonic test's restart input.
Validation includes 14 outlet unit cases in normal and two-thread OpenMP builds, covering ideal/real gases, learned EOS, moving grids, sonic transitions, reverse flow and SST energy. Forward and standard reverse derivative checks pass 2160 assertions each. Both ordinary and Riemann variants of the unlimited second-order periodic stress case converge at CFL 100 to density log residual -10 at iteration 1684. The Riemann variant is included in parallel_regression.py to catch the previous abort before iteration 100.
The complete executable-source CI run passed all 14 builds, unit jobs, tape tests, three AD regression suites and all four address/thread sanitizer suites. Of 579 regression entries, 539 passed unchanged and 40 had finite numerical reference mismatches. All 72 assessed entries were independently rerun with the exact CI executables and original execution modes; every printed value matched CI exactly. A separate reference-only commit refreshes the 40 affected arrays, with no changes to tolerances, test lengths, solver settings or ARM-specific values. All 40 refreshed tests were then rerun and passed. CI for the reference-only commit passed all jobs: https://github.com/su2code/SU2/actions/runs/38597422616 . The preceding full source run is https://github.com/su2code/SU2/actions/runs/38590167936 .
The original 13 demonstrations converge with the characteristic projection. Nozzle and TurboRiemann iteration counts are unchanged; the Riemann ducts retain smaller speed gains than the fully coupled nonlinear derivative. Longer SST-flatplate runs give matching converged fields and forces. SWBLI force comparisons and a cylinder adjoint sensitivity comparison agree closely, but the 200-step SWBLI SST and adjoint runs do not establish full steady-state/gradient validation.
The wedge convergence failure with CFL 500, three BCGSTAB iterations and mixed precision also occurs without this PR: the exact develop base (3aa1a95) aborts with NaNs at iteration 82. The older ca3d54e baseline converges; the intervening base change modifies BCGSTAB update selection. A separate commit changes the wedge configuration to FGMRES and refreshes its three regression snapshots. CFL, linear tolerance and the three-iteration cap are retained. Exact develop/current OpenMP controls then converge at iterations 50/51 to matching forces; current serial/MPI runs converge at 48/51. All three regression checks pass independently. No outlet-specific damping or CFL adjustment is added.
With the non-default PrimalReuse tape, the Peng–Robinson outlet derivative check failed in 112 of 2160 comparisons when preaccumulation was enabled. The cause is in CoDiPack, not in this PR. After a preaccumulated section with no more inputs than outputs, CoDiPack can restore wrong stored values. Derivatives of code recorded before that section are then wrong. With a one-line CoDiPack change, the unchanged test passes all 2160 comparisons. Reported upstream: SciCompKL/CoDiPack#50. The default JacobianLinear tape passes the same check. This PR includes no AD changes.
This PR builds directly on develop and does not depend on #2943, #2944, #2945 or #2974. It covers single-phase finite-volume pressure outlets. Giles, mixing-plane reconstruction, ordinary real-gas outlet support, FEM, NEMO and continuous-adjoint boundaries remain outside its scope. Existing viscous and numerical-flux Jacobian approximations are retained; a fully converged adjoint comparison and objective Taylor test remain outstanding.
Original duct/nozzle configurations and plots. TurboRiemann configurations and earlier regression assessment. The earlier iteration tables use the former implicit linearization; with characteristic projection, the air/MDM Riemann ducts take 1482/1503 iterations and the ordinary air duct takes 1482. Nozzle and TurboRiemann demonstration counts are unchanged.
The Peng–Robinson reservoir-inlet experiment tests a separate EOS stopping criterion. That prototype change is not included in this PR.