TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Neumann_paroi_rayo_semi_transp_VEF.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 <Neumann_paroi_rayo_semi_transp_VEF.h>
17#include <Pb_rayo_semi_transp.h>
18#include <Champ_Uniforme.h>
19#include <Milieu_base.h>
20#include <Front_VF.h>
21
22Implemente_instanciable(Neumann_paroi_rayo_semi_transp_VEF,"Paroi_flux_impose_rayo_semi_transp_VEF",Neumann_paroi);
23
25{
26 return os;
27}
28
30{
31 is >> le_champ_front;
32 return is;
33}
34
39
41{
42 const DoubleTab& flux_radiatif = pb_rayo_semi_transp().flux_radiatif(frontiere_dis().le_nom()).valeurs();
43
44 if (le_champ_front->valeurs().size() == 1)
45 return le_champ_front->valeurs()(0, 0) - flux_radiatif(i, 0);
46 else if (le_champ_front->valeurs().dimension(1) == 1)
47 return le_champ_front->valeurs()(i, 0) - flux_radiatif(i, 0);
48 else
49 Cerr << "Neumann_paroi_rayo_semi_transp_VEF::flux_impose error" << finl;
50
51 return 0;
52}
53
55{
56 const DoubleTab& flux_radiatif = pb_rayo_semi_transp().flux_radiatif(frontiere_dis().le_nom()).valeurs();
57
58 if (le_champ_front->valeurs().dimension(0) == 1)
59 return le_champ_front->valeurs()(0, j) - flux_radiatif(i);
60 else
61 return le_champ_front->valeurs()(i, j) - flux_radiatif(i);
62}
63
65{
66 return (*this);
67}
68
70{
71 // Cerr<<"Neumann_paroi_rayo_semi_transp_VEF::calculer_temperature_bord() : Debut"<<finl;
72 // For a VEF discretization, the temperature is stored on the element faces,
73 // so it is sufficient here to retrieve the temperature values
74 // on the boundary faces.
75 DoubleTab& temperature = domaine_Cl_dis().equation().inconnue().valeurs();
76 DoubleTab& tab = temperature_bord_->valeurs_au_temps(temps);
77
78 const Front_VF& front_vf = ref_cast(Front_VF, frontiere_dis());
79 int ndeb = front_vf.num_premiere_face();
80 int nfin = ndeb + front_vf.nb_faces();
81 int face = 0;
82 for (face = ndeb; face < nfin; face++)
83 tab(face - ndeb, 0) = temperature(face);
84 // Cerr<<"Neumann_paroi_rayo_semi_transp_VEF::calculer_temperature_bord() : Fin"<<finl;
85}
86
88{
89 Motcle dom_app = eqn.domaine_application();
90 Motcle Thermique = "Thermique";
91 Motcle indetermine = "indetermine";
92 if ((dom_app == Thermique) || (dom_app == indetermine))
93 return 1;
94 else
95 {
97 return 0;
98 }
99}
100
102{
104
105 // Type and dimension the champ_front temperature_bord_
106 const Front_VF& front_vf = ref_cast(Front_VF, frontiere_dis());
107 int nb_comp = 1;
108
109 temperature_bord_.typer("Champ_front_fonc");
110 temperature_bord_->fixer_nb_comp(nb_comp);
111 DoubleTab& tab = temperature_bord_->valeurs();
112 tab.resize(front_vf.nb_faces(), nb_comp);
113}
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs() override
Returns the array of field values.
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
void err_pas_compatible(const Equation_base &) const
This method is called when the boundary condition is not compatible with the equation on which we try...
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
virtual void completer()
DOES NOTHING must be overridden in derived classes.
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
const Pb_rayo_semi_transp & pb_rayo_semi_transp() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Champ_Inc_base & inconnue() const =0
virtual const Motcle & domaine_application() const
Returns "indeterminate" Navier_Stokes_standard for example overrides this method.
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
A character string (Nom) in uppercase.
Definition Motcle.h:26
void completer() override
DOES NOTHING must be overridden in derived classes.
void mettre_a_jour(double temps) override
Performs a time update of the boundary condition.
const Cond_lim_base & la_cl() const override
int compatible_avec_eqn(const Equation_base &) const override
double flux_impose(int i) const override
Returns the value of the imposed flux on the i-th component of the field representing the flux at the...
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Objet_U.cpp:317
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
const Champ_front_base & flux_radiatif(const Nom &nom_bord) const
Base class for output streams.
Definition Sortie.h:52
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469