Documentation 6b54b78464
Loading...
Searching...
No Matches
CConstantDensity.hpp
Go to the documentation of this file.
1/*!
2 * \file CConstantDensity.hpp
3 * \brief Defines the incompressible constant density model.
4 * \author T. Economon
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "CFluidModel.hpp"
31
32/*!
33 * \class CConstantDensity
34 * \brief Child class for defining a constant density gas model (incompressible only).
35 * \author: T. Economon
36 */
37class CConstantDensity final : public CFluidModel {
38 public:
39 /*!
40 * \brief Constructor of the class.
41 */
42 CConstantDensity(su2double val_Density, su2double val_Cp, su2double val_Temperature_Ref) {
43 Density = val_Density;
44 Cp = val_Cp;
45 Cv = val_Cp;
46 Std_Ref_Temp_ND = val_Temperature_Ref;
47 }
48
49 /*!
50 * \brief Set the Dimensionless State using Temperature.
51 * \param[in] t - Temperature value at the point.
52 */
53 void SetTDState_T(su2double t, const su2double *val_scalars = nullptr) override {
54 /* Density is constant and thermodynamic pressure is
55 not required for incompressible, constant density flows,
56 but the energy equation can still be computed as a
57 decoupled equation. Hence, we update the value.
58 Note Cp = Cv, (gamma = 1).*/
59 Temperature = t;
60 Enthalpy = Cp * (Temperature - Std_Ref_Temp_ND); // Sensible enthalpy relative to STD_REF_TEMP
61 }
62
63 /*!
64 * \brief Set the Dimensionless State using Enthalpy.
65 * \param[in] val_enthalpy - Enthalpy value at the point.
66 * \param[in] val_scalars - not used here.
67 */
68 void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override {
69 Enthalpy = val_enthalpy;
70 Temperature = Enthalpy / Cp + Std_Ref_Temp_ND; // Temperature from sensible enthalpy
71 }
72
73 private:
74 su2double Std_Ref_Temp_ND{0.0}; /*!< \brief Nondimensional standard reference temperature for enthalpy. */
75};
Defines the main fluid model class for thermophysical properties.
Child class for defining a constant density gas model (incompressible only).
Definition CConstantDensity.hpp:37
CConstantDensity(su2double val_Density, su2double val_Cp, su2double val_Temperature_Ref)
Constructor of the class.
Definition CConstantDensity.hpp:42
void SetTDState_T(su2double t, const su2double *val_scalars=nullptr) override
Set the Dimensionless State using Temperature.
Definition CConstantDensity.hpp:53
void SetTDState_h(su2double val_enthalpy, const su2double *val_scalars=nullptr) override
Set the Dimensionless State using Enthalpy.
Definition CConstantDensity.hpp:68
Main class for defining the Thermo-Physical Model.
Definition CFluidModel.hpp:47
su2double Cp
Specific Heat Capacity at constant pressure.
Definition CFluidModel.hpp:64
su2double Temperature
Temperature.
Definition CFluidModel.hpp:55
su2double Cv
Specific Heat Capacity at constant volume.
Definition CFluidModel.hpp:65
su2double Enthalpy
Enthalpy.
Definition CFluidModel.hpp:50
su2double Density
Density.
Definition CFluidModel.hpp:52
passivedouble su2double
Definition code_config.hpp:181