TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Puissance_Thermique_QC_EF.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 <Puissance_Thermique_QC_EF.h>
17#include <Discretisation_base.h>
18#include <Probleme_base.h>
19#include <Milieu_base.h>
20#include <Domaine_Cl_EF.h>
21#include <Domaine_EF.h>
22
23Implemente_instanciable_sans_constructeur(Puissance_Thermique_QC_EF, "Puissance_Thermique_QC_EF", Terme_Source_EF_base);
24
26
28{
29 const Equation_base& eqn = equation();
31 champs_compris_.ajoute_champ(la_puissance);
32 return s;
33}
34
36{
37 const Domaine_EF& zEF = ref_cast(Domaine_EF, domaine_dis);
38 const Domaine_Cl_EF& zclEF = ref_cast(Domaine_Cl_EF, domaine_cl_dis);
39
40 iter_->associer_domaines(zEF, zclEF);
41
42 Eval_Puiss_Th_QC_EF& eval_puis = dynamic_cast<Eval_Puiss_Th_QC_EF&> (iter_->evaluateur());
43 eval_puis.associer_domaines(zEF, zclEF);
44}
45
47{
48 const Equation_base& eqn = pb.equation(0);
49 eqn.discretisation().nommer_completer_champ_physique(eqn.domaine_dis(), "Puissance_volumique", "W/m3", la_puissance, pb);
50
51 Eval_Puiss_Th_QC_EF& eval_puis = dynamic_cast<Eval_Puiss_Th_QC_EF&> (iter_->evaluateur());
53}
54
56{
57 if (champs_compris_.has_champ(nom, ref_champ))
58 return true;
59
60 return Terme_Source_EF_base::has_champ(nom, ref_champ);
61}
62
64{
65 if (champs_compris_.has_champ(nom))
66 return true;
67
69}
70
72{
73 OBS_PTR(Champ_base) ref_champ;
74
75 if (champs_compris_.has_champ(nom, ref_champ))
76 return ref_champ;
77
78 if (Terme_Source_EF_base::has_champ(nom, ref_champ))
79 return ref_champ;
80
81 throw std::runtime_error(std::string("Field ") + nom.getString() + std::string(" not found !"));
82}
84{
86 if (opt == DESCRIPTION)
87 Cerr << "Terme_Puissance_Thermique_QC_EF : " << champs_compris_.liste_noms_compris() << finl;
88 else
89 nom.add(champs_compris_.liste_noms_compris());
90}
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
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
void nommer_completer_champ_physique(const Domaine_dis_base &domaine_vdf, const Nom &nom_champ, const Nom &unite, Champ_base &champ, const Probleme_base &pbi) const
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_EF
Definition Domaine_EF.h:56
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
class Equation_base The role of an equation is the calculation of one or more fields....
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
void associer_puissance(const Champ_Don_base &)
void associer_domaines(const Domaine_dis_base &domaine, const Domaine_Cl_dis_base &domaine_cl)
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
OBS_PTR(Equation_base) mon_equation
A character string (Nom) in uppercase.
Definition Motcle.h:26
const std::string & getString() const
Definition Nom.h:92
An array of character strings (VECT(Nom)).
Definition Noms.h:26
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
class Puissance_Thermique_QC_EF
const Champ_base & get_champ(const Motcle &nom) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
void associer_pb(const Probleme_base &) override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
Base class for output streams.
Definition Sortie.h:52
void lire_donnees(Entree &, const Equation_base &eqn)
Reads the thermal power term from an input stream and an equation, possibly using the discretisation ...