16#include <Modifier_pour_fluide_dilatable.h>
17#include <Modele_turbulence_scal_base.h>
18#include <Fluide_Quasi_Compressible.h>
19#include <Dirichlet_paroi_defilante.h>
20#include <Convection_Diffusion_std.h>
21#include <Paroi_scal_hyd_base_VEF.h>
22#include <Dirichlet_paroi_fixe.h>
23#include <Paroi_decalee_Robin.h>
24#include <Domaine_Cl_VEF.h>
25#include <Champ_Uniforme.h>
26#include <EcrFicPartage.h>
27#include <Probleme_base.h>
28#include <Neumann_paroi.h>
29#include <Fluide_base.h>
30#include <Domaine_VEF.h>
41 le_dom_dis_ = ref_cast(
Domaine_VF, domaine_dis);
42 le_dom_Cl_dis_ = domaine_Cl_dis;
49 int nb_boundaries = le_dom_dis_->domaine().nb_front_Cl();
50 for (
int n_bord = 0; n_bord < nb_boundaries; n_bord++)
52 const Front_VF& fr_vf = le_dom_dis_->front_VF(n_bord);
54 if (fr_vf.
le_nom() == nom_bord)
57 for (
int ind_face = 0; ind_face < nb_faces; ind_face++)
66 int nb_faces_bord_reelles = le_dom_dis_->nb_faces_bord();
74 const DoubleTab& face_normales = le_dom_dis_->face_normales();
76 const IntTab& elem_faces = le_dom_dis_->elem_faces();
77 const IntTab& face_voisins = le_dom_dis_->face_voisins();
78 const DoubleVect& volumes_maille = le_dom_dis_->volumes();
79 const DoubleVect& surfaces_face = le_dom_dis_->face_surfaces();
83 Cerr <<
"Warning, nothing is implemented for Axi in VEF" << finl;
88 int nb_front = le_dom_dis_->nb_front_Cl();
90 for (
int n_bord = 0; n_bord < nb_front; n_bord++)
92 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
104 for (
int ind_face = 0; ind_face < size; ind_face++)
106 int num_face = le_bord.
num_face(ind_face);
107 int elem, autre_face;
108 elem = face_voisins(num_face, 0);
110 elem = face_voisins(num_face, 1);
114 autre_face = elem_faces(elem, 0);
115 if (autre_face == num_face)
116 autre_face = elem_faces(elem, 1);
118 double distance = volumes_maille(elem) / surfaces_face(num_face);
122 dist_equiv(ind_face) = distance;
127 ratio += (face_normales(num_face, i) * face_normales(num_face, i));
162 for (
int n_bord = 0; n_bord < le_dom_dis_->nb_front_Cl(); n_bord++)
164 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
173 int nfin = ndeb + le_bord.
nb_faces();
174 int nb_faces_elem = le_dom_dis_->domaine().nb_faces_elem();
176 DoubleTrav lambda(nfin-ndeb);
177 DoubleTrav lambda_t(nfin-ndeb);
178 DoubleTrav tfluide(nfin-ndeb);
183 CDoubleArrView conductivite =
static_cast<const DoubleVect&
>(le_fluide.
conductivite().valeurs()).view_ro();
184 CDoubleArrView conductivite_turbulente =
static_cast<const DoubleVect&
>(mon_modele_turb_scal->conductivite_turbulente().valeurs()).view_ro();
185 CDoubleArrView face_surfaces = le_dom_dis_->face_surfaces().view_ro();
186 CDoubleTabView face_normales = le_dom_dis_->face_normales().view_ro();
187 CIntTabView face_voisins = le_dom_dis_->face_voisins().view_ro();
188 CIntTabView elem_faces = le_dom_dis_->elem_faces().view_ro();
189 CDoubleArrView temperature_v =
static_cast<const DoubleVect&
>(temperature).view_ro();
190 DoubleArrView lambda_v =
static_cast<DoubleVect&
>(lambda).view_wo();
191 DoubleArrView lambda_t_v =
static_cast<DoubleVect&
>(lambda_t).view_wo();
192 DoubleArrView tfluide_v =
static_cast<DoubleVect&
>(tfluide).view_rw();
193 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), Kokkos::RangePolicy<>(ndeb, nfin),
194 KOKKOS_LAMBDA(
const int num_face)
196 int ind_face = num_face - ndeb;
197 int elem = face_voisins(num_face, 0);
199 elem = face_voisins(num_face, 1);
201 lambda_v(ind_face) = conductivite(unif ? 0 : elem);
202 lambda_t_v(ind_face) = conductivite_turbulente(elem);
205 double surface_face = face_surfaces(num_face);
206 for (
int i = 0; i < nb_faces_elem; i++)
208 int j = elem_faces(elem, i);
211 double surface_pond = 0.;
212 for (
int kk = 0; kk < dim; kk++)
214 (face_normales(j, kk) * oriente_normale(j, elem, face_voisins) *
215 face_normales(num_face, kk) * oriente_normale(num_face, elem, face_voisins))
216 / (surface_face * surface_face);
217 tfluide_v(ind_face) += temperature_v(j) * surface_pond;
221 end_gpu_timer(__KERNEL_NAME__);
223 for (
int num_face = ndeb; num_face < nfin; num_face++)
225 int ind_face = num_face - ndeb;
227 tab_(num_face, 0) = d_equiv;
228 tab_(num_face, 1) = (lambda(ind_face) + lambda_t(ind_face)) / lambda(ind_face) *
tab_d_reel_[num_face] / d_equiv;
229 tab_(num_face, 2) = (lambda(ind_face) + lambda_t(ind_face)) / d_equiv;
230 tab_(num_face, 3) = tfluide(ind_face);
235 double tparoi = temperature(num_face);
236 double flux = la_cl_neum.
flux_impose(num_face - ndeb);
237 double tparoi_equiv = tfluide(ind_face) + flux / (lambda(ind_face) + lambda_t(ind_face)) * d_equiv;
238 tab_(num_face, 4) = tparoi;
239 tab_(num_face, 5) = tparoi_equiv;
243 tab_(num_face, 4) = 0.;
244 tab_(num_face, 5) = 0.;
258 for (
int n_bord = 0; n_bord < le_dom_dis_->nb_front_Cl(); n_bord++)
260 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
271 Nusselt <<
"Bord " << le_bord.
le_nom() << finl;
277 <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
279 Nusselt <<
"\tFace a\t\t\t\t|" << finl;
281 <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
283 Nusselt <<
"X\t\t| Y\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K)\t| T face de bord (K)\t| Tparoi equiv.(K) " << finl;
285 <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------"
291 <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
293 Nusselt <<
"\tFace a\t\t\t\t\t\t\t|" << finl;
295 <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
297 Nusselt <<
"X\t\t| Y\t\t\t| Z\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K)\t| T face de bord (K)\t| Tparoi equiv.(K)" << finl;
299 <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------"
307 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------"
309 Nusselt <<
"\tFace a\t\t\t\t|" << finl;
310 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------"
312 Nusselt <<
"X\t\t| Y\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K) " << finl;
313 Nusselt <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------" << finl;
317 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------"
319 Nusselt <<
"\tFace a\t\t\t\t\t\t\t|" << finl;
320 Nusselt <<
"----------------------------------------------------------------------------------------------------------------------------------------------------------------"
322 Nusselt <<
"X\t\t| Y\t\t\t| Z\t\t\t| dist. carac. (m)\t| Nusselt (local)\t| h (Conv. W/m2/K)\t| Tf cote paroi (K) " << finl;
323 Nusselt <<
"----------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------"
329 int nfin = ndeb + le_bord.
nb_faces();
331 for (
int num_face = ndeb; num_face < nfin; num_face++)
333 double x = le_dom_dis_->xv(num_face, 0);
334 double y = le_dom_dis_->xv(num_face, 1);
336 Nusselt << x <<
"\t| " << y;
339 double z = le_dom_dis_->xv(num_face, 2);
340 Nusselt << x <<
"\t| " << y <<
"\t| " << z;
345 for (
int i=0; i<nb_fields; i++)
346 Nusselt <<
"\t| " <<
tab_(num_face, i);
353 Nusselt << finl << finl;
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Cond_lim Generic class used to represent any class
Convection_Diffusion_std This class is the base for equations modelling the transport.
Dirichlet_paroi_defilante Imposes the wall velocity in an equation of type Navier_Stokes.
Dirichlet_paroi_fixe Represents a fixed wall in a Navier-Stokes type equation.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Sortie & syncfile() override
Triggers writing to disk of the data accumulated on the different processors since the last call to s...
Class defining operators and methods for all reading operation in an input flow (file,...
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Milieu_base & milieu() const =0
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.
Probleme_base & probleme()
Returns the problem associated with the equation.
Base class for an incompressible fluid and its properties:
int num_premiere_face() const
int num_face(const int) const
virtual void creer_tableau_faces(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
Creates an array with one "row" per face of this boundary.
const Frontiere & frontiere() const
Returns the associated geometric boundary.
const Nom & le_nom() const override
Returns the name of the geometric boundary.
virtual const Champ_Don_base & conductivite() const
Returns the conductivity of the medium (const version).
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
virtual double flux_impose(int i) const
Returns the value of the imposed flux on the i-th component of the field representing the flux at the...
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 const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
void imprimer_nusselt(Sortie &) const override
void compute_nusselt() const override
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
DoubleVect & equivalent_distance_name(DoubleVect &d_eq, const Nom &nom_bord) const override
int init_lois_paroi() override
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Base class for output streams.
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
virtual const MD_Vector & get_md_vector() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
Base class for the hierarchy of scalar wall-law models computing turbulent quantities near walls....
DoubleVects equivalent_distance_
const DoubleVects & equivalent_distance() const
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &) const
Opens or creates a print file for Face, d_eq, local Nu, h.