Documentation 6b54b78464
Loading...
Searching...
No Matches
trans_correlations.hpp
Go to the documentation of this file.
1/*!
2 * \file trans_correlations.hpp
3 * \brief Numerics class for the LM model's correlation functions.
4 * \version 8.5.0 "Harrier"
5 *
6 * SU2 Project Website: https://su2code.github.io
7 *
8 * The SU2 Project is maintained by the SU2 Foundation
9 * (http://su2foundation.org)
10 *
11 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
12 *
13 * SU2 is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * SU2 is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
25 */
26
27#pragma once
28
29/*!
30 * \class TransLMCorrelations
31 * \brief Class for LM model's correlation functions.
32 * \ingroup SourceDiscr
33 * \author A. Rausa.
34 */
36 private:
37
38 LM_ParsedOptions options;
39
40 public:
41
42 /*!
43 * \brief Set LM options.
44 * \param[in] val_options - LM options structure.
45 */
46 void SetOptions(const LM_ParsedOptions val_options){
47 options = val_options;
48 }
49
50 /*!
51 * \brief Compute Re_theta_c from correlations.
52 * \param[in] Tu - Turbulence intensity.
53 * \param[in] Re_theta_t - Re_theta_t (TransVar[1]).
54 * \param[out] rethetac - Corrected value for Re_theta.
55 */
56 su2double ReThetaC_Correlations(const su2double Tu, const su2double Re_theta_t) const {
57
58 su2double rethetac = 0.0;
59
60 switch (options.Correlation) {
62 rethetac = min(0.615 * Re_theta_t + 61.5, Re_theta_t);
63 break;
64 }
65
67 rethetac = min(0.1 * exp(-0.0022 * Re_theta_t + 12), 300.0);
68 break;
69 }
70
72 rethetac = 0.91 * Re_theta_t + 5.32;
73 break;
74 }
75
77 const su2double FirstTerm = -0.042 * pow(Tu, 3);
78 const su2double SecondTerm = 0.4233 * pow(Tu, 2);
79 const su2double ThirdTerm = 0.0118 * pow(Tu, 1);
80 rethetac = Re_theta_t / (FirstTerm + SecondTerm + ThirdTerm + 1.0744);
81 break;
82 }
83
85 const su2double FirstTerm = 4.45 * pow(Tu, 3);
86 const su2double SecondTerm = 5.7 * pow(Tu, 2);
87 const su2double ThirdTerm = 1.37 * pow(Tu, 1);
88 rethetac = (FirstTerm - SecondTerm + ThirdTerm + 0.585) * Re_theta_t;
89 break;
90 }
91
93 rethetac = 0.62 * Re_theta_t;
94 break;
95 }
96
98 if (Re_theta_t <= 1870) {
99 const su2double FirstTerm = (-396.035 * pow(10, -2));
100 const su2double SecondTerm = (10120.656 * pow(10, -4)) * Re_theta_t;
101 const su2double ThirdTerm = (-868.230 * pow(10, -6)) * pow(Re_theta_t, 2);
102 const su2double ForthTerm = (696.506 * pow(10, -9)) * pow(Re_theta_t, 3);
103 const su2double FifthTerm = (-174.105 * pow(10, -12)) * pow(Re_theta_t, 4);
104 rethetac = FirstTerm + SecondTerm + ThirdTerm + ForthTerm + FifthTerm;
105 } else {
106 rethetac = Re_theta_t - (593.11 + 0.482 * (Re_theta_t - 1870.0));
107 }
108
109 break;
110 }
112 SU2_MPI::Error("Transition correlation is set to DEFAULT but no default value has ben set in the code.",
114 break;
115 }
116
117 return rethetac;
118 }
119
120 /*!
121 * \brief Compute FLength from correlations.
122 * \param[in] Tu - Turbulence intensity.
123 * \param[in] Re_theta_t - Re_theta_t (TransVar[1]).
124 * \param[out] F_length1 - Value for the F_length1 variable.
125 */
126 su2double FLength_Correlations(const su2double Tu, const su2double Re_theta_t) const {
127 su2double F_length1 = 0.0;
128
129 switch (options.Correlation) {
131 F_length1 = min(exp(7.168 - 0.01173 * Re_theta_t) + 0.5, 300.0);
132 break;
133 }
134
136 const su2double FirstTerm = -pow(0.025 * Re_theta_t, 2) + 1.47 * Re_theta_t - 120.0;
137 F_length1 = min(max(FirstTerm, 125.0), Re_theta_t);
138 break;
139 }
140
142 F_length1 = 3.39 * Re_theta_t + 55.03;
143 break;
144 }
145
147 if (Tu <= 1.) {
148 F_length1 = log(Re_theta_t + 1) / Tu;
149 } else {
150 const su2double FirstTerm = 0.2337 * pow(Tu, 2);
151 const su2double SecondTerm = -1.3493 * pow(Tu, 1);
152 F_length1 = log(Re_theta_t + 1) * (FirstTerm + SecondTerm + 2.1449);
153 }
154 break;
155 }
156
158 const su2double FirstTerm = 0.171 * pow(Tu, 2);
159 const su2double SecondTerm = 0.0083 * pow(Tu, 1);
160 F_length1 = (FirstTerm - SecondTerm + 0.0306);
161 break;
162 }
163
165 F_length1 = 40;
166 break;
167 }
168
170 if (Re_theta_t < 400) {
171 F_length1 = 39.8189 + (-119.270 * pow(10, -4)) * Re_theta_t +
172 (-132.567 * pow(10, -6)) * Re_theta_t * Re_theta_t;
173 } else if (Re_theta_t < 596) {
174 F_length1 = 263.404 + (-123.939 * pow(10, -2)) * Re_theta_t +
175 (194.548 * pow(10, -5)) * pow(Re_theta_t, 2) +
176 (-101.695 * pow(10, -8)) * pow(Re_theta_t, 3);
177 } else if (Re_theta_t < 1200) {
178 F_length1 = 0.5 - (3.0 * pow(10, -4)) * (Re_theta_t - 596.0);
179 } else {
180 F_length1 = 0.3188;
181 }
182 break;
183 }
185 SU2_MPI::Error("Transition correlation is set to DEFAULT but no default value has ben set in the code.",
187 break;
188 }
189
190 return F_length1;
191 }
192};
static void Error(const std::string &ErrorMsg, const std::string &FunctionName)
Definition mpi_structure.cpp:131
Class for LM model's correlation functions.
Definition trans_correlations.hpp:35
void SetOptions(const LM_ParsedOptions val_options)
Set LM options.
Definition trans_correlations.hpp:46
su2double FLength_Correlations(const su2double Tu, const su2double Re_theta_t) const
Compute FLength from correlations.
Definition trans_correlations.hpp:126
su2double ReThetaC_Correlations(const su2double Tu, const su2double Re_theta_t) const
Compute Re_theta_c from correlations.
Definition trans_correlations.hpp:56
passivedouble su2double
Definition code_config.hpp:181
FORCEINLINE ARRAY_T exp(const ARRAY_T &x)
Definition special_vectorization.hpp:156
FORCEINLINE ARRAY_T pow(const ARRAY_T &a, const ARRAY_T &b)
Definition special_vectorization.hpp:179
#define CURRENT_FUNCTION
Definition mpi_structure.hpp:59
@ MEDIDA_BAEDER
Kind of transition correlation model (Medida-Baeder).
@ KRAUSE
Kind of transition correlation model (Krause).
@ MENTER_LANGTRY
Kind of transition correlation model (Menter-Langtry).
@ KRAUSE_HYPER
Kind of transition correlation model (Krause hypersonic).
@ DEFAULT
Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA).
@ MALAN
Kind of transition correlation model (Malan).
@ SULUKSNA
Kind of transition correlation model (Suluksna).
@ MEDIDA
Kind of transition correlation model (Medida).
Structure containing parsed LM options.
Definition option_structure.hpp:1417
TURB_TRANS_CORRELATION Correlation
Definition option_structure.hpp:1420