TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Modele_turbulence_hyd_RANS_K_Eps_base.cpp
1/****************************************************************************
2* Copyright (c) 2018, 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#include <Modele_turbulence_hyd_RANS_K_Eps_base.h>
17#include <Transport_K_Eps_base.h>
18#include <Param.h>
19
20Implemente_base(Modele_turbulence_hyd_RANS_K_Eps_base, "Modele_turbulence_hyd_RANS_K_Eps_base", Modele_turbulence_hyd_2_eq_base);
21// XD mod_turb_hyd_rans_keps mod_turb_hyd_rans mod_turb_hyd_rans_keps INHERITS_BRACE Class for RANS turbulence model for
22// XD_CONT Navier-Stokes equations.
23
25
27
29{
31 param.ajouter("eps_min", &EPS_MIN_); // XD_ADD_P double
32 // XD_CONT Lower limitation of epsilon (default value 1.e-20).
33 param.ajouter("eps_max", &EPS_MAX_); // XD_ADD_P double
34 // XD_CONT Upper limitation of epsilon (default value 1.e+10).
35}
36
42
43bool Modele_turbulence_hyd_RANS_K_Eps_base::has_champ(const Motcle& nom, OBS_PTR(Champ_base)& ref_champ) const
44{
45 if (Modele_turbulence_hyd_base::has_champ(nom, ref_champ))
46 return true;
47
48 for (int i = 0; i < nombre_d_equations(); i++)
49 if (i==0 && get_eq_transport().has_champ(nom, ref_champ))
50 return true;
51
52 return false; /* rien trouve */
53}
54
56{
58 return true;
59
60 for (int i = 0; i < nombre_d_equations(); i++)
61 if (i==0 && get_eq_transport().has_champ(nom))
62 return true;
63
64 return false; /* rien trouve */
65}
66
68{
69 OBS_PTR(Champ_base) ref_champ;
70
71 if (Modele_turbulence_hyd_base::has_champ(nom, ref_champ))
72 return ref_champ;
73
74 for (int i = 0; i < nombre_d_equations(); i++)
75 if (i==0 && get_eq_transport().has_champ(nom))
76 return ref_champ;
77
78 throw std::runtime_error(std::string("Field ") + nom.getString() + std::string(" not found !"));
79}
80
88
89/*! @brief for PDI IO: retrieve name, type and dimensions of the fields to save/restore
90 *
91 */
93{
94 std::vector<YAML_data> data = Modele_turbulence_hyd_base::data_a_sauvegarder();
95 std::vector<YAML_data> eqn_transp = get_eq_transport().data_a_sauvegarder();
96 data.insert(data.end(), eqn_transp.begin(), eqn_transp.end());
97 return data;
98}
99
100/*! @brief Sauvegarde le modele de turbulence sur un flot de sortie.
101 *
102 * (en vue d'une reprise)
103 * Sauvegarde le type de l'objet et
104 * l'equation de transport K-epsilon associee.
105 *
106 * @param (Sortie& os) un flot de sortie
107 * @return (int) code de retour propage de: Transport_K_Eps::sauvegarder(Sortie&)
108 */
115
116/*! @brief Reprise du modele a partir d'un flot d'entree.
117 *
118 * Si l'equation portee par l'objet est non nulle
119 * on effectue une reprise "bidon".
120 *
121 * @param (Entree& is) un flot d'entree
122 * @return (int) code de retour propage de: Transport_K_Eps::sauvegarder(Sortie&) ou 1 si la reprise est bidon.
123 */
125{
127 if (mon_equation_)
128 return get_set_eq_transport().reprendre(is);
129 else
130 return reprendre_generique(is);
131}
132
133
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
int reprendre(Entree &) override
We resume the unknown from an input stream.
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the data to save/restore. This has to be overrode f...
virtual void completer()
Completes the construction (initialization) of objects associated with the equation.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
int sauvegarder(Sortie &) const override
We save the unknown, then the source terms to an output stream.
Classe Modele_turbulence_hyd_2_eq_base Classe de base des modeles de type RANS a deux equations.
virtual const Transport_2eq_base & get_eq_transport() const
virtual Transport_2eq_base & get_set_eq_transport()
Classe Modele_turbulence_hyd_RANS_K_Eps_base Classe de base des modeles de type RANS_keps.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
int reprendre(Entree &is) override
Reprise du modele a partir d'un flot d'entree.
const Champ_base & get_champ(const Motcle &nom) const override
int sauvegarder(Sortie &os) const override
Sauvegarde le modele de turbulence sur un flot de sortie.
OBS_PTR(Equation_base) mon_equation_
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
int reprendre(Entree &) override
Restores the wall law from a checkpoint.
int sauvegarder(Sortie &) const override
Saves the turbulence model to an output stream.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
A character string (Nom) in uppercase.
Definition Motcle.h:26
const std::string & getString() const
Definition Nom.h:92
An array of character strings (VECT(Nom)).
Definition Noms.h:26
friend class Entree
Definition Objet_U.h:71
friend class Sortie
Definition Objet_U.h:70
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
Base class for output streams.
Definition Sortie.h:52