16#include <Modele_turbulence_scal_base.h>
17#include <Turbulence_paroi_scal_base.h>
18#include <Schema_Euler_Implicite.h>
19#include <Echange_contact_VDF.h>
20#include <Domaine_Cl_dis_base.h>
21#include <Champ_front_calc.h>
22#include <Champ_Uniforme.h>
23#include <Probleme_base.h>
24#include <Equation_base.h>
25#include <Schema_Comm.h>
26#include <Milieu_base.h>
27#include <Domaine_VDF.h>
46int meme_point2(
const DoubleVect& a,
const DoubleVect& b);
52 if (
app_domains.size() == 0)
app_domains = { Motcle(
"Thermique"), Motcle(
"Neutronique"), Motcle(
"fraction_massique"), Motcle(
"indetermine") };
55 T_autre_pb_.typer(
"Champ_front_calc");
56 le_champ_front.typer(
"Ch_front_var_instationnaire_dep");
108 int nfin = ndeb + nb_faces;
113 const RefObjU& modele_turbulence = une_eqn.
get_modele(TURBULENCE);
121 int boundary_index=-1;
125 for (
int n_bord=0; n_bord<nb_boundaries; n_bord++)
128 boundary_index=n_bord;
130 for (
int ind_face=0; ind_face<nb_faces; ind_face++)
138 for (
int face=ndeb; face<nfin; face++)
148 for (
int face=ndeb; face<nfin; face++)
150 int elem = face_voisins(face,0);
152 elem = face_voisins(face,1);
153 for(i=0; i<nb_comp; i++)
156 tab(face-ndeb,i) = 1./(e(face-ndeb)/lambda(elem,i)+invhparoi);
162 for (
int face=ndeb; face<nfin; face++)
164 for(i=0; i<nb_comp; i++)
183 const RefObjU& modele_turbulence = une_eqn.
get_modele(TURBULENCE);
192 DoubleVect d_equiv_tmp;
210 for (
int face=0; face<nb_faces_raccord1; face++)
211 for(i=0; i<nb_comp; i++)
213 assert(lambda(face,i)!=0.);
214 tab(face,i) = 1./(e(face)/lambda(face,i)+invhparoi);
220 for (
int face=0; face<nb_faces_raccord1; face++)
221 for(i=0; i<nb_comp; i++)
223 assert(lambda(0,i)!=0.);
224 tab(face,i) = 1./(e(face)/lambda(0,i)+invhparoi);
237 calculer_h_local(tab,mon_eqn,ma_zvdf,ma_front_vf,mon_milieu,invhparoi,opt);
254 int nb_faces_raccord1 = domaine_dis1.
domaine().
raccord(nom_racc1)->nb_faces();
258 Cerr <<
"In Echange_contact_VDF::calculer_h_autre_pb, tab is no longer dimensioned." << finl;
259 Cerr <<
"Dimensioning is done in Echange_contact_VDF::initialiser." << finl;
262 if (domaine_dis1.
domaine().
raccord(nom_racc1)->que_suis_je() ==
"Raccord_distant_homogene")
264 calculer_h_distant(tab,une_eqn,zvdf_2,front_vf,le_milieu,invhparoi,opt,nom_racc2);
268 calculer_h_local(tab,une_eqn,zvdf_2,front_vf,le_milieu,invhparoi,opt);
289 int nb_faces_raccord1 = domaine_dis1.
domaine().
raccord(nom_racc1)->nb_faces();
291 h_imp_.typer(
"Champ_front_fonc");
292 h_imp_->fixer_nb_comp(nb_comp);
293 h_imp_->valeurs().resize(nb_faces_raccord1,nb_comp);
295 if (domaine_dis1.
domaine().
raccord(nom_racc1)->que_suis_je() !=
"Raccord_distant_homogene")
298 autre_h.resize(nb_faces_raccord1,nb_comp);
314 DoubleTrav o_proc, o_item, proc, l_item;
317 for (
int i = 0; i < o_fvf.nb_faces(); i++)
319 int f = o_fvf.num_face(i), e = o_f_e(f, 0) == -1 ? o_f_e(f, 1) : o_f_e(f, 0);
320 o_proc(f) = src(e, 0), o_item(f) = src(e, 1);
324 if (o_fvf.frontiere().que_suis_je() ==
"Raccord_distant_homogene")
325 o_fvf.frontiere().trace_face_distant(o_proc, proc), o_fvf.frontiere().trace_face_distant(o_item, l_item);
326 else o_fvf.frontiere().trace_face_local(o_proc, proc), o_fvf.frontiere().trace_face_local(o_item, l_item);
330 for (
int i = 0; i < fvf.
nb_faces(); i++)
334 item(i) = (int)std::lrint(l_item(i));
337 if (o_domaine.
virt_e_map.count({{ (int) proc(i), (int) l_item(i) }}))
338 item(i) = o_domaine.
virt_e_map.at({{ (int) proc(i), (int) l_item(i) }});
339 else Process::exit(
Nom(
"Echange_contact_VDF : missing element opposite face ") +
Nom(fvf.
num_face(i)) +
" in " + fvf.
le_nom() +
" ! Have you used Decouper_multi?");
356 DoubleTab& mon_h= h_imp_->valeurs();
368 for (
int ii=0; ii<taille; ii++)
369 for (
int jj=0; jj<nb_comp; jj++)
371 mon_h(ii,jj)=1./(1./
autre_h(ii,jj)+1./mon_h(ii,jj));
383 int nb_faces_bord = ma_front_vf.
nb_faces();
384 assert(Teta_eq.
dimension(0)==nb_faces_bord);
387 for (
int numfa=0; numfa<nb_faces_bord; numfa++)
389 Teta_eq(numfa,0) = t_autre(numfa,0);
404 int nb_faces_bord = ma_front_vf.
nb_faces();
406 Teta_p.
resize(nb_faces_bord,1);
408 for (
int numfa=0; numfa<nb_faces_bord; numfa++)
410 ind_fac = numfa+ndeb;
416 Teta_p(numfa,0) = (mon_h(numfa,0)*mon_inco(elem) + lautre_h(numfa,0)*t_autre(numfa,0))/(mon_h(numfa,0)+lautre_h(numfa,0));
430 int nb_faces_bord = ma_front_vf.
nb_faces();
431 int ind_fac,ind_fac_2;
432 const DoubleTab& xv=ma_zvdf.
xv();
433 const DoubleTab& xv2=zvdf_2.
xv();
437 for (
int numfa=0; numfa<nb_faces_bord; numfa++)
439 ind_fac = numfa+ndeb;
440 ind_fac_2=numfa+ndeb2;
443 x1[k] = xv(ind_fac,k);
444 x2[k] = xv2(ind_fac_2,k);
446 if (!meme_point2(x1,x2))
449 Cerr<<
"Correspondence problem: the two 'Raccords' named "<<ma_front_vf.
le_nom() <<
" are not facing."<<finl;
450 Cerr<<
"Problem on the following faces:" << finl;
453 Cerr <<
"Coordinates of the face 1: (" << x1[0] <<
" " << x1[1] <<
") on the domain " << ma_zvdf.
domaine().
le_nom() << finl;
454 Cerr <<
"Coordinates of the face 2: (" << x2[0] <<
" " << x2[1] <<
") on the domain " << zvdf_2.
domaine().
le_nom() << finl;
458 Cerr <<
"Coordinates of the face 1: (" << x1[0] <<
" " << x1[1] << x1[2] <<
") on the domain " << ma_zvdf.
domaine().
le_nom() << finl;
459 Cerr <<
"Coordinates of the face 2: (" << x2[0] <<
" " << x2[1] << x2[2] <<
") on the domain " << zvdf_2.
domaine().
le_nom() << finl;
461 Cerr <<
"\nIn VDF, numbering of faces on each 'Raccord' must be identical (to a constant)." << finl;
462 Cerr <<
"The faces of each sub frontier of the boundary " << ma_front_vf.
le_nom() <<
" must be created in the same order on each domain, this process is sensitive to the reading sense of the faces." << finl;
470int meme_point2(
const DoubleVect& x,
const DoubleVect& y)
473 assert(dim==y.
size());
475 for (
int k=0; k<dim; k++)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual void associer_fr_dis_base(const Frontiere_dis_base &)
Associates a discretized boundary with the field.
virtual void changer_temps_futur(double temps, int i)
Changes the time value for the i-th temporal value after the present.
virtual DoubleTab & valeurs_au_temps(double temps)=0
virtual void fixer_nb_valeurs_temporelles(int nb_cases)
Called by Conds_lim::completer. By default does nothing.
virtual int reculer(double temps)
To implement in derived classes.
virtual int avancer(double temps)
To implement in derived classes.
virtual void mettre_a_jour(double temps)
DOES NOTHING, to override.
class Champ_front_calc Derived class of Champ_front_var representing
const Frontiere_dis_base & front_dis() const
Returns the discretized boundary corresponding to the domain on which the trace is taken.
void creer(const Nom &, const Nom &, const Motcle &)
Create the Champ_front_calc object representing the trace of an unknown field on a boundary from name...
const Nom & nom_bord_oppose() const
Returns the name of the boundary on which the trace is computed.
int initialiser(double, const Champ_Inc_base &) override
Initialization at the beginning of calculation.
const Equation_base & equation() const
Returns the equation associated with the unknown whose trace is taken.
const Domaine_dis_base & domaine_dis() const override
Returns the discretized domain associated with the equation carrying the unknown field whose trace is...
const Milieu_base & milieu() const
Returns the medium associated with the equation carrying the unknown field whose trace is taken.
virtual void changer_temps_futur(double temps, int i)
Changes the i-th future time of the BC.
virtual int avancer(double temps)
Rotates the wheel of the BC.
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
virtual int reculer(double temps)
Rotates the wheel of the BC.
std::vector< Motcle > app_domains
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
Raccord_t & raccord(int i)
virtual const MD_Vector & md_vector_elements() const
Returns the parallel descriptor of element arrays of the domain.
Domaine_dis_base & domaine_dis()
Returns a reference to the discretized domain associated with the boundary conditions.
std::map< std::array< int, 2 >, int > virt_e_map
void init_virt_e_map() const
double dist_norm_bord(int num_face) const override
Returns the normal distance for a boundary face (Cartesian coordinates).
void creer_tableau_faces(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
double xv(int num_face, int k) const
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
const Front_VF & front_VF(int i) const
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
Classe Echange_global_impose This class represents the special case of the class.
void mettre_a_jour(double temps) override
Performs a time update of the boundary condition.
void completer() override
DOES NOTHING must be overridden in derived classes.
int initialiser(double temps) override
Initialization at the beginning of the calculation.
virtual Champ_front_base & T_ext()
Returns the T_ext field of temperature imposed at the boundary.
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 RefObjU & get_modele(Type_modele type) const
virtual const Champ_Inc_base & inconnue() const =0
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual const Motcle & domaine_application() const
Returns "indeterminate" Navier_Stokes_standard for example overrides this method.
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
virtual int nb_comp() const
int num_premiere_face() const
int num_face(const int) const
virtual void trace_elem_distant(const DoubleTab &, DoubleTab &) const
virtual void trace_face_distant(const DoubleTab &, DoubleTab &) const
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
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.
Milieu_base This class is the base of the (physical) medium hierarchy.
virtual const Champ_Don_base & conductivite() const
Returns the conductivity of the medium (const version).
Base class for scalar turbulence models coupled to a Navier-Stokes convection-diffusion equation.
const Turbulence_paroi_scal_base & loi_paroi() const
Returns the scalar wall-law turbulence model (const version).
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
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.
static double precision_geom
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
virtual int nb_valeurs_temporelles() const =0
Base class for output streams.
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension_tot(int) const override
_SIZE_ dimension(int d) const
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
const Objet_U & valeur() const
Base class for the hierarchy of scalar wall-law models computing turbulent quantities near walls....
virtual bool use_equivalent_distance() const
Give a boolean indicating if we need to use equivant distance by default we consider that we use the ...
virtual DoubleVect & equivalent_distance_name(DoubleVect &d_eq, const Nom &nom_bord) const =0
const DoubleVects & equivalent_distance() const