16#include <Equation_base.h>
17#include <Probleme_base.h>
18#include <Probleme_Couple.h>
19#include <Milieu_base.h>
22#include <LecFicDiffuse.h>
23#include <communications.h>
25#include <Schema_Euler_Implicite_Stationnaire.h>
60 Cerr <<
"A solver must be selected." << finl;
61 Cerr <<
"Syntax : " << finl
62 <<
"Solveur solver_name [ solver parameters ] " << finl;
67 Cerr <<
"diffusion_implicite option cannot be used with an implicit time scheme." << finl;
71 if (le_solveur->le_nom()!=
"Implicit_steady")
73 Cerr <<
"You can only select the Implicit_steady solver" << finl;
74 Cerr <<
"Syntax : " << finl
75 <<
"Solveur Implicit_steady [ solver parameters ] " << finl;
127 if(dt_loc.
size()* nb_dim == secmem.
size())
129 DoubleVect dt_loc_velocity(secmem);
131 for(
int i=0; i<dt_loc_velocity.
size(); i++)
133 if(i != 0 && i%nb_dim == 0) j++;
134 dt_loc_velocity[i]= dt_loc[j];
140 else if (dt_loc.
size()*2==secmem.
size())
143 DoubleVect dt_loc_velocity(secmem);
145 for(
int i=0; i<dt_loc_velocity.
size(); i++)
147 if(i != 0 && i%2 == 0) j++;
148 dt_loc_velocity[i]= dt_loc[j];
165 Cerr <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << finl;
166 Cerr <<
"Implicit_Euler_Steady_Scheme: incompatible equation detected." << finl;
167 Cerr <<
" Equation : " << eqn.
que_suis_je() << finl;
168 Cerr <<
" dt_loc.size() = " << dt_loc.
size() <<
" (face-sized, from NS convection operator)" << finl;
169 Cerr <<
" secmem.size() = " << secmem.
size() <<
" (unknown DOF count for this equation)" << finl;
171 Cerr <<
"This scheme is ONLY compatible with VEF discretization when used" << finl;
172 Cerr <<
"with RANS turbulence (k-eps, k-omega) or temperature equations." << finl;
173 Cerr <<
"In VDF, turbulence and scalar unknowns are element-centered (nb_elem)" << finl;
174 Cerr <<
"while dt_loc is face-centered (nb_faces), which are incompatible." << finl;
175 Cerr <<
"Please switch to a VEF discretization or use a different time scheme." << finl;
176 Cerr <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << finl;
195 for (
int count=0; count<
dt_locaux_.size(); count++)
212 if (
pb_base().discretisation().is_vdf())
219 Cerr <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << finl;
220 Cerr <<
"Implicit_Euler_Steady_Scheme is NOT compatible with VDF" << finl;
221 Cerr <<
"for turbulent or multi-equation problems." << finl;
222 Cerr <<
" Discretization : VDF" << finl;
225 Cerr <<
"RANS turbulence (k-eps, k-omega) and temperature equations are" << finl;
226 Cerr <<
"not supported with this scheme in VDF: the local time-step" << finl;
227 Cerr <<
"coupling diverges due to inconsistent DOF layout." << finl;
228 Cerr <<
"Please switch to VEF discretization or use a standard time scheme." << finl;
229 Cerr <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << finl;
254 double dt_loc_sum = mp_somme_vect(
dt_locaux_);
256 Cout <<
"dt_loc stats: min=" << dt_loc_min
257 <<
" max=" << dt_loc_max
258 <<
" mean=" << dt_loc_sum / dt_loc_n
259 <<
" ratio_max/min=" << dt_loc_max / (dt_loc_min + 1.e-300) << finl;
282 const double norm_un = mp_norme_vect(un);
283 DoubleTab tab_critere(unp1);
285 tab_critere /= std::max(norm_un, 1.e-10);
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
DoubleTab & passe(int i=1) override
Returns field values at instant t-i.
DoubleTab & valeurs() override
Returns the array of field values at the current 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....
Solveur_Masse_base & solv_masse()
Returns the mass solver associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
void calculer_pas_de_temps_locaux(DoubleTab &) const
Matrice_Base class - Base class of the matrix hierarchy.
bool contient(const Nom &nom) const
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.
Helper class to factorize the readOn method of Objet_U classes.
virtual double calculer_pas_de_temps() const
Computes the value of the next time step for the problem.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
static void imprimer_ram_totale(int all_process=0)
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
void initialize() override
bool isStationary() const override
Returns 1 if during the last time step, the problem has not evolved.
void calculer_pas_de_temps_local_pb()
void mettre_a_jour_dt_stab() override
bool iterateTimeStep(bool &converged) override
Calculate the U(n+1) unknown for each equation (if solved) of the problem with the selected time sche...
double steady_security_factor_
int mettre_a_jour() override
Updates the current time (t+=dt) and the number of time steps performed (nb_pas_dt_++).
bool corriger_dt_calcule(double &dt_calc) const override
Corrects the computed time step passed as parameter and verifies it is not "too" small (< dt_min_).
void ajouter_inertie(Matrice_Base &mat_morse, DoubleTab &secmem, const Equation_base &eqn) const override
int reprendre(Entree &) override
Restores an Objet_U from an input stream. Virtual method to override.
void set_param(Param &) const override
int reprendre(Entree &) override
Restores an Objet_U from an input stream. Virtual method to override.
void set_param(Param &) const override
bool iterateTimeStep(bool &converged) override
Calculate the U(n+1) unknown for each equation (if solved) of the problem with the selected time sche...
void calcul_fac_sec(double &residu_, double &residu_old, double &facsec_)
int diffusion_implicite() const
Returns 1 if the time scheme has been read with diffusion_implicite.
int limpr() const
Returns 1 if there is a need to perform a print (cf dt_impr) Returns 0 otherwise.
int & set_stationnaire_atteint()
virtual bool isStationary() const
Returns 1 if during the last time step, the problem has not evolved.
Probleme_base & pb_base()
DoubleTab dt_locaux_
Local time steps: Vector of size nb faces of the mesh.
virtual void imprimer(Sortie &os) const
Prints the time step to an output stream if appropriate.
virtual void initialize()
virtual int mettre_a_jour()
Updates the current time (t+=dt) and the number of time steps performed (nb_pas_dt_++).
double dt_stab_
Stability time step.
void update_critere_statio(const DoubleTab &tab_critere, Equation_base &equation)
Updates stationnaire_atteint_ and residu_ (criterion: residu_ < seuil_statio_).
virtual Matrice_Base & ajouter_masse_dt_local(DoubleVect &dt_locaux, Matrice_Base &matrice, int penalisation=1) const
Base class for output streams.
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")