Documentation 6b54b78464
Loading...
Searching...
No Matches
CIncNSVariable.hpp
Go to the documentation of this file.
1/*!
2 * \file CIncNSVariable.hpp
3 * \brief Class for defining the variables of the incompressible
4 Navier-Stokes solver.
5 * \author F. Palacios, T. Economon
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include "CIncEulerVariable.hpp"
32
33/*!
34 * \class CIncNSVariable
35 * \brief Class for defining the variables of the incompressible Navier-Stokes solver.
36 * \ingroup Navier_Stokes_Equations
37 * \author F. Palacios, T. Economon, T. Albring
38 */
39class CIncNSVariable final : public CIncEulerVariable {
40private:
41 VectorType Tau_Wall; /*!< \brief Magnitude of the wall shear stress from a wall function. */
42 VectorType DES_LengthScale; /*!< \brief DES Length Scale. */
43 VectorType lesMode; /*!< \brief Sensor for local simulation mode (0=RANS, 1=LES).*/
44 const bool Energy; /*!< \brief Flag for Energy equation in incompressible flows. */
45
46public:
47 /*!
48 * \brief Constructor of the class.
49 * \param[in] pressure - value of the pressure.
50 * \param[in] velocity - Value of the flow velocity (initialization value).
51 * \param[in] temperature - Value of the temperature (initialization value).
52 * \param[in] npoint - Number of points/nodes/vertices in the domain.
53 * \param[in] ndim - Number of dimensions of the problem.
54 * \param[in] nvar - Number of variables of the problem.
55 * \param[in] config - Definition of the particular problem.
56 */
57 CIncNSVariable(su2double pressure, const su2double *velocity, su2double temperature,
58 unsigned long npoint, unsigned long ndim, unsigned long nvar, const CConfig *config);
59
60 /*!
61 * \brief Set the laminar viscosity.
62 */
63 inline void SetLaminarViscosity(unsigned long iPoint, su2double laminarViscosity) override {
64 Primitive(iPoint, indices.LaminarViscosity()) = laminarViscosity;
65 }
66
67 /*!
68 * \overload
69 * \param[in] eddy_visc - Value of the eddy viscosity.
70 */
71 inline void SetEddyViscosity(unsigned long iPoint, su2double eddy_visc) override {
72 Primitive(iPoint, indices.EddyViscosity()) = eddy_visc;
73 }
74
75 /*!
76 * \brief Get the laminar viscosity of the flow.
77 * \return Value of the laminar viscosity of the flow.
78 */
79 inline su2double GetLaminarViscosity(unsigned long iPoint) const override {
80 return Primitive(iPoint, indices.LaminarViscosity());
81 }
82
83 /*!
84 * \brief Get the eddy viscosity of the flow.
85 * \return The eddy viscosity of the flow.
86 */
87 inline su2double GetEddyViscosity(unsigned long iPoint) const override {
88 return Primitive(iPoint, indices.EddyViscosity());
89 }
90
91 /*!
92 * \brief Set the thermal conductivity.
93 */
94 inline void SetThermalConductivity(unsigned long iPoint, su2double thermalConductivity) override {
95 Primitive(iPoint, indices.ThermalConductivity()) = thermalConductivity;
96 }
97
98 /*!
99 * \brief Get the thermal conductivity of the flow.
100 * \return Value of the laminar viscosity of the flow.
101 */
102 inline su2double GetThermalConductivity(unsigned long iPoint) const override {
103 return Primitive(iPoint, indices.ThermalConductivity());
104 }
105
106 /*!
107 * \brief Set all the primitive variables for incompressible flows
108 */
109 bool SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel, const su2double *scalar = nullptr);
111
112 /*!
113 * \brief Set the value of the wall shear stress computed by a wall function.
114 */
115 inline void SetTau_Wall(unsigned long iPoint, su2double tau_wall) override { Tau_Wall(iPoint) = tau_wall; }
116
117 /*!
118 * \brief Get the value of the wall shear stress computed by a wall function.
119 * \return Value of the wall shear stress computed by a wall function.
120 */
121 inline su2double GetTau_Wall(unsigned long iPoint) const override { return Tau_Wall(iPoint); }
122 inline const VectorType& GetTau_Wall() const { return Tau_Wall; }
123
124 /*!
125 * \brief Set the DES Length Scale.
126 */
127 inline void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) override {
128 DES_LengthScale(iPoint) = val_des_lengthscale;
129 }
130
131 /*!
132 * \brief Get the DES length scale
133 * \return Value of the DES length Scale.
134 */
135 inline su2double GetDES_LengthScale(unsigned long iPoint) const override { return DES_LengthScale(iPoint); }
136
137 /*!
138 * \brief Set the LES sensor.
139 */
140 inline void SetLES_Mode(unsigned long iPoint, su2double val_les_mode) override {
141 lesMode(iPoint) = val_les_mode;
142 }
143
144 /*!
145 * \brief Get the LES sensor.
146 * \return Value of the LES sensor.
147 */
148 inline su2double GetLES_Mode(unsigned long iPoint) const override { return lesMode(iPoint); }
149
150};
Class for defining the variables of the incompressible Euler solver.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
MatrixType Primitive
Primitive variables.
Definition CFlowVariable.hpp:41
Main class for defining the Thermo-Physical Model.
Definition CFluidModel.hpp:47
Class for defining the variables of the incompressible Euler solver.
Definition CIncEulerVariable.hpp:41
const CIndices< unsigned long > indices
Definition CIncEulerVariable.hpp:70
Class for defining the variables of the incompressible Navier-Stokes solver.
Definition CIncNSVariable.hpp:39
const VectorType & GetTau_Wall() const
Definition CIncNSVariable.hpp:122
su2double GetEddyViscosity(unsigned long iPoint) const override
Get the eddy viscosity of the flow.
Definition CIncNSVariable.hpp:87
void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) override
Set the DES Length Scale.
Definition CIncNSVariable.hpp:127
bool SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel, const su2double *scalar=nullptr)
Set all the primitive variables for incompressible flows.
Definition CIncNSVariable.cpp:53
su2double GetLaminarViscosity(unsigned long iPoint) const override
Get the laminar viscosity of the flow.
Definition CIncNSVariable.hpp:79
su2double GetThermalConductivity(unsigned long iPoint) const override
Get the thermal conductivity of the flow.
Definition CIncNSVariable.hpp:102
void SetLaminarViscosity(unsigned long iPoint, su2double laminarViscosity) override
Set the laminar viscosity.
Definition CIncNSVariable.hpp:63
su2double GetLES_Mode(unsigned long iPoint) const override
Get the LES sensor.
Definition CIncNSVariable.hpp:148
void SetEddyViscosity(unsigned long iPoint, su2double eddy_visc) override
Definition CIncNSVariable.hpp:71
su2double GetTau_Wall(unsigned long iPoint) const override
Get the value of the wall shear stress computed by a wall function.
Definition CIncNSVariable.hpp:121
void SetThermalConductivity(unsigned long iPoint, su2double thermalConductivity) override
Set the thermal conductivity.
Definition CIncNSVariable.hpp:94
su2double GetDES_LengthScale(unsigned long iPoint) const override
Get the DES length scale.
Definition CIncNSVariable.hpp:135
void SetLES_Mode(unsigned long iPoint, su2double val_les_mode) override
Set the LES sensor.
Definition CIncNSVariable.hpp:140
void SetTau_Wall(unsigned long iPoint, su2double tau_wall) override
Set the value of the wall shear stress computed by a wall function.
Definition CIncNSVariable.hpp:115
virtual bool SetPrimVar(unsigned long iPoint, CConfig *config)
A virtual member.
Definition CVariable.hpp:1269
passivedouble su2double
Definition code_config.hpp:181
IndexType LaminarViscosity() const
Definition CEulerVariable.hpp:62
IndexType EddyViscosity() const
Definition CEulerVariable.hpp:63
IndexType ThermalConductivity() const
Definition CEulerVariable.hpp:64