TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Convection_Diffusion_Espece_Binaire_Turbulent_QC.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Convection_Diffusion_Espece_Binaire_Turbulent_QC.h>
17#include <Fluide_Quasi_Compressible.h>
18#include <Probleme_base.h>
19#include <Param.h>
20
21Implemente_instanciable(Convection_Diffusion_Espece_Binaire_Turbulent_QC, "Convection_Diffusion_Espece_Binaire_Turbulent_QC", Convection_Diffusion_Espece_Binaire_QC);
22// XD Convection_Diffusion_Espece_Binaire_Turbulent_QC convection_diffusion_espece_binaire_QC Convection_Diffusion_Espece_Binaire_Turbulent_QC INHERITS_BRACE Species conservation equation for a binary quasi-compressible fluid as well as the associated turbulence model equations.
23// XD attr modele_turbulence modele_turbulence_scal_base modele_turbulence OPT Turbulence model for the species
24// XD_CONT conservation equation.
25
27
29
35
37{
38 if (mot == "diffusion")
39 {
40 Cerr << "Reading and typing of the diffusion operator : " << finl;
41 terme_diffusif.associer_diffusivite(diffusivite_pour_transport());
42 ref_cast_non_const(Champ_base,terme_diffusif.diffusivite()).nommer("mu_sur_Schmidt");
44 terme_diffusif.associer_diffusivite_pour_pas_de_temps(diffusivite_pour_pas_de_temps());
45 return 1;
46 }
47 else if (mot == "modele_turbulence")
48 {
49 lire_modele(is, *this);
50 RefObjU le_modele;
51 le_modele = le_modele_turbulence.valeur();
52 liste_modeles_.add_if_not(le_modele);
53 return 1;
54 }
55 else
57}
58
59/*! @brief for PDI IO: retrieve name, type and dimensions of the fields to save/restore
60 *
61 */
63{
65 std::vector<YAML_data> turb = Convection_Diffusion_Turbulent::data_a_sauvegarder();
66 data.insert(data.end(), turb.begin(), turb.end());
67 return data;
68}
69
70/*! @brief Sauvegarde sur un flot de sortie, double appel a: Convection_Diffusion_Espece_Binaire_QC::sauvegarder(Sortie& );
71 *
72 * Convection_Diffusion_Turbulent::sauvegarder(Sortie& );
73 *
74 * @param (Sortie& os) un flot de sortie
75 * @return (int) renvoie toujours 1
76 */
77int Convection_Diffusion_Espece_Binaire_Turbulent_QC::sauvegarder(Sortie& os) const
78{
79 int bytes = 0;
82 return bytes;
83}
84
85/*! @brief Reprise a partir d'un flot d'entree, double appel a: Convection_Diffusion_Espece_Binaire_QC::reprendre(Entree& );
86 *
87 * Convection_Diffusion_Turbulent::reprendre(Entree&);
88 *
89 * @param (Entree& is) un flot d'entree
90 * @return (int) renvoie toujours 1
91 */
92int Convection_Diffusion_Espece_Binaire_Turbulent_QC::reprendre(Entree& is)
93{
96 return 1;
97}
98
99/*! @brief Double appel a: Convection_Diffusion_Turbulent::completer()
100 *
101 * Convection_Diffusion_Espece_Binaire_QC::completer()
102 *
103 */
105{
108}
109
110/*! @brief Mise a jour en temps de l'equation, double appel a: Convection_Diffusion_Espece_Binaire_QC::mettre_a_jour(double );
111 *
112 * Convection_Diffusion_Turbulent::mettre_a_jour(double );
113 *
114 * @param (double temps) le temps de mise a jour
115 */
116void Convection_Diffusion_Espece_Binaire_Turbulent_QC::mettre_a_jour(double temps)
117{
120}
121
123{
125
126 if (le_modele_turbulence)
127 le_modele_turbulence->creer_champ(motlu);
128}
129
130bool Convection_Diffusion_Espece_Binaire_Turbulent_QC::has_champ(const Motcle& nom, OBS_PTR(Champ_base)& ref_champ) const
131{
134
135 if (le_modele_turbulence)
136 if (le_modele_turbulence->has_champ(nom))
137 return le_modele_turbulence->has_champ(nom, ref_champ);
138
139 return false; /* rien trouve */
140}
141
143{
145 return true;
146
147 if (le_modele_turbulence)
148 if (le_modele_turbulence->has_champ(nom))
149 return true;
150
151 return false; /* rien trouve */
152}
153
155{
158
159 if (le_modele_turbulence)
160 if (le_modele_turbulence->has_champ(nom))
161 return le_modele_turbulence->get_champ(nom);
162
163 throw std::runtime_error(std::string("Field ") + nom.getString() + std::string(" not found !"));
164}
165
167{
169
170 if (le_modele_turbulence)
171 le_modele_turbulence->get_noms_champs_postraitables(nom, opt);
172}
173
174/*! @brief Double appel a: Convection_Diffusion_Turbulent::preparer_calcul()
175 *
176 * Convection_Diffusion_Espece_Binaire_QC::preparer_calcul()
177 *
178 * @return (int) renvoie toujours 1
179 */
181{
184
185 return 1;
186}
187
188void Convection_Diffusion_Espece_Binaire_Turbulent_QC::imprimer(Sortie& os) const
189{
191 le_modele_turbulence->imprimer(os);
192}
193
200
202{
203 for (const auto &itr : liste_modeles_)
204 {
205 const RefObjU& mod = itr;
206 if (mod)
207 if ((sub_type(Modele_turbulence_scal_base, mod.valeur())) && (type == TURBULENCE))
208 return mod;
209 }
210 return Equation_base::get_modele(type);
211}
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual void creer_champ(const Motcle &motlu)=0
virtual const Champ_base & get_champ(const Motcle &nom) const =0
virtual void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const =0
virtual bool has_champ(const Motcle &nom, OBS_PTR(Champ_base)&ref_champ) const =0
classe Convection_Diffusion_Espece_Binaire_QC Cas particulier de Convection_Diffusion_Espece_Binaire_...
void completer() override
Complete la construction (initialisation) des objets associes a l'equation.
classe Convection_Diffusion_Espece_Binaire_Turbulent_QC Cette classe represente le cas particulier de
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
void completer()
Complete le modele de turbulence.
Entree & lire_op_diff_turbulent(Entree &, const Equation_base &, Operateur_Diff &)
Entree & lire_modele(Entree &, const Equation_base &)
virtual int sauvegarder(Sortie &) const
Simple appel a Modele_turbulence_scal_base::sauvegarder(Sortie&) sur le membre concerne.
virtual void mettre_a_jour(double)
Mise a jour en temps du modele de turbulence.
virtual int reprendre(Entree &)
Reprise (apres une sauvegarde) a partir d'un flot d'entree.
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void set_param(Param &titi) const override
int reprendre(Entree &) override
On reprend l'inconnue a partir d'un flot d'entree.
virtual const RefObjU & get_modele(Type_modele type) const
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 imprimer(Sortie &os) const
Imprime les operateurs de l'equation si le schema en temps indique que c'est necessaire.
virtual void mettre_a_jour(double temps)
La valeur de l'inconnue sur le pas de temps a ete calculee.
virtual void completer()
Complete la construction (initialisation) des objets associes a l'equation.
virtual int preparer_calcul()
Tout ce qui ne depend pas des autres problemes eventuels.
int sauvegarder(Sortie &) const override
On sauvegarde l'inconnue, puis les sources sur un flot de sortie.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
virtual bool initTimeStep(double dt)
Allocation et initialisation de l'inconnue et des CLs jusqu'a present+dt.
Classe Modele_turbulence_scal_base Cette classe represente un modele de turbulence pour une equation ...
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
const std::string & getString() const
Definition Nom.h:92
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
@ REQUIRED
Definition Param.h:115
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
Classe de base des flux de sortie.
Definition Sortie.h:52
const Objet_U & valeur() const
Definition TRUST_Ref.h:134