Repository navigation
Conversation
Delete the disabled viscous blocks in BC_Inlet and BC_Outlet, the disabled chemistry source block and the leftover species loop in the heat-flux wall, and the unused turbulent kinetic energy lines. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
The block that passes dPdU, dTdU, dTvedU, Eve, Cvve and Gamma of two points to a numerics object was repeated in the centered, upwind, viscous and boundary loops. Replace the nine copies by one helper in CNEMOEulerSolver. The helper always sets Gamma. BC_Supersonic_Inlet did not set it before, so the AUSM+-up2 and AUSM+M schemes read the value of a previous call there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
Add SetWallVelocity_Strong and SetWallEnergyFlux_Weak to CNEMONSSolver and use them in the heat-flux, isothermal and Smoluchowski-Maxwell walls, which repeated the same statements. Reduce BC_HeatFluxCatalytic_Wall to its error message. The code after the error could not run and had no catalytic contribution. Remove the unused GradY array of the catalytic isothermal wall. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
Keep the behavior of the code before the helper was added: only the call sites that passed Gamma to the numerics before still do it, with their own SetGamma call. The helper passes dPdU, dTdU, dTvedU, Eve and Cvve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
Add SetNumericsTransportState and AddViscousBoundaryResidual to CNEMOEulerSolver. BC_Far_Field and BC_Supersonic_Inlet had the same viscous block, and Viscous_Residual repeated the transport property calls. Reduce BC_Inlet to its error message. The code after the error could not run. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
BC_Outlet and the isothermal walls allocated and freed their work arrays with new and delete at every call. Use static arrays of size MAXNVAR and MAXNDIM. The Jacobian and the unit normal of the isothermal wall are now local to each vertex of the loop. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
CEulerSolver and CNEMOEulerSolver computed the reference values and the non-dimensional free-stream values with the same statements in their SetNondimensionalization. Move them to SetCompressibleNonDimValues in CFVMFlowSolverBase. Each solver keeps the values that are specific to it (vib.-el. temperature for NEMO; conductivity, specific heat, ReThetaT and mass diffusivity for the ideal gas solver). No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
Use GeometryToolbox::Norm for the non-dimensional velocity magnitude, wrap two lines longer than 120 characters, shorten three comments, and drop the val_ prefix from the arguments of the two wall helpers so that all the new helpers use the same naming. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
This branch has not been deployed
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.
Proposed Changes
A clean-up of the two NEMO solver classes (
CNEMOEulerSolver,CNEMONSSolver). It changes no result and adds no feature.BC_InletandBC_HeatFluxCatalytic_Wallstart with a "not operational" error, so the rest of their bodies was dead. Commented-out blocks are removed too.CEulerSolverthrough one function inCFVMFlowSolverBase. This is the only change outside NEMO; it is one commit (222b7b64d4) and can be split off if you prefer.The two NEMO solver files go from 3,404 to 2,728 lines.
Why it helps. The copies had drifted apart over time, and a correction made in one was missing in the others. With one helper per task, a fix is made once.
Why not build NEMO on
CScalarSolver. I looked at this first. The scalar solver runs after the flow solver, as a separate system. In NEMO the pressure depends on the composition and the chemistry is stiff, so species, energy and flow are solved together on purpose. Splitting them would be a rewrite that changes every NEMO result, so I kept the coupled solver.Checks, against
developbuilt on the same machine: identical values for the 14 NEMO regression cases, for three extra NEMO cases (heat-flux wall, slip wall, viscous supersonic inlet) and for six standard compressible cases covering allREF_DIMENSIONALIZATIONoptions. The NEMO unit tests pass. No warnings with--warnlevel=3in the changed files, also in the AD configuration. Not checked: runs with Mutation++, OpenMP or AD.Related Work
This is only the refactoring. While reading the code I collected a list of bugs and possible improvements in NEMO. None is addressed here on purpose: they will come in separate pull requests, grouped by area of the code, so that a change of results is never mixed with a change of structure. Where the old code had a defect, this pull request keeps the old behavior.
PR Checklist
pre-commit run --allto format old commits.🤖 Generated with Claude Code
https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm