TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Paroi_contact_rayo.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Discretisation_base.h>
17#include <Paroi_contact_rayo.h>
18#include <Probleme_base.h>
19#include <Equation_base.h>
20
21Implemente_instanciable(Paroi_contact_rayo, "paroi_contact_rayo", Cond_lim_utilisateur_base);
22// XD paroi_contact_rayo condlim_base paroi_contact_rayo INHERITS_BRACE Radiation Thermal condition between two domains.
23// XD_CONT Important: the name of the boundaries in the two domains should be the same. (Warning: there is also an old
24// XD_CONT limitation not yet fixed on the sequential algorithm in VDF to detect the matching faces on the two
25// XD_CONT boundaries: faces should be ordered in the same way). The kind of condition depends on the discretization. In
26// XD_CONT VDF, it is a heat exchange condition, and in VEF, a temperature condition. NL2 Such a coupling requires
27// XD_CONT coincident meshes for the moment. In case of non-coincident meshes, run is stopped and two external files are
28// XD_CONT automatically generated in VEF (connectivity_failed_boundary_name and connectivity_failed_pb_name.med). In
29// XD_CONT 2D, the keyword Decouper_bord_coincident associated to the connectivity_failed_boundary_name file allows to
30// XD_CONT generate a new coincident mesh. NL2 In 3D, for a first preliminary cut domain with HOMARD (fluid for
31// XD_CONT instance), the second problem associated to pb_name (solide in a fluid/solid coupling problem) has to be
32// XD_CONT submitted to HOMARD cutting procedure with connectivity_failed_pb_name.med. NL2 Such a procedure works as
33// XD_CONT while the primary refined mesh (fluid in our example) impacts the fluid/solid interface with a compact shape
34// XD_CONT as described below (values 2 or 4 indicates the number of division from primary faces obtained in fluid
35// XD_CONT domain at the interface after HOMARD cutting): NL2 2-2-2-2-2-2 NL2 2-4-4-4-4-4-2 \\; 2-2-2 NL2 2-4-4-4-4-2
36// XD_CONT \\; 2-4-2 NL2 2-2-2-2-2 \\; 2-2 NL2 OK NL2 NL2 2-2 \\; \\; 2-2-2 NL2 2-4-2 \\; 2-2 NL2 2-2 \\; 2-2 NL2 NOT OK
37// XD attr autrepb ref_Pb_base autrepb REQ Name of other problem.
38// XD attr nameb chaine nameb REQ boundary name of the remote problem which should be the same than the local name
39// XD attr type_rayo chaine type_rayo REQ Radiation type : transparent or semi-transparent
40
42{
43 return s << que_suis_je() << " " << nom_autre_pb << " " << nom_autre_bord << " " << type_rayo;
44}
45
47{
48 s >> nom_autre_pb;
49 s >> nom_autre_bord;
50 s >> type_rayo; /* pour l'autre probleme */
51
52 if (type_rayo != "TRANSP" && type_rayo != "SEMI_TRANSP")
53 {
54 Cerr << "type_rayo should be TRANSP or SEMI_TRANSP and not " << type_rayo << finl;
56 }
57
58 return s ;
59}
60
62{
63 int rayo = is_pb_rayo();
64 if (!rayo)
65 {
66 if (type_rayo == "TRANSP") rayo = 2;
67 else if (type_rayo == "SEMI_TRANSP") rayo = 1;
68 else throw;
69 }
70
71 const Nom& nom_mon_pb = mon_equation->probleme().le_nom();
72 if (nom_mon_pb == nom_autre_pb)
73 {
74 Cerr << "Error in " << que_suis_je() << " the name of the other problem is the same as my problem :" << nom_mon_pb << " on the boundary :" << nom_bord_ << finl;
76 }
77
78 if (mon_equation->discretisation().is_vdf() || mon_equation->discretisation().is_poly_family())
79 {
80 if (mon_equation->discretisation().is_vdf())
81 {
82 if (rayo == 2) ajout = "Echange_contact_rayo_transp_VDF ";
83 if (rayo == 1) ajout = "Paroi_Echange_contact_rayo_semi_transp_VDF ";
84 }
85 else ajout = mon_equation->discretisation().is_PolyMAC_HFV() ? "paroi_echange_contact_PolyMAC_HFV " :
86 mon_equation->discretisation().is_PolyMAC_MPFA() ? "paroi_echange_contact_PolyMAC_MPFA " : "paroi_echange_contact_PolyMAC_CDO ";
87
88 ajout += nom_autre_pb;
89 ajout += " ";
90 ajout += nom_autre_bord + " ";
91 ajout += mon_equation->inconnue().le_nom() + " 1.e10";
92 }
93 else
94 {
95 if (rayo == 1)
96 {
97 ajout = "paroi_temperature_imposee_rayo_semi_transp ";
98 ajout += "Champ_Front_contact_rayo_semi_transp_VEF ";
99 }
100 else if (rayo == 2)
101 {
102 ajout = "paroi_temperature_imposee_rayo_transp ";
103 ajout += "Champ_Front_contact_rayo_transp_VEF ";
104 }
105 ajout += nom_mon_pb;
106 ajout += " ";
107 ajout += nom_bord_;
108 ajout += " ";
109 ajout += nom_autre_pb;
110 ajout += " ";
111 ajout += nom_autre_bord;
112 }
113}
classe Cond_lim_utilisateur_base: Les classes heritant de cette classe sont des classes utilisaturs
int is_pb_rayo()
renvoit 0 si le pb n'est pas rayonnant 1 si il est semi_transp
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
const Nom & le_nom() const override
Renvoie *this;.
Definition Nom.cpp:563
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
void complement(Nom &nom) override
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