TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Paroi_rayo_transp.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 <Modele_rayo_transp.h>
17#include <Paroi_rayo_transp.h>
18#include <Pb_Fluide_base.h>
19#include <Front_VF.h>
20
21Implemente_base(Paroi_rayo_transp, "Paroi_rayo_transp", Neumann_paroi);
22
23Sortie& Paroi_rayo_transp::printOn(Sortie& s) const { return s; }
24
25Entree& Paroi_rayo_transp::readOn(Entree& is) { return is; }
26
28{
29 assert(!le_modele_rayo_);
30
31 // retrieve the radiation model only if the problem is a fluid + radiation problem ... !
32 const Probleme_base& this_pb = domaine_Cl_dis().equation().probleme();
33
34 if (sub_type(Pb_Fluide_base, this_pb))
35 {
36 if (this_pb.milieu().is_rayo_transp())
37 {
38 le_modele_rayo_ = ref_cast(Pb_Fluide_base, this_pb).get_mod_rayo_transp();
39
40 if (le_modele_rayo_->nom_pb_rayonnant() != this_pb.le_nom())
41 error_pb_name(que_suis_je(), this_pb.le_nom(), le_modele_rayo_->nom_pb_rayonnant());
42 }
43 else
44 error_non_rad_bc(que_suis_je(), this_pb.le_nom(), frontiere_dis().frontiere().le_nom(), "paroi_flux_impose");
45 }
46
47 return Neumann_paroi::initialiser(temps);
48}
49
51{
52 const Front_VF& la_frontiere_VF = ref_cast(Front_VF, frontiere_dis());
53 int ndeb = la_frontiere_VF.num_premiere_face();
54 double flux_radia = le_modele_rayo_->flux_radiatif(i + ndeb);
55 if (le_champ_front->valeurs().size() == 1)
56 return le_champ_front->valeurs()(0, 0) - flux_radia;
57 else if (le_champ_front->valeurs().dimension(1) == 1)
58 return le_champ_front->valeurs()(i, 0) - flux_radia;
59 else
60 Cerr << "Paroi_rayo_transp::flux_impose error" << finl;
61
63 return 0.;
64}
65
66double Paroi_rayo_transp::flux_impose(int i, int j) const
67{
68 const Front_VF& la_frontiere_VF = ref_cast(Front_VF, frontiere_dis());
69 int ndeb = la_frontiere_VF.num_premiere_face();
70 double flux_radia = le_modele_rayo_->flux_radiatif(i + ndeb);
71 const int k = (le_champ_front->valeurs().size() == 1) ? 0 : i;
72 return le_champ_front->valeurs()(k, j) - flux_radia;
73}
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
virtual int initialiser(double temps)
Initialization at the beginning of the calculation.
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
void error_non_rad_bc(const Nom &nom_class, const Nom &nom_pb, const Nom &nom_bord, const Nom &other_type)
void error_pb_name(const Nom &nom_class, const Nom &nom_pb, const Nom &nom_pb_ray)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Probleme_base & probleme()
Returns the problem associated with the equation.
class Front_VF
Definition Front_VF.h:36
int num_premiere_face() const
Definition Front_VF.h:63
virtual bool is_rayo_transp() const
Definition Milieu_base.h:83
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
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 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
int initialiser(double temps) override
Initialization at the beginning of the calculation.
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...
Pb_Fluide_base This class provides a base class for.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Probleme_U.h:109
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Milieu_base & milieu() const
Returns the physical medium associated with the problem (const version).
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52