Skip to content

Add support for Riemann boundary condition to all scalar solvers#2846

Merged
bigfooted merged 3 commits into
su2code:developfrom
aureliegrebe:feature_species_riemann
Jul 18, 2026
Merged

Add support for Riemann boundary condition to all scalar solvers#2846
bigfooted merged 3 commits into
su2code:developfrom
aureliegrebe:feature_species_riemann

Conversation

@aureliegrebe

Copy link
Copy Markdown

Proposed Changes

Add support for Riemann boundary conditions to all scalar solvers by moving BC_Riemann definition from CTurbSolver to CScalarSolver.

I've only tested this for for CSpeciesSolver; I put the definition in CScalarSolver mainly just to avoid code duplication between CTurbSolver and CSpeciesSolver. Please let me know if there is a reason not to do this.

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

This allows BC_Riemann to be used with all scalar solvers, particularily
the species solver.
@pcarruscag

Copy link
Copy Markdown
Member

Thanks for this — moving BC_Riemann up to CScalarSolver to share it across turbulence and species is a nice simplification and the change itself looks correct as a relocation (dispatch to BC_Inlet/BC_Outlet is virtual, so it resolves properly for each solver).

While reviewing, we ran into a pre-existing gap that your change surfaces more visibly now that species goes through this path too: scalar inlet values (turbulence/species) are never actually populated for a MARKER_RIEMANN boundary, so BC_Riemann silently falls back to freestream turbulence/species values at that marker regardless of what's imposed on the flow side.

The root cause is in the inlet-filling logic, which only populates the per-marker scalar arrays when the marker's KindBC is INLET_FLOW (or SUPERSONIC_INLET for species) — a RIEMANN_BOUNDARY marker never qualifies:

  • CSpeciesSolver::SetUniformInletSU2_CFD/src/solvers/CSpeciesSolver.cpp:521
  • CTurbSASolver::SetUniformInletSU2_CFD/src/solvers/CTurbSASolver.cpp:1954

For species this means there's currently no way to specify the composition entering through a Riemann boundary at all — it's silently freestream regardless of MARKER_INLET_SPECIES. Turbulence has the same issue (pre-existing, not introduced by you) since CConfig::GetInlet_TurbVal falls back to freestream when the tag isn't found under MARKER_INLET_TURBULENT, which it never will be for a Riemann-tagged marker.

Could you extend the fix to make these SetUniformInlet (and equivalent) checks also apply to RIEMANN_BOUNDARY markers, so MARKER_INLET_TURBULENT/MARKER_INLET_SPECIES entries are actually honored there?

Lastly, could you add a test case (or adapt an existing regression case) that uses MARKER_RIEMANN with the species/turbulence solver, so this path gets exercised in CI going forward?

@bigfooted

Copy link
Copy Markdown
Contributor

@joshkellyjak can you have a look as well?

@aureliegrebe

Copy link
Copy Markdown
Author

While reviewing, we ran into a pre-existing gap that your change surfaces more visibly now that species goes through this path too: scalar inlet values (turbulence/species) are never actually populated for a MARKER_RIEMANN boundary, so BC_Riemann silently falls back to freestream turbulence/species values at that marker regardless of what's imposed on the flow side.

I've added logic to the CSpeciesSolver::SetUniformInlet that sets the inlet values according to MARKER_INLET_SPECIES if the Riemann boundary is treated as an inlet.

For species this means there's currently no way to specify the composition entering through a Riemann boundary at all — it's silently freestream regardless of MARKER_INLET_SPECIES. Turbulence has the same issue (pre-existing, not introduced by you) since CConfig::GetInlet_TurbVal falls back to freestream when the tag isn't found under MARKER_INLET_TURBULENT, which it never will be for a Riemann-tagged marker.

I'm not entirely convinced there was actually a bug in the turbulent solvers causing MARKER_INLET_TURBULENT to be ignored. This value is never read in SetUniformInlet under any case, and is read in the BC_Inlet, which BC_Riemann calls. As far as I can tell, the value set in SetUniformInlet is only used when inlet-files are used, which is not supported for Riemann boundary conditions.

Lastly, could you add a test case (or adapt an existing regression case) that uses MARKER_RIEMANN with the species/turbulence solver, so this path gets exercised in CI going forward?

I've copied and modified the axi_rans_air_nozzle_restart to create axi_rans_air_nozzle_species.

@bigfooted

bigfooted commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@aureliegrebe Thank you for this contribution!

@bigfooted
bigfooted merged commit 7505806 into su2code:develop Jul 18, 2026
37 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants