16#include <Modele_turbulence_scal_base.h>
17#include <Echange_externe_impose.h>
18#include <Op_Diff_DG_base.h>
19#include <Check_espace_virtuel.h>
20#include <Domaine_Cl_DG.h>
21#include <Champ_Elem_DG.h>
22#include <Champ_Fonc_P0_base.h>
23#include <Schema_Temps_base.h>
24#include <Domaine_DG.h>
25#include <Champ_Uniforme.h>
26#include <communications.h>
27#include <Probleme_base.h>
28#include <EcrFicPartage.h>
29#include <Milieu_base.h>
63 const Domaine& mon_dom = le_dom_dg_->domaine();
64 double dt_stab = DMAXFLOAT;
66 const int nb_elem = mon_dom.
nb_elem();
75 const DoubleVect& valeurs_diffusivite = champ_diffusivite.
valeurs();
76 double alpha_max = local_max_vect(valeurs_diffusivite);
79 double h_imp_max = -1, h_imp_temp = -2;
82 for (
int i = 0; i < le_dom_cl_dg.
nb_cond_lim(); i++)
91 const DoubleVect& tab = le_ch_front.
valeurs();
94 h_imp_temp = local_max_vect(tab);
95 h_imp_temp = std::fabs(h_imp_temp);
96 h_imp_max = (h_imp_temp > h_imp_max) ? h_imp_temp : h_imp_max;
102 if (alpha_max != 0.0 && nb_elem != 0)
104 double min_delta_h_carre = le_dom_dg_->carre_pas_du_maillage();
111 double max_conductivity = local_max_vect(tab_lambda);
114 double Bi = h_imp_max * sqrt(min_delta_h_carre) / max_conductivity;
117 alpha_max *= h_imp_max * sqrt(min_delta_h_carre) / max_conductivity;
119 dt_stab = min_delta_h_carre / (2. *
dimension * alpha_max);
127 const DoubleTab& valeurs_diffu = champ_diffu.
valeurs();
129 const DoubleTab& valeurs_rho = champ_rho.
valeurs();
136 const IntTab& e_f = le_dom_dg_->elem_faces();
137 for (
int elem = 0; elem < nb_elem; elem++)
139 const double diffu = valeurs_diffu(elem);
140 const double rho = valeurs_rho(elem);
142 if (e_f.
dimension(1) == deux_dim || e_f(elem, deux_dim) == -1)
147 for (
int f = 0; f < deux_dim; f++)
149 int face = e_f(elem, f);
150 const double d = le_dom_dg_->volumes(elem) / le_dom_dg_->face_surfaces(face);
154 dt = 0.5 * rho / ((diffu + DMINFLOAT) * h);
158 dt = le_dom_dg_->carre_pas_maille(elem) * rho / (deux_dim * (diffu + DMINFLOAT));
179 le_dom_dg_ = ref_cast(
Domaine_DG, domaine_dis);
210 le_dom_dg_->domaine().creer_tableau_elements(
nu_);
246 int n =
nu_.dimension_tot(0), nb_comp =
nu_.line_size();
248 const DoubleVect& arr_diffu = diffu;
249 DoubleVect& arr_nu =
nu_;
250 for (i = 0; i < n; i++)
251 for (j = 0; j < nb_comp; j++)
252 arr_nu[i * nb_comp + j] = arr_diffu[j];
257 assert_espace_virtuel_vect(diffu);
258 nu_.inject_array(diffu);
271 double val_nu = diffu(0, 0);
272 for (i = 0; i < diffu_turb.
dimension(0); i++)
273 for (j = 0; j < 2; j++)
276 val_nu = diffu(i, 0);
277 nu_(i, j) = val_nu + diffu_turb(i, j);
285 int n =
nu_.dimension_tot(0), nb_comp =
nu_.line_size();
287 const DoubleVect& arr_diffu_turb = diffu_turb;
288 DoubleVect& arr_nu =
nu_;
289 for (i = 0; i < n; i++)
290 for (j = 0; j < nb_comp; j++)
291 arr_nu[i * nb_comp + j] += arr_diffu_turb[j];
296 assert_espace_virtuel_vect(diffu_turb);
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
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_base Base class for the hierarchy of classes that represent the different boundary con...
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
int nb_cond_lim() const
Returns the number of 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.
Classe Echange_externe_impose: This class represents the special case of the class.
virtual double h_imp(int num) const
Returns the value of the imposed heat exchange coefficient on the i-th component.
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
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).
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
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.
This class provides the common infrastructure shared by all DG diffusion operators in TRUST....
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
Computes the diffusion operator applied to inco and stores the result in resu.
double calculer_dt_stab() const override
Computes the maximum stable explicit time step for the diffusion operator.
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
Associates the operator with a DG domain and its boundary conditions.
void completer() override
Finalizes the operator setup after all associations have been made.
const Champ_base & diffusivite() const override
void update_nu() const
Updates the cached effective diffusivity field nu_ by combining molecular and turbulent contributions...
bool has_diffusivite_turbulente() const
const Champ_Fonc_base & diffusivite_turbulente() const
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Returns the field corresponding to the true diffusivity of the medium used for the time step computat...
virtual void completer()
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
virtual DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const
static double mp_min(double)
static double mp_max(double)
Base class for output streams.
virtual const Champ_base & get_champ_masse_volumique() const
Returns the density field.
virtual int has_champ_masse_volumique() const
Returns 1 if the density field has been associated, 0 otherwise.
_SIZE_ dimension(int d) const
virtual const MD_Vector & get_md_vector() const