TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Modele_turbulence_hyd_2_eq_base.cpp
1/****************************************************************************
2* Copyright (c) 2025, 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_2_eq_base.h>
17#include <TRUST_2_PDI.h>
18#include <TRUSTTrav.h>
19#include <Param.h>
20
21Implemente_base(Modele_turbulence_hyd_2_eq_base, "Modele_turbulence_hyd_2_eq_base", Modele_turbulence_hyd_base);
22
25
27{
29 param.ajouter_non_std("Transport_equation", (this)); // cannot be REQUIRED because of Bicephale models
30 param.ajouter_non_std("Transport_K_Epsilon", (this));
31 param.ajouter_non_std("Transport_K_Omega", (this));
32 param.ajouter_non_std("Transport_K_Epsilon_Realisable", (this));
33 param.ajouter_non_std("transport_k", (this));
34 param.ajouter_non_std("transport_epsilon", (this));
35 param.ajouter("k_min", &K_MIN_);
36 param.ajouter_flag("quiet", &lquiet_);
37}
38
40{
41 if (mot == "transport_equation")
42 {
43 Motcle typ_eq;
44 is>> typ_eq;
45 Nom name_transport_eq=typ_eq;
46 ptr_eq_transport_.typer(name_transport_eq);
48 if (ptr_eq_transport_) ptr_eq_transport_->discretiser();
50 }
51 else if (mot == "Transport_K_Epsilon" || mot == "Transport_K_Omega" || mot == "Transport_K_Epsilon_Realisable")
52 {
53 Cerr << "Error: You are using an obsolete syntaxe for " << mot << " in your datafile!!!!!!!!!!!!!!!!" << finl;
54 Cerr << " Since v1.9.7, you should replace:" << finl;
55 Cerr << " " << mot << finl;
56 Cerr << " by:" << finl;
57 Cerr << " Transport_equation " << mot << finl;
58 Cerr << "Please update your datafile" << finl;
60 }
61 else if (mot == "transport_k" || mot == "transport_epsilon")
62 {
63 Cerr << "Error: You are using an obsolete syntaxe for " << mot << " in your datafile!!!!!!!!!!!!!!!!" << finl;
64 Cerr << " Since v1.9.7, you should use a block like:" << finl;
65 Cerr << " List_transport_equations {" << finl;
66 Cerr << " K_equation transport_k_ou_eps { .... }" << finl;
67 Cerr << " Eps_equation transport_k_ou_eps { .... }" << finl;
68 Cerr << " }" << finl;
69 Cerr << "Please update your datafile" << finl;
71 }
72 else
74 return 1;
75}
76
78{
80 if (ptr_eq_transport_) ptr_eq_transport_->creer_champ(motlu);
81}
82
84{
85 Nom lp = loipar_->que_suis_je();
86 if (lp == "negligeable_VEF" || lp == "negligeable_VDF")
87 {
88 Cerr << "The turbulence model of type " << que_suis_je() << finl;
89 Cerr << "must not be used with a wall law of type negligeable." << finl;
90 Cerr << "Another wall law must be selected with this kind of turbulence model." << finl;
92 }
93}
94
96{
98 {
99 Cerr <<"Problem in the resumption of Modele_turbulence_hyd_2_eq_base" << finl;
100 Cerr << "PDI format does not require to navigate through file..." << finl;
102 }
103
104 double dbidon;
105 Nom bidon;
106 DoubleTrav tab_bidon;
107 is >> bidon >> bidon;
108 is >> dbidon;
109 tab_bidon.jump(is);
110 return 1;
111}
112
114{
115 const Transport_2eq_base& eq_transport = ptr_eq_transport_.valeur();
116 return eq_transport;
117}
118
123
125{
126 const Champ_Inc_base& unkwown = get_eq_transport().inconnue();
127 return unkwown;
128}
Classe Champ_Inc_base.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
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
void creer_champ(const Motcle &motlu) override
virtual Transport_2eq_base & get_set_eq_transport()
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.
Classe Modele_turbulence_hyd_base Cette classe sert de base a la hierarchie des classes.
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 void set_param(Param &param) const override
void creer_champ(const Motcle &motlu) override
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:76
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
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
void ajouter_flag(const char *keyword, const bool *value)
Register a boolean flag whose mere presence switches it to true.
Definition Param.cpp:474
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
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
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
void jump(Entree &) override
Definition TRUSTTab.tpp:701
static int is_PDI_restart()
Classe Transport_2eq_base Classe de base pour les equations.
virtual void associer_modele_turbulence(const Modele_turbulence_hyd_2_eq_base &)=0