Documentation 6b54b78464
Loading...
Searching...
No Matches
CTurbSAVariable.hpp
Go to the documentation of this file.
1/*!
2 * \file CTurbSAVariable.hpp
3 * \brief Declaration of the variables of the SA turbulence model.
4 * \author F. Palacios, 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 "CTurbVariable.hpp"
31
32/*!
33 * \class CTurbSAVariable
34 * \brief Main class for defining the variables of the turbulence model.
35 * \ingroup Turbulence_Model
36 * \author A. Bueno.
37 */
38
39class CTurbSAVariable final : public CTurbVariable {
40
41private:
42 VectorType DES_LengthScale;
43 VectorType lesMode;
44 su2vector<int8_t> sbsInBox;
45 MatrixType stochSource;
46 MatrixType stochSourceOld;
47 VectorType Vortex_Tilting;
48 VectorType besselIntegral;
49
50public:
51 /*!
52 * \brief Constructor of the class.
53 * \param[in] val_nu_tilde - Turbulent variable value (initialization value).
54 * \param[in] val_muT - The eddy viscosity
55 * \param[in] npoint - Number of points/nodes/vertices in the domain.
56 * \param[in] ndim - Number of dimensions of the problem.
57 * \param[in] nvar - Number of variables of the problem.
58 * \param[in] constants -
59 * \param[in] config - Definition of the particular problem.
60 */
61 CTurbSAVariable(su2double val_nu_tilde, su2double val_muT, unsigned long npoint, unsigned long ndim, unsigned long nvar, CConfig *config);
62
63 /*!
64 * \brief Destructor of the class.
65 */
66 ~CTurbSAVariable() override = default;
67
68 /*!
69 * \brief Get the DES length scale
70 * \param[in] iPoint - Point index.
71 * \return Value of the DES length Scale.
72 */
73 inline su2double GetDES_LengthScale(unsigned long iPoint) const override { return DES_LengthScale(iPoint); }
74
75 /*!
76 * \brief Set the DES Length Scale.
77 * \param[in] iPoint - Point index.
78 */
79 inline void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) override { DES_LengthScale(iPoint) = val_des_lengthscale; }
80
81 /*!
82 * \brief Get the source terms for the stochastic equations.
83 * \param[in] iPoint - Point index.
84 * \param[in] iDim - Dimension index.
85 * \return Value of the source term for the stochastic equations.
86 */
87 inline su2double GetLangevinSourceTerms(unsigned long iPoint, unsigned short iDim) const override { return stochSource(iPoint, iDim); }
88
89 /*!
90 * \brief Set the source terms for the stochastic equations.
91 * \param[in] iPoint - Point index.
92 * \param[in] iDim - Dimension index.
93 * \param[in] val_stochSource - Value of the source term for the stochastic equations.
94 */
95 inline void SetLangevinSourceTerms(unsigned long iPoint, unsigned short iDim, su2double val_stochSource) override { stochSource(iPoint, iDim) = val_stochSource; }
96
97 /*!
98 * \brief Get the old value of the source terms for the stochastic equations.
99 * \param[in] iPoint - Point index.
100 * \param[in] iDim - Dimension index.
101 * \return Old value of the source terms for the stochastic equations.
102 */
103 inline su2double GetLangevinSourceTermsOld(unsigned long iPoint, unsigned short iDim) const override { return stochSourceOld(iPoint, iDim); }
104
105 /*!
106 * \brief Set the old value of source terms for the stochastic equations.
107 * \param[in] iPoint - Point index.
108 * \param[in] iDim - Dimension index.
109 * \param[in] val_stochSource_old - Old value of the source term for the stochastic equations.
110 */
111 inline void SetLangevinSourceTermsOld(unsigned long iPoint, unsigned short iDim, su2double val_stochSource_old) override { stochSourceOld(iPoint, iDim) = val_stochSource_old; }
112
113 /*!
114 * \brief Get if the Stochastic Backscatter Model must be applied only in a confined box.
115 * \param[in] iPoint - Point index.
116 * \return 1.0 if the Stochastic Backscatter Model must be applied only in a confined box.
117 */
118 inline int8_t GetSbsInBox(unsigned long iPoint) const override { return sbsInBox(iPoint); }
119
120 /*!
121 * \brief Set if the Stochastic Backscatter Model must be applied only in a confined box.
122 * \param[in] iPoint - Point index.
123 * \param[in] val_sbsInBox - 1.0 if the Stochastic Backscatter Model must be applied only in a confined box.
124 */
125 inline void SetSbsInBox(unsigned long iPoint, int8_t val_sbsInBox) override { sbsInBox(iPoint) = val_sbsInBox; }
126
127 /*!
128 * \brief Set the LES sensor.
129 */
130 inline void SetLES_Mode(unsigned long iPoint, su2double val_les_mode) override { lesMode(iPoint) = val_les_mode; }
131
132 /*!
133 * \brief Get the LES sensor.
134 * \return Value of the LES sensor.
135 */
136 inline su2double GetLES_Mode(unsigned long iPoint) const override { return lesMode(iPoint); }
137
138 /*!
139 * \brief Set the vortex tilting measure for computation of the EDDES length scale
140 * \param[in] iPoint - Point index.
141 */
142 void SetVortex_Tilting(unsigned long iPoint, CMatrixView<const su2double>,
143 const su2double* Vorticity, su2double LaminarViscosity) override;
144
145 /*!
146 * \brief Get the vortex tilting measure for computation of the EDDES length scale
147 * \param[in] iPoint - Point index.
148 * \return Value of the DES length Scale
149 */
150 inline su2double GetVortex_Tilting(unsigned long iPoint) const override { return Vortex_Tilting(iPoint); }
151
152 /*!
153 * \brief Set the integral of the product of three Bessel functions appearing in Laplacian smoothing.
154 * \param[in] iPoint - Point index.
155 * \param[in] val_integral - Value of the integral.
156 */
157 inline void SetBesselIntegral(unsigned long iPoint, su2double val_integral) override { besselIntegral(iPoint) = val_integral; }
158
159 /*!
160 * \brief Get the the integral of the product of three Bessel functions appearing in Laplacian smoothing.
161 * \return Value of the integral.
162 */
163 inline su2double GetBesselIntegral(unsigned long iPoint) const override { return besselIntegral(iPoint); }
164
165};
Base class for defining the variables of the turbulence model.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class to represent a matrix (without owning the data, this just wraps a pointer).
Definition container_decorators.hpp:40
Main class for defining the variables of the turbulence model.
Definition CTurbSAVariable.hpp:39
su2double GetLangevinSourceTerms(unsigned long iPoint, unsigned short iDim) const override
Get the source terms for the stochastic equations.
Definition CTurbSAVariable.hpp:87
su2double GetDES_LengthScale(unsigned long iPoint) const override
Get the DES length scale.
Definition CTurbSAVariable.hpp:73
su2double GetLangevinSourceTermsOld(unsigned long iPoint, unsigned short iDim) const override
Get the old value of the source terms for the stochastic equations.
Definition CTurbSAVariable.hpp:103
int8_t GetSbsInBox(unsigned long iPoint) const override
Get if the Stochastic Backscatter Model must be applied only in a confined box.
Definition CTurbSAVariable.hpp:118
void SetVortex_Tilting(unsigned long iPoint, CMatrixView< const su2double >, const su2double *Vorticity, su2double LaminarViscosity) override
Set the vortex tilting measure for computation of the EDDES length scale.
Definition CTurbSAVariable.cpp:74
void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) override
Set the DES Length Scale.
Definition CTurbSAVariable.hpp:79
void SetLangevinSourceTermsOld(unsigned long iPoint, unsigned short iDim, su2double val_stochSource_old) override
Set the old value of source terms for the stochastic equations.
Definition CTurbSAVariable.hpp:111
void SetLES_Mode(unsigned long iPoint, su2double val_les_mode) override
Set the LES sensor.
Definition CTurbSAVariable.hpp:130
void SetLangevinSourceTerms(unsigned long iPoint, unsigned short iDim, su2double val_stochSource) override
Set the source terms for the stochastic equations.
Definition CTurbSAVariable.hpp:95
void SetSbsInBox(unsigned long iPoint, int8_t val_sbsInBox) override
Set if the Stochastic Backscatter Model must be applied only in a confined box.
Definition CTurbSAVariable.hpp:125
void SetBesselIntegral(unsigned long iPoint, su2double val_integral) override
Set the integral of the product of three Bessel functions appearing in Laplacian smoothing.
Definition CTurbSAVariable.hpp:157
su2double GetBesselIntegral(unsigned long iPoint) const override
Get the the integral of the product of three Bessel functions appearing in Laplacian smoothing.
Definition CTurbSAVariable.hpp:163
su2double GetVortex_Tilting(unsigned long iPoint) const override
Get the vortex tilting measure for computation of the EDDES length scale.
Definition CTurbSAVariable.hpp:150
su2double GetLES_Mode(unsigned long iPoint) const override
Get the LES sensor.
Definition CTurbSAVariable.hpp:136
~CTurbSAVariable() override=default
Destructor of the class.
Base class for defining the variables of the turbulence model.
Definition CTurbVariable.hpp:38
passivedouble su2double
Definition code_config.hpp:181