TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Echange_externe_impose_H.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 <Echange_externe_impose_H.h>
17#include <Fluide_Dilatable_base.h>
18#include <Equation_base.h>
19
20Implemente_instanciable(Echange_externe_impose_H, "Paroi_echange_externe_impose_H", Echange_externe_impose);
21// XD paroi_echange_externe_impose_h paroi_echange_externe_impose paroi_echange_externe_impose_h INHERITS_BRACE
22// XD_CONT Particular case of class paroi_echange_externe_impose for enthalpy equation.
23
24
25Sortie& Echange_externe_impose_H::printOn(Sortie& s) const { return s << que_suis_je() << finl; }
26
28{
29 if (app_domains.size() == 0) app_domains = { Motcle("Thermique_H") };
30
32}
33
34/*! @brief Complete the boundary conditions.
35 *
36 */
38{
40 le_fluide = ref_cast(Fluide_Dilatable_base, mon_dom_cl_dis->equation().milieu());
42}
43
44/*! @brief Returns the imposed temperature value for the i-th component of the boundary field.
45 *
46 * @param i Index of the boundary field component.
47 * @return Imposed temperature value.
48 */
50{
51 if (le_champ_front->valeurs().size() == 1)
52 {
53 if (modifier_val_imp == 1)
54 return le_fluide->calculer_H(le_champ_front->valeurs()(0, 0));
55 else
56 return le_champ_front->valeurs()(0, 0);
57 }
58 else if (le_champ_front->valeurs().dimension(1) == 1)
59 {
60 if (modifier_val_imp == 1)
61 return le_fluide->calculer_H(le_champ_front->valeurs()(i, 0));
62 else
63 return le_champ_front->valeurs()(i, 0);
64 }
65 else
66 Cerr << "Echange_impose_base::T_ext error" << finl;
67
68 abort();
69 return 0.;
70}
71
72/*! @brief Returns the imposed temperature value for the (i,j)-th component of the boundary field.
73 *
74 * @param i Row index of the boundary field component.
75 * @param j Column index of the boundary field component.
76 * @return Imposed temperature value.
77 */
78double Echange_externe_impose_H::T_ext(int i, int j) const
79{
80 if (le_champ_front->valeurs().dimension(0) == 1)
81 {
82 if (modifier_val_imp == 1)
83 return le_fluide->calculer_H(le_champ_front->valeurs()(0, j));
84 else
85 return le_champ_front->valeurs()(0, j);
86 }
87 else
88 {
89 if (modifier_val_imp == 1)
90 return le_fluide->calculer_H(le_champ_front->valeurs()(i, j));
91 else
92 return le_champ_front->valeurs()(i, j);
93 }
94}
virtual void completer()
DOES NOTHING must be overridden in derived classes.
std::vector< Motcle > app_domains
Particular case of the Echange_externe_impose class for an enthalpy equation.
Champ_front_base & T_ext() override
Returns the T_ext field of temperature imposed at the boundary.
void completer() override
Complete the boundary conditions.
Classe Echange_externe_impose: This class represents the special case of the class.
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
Base class for a dilatable fluid, inheriting from Fluide_base.
virtual const Equation_base & equation(const std::string &nom_inc) const
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
static void abort()
Abort routine for TRUST on a fatal error.
Definition Process.cpp:573
Base class for output streams.
Definition Sortie.h:52