16#include <Frontiere_ouverte_temperature_imposee_rayo_semi_transp.h>
17#include <Temperature_imposee_paroi_rayo_semi_transp.h>
18#include <Frontiere_ouverte_rayo_semi_transp.h>
19#include <Neumann_paroi_rayo_semi_transp_VEF.h>
20#include <Rayo_semi_transp_solver_VEF.h>
21#include <Champ_front_uniforme.h>
22#include <Eq_rayo_semi_transp.h>
23#include <Pb_rayo_semi_transp.h>
24#include <Flux_radiatif_VEF.h>
25#include <Champ_Uniforme.h>
26#include <Domaine_Cl_VEF.h>
27#include <Domaine_VEF.h>
28#include <Fluide_base.h>
66 for (
int num_cl = 0; num_cl < les_cl.size(); num_cl++)
73 double A = cl_radiatif.
A();
75 if (sub_type(
Front_VF, la_cl->frontiere_dis()))
80 const int nfin = ndeb + le_bord.
nb_faces();
81 for (
int face = ndeb; face < nfin; face++)
83 int elem = face_voisins(face, 0);
85 elem = face_voisins(face, 1);
91 epsi = epsilon(face - ndeb, 0);
95 surface += (face_normales(face, i) * face_normales(face, i));
97 surface = sqrt(surface);
99 double coeff = epsi * surface;
100 coeff /= A * (2 - epsi);
103 matrice(face, face) += coeff;
108 Cerr <<
"Error in Rayo_semi_transp_solver_VEF::modifier_matrice()" << finl;
109 Cerr <<
"the boundary associated with la_cl does not derive from Front_VF" << finl;
113 else if (sub_type(
Symetrie, la_cl.valeur()))
118 Process::exit(
"The boundary condition used is not recognized for the radiation equation!");
128 const auto& fluide = eq_rayo.
fluide();
137 terme_diffusif->contribuer_a_avec(irradi, matrice);
140 const DoubleTab& kappa = fluide.kappa().valeurs();
146 Cerr <<
"Ordre de la matrice OK" << finl;
147 assert(fluide.kappa().nb_comp() == 1);
150 for (
int i = 0; i < matrice.
ordre(); i++)
157 double vol = volumes_entrelaces(i);
158 matrice(i, i) = matrice(i, i) + k * vol;
172 const auto& fluide = eq_rayo.
fluide();
175 const int nb_faces = domaine_VF.
nb_faces();
192 const DoubleTab& indice = fluide.indice().valeurs();
193 const DoubleTab& kappa = fluide.kappa().valeurs();
195 assert(fluide.indice().nb_comp() == 1);
196 assert(fluide.kappa().nb_comp() == 1);
198 double n = -123., k = -123.;
199 for (
int face = 0; face < nb_faces; face++)
211 double vol = volumes_entrelaces(face);
212 double T = temper(face);
213 secmem(face) += +4 * n * n * sigma * pow(T, 4) * k * vol;
219 terme_diffusif->contribuer_au_second_membre(secmem);
222 if (solveur->que_suis_je() ==
"Solv_GCP")
232 Cerr <<
"Error in Rayo_semi_transp_solver_VEF::resoudre() ! Cannot solve the semi-transparent radiation equation" << finl;
233 Cerr <<
"with the solver: " << solveur->que_suis_je() <<
" because kappa is not constant, so the matrix is not symmetric" << finl;
236 else if (solveur->que_suis_je() ==
"Solv_Gmres")
241 Cerr <<
"Error in Rayo_semi_transp_solver_VEF::resoudre() ! Cannot solve a semi-transparent radiation problem" << finl;
242 Cerr <<
"in parallel using the Solv_Gmres solver. If you have a problem with constant kappa," << finl;
243 Cerr <<
"you can work around this limitation by using the GCP solver with GCP preconditioning" << finl;
248 Cerr <<
"Error in Rayo_semi_transp_solver_VEF::resoudre() ! Cannot use the solver: " << solveur->que_suis_je() << finl;
249 Cerr <<
"to solve the radiation equation in a semi-transparent radiation problem" << finl;
259 const auto& fluide = eq_rayo.
fluide();
268 for (
int num_cl_rayo = 0; num_cl_rayo < les_cl_rayo.size(); num_cl_rayo++)
275 Nom nom_cl_rayo = la_cl_rayo->frontiere_dis().le_nom();
278 int test_remplissage_Tb = 0;
279 for (
int num_cl_temp = 0; num_cl_temp < les_cl_temp.size(); num_cl_temp++)
282 Nom nom_cl_temp = la_cl_temp->frontiere_dis().le_nom();
283 if (nom_cl_temp == nom_cl_rayo)
288 test_remplissage_Tb = 1;
295 test_remplissage_Tb = 1;
302 test_remplissage_Tb = 1;
309 test_remplissage_Tb = 1;
315 Cerr <<
"Error in Rayo_semi_transp_solver_VEF::evaluer_cl_rayonnement ! The case of a thermal BC " << la_cl_temp->que_suis_je() <<
" is not implemented" << finl;
322 if (test_remplissage_Tb == 0)
323 Cerr <<
"Rayo_semi_transp_solver_VEF::evaluer_cl_rayonnement -- The boundary temperature array has not been filled!!!!" << finl;
328 else if (sub_type(
Symetrie, la_cl_rayo.valeur()))
334 Cerr <<
"The boundary condition " << la_cl_rayo.que_suis_je() <<
" is not recognized for the radiation equation!" << finl;
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Champ_front_base Base class for the hierarchy of boundary fields.
virtual DoubleTab & valeurs() override
Returns the array of field values.
class Cond_lim Generic class used to represent any class
class Conds_lim This class represents a vector of boundary conditions.
static void verifier(const char *const msg, double)
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
int nb_faces() const
Returns the total number of faces.
DoubleVect & volumes_entrelaces()
int nb_faces_tot() const
Returns the total number of faces.
virtual double face_normales(int face, int comp) const
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
Class defining operators and methods for all reading operation in an input flow (file,...
const Pb_rayo_semi_transp & pb_rayo_semi_transp() const
Matrice_Morse & matrice_rayo()
void dimensionner_Mat_Bloc_Morse_Sym(Matrice &matrice_tmp)
void Mat_Morse_to_Mat_Bloc(Matrice &matrice_tmp)
SolveurSys & solveur_rayo()
Operateur_Diff & terme_diffusif_rayo()
const Champ_Inc_base & inconnue() const override
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 Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
virtual int nb_comp() const
void evaluer_cl_rayonnement(Champ_front_base &Tb, const Champ_Don_base &, const Champ_Don_base &, const Champ_Don_base &, const Domaine_VF &, const double, double)
Champ_front_base & emissivite()
int num_premiere_face() const
void calculer_temperature_bord(double temps)
Champ_front_base & temperature_bord()
void calculer_temperature_bord(double temps)
Champ_front_base & temperature_bord()
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
void clean() override
Remplit la matrice avec des zeros.
int ordre() const override
Returns the order of the matrix: - the number of rows if the matrix is square.
Matrice class - Generic class in the matrix hierarchy.
Champ_front_base & temperature_bord()
void calculer_temperature_bord(double temps)
class Nom: a character string for naming TRUST objects.
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Operateur_Diff Generic class of the hierarchy of operators representing a diffusion.
const double & valeur_sigma() const
Probleme_base & probleme_fluide()
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Equation_base & equation(int) const =0
static int nproc()
Returns the number of processors in the current group. See Comm_Group::nproc() and PE_Groups::current...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
void modifier_matrice() override
Modify the matrix to account for the presence of radiating faces near boundary elements.
void resoudre(double temps) override
int nb_colonnes_tot() override
void assembler_matrice() override
void evaluer_cl_rayonnement(double temps) override
int nb_colonnes() override
OBS_PTR(Eq_rayo_semi_transp) eq_rayo_semi_transp_
class SolveurSys A SolveurSys represents any class
int resoudre_systeme(const Matrice_Base &matrice, const DoubleVect &secmem, DoubleVect &solution)
Base class for output streams.
Symetrie On symmetry faces, the following properties hold:
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
Temperature_imposee_paroi_rayo_semi_transp class: used to impose a wall temperature.
void calculer_temperature_bord(double temps)
Champ_front_base & temperature_bord()