16#include <Frontiere_ouverte_temperature_imposee_rayo_semi_transp.h>
17#include <Echange_externe_impose_rayo_semi_transp.h>
18#include <Echange_global_impose_rayo_semi_transp.h>
19#include <Echange_contact_rayo_semi_transp_VDF.h>
20#include <Frontiere_ouverte_rayo_semi_transp.h>
21#include <Neumann_paroi_rayo_semi_transp_VDF.h>
22#include <Rayo_semi_transp_solver_VDF.h>
23#include <Champ_front_uniforme.h>
24#include <Eq_rayo_semi_transp.h>
25#include <Pb_rayo_semi_transp.h>
26#include <Flux_radiatif_VDF.h>
27#include <Champ_Uniforme.h>
28#include <Domaine_VDF.h>
29#include <Domaine_VDF.h>
30#include <Fluide_base.h>
63 const auto& fluide = eq_rayo.
fluide();
69 for (
int num_cl = 0; num_cl < les_cl.size(); num_cl++)
76 const DoubleTab& long_rayo = fluide.longueur_rayo().valeurs();
77 const DoubleTab& kappa = fluide.kappa().valeurs();
78 const double A = cl_radiatif.
A();
80 if (sub_type(
Front_VF, la_cl->frontiere_dis()))
84 const int nfin = ndeb + le_bord.
nb_faces();
86 assert(fluide.longueur_rayo().nb_comp() == 1);
87 assert(fluide.kappa().nb_comp() == 1);
89 for (
int face = ndeb; face < nfin; face++)
91 int elem = face_voisins(face, 0);
94 elem = face_voisins(face, 1);
98 double k = -123., l_r = -123.;
103 l_r = long_rayo(0, 0);
108 l_r = long_rayo(elem, 0);
114 epsi = epsilon(0, 0);
116 epsi = epsilon(face - ndeb, 0);
118 const double numer_coeff = l_r * face_surfaces(face);
119 double denum_coeff = 3 * k * epsi;
121 denum_coeff = 1 / denum_coeff;
122 denum_coeff *= A * (2 - epsi);
123 denum_coeff = denum_coeff + eF;
125 const double coeff = numer_coeff / denum_coeff;
128 if (epsi < DMINFLOAT) { }
130 matrice(elem, elem) += coeff;
135 Cerr <<
"Error in Rayo_semi_transp_solver_VDF::modifier_matrice()" << finl;
136 Cerr <<
"the boundary associated with la_cl does not derive from Front_VF" << finl;
140 else if (sub_type(
Symetrie, la_cl.valeur()))
145 Process::exit(
"The boundary condition used is not recognized for the radiation equation!");
155 const auto& fluide = eq_rayo.
fluide();
164 terme_diffusif->contribuer_a_avec(irradi, matrice);
167 const DoubleTab& kappa = fluide.kappa().valeurs();
170 if (matrice.
ordre() != nb_elem_tot)
173 Cerr <<
"Matrix order OK" << finl;
174 assert(fluide.kappa().nb_comp() == 1);
177 for (
int i = 0; i < matrice.
ordre(); i++)
184 const double vol = domaine_VF.
volumes(i);
186 matrice(i, i) = matrice(i, i) + k * vol;
200 const auto& fluide = eq_rayo.
fluide();
202 const int nb_elem = domaine_VF.
nb_elem();
203 const DoubleTab& kappa = fluide.kappa().valeurs();
219 const DoubleTab& indice = fluide.indice().valeurs();
221 assert(fluide.indice().nb_comp());
222 assert(fluide.kappa().nb_comp() == 1);
224 double n = -123., k = -123.;
225 for (
int elem = 0; elem < nb_elem; elem++)
237 const double vol = domaine_VF.
volumes(elem);
238 const double T = temper(elem);
239 secmem(elem) += +4 * n * n * sigma * pow(T, 4) * k * vol;
245 terme_diffusif->contribuer_au_second_membre(secmem);
247 if (solveur->que_suis_je() ==
"Solv_GCP")
257 Cerr <<
"Error in Rayo_semi_transp_solver_VDF::resoudre()! Cannot solve the equation" << finl;
258 Cerr <<
"of semi-transparent radiation with the solver: " << solveur->que_suis_je() <<
" because kappa is not constant, therefore the matrix is not symmetric" << finl;
261 else if (solveur->que_suis_je() ==
"Solv_Gmres")
266 Cerr <<
"Error in Rayo_semi_transp_solver_VDF::resoudre()! Cannot solve a problem" << finl;
267 Cerr <<
"of semi-transparent radiation in parallel using the Solv_Gmres solver. If you treat" << finl;
268 Cerr <<
"a problem with constant kappa, you can bypass this limitation by using the GCP solver with GCP preconditioning" << finl;
273 Cerr <<
"Error in Rayo_semi_transp_solver_VDF::resoudre()! Cannot use the solver: " << solveur->que_suis_je() << finl;
274 Cerr <<
"to solve the radiation equation in a semi-transparent radiation problem" << finl;
284 const auto& fluide = eq_rayo.
fluide();
293 for (
int num_cl_rayo = 0; num_cl_rayo < les_cl_rayo.size(); num_cl_rayo++)
300 Nom nom_cl_rayo = la_cl_rayo->frontiere_dis().le_nom();
303 int test_remplissage_Tb = 0;
304 for (
int num_cl_temp = 0; num_cl_temp < les_cl_temp.size(); num_cl_temp++)
307 Nom nom_cl_temp = la_cl_temp->frontiere_dis().le_nom();
308 if (nom_cl_temp == nom_cl_rayo)
313 test_remplissage_Tb = 1;
320 test_remplissage_Tb = 1;
327 test_remplissage_Tb = 1;
334 test_remplissage_Tb = 1;
341 test_remplissage_Tb = 1;
348 test_remplissage_Tb = 1;
354 Cerr <<
"Error in Rayo_semi_transp_solver_VDF::evaluer_cl_rayonnement! The case of a thermal BC " << la_cl_temp->que_suis_je() <<
" is not implemented" << finl;
361 if (test_remplissage_Tb == 0)
362 Cerr <<
"Rayo_semi_transp_solver_VDF::evaluer_cl_rayonnement -- The boundary temperature array was not filled!!!!" << finl;
367 else if (sub_type(
Symetrie, la_cl_rayo.valeur()))
373 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)
int_t nb_elem_tot() const
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
double dist_norm_bord(int num_face) const override
Returns the normal distance for a boundary face (Cartesian coordinates).
virtual const DoubleVect & face_surfaces() const
double volumes(int i) const
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
const Domaine & domaine() const
class Echange_externe_impose_rayo_semi_transp
Champ_front_base & temperature_bord()
void calculer_temperature_bord(double temps)
class Echange_global_impose_rayo_semi_transp
void calculer_temperature_bord(double temps)
Champ_front_base & temperature_bord()
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.
int nb_colonnes() override
void evaluer_cl_rayonnement(double temps) override
void modifier_matrice() override
Modifies the matrix to account for the presence of radiating faces near boundary elements.
void assembler_matrice() override
void resoudre(double temps) override
int nb_colonnes_tot() 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: