Skip to content

Preconditioning for multicomponent flows - #2426

Merged
Cristopher-Morales merged 163 commits into
developfrom
feature_preconditioning
Dec 13, 2025
Merged

Cristopher-Morales merged 163 commits into
developfrom
feature_preconditioning

Conversation

@Cristopher-Morales

@Cristopher-Morales Cristopher-Morales commented Jan 18, 2025 •

Copy link
Copy Markdown
Contributor

Proposed Changes

This pull request aims to extend the preconditioning for incompressible multicomponent flows, specifically when FLUID_MIXTURE model is used and energy equation is solved. Changes introduced in this pull request aim to solve directly for the sensible enthalpy instead of temperature. Specifically, the energy equation that is going to be solved for multicomponent flows is given as follows:

image

and the sensible enthalpy is:
image

Currently $C_{p}$ does not depend on temperature for FLUID_MIXTURE, but it depends on the mixture composition. So the sensible enthalpy simplifies to $C_{p}*(T-T_{0})$. For problems where $C_{p}$ strongly depends on the temperature, Cantera library will be coupled to SU2. After this pull request is completed, a pull request with a fluid model using Cantera will be done where an energy equation for the total enthalpy will be solved.
A PDF document containing further details about this pull request is available at the following link:
preconditioning_general_approach.pdf

Related Work

Currently fluid mixture does not work correctly when the energy equation is on, this is mainly due to the fact that the energy equation that must be solved for multicomponent flows is the one mentioned above for the sensible enthalpy and not the energy equation for a perfect gas that is currently solved in SU2.

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.

@Cristopher-Morales Cristopher-Morales changed the title [WIP] Preconditioning fro multicomponent flows [WIP] Preconditioning for multicomponent flows Jan 18, 2025
Comment thread SU2_CFD/src/solvers/CIncEulerSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CIncNSSolver.cpp Fixed
Comment thread SU2_CFD/include/fluid/CFluidModel.hpp Outdated
Comment thread SU2_CFD/include/fluid/CFluidScalar.hpp
Comment thread SU2_CFD/include/solvers/CFVMFlowSolverBase.inl Outdated
Comment thread SU2_CFD/src/fluid/CFluidScalar.cpp Outdated
Comment thread SU2_CFD/src/numerics/CNumerics.cpp Outdated
Comment thread SU2_CFD/src/numerics/flow/convection/fds.cpp Outdated
Comment thread TestCases/hybrid_regression_AD.py Fixed
Comment thread TestCases/parallel_regression.py Fixed
Comment thread TestCases/parallel_regression_AD.py Fixed
Comment thread SU2_CFD/include/fluid/CConstantDensity.hpp
Comment thread SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp Outdated
Comment thread SU2_CFD/include/fluid/CConstantDensity.hpp Outdated
Comment thread SU2_CFD/include/variables/CIncEulerVariable.hpp Outdated
Comment thread SU2_CFD/src/output/CAdjFlowIncOutput.cpp Outdated
Comment thread SU2_CFD/src/output/CFlowOutput.cpp Outdated
Comment thread TestCases/radiation/p1adjoint/of_grad_cd.csv.ref Outdated
bigfooted and others added 6 commits December 9, 2025 08:06
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Comment thread SU2_CFD/include/variables/CIncEulerVariable.hpp Outdated
@Cristopher-Morales
Cristopher-Morales merged commit 2c0049f into develop Dec 13, 2025
149 of 153 checks passed
@Cristopher-Morales
Cristopher-Morales deleted the feature_preconditioning branch December 13, 2025 07:32
@bigfooted

Copy link
Copy Markdown
Contributor

Congratulations, Cristopher!
Thanks, Pedro!

@bigfooted bigfooted mentioned this pull request Dec 22, 2025
4 of 6 tasks
bigfooted added a commit that referenced this pull request Oct 21, 2026
## Proposed Changes

This pull request aims to add a fluid model called FLUID_CANTERA for
coupling Cantera library with SU2. Cantera library is an open-source
library for problems involving chemical kinetics, thermodynamics, and
transport processes. This is needed for combustion problems using the
incompressible solver.

[UPDATE] adding the cantera option to meson is now sufficient to get
cantera coupled to su2.

SU2 can be built with Cantera as follows (for example):

./meson.py build -Dwarning_level=2 -Denable-autodiff=false
-Denable-directdiff=false -Dwith-mpi=enabled -Denable-cgns=true
-Denable-tecio=false -Denable-cantera=true
--prefix=/path_to_SU2_directory/SU2

• -Denable-tests=true can be used for testing if Cantera is correctly
compiled with SU2, running one of the Cantera fluid unit test cases.

#### Work in progress:

• Improve cantera coupling, only compile the functionalities needed for
SU2. Currently, when cantera is compiled, whole functionalities are
compiled. Most of the cantera implementations are not needed for
incompressible reacting flows.
• Compile cantera with the AD options. For this purpose, a different
repository must be cloned and compiled, where the AD implementation of
cantera is located.
•	Add regression and unit test cases in the SU2 workflow. 

Regarding the coupling between SU2 and Cantera, any advice/suggestion
how to improve it would be really appreciated.

Thanks in advance!!


## Related Work

Related to pull request #2426 


## PR Checklist
*Put an X by all that apply. You can fill this out after submitting the
PR. If you have any questions, don't hesitate to ask! We want to help.
These are a guide for you to know what the reviewers will be looking for
in your contribution.*

- [X] I am submitting my contribution to the develop branch.
- [X] My contribution generates no new compiler warnings (try with
--warnlevel=3 when using meson).
- [X] 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.

---------

Co-authored-by: Cristopher-Morales <c.l.morales.ubal@tue.nl>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: bigfooted <bigfootedrockmidget@hotmail.com>
Co-authored-by: Josh Kelly <joshkellyjak@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Josh Kelly <81244680+joshkellyjak@users.noreply.github.com>
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.

4 participants