17#include <Paroi_ODVM_scal_VDF.h>
18#include <ParoiVDF_TBLE.h>
19#include <Paroi_std_hyd_VDF.h>
20#include <Domaine_Cl_VDF.h>
21#include <Dirichlet_paroi_fixe.h>
22#include <Echange_externe_impose.h>
23#include <Champ_Uniforme.h>
24#include <Champ_front_calc.h>
25#include <Convection_Diffusion_Temperature.h>
26#include <Convection_Diffusion_Concentration.h>
27#include <Modele_turbulence_scal_base.h>
28#include <Constituant.h>
29#include <Fluide_base.h>
31#include <Modele_turbulence_hyd_base.h>
32#include <Probleme_base.h>
33#include <Echange_contact_VDF.h>
68 les_mots[1]=
"facteur";
71 les_mots[4]=
"CHECK_FILES";
79 int rang=les_mots.search(mot_lu);
101 Cerr << mot_lu <<
" is not a valid keyword for ODVM scalar wall-model" << finl;
102 Cerr <<
"Possible keywords are : " << les_mots << finl;
127 tab_u_star.resize(le_dom_dis_->nb_faces_bord());
130 Tf0.resize(le_dom_dis_->nb_faces_bord());
137 const IntTab& face_voisins = domaine_VDF.
face_voisins();
139 const Equation_base& eqn_temp = mon_modele_turb_scal->equation();
150 const DoubleTab& lambda_f = ch_lambda.
valeurs();
151 const DoubleTab& Cp_f = ch_Cp.
valeurs();
152 const DoubleTab& rho_f = ch_rho.
valeurs();
157 double lambda_f_loc = -1.;
158 double Cp_f_loc = -1;;
159 double rho_f_loc = -1.;
164 lambda_f_loc = std::max(lambda_f(0,0),DMINFLOAT);
169 Cp_f_loc = std::max(Cp_f(0,0),DMINFLOAT);
174 rho_f_loc = std::max(rho_f(0,0),DMINFLOAT);
200 for (
int n_bord=0; n_bord<domaine_VDF.
nb_front_Cl(); n_bord++)
203 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
220 for (
int num_face=ndeb; num_face<nfin; num_face++)
222 if ((elem = face_voisins(num_face,0)) == -1) elem = face_voisins(num_face,1);
223 T0 = la_cl_ech.
T_ext(num_face-ndeb);
230 eq_odvm[num_face].initialiser(
N,
gamma,dist,T0, Temp(elem), t0, 1.,
facteur);
251 for (
int num_face=ndeb; num_face<nfin; num_face++)
253 if ((elem = face_voisins(num_face,0)) == -1) elem = face_voisins(num_face,1);
255 lambda_f_loc = lambda_f(elem);
257 Cp_f_loc = Cp_f(elem);
259 rho_f_loc = rho_f(elem);
261 K = sqrt(lambda_f_loc*Cp_f_loc*rho_f_loc/(lambda_s(0,0)*Cp_s(0,0)*rho_s(0,0)));
269 eq_odvm[num_face].initialiser(
N,
gamma,dist,Temp(elem), Temp(elem), t0, K,
facteur);
282 Cerr <<
"Problem while initializing ODVM: the boundary condition" << finl;
283 Cerr <<
"can not be used with ODVM wall-model at the moment." << finl;
313 const IntTab& face_voisins = domaine_VDF.
face_voisins();
314 int nb_elems = domaine_VDF.
nb_elem();
324 DoubleTab termes_sources;
325 termes_sources.
resize(nb_elems,1);
327 termes_sources /= rhoCp;
330 const DoubleTab& xv = domaine_VDF.
xv();
333 const DoubleTab& tab_visco = ch_visco_cin.
valeurs();
339 visco = std::max(tab_visco(0,0),DMINFLOAT);
347 Cerr <<
"In Paroi_ODVM_scal_VDF::calculer_scal : visco = " << tab_visco.
local_min_vect() <<
" <= 0 ? " << finl;
353 double diff, visco_cin;
361 const RefObjU& modele_turbulence_hydr = eqn_hydr.
get_modele(TURBULENCE);
364 const DoubleVect& tab_ustar = loi.
tab_u_star();
379 for (
int n_bord=0; n_bord<domaine_VDF.
nb_front_Cl(); n_bord++)
381 const Cond_lim& la_cl = le_dom_Cl_dis_->les_conditions_limites(n_bord);
391 int boundary_index=-1;
393 boundary_index=n_bord;
394 assert(boundary_index >= 0);
401 for (
int num_face=ndeb; num_face<nfin; num_face++)
403 if ((elem = face_voisins(num_face,0)) == -1) elem = face_voisins(num_face,1);
404 if (l_unif) visco_cin = visco;
405 else visco_cin = tab_visco[elem];
410 else diff = alpha.
valeurs()(elem,0);
412 T0 = la_cl_ech.
T_ext(num_face-ndeb);
413 if(
compt) eq_odvm[num_face].set_U_tau(tab_ustar(num_face),1);
414 else eq_odvm[num_face].set_U_tau(tab_ustar(num_face),-1);
416 double ts = termes_sources(elem);
417 eq_odvm[num_face].set_F(ts);
418 eq_odvm[num_face].aller_au_temps(tps,T0,Temp(elem),diff,visco_cin,1);
422 double periode = 1e-2, tn=0.;
423 if((tps-tn) > periode)
428 double Temp_w = la_cl_ech.
T_ext(num_face-ndeb);
429 double dy_w = eq_odvm[num_face].get_dy_w();
430 double Temp_mean = eq_odvm[num_face].get_Tm(1);
431 double Temp_prim = eq_odvm[num_face].get_Tp(1);
436 int global_face=num_face;
438 equivalent_distance_[boundary_index](local_face) = (Temp(elem)-Temp_w)*dy_w/(Temp_mean+Temp_prim - Temp_w);
451 const DoubleTab& h_autre_pb = la_cl_couplee.
h_autre_pb();
456 for (
int num_face=ndeb; num_face<nfin; num_face++)
458 if ((elem = face_voisins(num_face,0)) == -1) elem = face_voisins(num_face,1);
459 if (l_unif) visco_cin = visco;
460 else visco_cin = tab_visco[elem];
465 else diff = alpha.
valeurs()(elem,0);
468 const double Temp_solid = t_autre(num_face-ndeb,0);
470 T0 = (Tf0(num_face-ndeb)-Temp_solid)*h_autre_pb(num_face-ndeb,0);
471 T0 = T0*diff/lambda_f(0,0);
475 eq_odvm[num_face].set_U_tau(tab_ustar(num_face),1);
476 eq_odvm[num_face].init_profile_CHT(Temp_solid,Temp(elem));
480 eq_odvm[num_face].set_U_tau(tab_ustar(num_face),-1);
481 eq_odvm[num_face].aller_au_temps(tps,T0,Temp(elem),diff,visco_cin,2);
484 double Ttot0 = eq_odvm[num_face].get_Tm(0) + eq_odvm[num_face].get_Tp(0);
485 if(
compt!=1) Tf0(num_face-ndeb) = 0.5*Ttot0+0.5*Tf0(num_face-ndeb);
486 else Tf0(num_face-ndeb)=Temp_solid;
490 double Ttot1 = eq_odvm[num_face].get_Tm(1) + eq_odvm[num_face].get_Tp(1);
491 if((num_face==ndeb)&&(xv(ndeb,1)<1.))
493 SFichier fic(
"Suivi_ndeb.dat",ios::app);
494 fic << tps <<
" " << Temp_solid
495 <<
" " << eq_odvm[num_face].get_Tm(0)
499 <<
" " << eq_odvm[num_face].get_Tm(
N-1) << finl;
506 if((num_face==ndeb)&&(xv(ndeb,1)<1.))
509 for(
int i=0; i<
N; i++)
510 fic << eq_odvm[num_face].get_Y(i) <<
" " << sqrt(eq_odvm[num_face].get_qf(i)) <<
" " << sqrt(eq_odvm[num_face].get_qb(i)) <<finl;
512 fic_Q << tps <<
" " << eq_odvm[num_face].get_Q(0) << finl;
531 for (
int num_face=ndeb; num_face<nfin; num_face++)
534 for(
int i=0; i<
N; i++)
536 Tmean[i] = Tmean[i] + (eq_odvm[num_face].get_Tm(i)+eq_odvm[num_face].get_Tp(i))*dtG/(nfin-ndeb);
537 Trms[i] = Trms[i] + (eq_odvm[num_face].get_Tm(i)+eq_odvm[num_face].get_Tp(i))*(eq_odvm[num_face].get_Tm(i)+eq_odvm[num_face].get_Tp(i))*dtG/(nfin-ndeb);
538 Tpm[i] = Tpm[i] + eq_odvm[num_face].get_Tp(i)*dtG/(nfin-ndeb);
539 qb_mean[i] = qb_mean[i] + sqrt(eq_odvm[num_face].get_qb(i))*dtG/(nfin-ndeb);
541 Tm_mean[i] = Tm_mean[i]+eq_odvm[num_face].get_Tm(i)*dtG/(nfin-ndeb);
542 Tm_rms[i] = Tm_rms[i]+eq_odvm[num_face].get_Tm(i)*eq_odvm[num_face].get_Tm(i)*dtG/(nfin-ndeb);
543 Tp_rms[i] = Tp_rms[i]+eq_odvm[num_face].get_Tp(i)*eq_odvm[num_face].get_Tp(i)*dtG/(nfin-ndeb);
549 Nom nom_fic =
"ODVM_fields_";
554 fic <<
"# Time and Space Averaged ODVM Statistics " << finl;
555 fic <<
"# Y <T> Trms <Tp> sqrt(q) Tm_rms Tp_rms" << finl;
556 for(
int i=0; i<
N; i++)
557 fic << eq_odvm[ndeb].get_Y(i) <<
" " << Tmean[i]/
Tau <<
" " << sqrt((Trms[i]-(Tmean[i]*Tmean[i])/
Tau)/
Tau) <<
" " << Tpm[i]/
Tau <<
" " << qb_mean[i]/
Tau <<
" " << sqrt((Tm_rms[i]-(Tm_mean[i]*Tm_mean[i])/
Tau)/
Tau) <<
" " << sqrt((Tp_rms[i]-(Tpm[i]*Tpm[i])/
Tau)/
Tau) << finl;
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual DoubleTab & valeurs_au_temps(double temps)=0
class Champ_front_calc Derived class of Champ_front_var representing
const Milieu_base & milieu() const
Returns the medium associated with the equation carrying the unknown field whose trace is taken.
class Cond_lim Generic class used to represent any class
Convection_Diffusion_Concentration Special case of Convection_Diffusion_std.
Convection_Diffusion_std This class is the base for equations modelling the transport.
const Champ_Inc_base & inconnue() const override=0
Dirichlet_paroi_fixe Represents a fixed wall in a Navier-Stokes type equation.
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
double dist_norm_bord_axi(int num_face) const
Returns the normal distance for a boundary face (cylindrical coordinates).
double dist_norm_bord(int num_face) const override
Returns the normal distance for a boundary face (Cartesian coordinates).
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.
int nb_faces_bord() const
Returns the number of faces on which boundary conditions are applied:
const Front_VF & front_VF(int i) const
Classe Echange_externe_impose: This class represents the special case of the class.
virtual double T_ext(int num) const
Returns the value of the imposed temperature on the i-th component of the boundary field.
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
Sources & sources()
Returns the source terms associated with the equation.
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.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual int nb_comp() const
Base class for an incompressible fluid and its properties:
const Champ_Don_base & viscosite_cinematique() const
int num_local_face(const int) const
int num_premiere_face() const
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 & capacite_calorifique() const
Returns the heat capacity of the medium (const version).
virtual const Champ_Don_base & conductivite() const
Returns the conductivity of the medium (const version).
virtual const Champ_Don_base & diffusivite() const
Returns the diffusivity of the medium (const version).
virtual const Champ_base & masse_volumique() const
Returns the mass density of the medium (const version).
Base class for the turbulence model hierarchy for Navier-Stokes equations.
const Turbulence_paroi_base & loi_paroi() const
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.
CLASS: Paroi_ODVM_scal_VDF.
double temps_dern_post_inst
int init_lois_paroi() override
int calculer_scal(Champ_Fonc_base &) override
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
double temps_courant() const
Returns the current time.
double pas_de_temps() const
Returns the current time step (delta_t).
Base class for output streams.
DoubleTab & calculer(DoubleTab &) const
Calculates the contribution of all sources in the list and stores the result in the array passed as p...
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_TYPE_ local_min_vect(Mp_vect_options opt=VECT_REAL_ITEMS) const
const Objet_U & valeur() const
Base class for the hierarchy of wall-law models computing turbulent quantities near walls....
const DoubleVect & tab_u_star() const
DoubleVects equivalent_distance_