TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Boundary_Conditions_Thermique.cpp
1/****************************************************************************
2* Copyright (c) 2025, 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 <Boundary_Conditions_Thermique.h>
17#include <Param.h>
18
19Implemente_instanciable_sans_constructeur( Boundary_Conditions_Thermique, "Boundary_Conditions_Thermique", Objet_U ) ;
20
21static const double invalid_thermal_value = 12345e30;
22
23Boundary_Conditions_Thermique::Boundary_Conditions_Thermique()
24{
27 temperature_imposee_kmin_ = invalid_thermal_value;
28 temperature_imposee_kmax_ = invalid_thermal_value;
29 flux_impose_kmin_ = invalid_thermal_value;
30 flux_impose_kmax_ = invalid_thermal_value;
31}
32
33// SYNTAXE:
34// {
35// BCTYPE_KMIN Paroi_Temperature_imposee|Paroi_Flux_impose|perio
36// temperature_imposee_kmin double (optional)
37// flux_impose_kmin double (optional)
38// BCTYPE_KMAX Paroi_Temperature_imposee|Paroi_Flux_impose|perio
39//
40
41
43{
44 Objet_U::printOn( os );
45 return os;
46}
47
49{
50 Param param(que_suis_je());
51
52 param.ajouter("bctype_kmin", &bctype_kmin_, Param::REQUIRED);
53 param.dictionnaire("Paroi_Temperature_imposee", Paroi_Temperature_imposee);
54 param.dictionnaire("Paroi_Flux_impose", Paroi_Flux_impose);
55 param.dictionnaire("Perio", Perio);
56
57 param.ajouter("bctype_kmax", &bctype_kmax_, Param::REQUIRED);
58 param.dictionnaire("Paroi_Temperature_imposee", Paroi_Temperature_imposee);
59 param.dictionnaire("Paroi_Flux_impose", Paroi_Flux_impose);
60 param.dictionnaire("Perio", Perio);
61// param.ajouter_condition("IS_READ_TEMPERATURE_IMPOSEE_KMIN && VALUE_OF_TEMPERATURE_IMPOSEE_KMAX","Flux or Temperature must be associated to the BC if not perio");
62
63 param.ajouter("temperature_imposee_kmin", &temperature_imposee_kmin_);
64 param.ajouter("temperature_imposee_kmax", &temperature_imposee_kmax_);
65 param.ajouter("flux_impose_kmin", &flux_impose_kmin_);
66 param.ajouter("flux_impose_kmax", &flux_impose_kmax_);
67 param.lire_avec_accolades(is);
68
69 // Check whether kmin BC is correctly defined
70 if ((get_bctype_k_min() == Paroi_Temperature_imposee) && (temperature_imposee_kmin_>invalid_thermal_value*0.99))
71 {
72 Cerr << "Value of temperature for kmin Boundary Condition is missing." << finl;
74 }
75 else if ((get_bctype_k_min() == Paroi_Flux_impose) && (flux_impose_kmin_>invalid_thermal_value*0.99))
76 {
77 Cerr << "Value of flux for kmin Boundary Condition is missing." << finl;
79 }
80
81 // Check whether kmax BC is correctly defined
82 if ((get_bctype_k_max() == Paroi_Temperature_imposee) && (temperature_imposee_kmax_>invalid_thermal_value*0.99))
83 {
84 Cerr << "Value of temperature for kmax Boundary Condition is missing." << finl;
86 }
87 else if ((get_bctype_k_max() == Paroi_Flux_impose) && (flux_impose_kmax_>invalid_thermal_value*0.99))
88 {
89 Cerr << "Value of flux for kmax Boundary Condition is missing." << finl;
91 }
92 return is;
93}
: class Boundary_Conditions_Thermique
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
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
@ REQUIRED
Definition Param.h:115
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52