TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Conservation_Euler_base.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 <Conservation_Euler_base.h>
17#include <Pb_Euler.h>
18#include <EChaine.h>
19
20Implemente_base(Conservation_Euler_base, "Conservation_Euler_base", Convection_Diffusion_std);
21// XD cons_euler eqn_base cons_euler INHERITS_BRACE Base class equation for a multi-phase Euler conservation equations
22// XD attr termes_non_conservatifs bloc_op_non_conservativtifs non_conservative_terms OPT Keyword to alter the
23// XD_CONT non-conservative scheme.
24
25// XD bloc_op_non_conservativtifs objet_lecture nul NO_BRACE not_set
26// XD attr aco chaine(into=["{"]) aco REQ Opening curly bracket.
27// XD attr operateur op_non_conservativtifs_deriv operateur REQ not_set
28// XD attr acof chaine(into=["}"]) acof REQ Closing curly bracket.
29
31
33{
34 assert(l_inco_ch_ && le_fluide_);
36
37 if (!sub_type(Pb_Euler, probleme()))
38 {
39 Cerr << "Equation " << que_suis_je() << " can only used with a pb of type Pb_Euler not " << probleme().que_suis_je() << " !!" << finl;
41 }
42 return is;
43}
44
46{
47 if (mot == "convection")
48 {
49 Cerr << "Reading and typing of the convection operator : " << finl;
50 const Champ_base& ch_vitesse_transportante = vitesse_pour_transport();
51 associer_vitesse(ch_vitesse_transportante);
52 terme_convectif.associer_vitesse(ch_vitesse_transportante);
53 is >> terme_convectif;
54 terme_convectif.associer_eqn(*this);
55 return 1;
56 }
57 else if (mot == "termes_non_conservatifs|non_conservative_terms")
58 {
59 Cerr << "Reading and typing of the non_conservative_terms operator : " << finl;
60 is >> terme_nconserv_;
61 terme_nconserv_.associer_eqn(*this);
62 return 1;
63 }
64 else
66}
67
69{
70 assert(sub_type(Pb_Euler, probleme()));
71 // si monophasique et termes_non_conservatifs non-lu ... on type sans error !
72 const bool is_single_phase = (ref_cast(Pb_Euler, probleme()).nb_phases() == 1);
73 if (is_single_phase && !terme_nconserv_)
74 {
75 EChaine str(" { negligeable } ");
76 str >> terme_nconserv_;
77 terme_nconserv_.associer_eqn(*this);
78 }
79 else if (!is_single_phase && !terme_nconserv_)
80 {
81 Cerr << "Error while reading " << que_suis_je() << " !!! non_conservative_terms operator is not read although it is required !!! Fix your data file ..." << finl;
83 }
84}
85
87{
88 associer_fluide(ref_cast(Fluide_base, un_milieu));
89}
90
92{
93 assert(sub_type(Fluide_base,un_fluide));
94 le_fluide_ = ref_cast(Fluide_base, un_fluide);
95}
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
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.
void associer_milieu_base(const Milieu_base &) override
void associer_fluide(const Fluide_base &)
classe Convection_Diffusion_std Cette classe est la base des equations modelisant le transport
void associer_vitesse(const Champ_base &)
Associe la vitesse transportante a l'equation.
virtual const Champ_base & vitesse_pour_transport() const
Une entree dont la source est une chaine de caracteres.
Definition EChaine.h:31
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
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 Fluide_base Cette classe represente un d'un fluide incompressible ainsi que
Definition Fluide_base.h:38
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
Definition Milieu_base.h:50
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
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
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