TrioCFD 1.9.9_beta
TrioCFD documentation
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 not tested yet.... stopping " << finl;
35 return is;
36}
37
38// Description: method called by derived classes to type the source term
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 * Time update of the source term.
59 *
60 * @param (double) the time update step
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() << " can only be used in 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}
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
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
Fluide_Quasi_Compressible class This class represents a quasi-compressible fluid,.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
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
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
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
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
Derived classes compute a source term for the QC momentum equation.
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.
Source_base A Source_base object is a term appearing on the right-hand side of an.
Definition Source_base.h:42
virtual void completer()
Updates internal references of the Source_base object.