Skip to content
Open
Show file tree
Hide file tree
Changes from 112 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
ca9083e
solving for enthalpy
Cristopher-Morales Oct 22, 2024
0487a68
fixing flux jacobian
Cristopher-Morales Oct 25, 2024
dd369bb
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 26, 2024
5076f9d
fix output error
Cristopher-Morales Oct 26, 2024
09fe6f4
adding enthalpy diffusion
Cristopher-Morales Oct 31, 2024
851b13f
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 31, 2024
f258308
moving enthalpy diffusion terms to CIncNSSolver.cpp
Cristopher-Morales Nov 3, 2024
63a8f37
small fix
Cristopher-Morales Nov 3, 2024
cb1d3ef
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Nov 4, 2024
30d0b88
cleaning and rewritting some functions
Cristopher-Morales Nov 9, 2024
dd22fcd
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Nov 18, 2024
7f92730
axisymetric source term and corrected flux jacobian at the wall
Cristopher-Morales Nov 22, 2024
fdbb9b9
updating BC_ConjugateHeat_Interface for fluid mixture
Cristopher-Morales Nov 30, 2024
c0b10a6
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Dec 9, 2024
911c996
Merge branch 'develop' into feature_preconditioning
Dec 23, 2024
2af10c3
activating muscl, consistent extrapolation for multicomponent
Jan 2, 2025
d0d0221
Merge branch 'develop' into feature_preconditioning
Jan 2, 2025
a1f526c
correct average enthalpy for multicomponent flows output
Jan 10, 2025
c469d32
Merge branch 'develop' into feature_preconditioning
Jan 11, 2025
ef2dc5f
changing boolean names
Jan 11, 2025
94bd0b0
up to date to develop
Jan 11, 2025
1c44044
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jan 14, 2025
912642b
adding brackets
Cristopher-Morales Jan 18, 2025
a6ce2d4
fixing warning
Cristopher-Morales Jan 18, 2025
e9d1e1f
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jan 23, 2025
127df29
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jan 25, 2025
211dda0
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jan 27, 2025
0655c99
adding standard reference temperature T0=298.15K as default value
Cristopher-Morales Jan 30, 2025
b8b45ef
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Feb 2, 2025
aca6e19
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Feb 13, 2025
5c656bb
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Feb 16, 2025
3f45e1c
reformulating and cleaning
Cristopher-Morales Feb 18, 2025
b1fc9d4
cleaning flow_diffusion.hpp and .cpp
Cristopher-Morales Feb 19, 2025
b23913a
removing spaces
Cristopher-Morales Feb 21, 2025
1961b08
fix description working variable
Cristopher-Morales Feb 21, 2025
02e5eac
update parallel regresion test
Cristopher-Morales Feb 22, 2025
810d2df
fix non-dimensionalization issue
Cristopher-Morales Feb 22, 2025
70ae6ee
updating species Non-Dimensional test case
Cristopher-Morales Feb 22, 2025
e9d3f4c
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 4, 2025
165a9ad
fix parallel_regression.py
Cristopher-Morales Mar 4, 2025
eabaabf
updating regression test cases
Cristopher-Morales Mar 4, 2025
96c6219
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 8, 2025
e1d873b
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 10, 2025
bbb76ae
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 10, 2025
52a1689
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 11, 2025
8d829b2
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 24, 2025
8a6b0f0
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 25, 2025
6a54f9f
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 26, 2025
761a3ac
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Mar 28, 2025
31b6101
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Apr 14, 2025
be00947
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Apr 28, 2025
ca43883
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales May 7, 2025
f1ddb3c
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales May 12, 2025
d0f5577
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jun 2, 2025
4428a03
update parallel regression test
Cristopher-Morales Jun 3, 2025
395430d
adding adj enthalpy fields for incompressible solver
Cristopher-Morales Jun 4, 2025
247e64b
adding HeatFluxDiffusion in Preaccumulation
Cristopher-Morales Jun 4, 2025
fcacd18
updating JST and Lax-Friedrich
Cristopher-Morales Jun 6, 2025
5e1dacf
updating BC far-field for multicomponent flows
Cristopher-Morales Jun 18, 2025
93f70ab
fix small bug conductivity prandtl
Cristopher-Morales Jun 20, 2025
4b1fb41
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jun 24, 2025
8a31e7e
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jun 27, 2025
8640efd
adding regression cases
Cristopher-Morales Jun 27, 2025
a25de29
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jun 30, 2025
c0b0bed
update residual JST-Lax_Friedrich
Cristopher-Morales Jun 30, 2025
f1744c0
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 2, 2025
ae3ab31
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 7, 2025
3148c3a
adding function for computing enthalpy due to species diffusion
Cristopher-Morales Jul 12, 2025
69d4efa
adding setTDState_h for multicomponent
Cristopher-Morales Jul 13, 2025
346a511
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 15, 2025
bcfec92
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 17, 2025
1cfbb67
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 18, 2025
7a6ddfc
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 21, 2025
c7f27da
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 28, 2025
a8c69ae
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Jul 31, 2025
982fb56
updating parallel_regresion residuals
Jul 31, 2025
a6a5b4e
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Aug 4, 2025
18792df
update multizone restart for species transport
Aug 21, 2025
5fa9236
updating residual multizone species transport
Aug 21, 2025
1b52536
Update SU2_CFD/include/numerics/CNumerics.hpp
Cristopher-Morales Aug 25, 2025
47e77c7
Update SU2_CFD/include/numerics/CNumerics.hpp
Cristopher-Morales Aug 25, 2025
f99a541
Update SU2_CFD/src/fluid/CFluidScalar.cpp
Cristopher-Morales Aug 25, 2025
d3496d6
Update SU2_CFD/src/numerics/CNumerics.cpp
Cristopher-Morales Aug 25, 2025
d45faef
fixing names according to review comment
Cristopher-Morales Aug 25, 2025
b81cd1b
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Aug 26, 2025
bbb0882
fixing ComputeConsistentExtrapolation according to review comment
Cristopher-Morales Aug 26, 2025
982b649
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Aug 26, 2025
62fd167
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Aug 29, 2025
0025691
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Aug 31, 2025
12c3290
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Sep 2, 2025
d66fceb
removing WorkingVar from numerics and small cleaning
Cristopher-Morales Sep 3, 2025
8ba4b78
formatting
Cristopher-Morales Sep 10, 2025
8ce7ba3
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Sep 11, 2025
a3481f4
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Sep 15, 2025
745cf5a
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Sep 19, 2025
18a4348
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Sep 24, 2025
da4ab08
updating residuals
Cristopher-Morales Sep 24, 2025
69ec88d
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Sep 25, 2025
91477ee
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 2, 2025
61ba0f2
defining enthalpy in each model and reformulating inlet BC
Cristopher-Morales Oct 3, 2025
a0884d7
fix error JST and BC IncEulerSolver
Cristopher-Morales Oct 4, 2025
807667f
using GetFluidModel in CIncEulerSolver
Cristopher-Morales Oct 6, 2025
5477a05
making enthalpy the working variable
Cristopher-Morales Oct 7, 2025
58e66ea
fix warning
Cristopher-Morales Oct 7, 2025
09323dd
fixing outputs
Cristopher-Morales Oct 7, 2025
798d7c4
fix centered scheme
Cristopher-Morales Oct 7, 2025
ac24ff5
fix ADJ_TEMPERATURE
Cristopher-Morales Oct 7, 2025
c874b02
changes energy_multicomponent, enthalpy and RMS_ENTHALPY in test cases
Cristopher-Morales Oct 8, 2025
b0e3769
imposing temperature when energy equation is switched off
Cristopher-Morales Oct 8, 2025
d316de6
changing screenoutput BGS_ENTHALPY[0] in cht files
Cristopher-Morales Oct 8, 2025
e2a80e6
avoid duplicating enthalpy output for flamelet solver
Cristopher-Morales Oct 9, 2025
23fe425
renaming LIMITER_TEMPERATURE to LIMITER_ENTHALPY
Cristopher-Morales Oct 9, 2025
e8f9571
Update SU2_CFD/include/numerics/flow/convection/centered.hpp
Cristopher-Morales Oct 9, 2025
66de4bc
Update SU2_CFD/include/numerics/flow/convection/centered.hpp
Cristopher-Morales Oct 9, 2025
bae602b
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 10, 2025
b051888
adding eddy diffusivity in enthalpy diffusion
Cristopher-Morales Oct 13, 2025
5a14508
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 20, 2025
f990a55
updating residuals species transport
Cristopher-Morales Oct 22, 2025
9224935
updating residuals
Cristopher-Morales Oct 22, 2025
051c201
update residual and fixing output temperature
Cristopher-Morales Oct 22, 2025
07b3f61
small cleaning
Cristopher-Morales Oct 22, 2025
63a8761
updating residuals
Cristopher-Morales Oct 23, 2025
42d3e9b
updating residuals
Cristopher-Morales Oct 23, 2025
3491b37
updating residuals DAspecies tutorial case
Cristopher-Morales Oct 23, 2025
9a8d01e
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 24, 2025
341281b
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 26, 2025
13985c5
Update SU2_CFD/include/variables/CIncEulerVariable.hpp
Cristopher-Morales Oct 26, 2025
8cffbd2
Update SU2_CFD/src/fluid/CFluidScalar.cpp
Cristopher-Morales Oct 26, 2025
e5c3992
addressing comments part 1
Cristopher-Morales Oct 26, 2025
a2ae0b1
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
Cristopher-Morales Oct 26, 2025
21fab1a
addressing comments part 2
Cristopher-Morales Oct 27, 2025
61be943
addressing comments part 3
Cristopher-Morales Oct 27, 2025
b8ecc10
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 27, 2025
2177d51
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Oct 27, 2025
fed3aa2
Merge branch 'develop' into feature_preconditioning
Cristopher-Morales Nov 2, 2025
8644084
updating residuals
Cristopher-Morales Nov 2, 2025
2e0dcfe
updating residuals and .ref files
Cristopher-Morales Nov 2, 2025
fa3bad1
updating residual custom_source_buoyancy
Cristopher-Morales Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ jobs:
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
args: -b ${{github.ref}} -t feature_preconditioning -c feature_restart_preconditioning -s ${{matrix.testscript}}
- name: Cleanup
uses: docker://ghcr.io/su2code/su2/test-su2:250717-1402
with:
Expand Down
7 changes: 7 additions & 0 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ class CConfig {
Initial_BCThrust, /*!< \brief Ratio of turbulent to laminar viscosity at the actuator disk. */
Pressure_FreeStream, /*!< \brief Total pressure of the fluid. */
Pressure_Thermodynamic, /*!< \brief Thermodynamic pressure of the fluid. */
Standard_Ref_Temperature, /*!< \brief Standard reference temperature for multicomponent flows. */
Temperature_FreeStream, /*!< \brief Total temperature of the fluid. */
Temperature_ve_FreeStream; /*!< \brief Total vibrational-electronic temperature of the fluid. */
unsigned short wallModel_MaxIter; /*!< \brief maximum number of iterations for the Newton method for the wall model */
Expand Down Expand Up @@ -1951,6 +1952,12 @@ class CConfig {
*/
su2double GetPressure_Thermodynamic(void) const { return Pressure_Thermodynamic; }

/*!
* \brief Get the value of the standard reference temperature for multicomponent flows.
* \return Standard reference temperature, Non-dimensionalized if it is needed for Non-Dimensional problems.
*/
su2double GetStandard_RefTemperatureND(void) const { return Standard_Ref_Temperature / Temperature_Ref; }

/*!
* \brief Get the value of the non-dimensionalized thermodynamic pressure.
* \return Non-dimensionalized thermodynamic pressure.
Expand Down
3 changes: 3 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,9 @@ void CConfig::SetConfig_Options() {
addDoubleOption("GAMMA_VALUE", Gamma, 1.4);
/*!\brief THERMODYNAMIC_PRESSURE \n DESCRIPTION: Thermodynamics(operating) Pressure (101325 Pa), only for incompressible flows) \ingroup Config*/
addDoubleOption("THERMODYNAMIC_PRESSURE", Pressure_Thermodynamic, 101325.0);
/*!\brief STANDARD_REFERENCE_TEMPERATURE \n DESCRIPTION: Standard reference temperature (298.15K), only for
* multicomponent incompressible flows) \ingroup Config*/
addDoubleOption("STANDARD_REFERENCE_TEMPERATURE", Standard_Ref_Temperature, 298.15);
/*!\brief CP_VALUE \n DESCRIPTION: Specific heat at constant pressure, Cp (1004.703 J/kg*K (air), constant density incompressible fluids only) \ingroup Config*/
addDoubleListOption("SPECIFIC_HEAT_CP", nSpecific_Heat_Cp, Specific_Heat_Cp);
/*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/
Expand Down
10 changes: 10 additions & 0 deletions SU2_CFD/include/fluid/CConstantDensity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,15 @@ class CConstantDensity final : public CFluidModel {
decoupled equation. Hence, we update the value.
Note Cp = Cv, (gamma = 1).*/
Temperature = t;
Enthalpy = Cp * Temperature;
}

/*!
* \brief Set the Dimensionless State using Enthalpy.
* \param[in] val_enthalpy - Enthalpy value at the point.
*/
void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override {
Enthalpy = val_enthalpy;
Temperature = Enthalpy / Cp;
}
};
7 changes: 7 additions & 0 deletions SU2_CFD/include/fluid/CFluidFlamelet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ class CFluidFlamelet final : public CFluidModel {
*/
void SetTDState_T(su2double val_temperature, const su2double* val_scalars = nullptr) override;

/*!
* \brief Set the thermodynamic state.
* \param[in] val_enthalpy - enthalpy
* \param[in] val_scalars - pointer to species mass fractions
*/
void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override;

/*!
* \brief Evaluate data-set for flamelet simulations.
* \param[in] input_scalar - controlling variables used to interpolate manifold.
Expand Down
23 changes: 23 additions & 0 deletions SU2_CFD/include/fluid/CFluidModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class CLookUpTable;
class CFluidModel {
protected:
su2double StaticEnergy{0.0}; /*!< \brief Internal Energy. */
su2double Enthalpy{0.0}; /*!<*\brief Enthalpy. */
su2double Entropy{0.0}; /*!< \brief Entropy. */
su2double Density{0.0}; /*!< \brief Density. */
su2double Pressure{0.0}; /*!< \brief Pressure. */
Expand Down Expand Up @@ -113,6 +114,11 @@ class CFluidModel {
*/
su2double GetStaticEnergy() const { return StaticEnergy; }

/*!
* \brief Get fluid enthalpy.
*/
su2double GetEnthalpy() const { return Enthalpy; }

/*!
* \brief Get fluid density.
*/
Expand Down Expand Up @@ -186,6 +192,16 @@ class CFluidModel {
return mass_diffusivity;
}

/*!
* \brief Get heat diffusivity terms.
*/
virtual void GetEnthalpyDiffusivity(su2double* enthalpy_diffusions = nullptr) {}

/*!
* \brief Get gradient heat diffusivity terms.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are gradients with respect to what variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image Thanks for the comment! This gradient (I think I should call this in a different way) is for computing the Jacobian of the heat flux term due to species diffusion in the energy equation. In the picture attached, it is explained. Thanks in advance!!!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cristopher-Morales please just improve the \brief comment here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unresolving because the comment was not improved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!

Thank you so much for your comment,

I have improved the documentation of this function.

Please let me know what you think about it.

Thanks in advance!

*/
virtual void GetGradEnthalpyDiffusivity(su2double* grad_enthalpy_diffusions = nullptr) {}

/*!
* \brief Get fluid pressure partial derivative.
*/
Expand Down Expand Up @@ -339,6 +355,13 @@ class CFluidModel {
*/
virtual void SetTDState_T(su2double val_Temperature, const su2double* val_scalars = nullptr) {}

/*!
* \brief Virtual member.
* \param[in] val_enthalpy - Enthalpy value at the point.
* \param[in] val_scalars - Scalar mass fractions.
*/
virtual void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) {}

/*!
* \brief Set fluid eddy viscosity provided by a turbulence model needed for computing effective thermal conductivity.
*/
Expand Down
23 changes: 23 additions & 0 deletions SU2_CFD/include/fluid/CFluidScalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CFluidScalar final : public CFluidModel {
const int n_species_mixture; /*!< \brief Number of species in mixture. */
su2double Gas_Constant; /*!< \brief Specific gas constant. */
const su2double Pressure_Thermodynamic; /*!< \brief Constant pressure thermodynamic. */
const su2double Ref_Temperature; /*!< \brief Reference temperature. */
const su2double GasConstant_Ref; /*!< \brief Gas constant reference needed for Nondimensional problems. */
const su2double Prandtl_Number; /*!< \brief Prandlt number.*/

Expand Down Expand Up @@ -91,6 +92,11 @@ class CFluidScalar final : public CFluidModel {
*/
su2double ComputeMeanSpecificHeatCp(const su2double* val_scalars);

/*!
* \brief Compute Enthalpy given the temperature and scalars.
*/
su2double ComputeEnthalpyFromT(const su2double val_temperature, const su2double* val_scalars);

/*!
* \brief Compute gas constant for mixture.
*/
Expand Down Expand Up @@ -137,9 +143,26 @@ class CFluidScalar final : public CFluidModel {
*/
inline su2double GetMassDiffusivity(int ivar) override { return massDiffusivity[ivar]; }

/*!
* \brief Get enthalpy diffusivity terms.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document the arguments, what size is the array expected to have, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!

Thank you so much for your comment,

I have added a documentation of arguments and the size of the array expected by this function.

Please let me know what you think about it.

Thanks!

void GetEnthalpyDiffusivity(su2double* enthalpy_diffusions) override;

/*!
* \brief Get gradient enthalpy diffusivity terms.
*/
void GetGradEnthalpyDiffusivity(su2double* grad_enthalpy_diffusions) override;

/*!
* \brief Set the Dimensionless State using Temperature.
* \param[in] t - Temperature value at the point.
*/
void SetTDState_T(su2double val_temperature, const su2double* val_scalars) override;

/*!
* \brief Virtual member.
* \param[in] val_enthalpy - Enthalpy value at the point.
* \param[in] val_scalars - Scalar mass fractions.
*/
void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override;
};
11 changes: 11 additions & 0 deletions SU2_CFD/include/fluid/CIncIdealGas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ class CIncIdealGas final : public CFluidModel {
/*--- The EoS only depends upon temperature. ---*/
Temperature = t;
Density = Pressure / (Temperature * Gas_Constant);
Enthalpy = Cp * Temperature;
}

/*!
* \brief Set the Dimensionless State using Enthalpy.
* \param[in] val_enthalpy - Enthalpy value at the point.
*/
void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override {
Enthalpy = val_enthalpy;
Temperature = Enthalpy / Cp;
Density = Pressure / (Temperature * Gas_Constant);
}

private:
Expand Down
19 changes: 19 additions & 0 deletions SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ class CIncIdealGasPolynomial final : public CFluidModel {
Cp += coeffs_[i] * t_i;
}
Cv = Cp / Gamma;
Enthalpy = Cp * Temperature;
}

/*!
* \brief Set the Dimensionless State using enthalpy.
* \param[in] val_enthalpy - Enthalpy value at the point.
*/
void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override {
Enthalpy = val_enthalpy;
Temperature = Enthalpy / Cp;
Density = Pressure / (Temperature * Gas_Constant);
/* Evaluate the new Cp from the coefficients and temperature. */
Cp = coeffs_[0];
su2double t_i = 1.0;
for (int i = 1; i < N; ++i) {
t_i *= Temperature;
Cp += coeffs_[i] * t_i;
}
Cv = Cp / Gamma;
}

private:
Expand Down
36 changes: 26 additions & 10 deletions SU2_CFD/include/numerics/CNumerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ class CNumerics {
const su2double
*ScalarVar_i, /*!< \brief Vector of scalar variables at point i. */
*ScalarVar_j; /*!< \brief Vector of scalar variables at point j. */
su2double
HeatFluxDiffusion; /*!< \brief Heat flux due to enthalpy diffusion for multicomponent. */
su2double
JacHeatFluxDiffusion; /*!< \brief Heat flux jacobian due to enthalpy diffusion for multicomponent. */
const su2double
*TransVar_i, /*!< \brief Vector of turbulent variables at point i. */
*TransVar_j; /*!< \brief Vector of turbulent variables at point j. */
Expand Down Expand Up @@ -187,6 +191,8 @@ class CNumerics {

bool nemo; /*!< \brief Flag for NEMO problems */

bool energy_multicomponent = false; /*!< \brief Flag for multicomponent and reacting flow */

bool bounded_scalar = false; /*!< \brief Flag for bounded scalar problem */

public:
Expand Down Expand Up @@ -750,6 +756,20 @@ class CNumerics {
Diffusion_Coeff_j = val_diffusioncoeff_j;
}

/*!
* \brief Set the heat flux due to enthalpy diffusion
* \param[in] val_heatfluxdiffusion - Value of the heat flux due to enthalpy diffusion.
*/
inline void SetHeatFluxDiffusion(su2double val_heatfluxdiffusion) { HeatFluxDiffusion = val_heatfluxdiffusion; }

/*!
* \brief Set Jacobian of the heat flux due to enthalpy diffusion
* \param[in] val_jacheatfluxdiffusion - Value of the heat flux jacobian due to enthalpy diffusion.
*/
inline void SetJacHeatFluxDiffusion(su2double val_jacheatfluxdiffusion) {
JacHeatFluxDiffusion = val_jacheatfluxdiffusion;
}

/*!
* \brief Set the laminar viscosity.
* \param[in] val_laminar_viscosity_i - Value of the laminar viscosity at point i.
Expand Down Expand Up @@ -1038,8 +1058,7 @@ class CNumerics {
* \param[in] val_density - Value of the density.
* \param[in] val_velocity - Pointer to the velocity.
* \param[in] val_betainc2 - Value of the artificial compresibility factor.
* \param[in] val_cp - Value of the specific heat at constant pressure.
* \param[in] val_temperature - Value of the temperature.
* \param[in] val_enthalpy - Value of the enthalpy.
* \param[in] val_dRhodT - Value of the derivative of density w.r.t. temperature.
* \param[in] val_normal - Normal vector, the norm of the vector is the area of the face.
* \param[in] val_scale - Scale of the projection.
Expand All @@ -1048,8 +1067,7 @@ class CNumerics {
void GetInviscidIncProjJac(const su2double *val_density,
const su2double *val_velocity,
const su2double *val_betainc2,
const su2double *val_cp,
const su2double *val_temperature,
const su2double *val_enthalpy,
const su2double *val_dRhodT,
const su2double *val_normal,
su2double val_scale,
Expand All @@ -1060,17 +1078,15 @@ class CNumerics {
* \param[in] val_density - Value of the density.
* \param[in] val_velocity - Pointer to the velocity.
* \param[in] val_betainc2 - Value of the artificial compresibility factor.
* \param[in] val_cp - Value of the specific heat at constant pressure.
* \param[in] val_temperature - Value of the temperature.
* \param[in] val_dRhodT - Value of the derivative of density w.r.t. temperature.
* \param[in] val_enthalpy - Value of the enthalpy.
* \param[in] val_dRhodh - Value of the derivative of density w.r.t. enthalpy.
* \param[out] val_Precon - Pointer to the preconditioning matrix.
*/
void GetPreconditioner(const su2double *val_density,
const su2double *val_velocity,
const su2double *val_betainc2,
const su2double *val_cp,
const su2double *val_temperature,
const su2double *val_drhodt,
const su2double *val_enthalpy,
const su2double *val_drhodh,
su2double **val_Precon) const;

/*!
Expand Down
4 changes: 2 additions & 2 deletions SU2_CFD/include/numerics/flow/convection/centered.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CCentLaxInc_Flow final : public CNumerics {
MeanDensity, MeanPressure,
MeanBetaInc2, MeanEnthalpy,
MeanCp, MeanTemperature, /*!< \brief Mean values of primitive variables. */
MeandRhodT, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */
MeandRhodh, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */
Param_p, Param_Kappa_0, /*!< \brief Artificial dissipation parameters. */
Local_Lambda_i, Local_Lambda_j,
MeanLambda, /*!< \brief Local eingenvalues. */
Expand Down Expand Up @@ -109,7 +109,7 @@ class CCentJSTInc_Flow final : public CNumerics {
MeanDensity, MeanPressure,
MeanBetaInc2, MeanEnthalpy,
MeanCp, MeanTemperature, /*!< \brief Mean values of primitive variables. */
MeandRhodT, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */
MeandRhodh, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */
Param_p, Param_Kappa_2,
Param_Kappa_4, /*!< \brief Artificial dissipation parameters. */
Local_Lambda_i, Local_Lambda_j,
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/numerics/flow/convection/fds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CUpwFDSInc_Flow final : public CNumerics {
su2double **Precon, **invPrecon_A;
su2double Proj_ModJac_Tensor_ij, Pressure_i,
Pressure_j, ProjVelocity,
MeandRhodT, dRhodT_i, dRhodT_j, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */
MeandRhodh, dRhodh_i, dRhodh_j, /*!< \brief Derivative of density w.r.t. enthalpy (variable density flows). */
Temperature_i, Temperature_j, /*!< \brief Temperature at node 0 and 1. */
MeanDensity, MeanPressure, MeanSoundSpeed, MeanBetaInc2, MeanEnthalpy, MeanCp, MeanTemperature; /*!< \brief Mean values of primitive variables. */
unsigned short iDim, iVar, jVar, kVar;
Expand Down
1 change: 1 addition & 0 deletions SU2_CFD/include/numerics/flow/flow_diffusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ class CAvgGrad_Flow final : public CAvgGrad_Base {
class CAvgGradInc_Flow final : public CAvgGrad_Base {
private:
su2double Mean_Thermal_Conductivity; /*!< \brief Mean value of the effective thermal conductivity. */
su2double Mean_Heat_Capacity; /*!< \brief Mean value of the heat capacity. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid intermediate su2doubles as class members?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!

Thanks for the comment!

I have removed this line because with the previous pull request about conductivity for compressible flows #2420, the mean heat capacity is now a member of the CAvgGrad_Base in the flow_diffussion.hpp, so there was no need to re-declare it in the CAvgGradInc_Flow.
Please let me know any additional comment about it.

Thanks in advance!!

bool energy; /*!< \brief computation with the energy equation. */

/*!
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/include/numerics/flow/flow_sources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ class CSourceGeneralAxisymmetric_Flow final : public CSourceAxisymmetric_Flow {
class CSourceIncAxisymmetric_Flow final : public CSourceBase_Flow {
bool implicit, /*!< \brief Implicit calculation. */
viscous, /*!< \brief Viscous incompressible flows. */
energy; /*!< \brief computation with the energy equation. */
energy, /*!< \brief computation with the energy equation. */
multicomponent; /*!< \brief multicomponent incompressible flows. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore?

Copy link
Contributor Author

@Cristopher-Morales Cristopher-Morales Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!

thanks for you comment,

I added that boolean multicomponent because for axisymmetric flows, there is an additional term that comes from the enthalpy diffusion which is only needed for multicomponent flows (term in blue)

image

I thought that It should only be computed and added when it is needed because when the FLUID_MODEL is different than FLUID_MIXTURE, the species mass fractions become passive scalars, so the term in blue becomes zero.

Please let me know what you think about it.

Thank you so much in advance!!!


public:
/*!
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class CFVMFlowSolverBase : public CSolver {
su2double Mach_Inf = 0.0; /*!< \brief Mach number at the infinity. */
su2double Density_Inf = 0.0; /*!< \brief Density at the infinity. */
su2double Energy_Inf = 0.0; /*!< \brief Energy at the infinity. */
su2double Temperature_Inf = 0.0; /*!< \brief Energy at the infinity. */
su2double Temperature_Inf = 0.0; /*!< \brief Temperature at the infinity. */
su2double Enthalpy_Inf = 0.0; /*!< \brief Enthalpy at the infinity. */
su2double Pressure_Inf = 0.0; /*!< \brief Pressure at the infinity. */
su2double* Velocity_Inf = nullptr; /*!< \brief Flow Velocity vector at the infinity. */

Expand Down
13 changes: 13 additions & 0 deletions SU2_CFD/include/solvers/CIncEulerSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@ class CIncEulerSolver : public CFVMFlowSolverBase<CIncEulerVariable, ENUM_REGIME
CConfig *config,
unsigned short iMesh) final;

/*!
* \brief Recompute the extrapolated quantities, after MUSCL reconstruction,
* in a more thermodynamically consistent way.
* \note This method is static to improve the chances of it being used in a
* thread-safe manner.
* \param[in,out] fluidModel - The fluid model.
* \param[in] nDim - Number of physical dimensions.
* \param[in,out] primitive - Primitive variables.
* \param[in] scalar - scalar variable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order doesn't match function signature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI!

Thanks for the comment!

I switched the order of them according to the function.

Please let me know if that was needed to address this comment.

Thanks in advance!!!

*/
static void ComputeConsistentExtrapolation(CFluidModel* fluidModel, unsigned short nDim, const su2double* scalar,
su2double* primitive);

/*!
* \brief Source term integration.
* \param[in] geometry - Geometrical definition of the problem.
Expand Down
13 changes: 12 additions & 1 deletion SU2_CFD/include/solvers/CIncNSSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,19 @@ class CIncNSSolver final : public CIncEulerSolver {
*/
void Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, const CGeometry *geometry,
const unsigned short iMesh);
/*!
* \brief Compute the enthalpy due to species diffusion contribution for multicomponent and reacting flows.
* \param[in] iEdge - Edge for which the flux and Jacobians are to be computed.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] solver_container - Container vector with all the solutions.
* \param[in] numerics - Description of the numerical method.
* \param[in] n_species - Number of species in the mixture that a transport equation is solved.
* \param[in] implicit - Boolean for implicit iterations.
*/
void Compute_Enthalpy_Diffusion(unsigned long iEdge, CGeometry* geometry, CSolver** solver_container,
CNumerics* numerics, const int n_species, const bool implicit);

public:
public:
/*!
* \brief Constructor of the class.
* \param[in] geometry - Geometrical definition of the problem.
Expand Down
Loading