TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Modele_turbulence_hyd_K_Omega.h
1/****************************************************************************
2* Copyright (c) 2023, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Modele_turbulence_hyd_K_Omega_included
17#define Modele_turbulence_hyd_K_Omega_included
18
19#include <TRUSTTabs_forward.h>
20#include <Transport_K_Omega.h>
21#include <Modele_turbulence_hyd_RANS_K_Omega_base.h>
22
23/*! @brief Classe Modele_turbulence_hyd_K_Omega Cette classe represente le modele de turbulence (k, omega) pour les
24 *
25 * equations de Navier-Stokes.
26 *
27 * @sa Modele_turbulence_hyd_base Modele_turbulence_hyd_LES_base
28 */
30{
31 Declare_instanciable(Modele_turbulence_hyd_K_Omega);
32public:
33 void set_param(Param& param) const override;
34 int preparer_calcul() override;
35 void completer() override;
36 bool initTimeStep(double dt) override;
37 void mettre_a_jour(double) override;
38 virtual inline Champ_Inc_base& get_set_eq_K_Omega();
39 virtual inline const Champ_Inc_base& get_eq_K_Omega() const;
41 inline const Transport_K_Omega_base& get_eq_transport() const override;
42 void get_noms_champs_postraitables(Noms& nom,Option opt=NONE) const override;
43 void discretiser() override;
44
45 inline const DoubleTab& get_tabF1() const;
46 inline DoubleTab& get_tabF1();
47 inline const DoubleTab& get_tabF2() const;
48 inline DoubleTab& get_tabF2();
49 inline const DoubleTab& get_enstrophy() const;
50 inline DoubleTab& get_enstrophy();
51 inline const DoubleTab& get_strain_invariant() const;
52 inline DoubleTab& get_strain_invariant();
53
56
57 inline bool is_SST() const { return is_SST_ ;}
58 inline bool is_SST_or_BSL() const { return is_BSL_ ;} // if SST is a specialization of BSL
59
60protected:
61 void fill_turbulent_viscosity_tab(const DoubleTab& K_Omega, DoubleTab& turbulent_viscosity);
62 OWN_PTR(Champ_Fonc_base) tabF1_; // Blending field for SST model
63 OWN_PTR(Champ_Fonc_base) tabF2_; // for the turbulent viscosity in the SST model
64 OWN_PTR(Champ_Fonc_base) enstrophy_; // for the turbulent viscosity in the SST model
65 OWN_PTR(Champ_Fonc_base) strain_invariant_; // for the turbulent viscosity in the SST model
66 OWN_PTR(Champ_Inc_base) visco_turb_au_format_K_Omega_;
67 bool is_SST_ = false; // check if model variant is SST
68 bool is_BSL_ = false; // check if model variant is BSL
69};
70
71/*! @brief Renvoie le champ inconnue du modele de turbulence i.
72 *
73 * e. : (K, Omega). Cette inconnue est portee
74 * par l'equation de transport K-Omega porte par le modele.
75 * (version const)
76 *
77 * @return (Champ_Inc_base&) le champ inconnue (K, Omega)
78 */
80{
82 return inc;
83}
84
85/*! @brief Renvoie le champ inconnue du modele de turbulence i.
86 *
87 * e. : (K, Omega). Cette inconnue est portee
88 * par l'equation de transport K-Omega porte par le modele.
89 *
90 * @return (Champ_Inc_base&) le champ inconnue (K, Omega)
91 */
96
98{
99 const Transport_K_Omega_base& eq_transport=ref_cast(Transport_K_Omega_base,ptr_eq_transport_.valeur());
100 return eq_transport;
101}
102
104{
105 Transport_K_Omega_base& eq_transport=ref_cast(Transport_K_Omega_base,ptr_eq_transport_.valeur());
106 return eq_transport;
107}
108
109/*! @brief Returns the blending table F1 for SST.
110 *
111 * (version const)
112 *
113 * @return (DoubleTab&) tabF1_
114 */
115inline const DoubleTab& Modele_turbulence_hyd_K_Omega::get_tabF1() const
116{
117 return tabF1_->valeurs();
118}
119
120/*! @brief Returns the blending table F1 for SST.
121 *
122 * @return (DoubleTab&) tabF1_
123 */
125{
126 return tabF1_->valeurs();
127}
128
129/*! @brief Returns the table F2 for SST.
130 *
131 * (version const)
132 *
133 * @return (DoubleTab&) tabF2_
134 */
135inline const DoubleTab& Modele_turbulence_hyd_K_Omega::get_tabF2() const
136{
137 return tabF2_->valeurs();
138}
139
140/*! @brief Returns the table F2 for SST.
141 *
142 * @return (DoubleTab&) tabF2_
143 */
145{
146 return tabF2_->valeurs();
147}
148
149/*! @brief Returns the field enstrophy.
150 *
151 * (version const)
152 *
153 * @return (DoubleTab&) enstrophy
154 */
155inline const DoubleTab& Modele_turbulence_hyd_K_Omega::get_enstrophy() const
156{
157 return enstrophy_->valeurs();
158}
159
160/*! @brief Returns the field F2.
161 *
162 * @return (DoubleTab&) tabF2
163 */
165{
166 return enstrophy_->valeurs();
167}
168
169/*! @brief Returns the field strain_invariant.
170 *
171 * (version const)
172 *
173 * @return (DoubleTab&) enstrophy
174 */
176{
177 return strain_invariant_->valeurs();
178}
179
180/*! @brief Returns the field F2.
181 *
182 * @return (DoubleTab&) tabF2
183 */
185{
186 return strain_invariant_->valeurs();
187}
188#endif /* Modele_turbulence_hyd_K_Omega_included */
classe Champ_Fonc_base Classe de base des champs qui sont fonction d'une grandeur calculee
Classe Champ_Inc_base.
Classe Modele_turbulence_hyd_K_Omega Cette classe represente le modele de turbulence (k,...
OWN_PTR(Champ_Fonc_base) tabF1_
OWN_PTR(Champ_Fonc_base) tabF2_
OWN_PTR(Champ_Fonc_base) strain_invariant_
const DoubleTab & get_enstrophy() const
Returns the field enstrophy.
const DoubleTab & get_tabF2() const
Returns the table F2 for SST.
const DoubleTab & get_tabF1() const
Returns the blending table F1 for SST.
virtual const Champ_Inc_base & get_eq_K_Omega() const
Renvoie le champ inconnue du modele de turbulence i.
OWN_PTR(Champ_Inc_base) visco_turb_au_format_K_Omega_
virtual Champ_Inc_base & get_set_eq_K_Omega()
Renvoie le champ inconnue du modele de turbulence i.
OWN_PTR(Champ_Fonc_base) enstrophy_
void fill_turbulent_viscosity_tab(const DoubleTab &K_Omega, DoubleTab &turbulent_viscosity)
Fill the turbulent viscosity table depending on the model.
void set_param(Param &param) const override
void mettre_a_jour(double) override
Performs a time update of the turbulence model.
int preparer_calcul() override
Prepare the computation of the k-omega model.
Transport_K_Omega_base & get_set_eq_transport() override
const DoubleTab & get_strain_invariant() const
Returns the field strain_invariant.
const Transport_K_Omega_base & get_eq_transport() const override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
void discretiser() override
Discretise le modele de turbulence.
virtual Champ_Fonc_base & calculer_viscosite_turbulente(double)
Calcule la viscosite turbulente au temps demande.
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Classe Transport_K_Omega_base Classe de base pour les equations.
const Champ_Inc_base & inconnue() const override
Renvoie le champ inconnue de l'equation.
int controler_K_Omega()
Controle le champ inconnue K-Omega en forcant a zero les valeurs du champ.