TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Source_QC_QDM_Gen.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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 <Source_QC_QDM_Gen.h>
17#include <Equation_base.h>
18#include <Discretisation_base.h>
19#include <Probleme_base.h>
20#include <Modifier_pour_fluide_dilatable.h>
21#include <Fluide_Quasi_Compressible.h>
22#include <TRUSTTrav.h>
23
24Implemente_instanciable(Source_QC_QDM_Gen,"Source_QC_QDM_Gen_QC",Source_base);
25
26Sortie& Source_QC_QDM_Gen::printOn(Sortie& os) const { return os; }
27
29{
30 Nom typ_complet;
31 is >> typ_complet;
32 readOn_spec(is, typ_complet);
33 Cerr << " Source_QC_QDM_Gen Pas teste encore.... on s'arrete " << finl;
35 return is;
36}
37
38// Desciption: methode appele par les classes filles pour typer le terme source
40{
41 source_incompressible.typer_direct(typ);
42 source_incompressible->associer_eqn(mon_equation.valeur());
43 is >> source_incompressible.valeur();
44 return is;
45}
46
47DoubleTab& Source_QC_QDM_Gen::ajouter(DoubleTab& resu) const
48{
49 DoubleTrav trav(resu);
50 source_incompressible.ajouter(trav);
51 // multiplication par rho de trav
52 multiplier_par_rho_si_dilatable(trav,equation().milieu());
53 resu+=trav;
54 return resu;
55}
56/*! @brief DOES NOTHING - to override in derived classes.
57 *
58 * Mise a jour en temps du terme source.
59 *
60 * @param (double) le pas de temps de mise a jour
61 */
63{
64 source_incompressible->mettre_a_jour(t);
65}
66
67/*! @brief Met a jour les references internes a l'objet Source_QC_QDM_Gen.
68 *
69 * Appelle 2 methodes virtuelles pures protegees:
70 * Source_QC_QDM_Gen::associer_domaines(const Domaine_dis_base& ,const Domaine_Cl_dis_base&)
71 * Source_QC_QDM_Gen::associer_pb(const Probleme_base&)
72 *
73 */
79
81{
82 return source_incompressible->impr(os);
83}
84
85DoubleTab& Source_QC_QDM_Gen::calculer(DoubleTab& resu) const
86{
87 resu=0.;
88 ajouter(resu);
89 return resu;
90}
92{
93 source_incompressible->associer_domaines_public(z,zcl);
94}
95
97{
98 if (!sub_type(Fluide_Quasi_Compressible, pb.equation(0).milieu()))
99 {
100 Cerr << que_suis_je() << " n'est a utiliser qu'en Quasi Compressible" << finl;
102 }
103}
104
106{
107 source_incompressible->creer_champ(motlu);
108}
109
111{
112 return source_incompressible->get_champ(nom);
113}
115{
116 source_incompressible->get_noms_champs_postraitables(nom,opt);
117}
118
119bool Source_QC_QDM_Gen::has_champ(const Motcle& nom, OBS_PTR(Champ_base)& ref_champ) const
120{
121 return source_incompressible->has_champ(nom, ref_champ);
122}
123
125{
126 return source_incompressible->has_champ(nom);
127}
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Milieu_base & milieu() const =0
classe Fluide_Quasi_Compressible Cette classe represente un d'un fluide quasi compressible
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
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
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
friend class Entree
Definition Objet_U.h:76
friend class Sortie
Definition Objet_U.h:75
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
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
virtual const Equation_base & equation(int) const =0
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
Classe Source_QC_QDM_Gen Ces classes filles permettent de calculer une source pour le QC.
int impr(Sortie &os) const override
void completer() override
Met a jour les references internes a l'objet Source_QC_QDM_Gen.
Entree & readOn_spec(Entree &, Nom &)
DoubleTab & ajouter(DoubleTab &) const override
void associer_pb(const Probleme_base &) override
const Champ_base & get_champ(const Motcle &nom) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
DoubleTab & calculer(DoubleTab &) const override
void creer_champ(const Motcle &motlu) override
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
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
classe Source_base Un objet Source_base est un terme apparaissant au second membre d'une
Definition Source_base.h:42
virtual void completer()
Met a jour les references internes a l'objet Source_base.