TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Neumann_sortie_libre_Temp_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 <Neumann_sortie_libre_Temp_H.h>
17#include <Fluide_Dilatable_base.h>
18#include <Equation_base.h>
19
20Implemente_instanciable(Neumann_sortie_libre_Temp_H, "Sortie_libre_temperature_imposee_H", Neumann_sortie_libre);
21// XD sortie_libre_temperature_imposee_h neumann sortie_libre_temperature_imposee_h NO_BRACE Open boundary for heat
22// XD_CONT equation with enthalpy as unknown.
23// XD attr ch front_field_base ch REQ Boundary field type.
24
25
26Sortie& Neumann_sortie_libre_Temp_H::printOn(Sortie& s) const { return s << que_suis_je() << finl; }
27
29{
30 if (app_domains.size() == 0) app_domains = { Motcle("Thermique_H") };
31
32 s >> le_champ_ext;
33 le_champ_front = le_champ_ext;
34
35 return s;
36}
37
38/*! @brief Complete les conditions aux limites.
39 *
40 */
42{
43 le_fluide = ref_cast(Fluide_Dilatable_base, mon_dom_cl_dis->equation().milieu());
45}
46
47/*! @brief Renvoie la valeur de la i-eme composante du champ impose a l'exterieur de la frontiere.
48 *
49 * @param (int i) indice suivant la premiere dimension du champ
50 * @return (double) la valeur imposee sur la composante du champ specifiee
51 * @throws deuxieme dimension du champ de frontiere superieur a 1
52 */
54{
55 if (le_champ_ext->valeurs().size() == 1)
56 {
57 if (modifier_val_imp == 1)
58 return le_fluide->calculer_H(le_champ_ext->valeurs()(0, 0));
59 else
60 return le_champ_ext->valeurs()(0, 0);
61 }
62 else if (le_champ_ext->valeurs().dimension(1) == 1)
63 {
64 if (modifier_val_imp == 1)
65 return le_fluide->calculer_H(le_champ_ext->valeurs()(i, 0));
66 else
67 return le_champ_ext->valeurs()(i, 0);
68 }
69 else
70 {
71 Cerr << "Neumann_sortie_libre_Temp_H::val_ext" << finl;
72 Cerr << le_champ_ext << finl;
73 }
74
75 abort();
76 return 0.;
77}
78
79/*! @brief Renvoie la valeur de la (i,j)-eme composante du champ impose a l'exterieur de la frontiere.
80 *
81 * @param (int i) indice suivant la premiere dimension du champ
82 * @param (int j) indice suivant la deuxieme dimension du champ
83 * @return (double) la valeur imposee sur la composante du champ specifiee
84 */
85double Neumann_sortie_libre_Temp_H::val_ext(int i, int j) const
86{
87 if (le_champ_ext->valeurs().dimension(0) == 1)
88 {
89 if (modifier_val_imp == 1)
90 return le_fluide->calculer_H(le_champ_ext->valeurs()(0, j));
91 else
92 return le_champ_ext->valeurs()(0, j);
93 }
94 else
95 {
96 if (modifier_val_imp == 1)
97 return le_fluide->calculer_H(le_champ_ext->valeurs()(i, j));
98 else
99 return le_champ_ext->valeurs()(i, j);
100 }
101}
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
classe Fluide_Dilatable_base Cette classe represente un d'un fluide dilatable,
virtual const Equation_base & equation(const std::string &nom_inc) const
classe Neumann_sortie_libre_Temp_H Cette classe represente une frontiere ouverte a temperature impose...
void completer() override
Complete les conditions aux limites.
classe Neumann_sortie_libre Cette classe represente une frontiere ouverte sans vitesse imposee
const DoubleTab & val_ext() const
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
static void abort()
Routine de sortie de Trio-U sur une erreur abort().
Definition Process.cpp:570
Classe de base des flux de sortie.
Definition Sortie.h:52