Documentation 6b54b78464
Loading...
Searching...
No Matches
trans_edge_flux.hpp
Go to the documentation of this file.
1/*!
2 * \file trans_edge_flux.hpp
3 * \brief Langtry-Menter transition model as a third-layer scalar flux, see numerics/scalar/scalar_edge_flux.hpp.
4 * \author P. Gomes
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 "../../scalar/scalar_edge_flux.hpp"
31
32/*!
33 * \class CScalarFlux_TransLM
34 * \ingroup ViscDiscr
35 * \brief Convection and diffusion of the Langtry-Menter transition model, conservative with a
36 * diagonal, i/j-symmetric diffusion matrix. The coefficients depend only on the flow's
37 * mu/mu_t, not on the transported gamma/Re_theta, so no coefficientJacobians override
38 * is needed.
39 * \note LM writes no finalizeFlux of its own: the inherited CUpwScalarFlux one is exactly
40 * flux(iVar) = a0*rho_i*phi_i(iVar) + a1*rho_j*phi_j(iVar), Conservative weighting by
41 * density, which is the model's whole convective term.
42 */
43template <class Double, class FlowIndices, int nDim, size_t nVar = 2>
45 : public CUpwScalarBase<Double, CScalarFlux_TransLM<Double, FlowIndices, nDim, nVar>, FlowIndices, nDim, nVar> {
46 public:
47 static constexpr bool Conservative = true;
48 static constexpr bool DiagonalDiffusion = true;
49
51 using Int = typename Base::Int;
52 using Base::Base;
53
54 /*!
55 * \brief Diffusion coefficients, an i/j average of (mu+mu_t) for intermittency and of
56 * 2*(mu+mu_t) for the momentum-thickness Reynolds number; identical for both edge sides.
57 */
58 template <class VariableType>
60 const EdgeSide<VariableType>& side_i, Int jPoint,
61 const EdgeSide<VariableType>& side_j,
62 const CPair<Double>&) const {
63 const Double mu_i = gatherVariables(iPoint, side_i.flowNodes->GetPrimitive(), idx.LaminarViscosity());
64 const Double mu_j = gatherVariables(jPoint, side_j.flowNodes->GetPrimitive(), idx.LaminarViscosity());
65 const Double muT_i = gatherVariables(iPoint, side_i.flowNodes->GetPrimitive(), idx.EddyViscosity());
66 const Double muT_j = gatherVariables(jPoint, side_j.flowNodes->GetPrimitive(), idx.EddyViscosity());
67
68 const Double diff_i_gamma = mu_i + muT_i;
69 const Double diff_j_gamma = mu_j + muT_j;
70 const Double diff_i_ReThetaT = 2.0 * (mu_i + muT_i);
71 const Double diff_j_ReThetaT = 2.0 * (mu_j + muT_j);
72
74 D(0) = 0.5 * (diff_i_gamma + diff_j_gamma);
75 D(1) = 0.5 * (diff_i_ReThetaT + diff_j_ReThetaT);
76 return {D, D};
77 }
78};
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
su2double GetPrimitive(unsigned long iPoint, unsigned long iVar) const final
Get a primitive variable.
Definition CFlowVariable.hpp:95
Convection and diffusion of the Langtry-Menter transition model, conservative with a diagonal,...
Definition trans_edge_flux.hpp:45
static constexpr bool DiagonalDiffusion
Definition trans_edge_flux.hpp:48
static constexpr bool Conservative
Definition trans_edge_flux.hpp:47
typename Base::Int Int
Definition trans_edge_flux.hpp:51
CPair< Vector< Double, nVar > > coefficients(const FlowIndices &idx, Int iPoint, const EdgeSide< VariableType > &side_i, Int jPoint, const EdgeSide< VariableType > &side_j, const CPair< Double > &) const
Diffusion coefficients, an i/j average of (mu+mu_t) for intermittency and of 2*(mu+mu_t) for the mome...
Definition trans_edge_flux.hpp:59
Upwind convection and diffusion of a transported scalar, accumulated into one residual,...
Definition scalar_edge_flux.hpp:316
typename CLaneTraits< Double_ >::Int Int
Definition scalar_edge_flux.hpp:319
Double_ Double
Definition scalar_edge_flux.hpp:318
const FlowIndices idx
Definition scalar_edge_flux.hpp:338
#define FORCEINLINE
Definition code_config.hpp:44
Double gatherVariables(Int iPoint, const Container &vars, size_t iVar=0)
Gather a single variable, from column iVar (0 by default) of row iPoint of a 2D container,...
Definition util.hpp:277
Simple pair type for i/j variables.
Definition util.hpp:130
Locates the data of one endpoint of an edge.
Definition scalar_edge_flux.hpp:42
const CFlowVariable * flowNodes
Flow variables, null for solid heat transfer.
Definition scalar_edge_flux.hpp:44