16#include <Frontiere_dis_base.h>
17#include <Schema_Temps_base.h>
18#include <Navier_Stokes_std.h>
19#include <Champ_front_synt.h>
20#include <Champ_Uniforme.h>
21#include <Fluide_base.h>
22#include <Domaine_VF.h>
39 os << tab.
size() <<
" ";
40 for(
int i=0; i<tab.
size(); i++)
79 Cerr <<
"Error the dimension must be equal to 3" << finl;
84 les_mots[0]=
"moyenne";
85 les_mots[1]=
"lenghtScale";
86 les_mots[2]=
"nbModes";
87 les_mots[3]=
"turbKinEn";
88 les_mots[4]=
"turbDissRate";
89 les_mots[5]=
"KeOverKmin";
90 les_mots[6]=
"timeScale";
91 les_mots[7]=
"ratioCutoffWavenumber";
92 les_mots[8]=
"dir_fluct";
97 Cerr <<
"Error while reading Champ_front_synt" << finl;
98 Cerr <<
"We expected a { instead of " << motlu << finl;
105 int rang=les_mots.search(motlu);
113 for(
int i=0; i<dim; i++)
164 for(
int i=0; i<dim; i++)
174 Cerr <<
"Error while reading Champ_front_synt:" << finl;
175 Cerr <<
" Parameter " << motlu <<
" has been renamed to KeOverKmin since TRUST v1.9.0"<< finl;
176 Cerr <<
" Update your datafile."<< finl;
180 Cerr <<
"Error while reading Champ_front_synt:" << finl;
181 Cerr <<
" " << motlu <<
"is not understood."<< finl;
182 Cerr <<
" We are expecting a parameter among " << les_mots << finl;
191 Cerr <<
"Error while reading Champ_front_synt: wrong number of parameters" << finl;
192 Cerr <<
"You should specify all these parameters: " << les_mots << finl;
197 Cerr <<
"Error while reading Champ_front_synt" << finl;
198 Cerr <<
"There is at least one parameter among: timeScale, lenghtScale, nbModes, turbKinEn, turbDissRate and ratioCutoffWavenumber set to 0" << finl;
202 for(
int i=0; i<dim; i++)
253 double visc = ref_cast(
Fluide_base,mil).viscosite_cinematique().valeurs()(0,0);
262 DoubleVect aireFaces;
266 for(
int i=0; i<nb_face; i++)
267 sum_aire += aireFaces[i];
269 sum_aire =
mp_sum(sum_aire);
286 double kappa_eta = pow((
turbDissRate/(visc*visc*visc)),0.25);
289 double delta_kappa = pow( (std::min(kappa_eta,kappa_max) / kappa_min ), 1./(
nbModes-1.));
290 if (kappa_max <= kappa_min)
292 Cerr <<
"Error: kappa_max(=" << kappa_max <<
") <= kappa_min(=" << kappa_min <<
")" << finl;
293 Cerr <<
"You should either refine your mesh or increase the ratioCutoffWavenumber value in " <<
que_suis_je() << finl;
303 DoubleVect kappa_face(
nbModes+1);
304 DoubleVect kappa_center(
nbModes);
326 phi(i) = drand48()* 2*pi ;
327 alpha(i) = drand48()* 2*pi ;
328 psi(i) = drand48()* 2*pi ;
330 tetha(i) = acos(1-2*drand48()) ;
333 kappa_x(i) = sin(tetha(i))*cos(phi(i));
334 kappa_y(i) = sin(tetha(i))*sin(phi(i));
335 kappa_z(i) = cos(tetha(i));
338 sigma_x(i) = cos(phi(i))*cos(tetha(i))*cos(alpha(i)) - sin(phi(i))*sin(alpha(i));
339 sigma_y(i) = sin(phi(i))*cos(tetha(i))*cos(alpha(i)) + cos(phi(i))*sin(alpha(i));
340 sigma_z(i) = -sin(tetha(i))*cos(alpha(i));
344 for(
int i = 0; i<
nbModes+1; i++)
346 kappa_face(i) = kappa_min * pow(delta_kappa,i);
350 for(
int i = 0; i<
nbModes; i++)
352 kappa_center(i) = 1.0/2.0*(kappa_face(i+1)+kappa_face(i));
353 dkn(i) = kappa_face(i+1)- kappa_face(i);
357 DoubleTab centreGrav(nb_face);
360 for(
int i = 0; i<nb_face; i++ )
365 double x_center = centreGrav(i,0);
366 double y_center = centreGrav(i,1);
367 double z_center = centreGrav(i,2);
371 double kx = kappa_x(m) * kappa_center(m);
372 double ky = kappa_y(m) * kappa_center(m);
373 double kz = kappa_z(m) * kappa_center(m);
375 double arg = kx*x_center + ky*y_center + kz*z_center + psi(m);
377 double tfunk = cos(arg);
379 double karman_spectrum = amp/kappa_e * (2.*
turbKinEn/3.) * pow((kappa_center(m)/kappa_e),4)/pow(1+pow(kappa_center(m)/kappa_e, 2),17.0/6.0) * exp(-2*(pow(kappa_center(m)/kappa_eta, 2)));
380 double amplitude = sqrt(karman_spectrum * dkn(m));
382 turb(0) += 2*amplitude*tfunk*sigma_x(m);
383 turb(1) += 2*amplitude*tfunk*sigma_y(m);
384 turb(2) += 2*amplitude*tfunk*sigma_z(m);
397 double b = sqrt(1-a*a);
class Ch_front_var_instationnaire_dep This abstract class represents a field on a boundary,
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialization at the beginning of calculation.
int lire_dimension(Entree &, const Nom &)
Verification of the field dimension Returns the dimension of the field.
class Champ_front_base Base class for the hierarchy of boundary fields.
virtual DoubleTab & valeurs() override
Returns the array of field values.
Champ_front_synt Derived from Champ_front_base.
void mettre_a_jour(double temps) override
DOES NOTHING, to override.
Champ_front_base & affecter_(const Champ_front_base &ch) override
Not implemented!!
int initialiser(double temps, const Champ_Inc_base &inco) override
Updates the time.
double ratioCutoffWavenumber
DoubleTab & valeurs_au_temps(double temps) override
Returns the values at the desired time.
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
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
void calculer_surfaces(DoubleVect_t &surf) const
Computes the surface area of the faces.
void calculer_centres_gravite(DoubleTab_t &xv) const
Computes the centers of gravity of each face.
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
virtual int nb_comp() const
Base class for an incompressible fluid and its properties:
const Faces_t & faces() const
const Frontiere & frontiere() const
Returns the associated geometric boundary.
Milieu_base This class is the base of the (physical) medium hierarchy.
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.
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
static double mp_sum_as_double(int v)
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
double pas_de_temps() const
Returns the current time step (delta_t).
Base class for output streams.
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")