TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Temperature_imposee_paroi_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 <Temperature_imposee_paroi_H.h>
17#include <Fluide_Dilatable_base.h>
18#include <Equation_base.h>
19
20Implemente_instanciable(Temperature_imposee_paroi_H, "Paroi_temperature_imposee_H", Temperature_imposee_paroi);
21
22Sortie& Temperature_imposee_paroi_H::printOn(Sortie& s) const { return s << que_suis_je() << finl; }
23
25{
26 if (app_domains.size() == 0) app_domains = { Motcle("Thermique_H") };
27 if (supp_discs.size() == 0) supp_discs = { Nom("VEF"), Nom("EF"), Nom("EF_axi"), Nom("VEF_P1_P1"), Nom("VEFPreP1B"), Nom("PolyMAC_CDO"), Nom("PolyMAC_HFV"), Nom("PolyMAC_MPFA") };
28
29 return Dirichlet::readOn(s);
30}
31
32/*! @brief Complete the boundary conditions.
33 *
34 */
36{
37 le_fluide = ref_cast(Fluide_Dilatable_base, mon_dom_cl_dis->equation().milieu());
39}
40
41/*! @brief Returns the imposed value for the i-th component of the boundary field.
42 *
43 * @param i Index along the first dimension of the field.
44 * @return Imposed value for the specified field component.
45 */
47{
48 if (le_champ_front->valeurs().size() == 1)
49 {
50 if (modifier_val_imp == 1)
51 return le_fluide->calculer_H(le_champ_front->valeurs()(0, 0));
52 else
53 return le_champ_front->valeurs()(0, 0);
54 }
55 else if (le_champ_front->valeurs().dimension(1) == 1)
56 {
57 if (modifier_val_imp == 1)
58 return le_fluide->calculer_H(le_champ_front->valeurs()(i, 0));
59 else
60 return le_champ_front->valeurs()(i, 0);
61 }
62 else
63 Cerr << "Temperature_imposee_paroi_H::val_imp error" << finl;
64
65 abort();
66 return 0.;
67}
68
69/*! @brief Returns the imposed value for the (i,j)-th component of the boundary field.
70 *
71 * @param i Index along the first dimension of the field.
72 * @param j Index along the second dimension of the field.
73 * @return Imposed value for the specified field component.
74 */
75double Temperature_imposee_paroi_H::val_imp(int i, int j) const
76{
77 if (le_champ_front->valeurs().dimension(0) == 1)
78 {
79 if (modifier_val_imp == 1)
80 return le_fluide->calculer_H(le_champ_front->valeurs()(0, j));
81 else
82 return le_champ_front->valeurs()(0, j);
83 }
84 else
85 {
86 if (modifier_val_imp == 1)
87 return le_fluide->calculer_H(le_champ_front->valeurs()(i, j));
88 else
89 return le_champ_front->valeurs()(i, j);
90 }
91}
std::vector< Nom > supp_discs
std::vector< Motcle > app_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
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
Imposes the wall temperature in a Convection_Diffusion_Enthalpie-type equation.
void completer() override
Complete the boundary conditions.
double val_imp(int i) const override
Returns the imposed value for the i-th component of the boundary field.
Temperature_imposee_paroi Imposes the wall temperature in a Convection_Diffusion_Temperature type equ...