16#include <Transport_Interfaces_base.h>
17#include <MD_Vector_composite.h>
18#include <Matrice_Morse_Sym.h>
19#include <Navier_Stokes_std.h>
20#include <Frontiere_dis_base.h>
21#include <Schema_Temps_base.h>
22#include <MD_Vector_tools.h>
23#include <Assembleur_base.h>
24#include <TRUSTTab_parts.h>
25#include <communications.h>
26#include <Champ_Uniforme.h>
27#include <MD_Vector_std.h>
28#include <solv_iteratif.h>
29#include <Probleme_base.h>
30#include <Discret_Thyd.h>
31#include <Fluide_base.h>
32#include <Domaine_VF.h>
40#include <TRUST_2_PDI.h>
84 terme_convectif.set_description(
"Momentum flow rate=Integral(rho*u*u*ndS) [N] if SI units used");
86 terme_diffusif.set_description(
"Friction drag exerted by the fluid=Integral(-mu*(grad(u) +grad(u)^T)*ndS) [N] if SI units used");
89 gradient.set_fichier(
"Force_pression");
90 gradient.set_description(
"Pressure drag exerted by the fluid=Integral(P*ndS) [N] if SI units used");
100 param.
ajouter_condition(
"is_read_diffusion",
"The diffusion operator must be read, select negligeable type if you want to neglect it.");
101 param.
ajouter_condition(
"is_read_convection",
"The convection operator must be read, select negligeable type if you want to neglect it.");
132 if (mot==
"diffusion")
134 Cerr <<
"Reading and typing of the diffusion operator : " << finl;
141 else if (mot==
"convection")
143 Cerr <<
"Reading and typing of the convection operator : " << finl;
149 else if (mot==
"solveur_pression")
151 Cerr <<
"Reading and typing of pressure solver : " << finl;
157 else if (mot==
"dt_projection")
159 Cerr <<
"Reading projection time step " << finl;
164 else if (mot==
"Traitement_particulier")
166 Cerr <<
"Reading and typing of Traitement_particulier considered : " << finl;
167 Nom type=
"Traitement_particulier_NS_";
169 Motcle accouverte =
"{" , accfermee =
"}" ;
171 if (motbidon == accouverte)
175 if (le_cas == accfermee)
183 if (discr ==
"VEFPreP1B")
186 Cerr << type << finl;
187 le_traitement_particulier.typer(type);
188 le_traitement_particulier->associer_eqn(*
this);
189 le_traitement_particulier->lire(is);
193 Cerr <<
"Error while reading Traitement_particulier for Navier_Stokes_standard equation";
194 Cerr <<
"A { was expected." << finl;
199 else if (mot==
"Erreur_max_DivU")
201 Cerr <<
"Reading DivU maximum" << finl;
206 else if (mot==
"seuil_divU")
208 Cerr <<
"Reading the threshold value for the velocity divergence " << finl;
213 else if (mot==
"solveur_bar")
216 Motcle accouverte =
"{" , accfermee =
"}" ;
220 while (acc!=0 || !ok)
223 if (motlu==accouverte)
228 if (motlu==accfermee) acc--;
240 else if (mot==
"methode_calcul_pression_initiale")
245 compris[0]=
"avec_les_cl";
246 compris[1]=
"avec_sources";
247 compris[2]=
"avec_sources_et_operateurs";
248 compris[3]=
"sans_rien";
252 Cerr<<methode<<
" is not understood."<<finl;
253 Cerr<<
" Allowed keywords are :"<<compris<<finl;
307 Cerr <<
"Centrifuge force term creation for Axi case."<< finl;
308 Nom type_so =
"Force_Centrifuge_";
317 so->associer_eqn(*
this);
328 la_pression->associer_domaine_cl_dis(le_dom_Cl_dis);
337 assembleur_pression_->associer_domaine_cl_dis_base(
domaine_Cl_dis());
338 assembleur_pression_->completer(*
this);
340 if (distance_paroi_globale)
343 domaine.init_dist_paroi_globale(
domaine_Cl_dis().les_conditions_limites());
344 Cerr <<
"Initializing distance_paroi_globale ... " << finl;
345 const DoubleTab& dist_calc = domaine.y_elem();
346 for (
int e = 0 ; e < domaine.nb_elem() ; e++) distance_paroi_globale->valeurs()(e, 0) = dist_calc(e);
362 Cerr <<
"Hydraulic equation discretization (Navier_Stokes_std::discretiser)" << finl;
366 la_vitesse->add_synonymous(
Nom(
"velocity"));
383 gradient.l_op_base().associer_eqn(*
this);
419 Nom type =
"Assembleur_P_";
421 Cerr <<
"Navier_Stokes_std::discretiser_assembleur_pression : type="<< type << finl;
422 assembleur_pression_.typer(type);
423 assembleur_pression_->associer_domaine_dis_base(
domaine_dis());
428 if (!
probleme().domaine().mesh_update_required())
return;
470 Cerr <<
"Error for Navier_Stokes_std::operateur(int i)" << finl;
472 Cerr <<
"and you are trying to access the " << i <<
" th one."<< finl;
496 Cerr <<
"Error for Navier_Stokes_std::operateur(int i)" << finl;
498 Cerr <<
"and you are trying to access the " << i <<
" th one."<< finl;
514 Cerr <<
"Error for Navier_Stokes_std::operateur_fonctionnel(int i)" << finl;
515 Cerr <<
"Navier_Stokes_std has " <<
nombre_d_operateurs() <<
" functional operators "<<finl;
516 Cerr <<
"and you are trying to access the " << i <<
" th one."<< finl;
532 Cerr <<
"Error for Navier_Stokes_std::operateur_fonctionnel(int i)" << finl;
533 Cerr <<
"Navier_Stokes_std has " <<
nombre_d_operateurs() <<
" functional operators "<<finl;
534 Cerr <<
"and you are trying to access the " << i <<
" th one."<< finl;
599 return la_vitesse.valeur();
608 return la_vitesse.valeur();
628 return le_fluide.valeur();
638 return le_fluide.valeur();
643 Cerr <<
"Reading of initial conditions\n";
650 Cerr <<
"We expected a { while reading " <<
que_suis_je() << finl;
651 Cerr <<
"and not : " << nom << finl;
656 compris[1]=
"vitesse";
657 compris[2]=
"pression";
663 ind = compris.
rang(motlu);
680 Cerr << nom <<
" is not understood. Keywords are:" << finl;
681 Cerr << compris << finl;
693 if (assembleur_pression_->get_resoudre_increment_pression())
699 const DoubleTab& tab_pression =
la_pression->valeurs();
701 gradient.calculer(tab_pression, gradP);
721 DoubleTrav secmemP(tab_pression);
732 DoubleTab derivee2(derivee);
734 derivee2+=la_vitesse->passe();
748 DoubleTab derivee2(derivee);
758 assembleur_pression_->modifier_secmem(secmemP);
763 if (assembleur_pression_->get_resoudre_increment_pression())
766 DoubleTrav Cp(tab_pression);
771 assembleur_pression_->modifier_solution(tab_pression);
774 solveur_masse->appliquer(gradP);
781 assembleur_pression_->modifier_solution(tab_pression);
791 gradient.calculer(tab_pression, gradP);
795 DoubleTrav Mmoins1gradP(gradP);
796 Mmoins1gradP = gradP;
797 solveur_masse->appliquer(Mmoins1gradP);
800 derivee -= Mmoins1gradP;
818 Cerr <<
"WARNING: Quasi compressible model --> no projection (except the first time step)." << finl;
821 Cerr <<
"Projection of initial and boundaries conditions " << finl;
822 DoubleTab& tab_vitesse = la_vitesse->valeurs();
826 double normal_seuil = 0.;
839 dt = std::min(dt, le_schema_en_temps->pas_temps_max());
844 double bilan=mp_norme_vect(secmem);
845 Cout <<
"------------- Projection -----------------" << finl;
846 Cout <<
"--------------------------------------------" << finl;
847 Cout <<
"Mass balance before projection : " << bilan << finl;
862 assembleur_pression_->modifier_solution(lagrange);
867 gradient->multvect(lagrange, gradP);
870 solveur_masse->appliquer(gradP);
874 tab_vitesse.
ajoute(-dt,gradP);
877 DoubleTab_parts partv(tab_vitesse);
878 partv[0].ajoute(-dt,gradP);
881 solveur_masse->corriger_solution(tab_vitesse, tab_vitesse);
889 bilan=mp_norme_vect(secmem);
890 Cout <<
"Mass balance after projection : " << bilan << finl;
891 Cout <<
"------------- Projection OK---------------" << finl;
892 Cout <<
"--------------------------------------------" << finl;
908 double temps = le_schema_en_temps->temps_courant()+le_schema_en_temps->pas_de_temps();
912 static double nb_proj = nb_proj_int;
941 Cerr <<
"Assembling for quasi-compressible" << finl;
954 le_dom_Cl_dis->mettre_a_jour(temps);
961 Cout <<
"Estimation of the pressure field at startup:" << finl;
973 if (le_schema_en_temps->pas_de_temps() == 0)
976 dt = std::min(dt, le_schema_en_temps->pas_temps_max());
977 le_schema_en_temps->set_dt() = (dt);
982 le_schema_en_temps->set_dt() = 0;
985 solveur_masse->appliquer(vpoint);
991 assembleur_pression_->modifier_secmem_pour_incr_p(
la_pression->valeurs(), 1, secmem);
994 Cerr <<
"Pressure increment computed successfully" << finl;
997 operator_add(
la_pression->valeurs(), inc_pre, VECT_ALL_ITEMS);
1013 if (le_traitement_particulier)
1014 le_traitement_particulier->preparer_calcul_particulier();
1049 if (postraitement_gradient_P_)
1053 solveur_masse->appliquer(
gradient_P->valeurs());
1068 double seuil_dyn_max = 1.e-10;
1069 seuil_dyn=std::max(seuil_dyn,seuil_dyn_max);
1077 if (le_traitement_particulier)
1078 le_traitement_particulier->post_traitement_particulier();
1080 Debog::verifier(
"Navier_Stokes_std::mettre_a_jour : vitesse", la_vitesse->valeurs());
1082 if (la_vorticite) la_vorticite->mettre_a_jour(temps);
1089double Navier_Stokes_std::LocalFlowRateRelativeError()
const
1125 if (i <=
pression().nb_valeurs_temporelles())
1155 ConstDoubleTab_parts ppart(tab_pression);
1211 ident_pression +=
Nom(temps,
probleme().reprise_format_temps());
1215 avancer_fichier_with_syno(is,ident_pression,field_tag_syno);
1219 avancer_fichier(is,ident_pression);
1223 if (le_traitement_particulier)
1224 le_traitement_particulier->reprendre_stat();
1244 Cerr <<
"Error of fluid type for the method Navier_Stokes_std::associer_milieu_base" << finl;
1257 Cerr <<
"You forgot to associate a fluid to the problem named " <<
probleme().
le_nom() << finl;
1260 return le_fluide.valeur();
1273 Cerr <<
"You forgot to associate a fluid to the problem named " <<
probleme().
le_nom() << finl;
1276 return le_fluide.valeur();
1283 if (motlu ==
"vorticite")
1292 else if (motlu ==
"critere_Q")
1301 else if (motlu ==
"y_plus")
1310 else if (motlu ==
"distance_paroi_globale")
1312 if (!distance_paroi_globale)
1319 else if (motlu ==
"reynolds_maille")
1328 else if (motlu ==
"courant_maille")
1337 else if (motlu ==
"taux_cisaillement")
1346 else if (motlu ==
"pression_hydrostatique")
1356 else if (motlu ==
"gradient_vitesse")
1366 if (le_traitement_particulier)
1367 le_traitement_particulier->creer_champ(motlu);
1375 DoubleTab& val= pression_hydro.
valeurs();
1377 if (!
milieu().a_gravite())
1379 Cerr<<
"postprocessing of presion_hydrostatique needs gravity"<<finl;
1385 Cerr<<
"postprocessing of presion_hydrostatique availabe only for incompressible flow"<<finl;
1393 for (
int som=0; som<nb_som; som++)
1397 gz+=coords(som,dir)*gravite(0,dir);
1405 if (nom ==
"gradient_pression")
1411 if (nom ==
"vorticite" && la_vorticite)
1423 if (nom ==
"y_plus" &&
y_plus)
1447 if (nom ==
"gradient_vitesse" &&
grad_u)
1462 if (le_traitement_particulier)
1463 if (le_traitement_particulier->has_champ(nom, ref_champ))
1471 if (nom ==
"gradient_pression")
1474 if (nom ==
"vorticite" && la_vorticite)
1480 if (nom ==
"y_plus" &&
y_plus)
1492 if (nom ==
"gradient_vitesse" &&
grad_u)
1501 if (le_traitement_particulier)
1502 if (le_traitement_particulier->has_champ(nom))
1511 if (nom ==
"gradient_pression")
1512 postraitement_gradient_P_ = 1;
1514 if (nom ==
"vorticite")
1517 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1520 if ((ch.
temps() == temps_init) && (la_vitesse->mon_equation_non_nul()))
1525 if (nom ==
"critere_Q")
1528 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1531 if ((ch.
temps() == temps_init) && (la_vitesse->mon_equation_non_nul()))
1536 if (nom ==
"y_plus")
1539 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1542 if (((ch.
temps() != la_vitesse->temps()) || (ch.
temps() == temps_init)) && (la_vitesse->mon_equation_non_nul()))
1547 if (nom ==
"reynolds_maille")
1550 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1553 if ((ch.
temps() == temps_init) && (la_vitesse->mon_equation_non_nul()))
1558 if (nom ==
"courant_maille")
1561 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1564 if (((ch.
temps() != la_vitesse->temps()) || (ch.
temps() == temps_init)) && (la_vitesse->mon_equation_non_nul()))
1569 if (nom ==
"taux_cisaillement")
1572 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1575 if ((ch.
temps() == temps_init) && (la_vitesse->mon_equation_non_nul()))
1580 if (nom ==
"gradient_vitesse")
1583 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1586 if ((ch.
temps() == temps_init) && (la_vitesse->mon_equation_non_nul()))
1591 if (nom ==
"pression_hydrostatique")
1594 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1597 if (((ch.
temps() != la_vitesse->temps()) || (ch.
temps() == temps_init)) && (la_vitesse->mon_equation_non_nul()))
1610 if (le_traitement_particulier)
1611 if (le_traitement_particulier->has_champ(nom, ref_champ))
1614 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
1621 if (le_traitement_particulier)
1622 le_traitement_particulier->get_noms_champs_postraitables(nom, opt);
1625 noms_compris.add(
"vorticite");
1626 noms_compris.add(
"critere_Q");
1627 noms_compris.add(
"y_plus");
1628 noms_compris.add(
"reynolds_maille");
1629 noms_compris.add(
"courant_maille");
1630 noms_compris.add(
"taux_cisaillement");
1631 noms_compris.add(
"pression_hydrostatique");
1632 noms_compris.add(
"gradient_vitesse");
1634 if (opt == DESCRIPTION)
1635 Cerr <<
" Navier_Stokes_std : " << noms_compris << finl;
1637 nom.add(noms_compris);
1655 double LocalFlowRateError=mp_max_abs_vect(
divergence_U->valeurs());
1657 os <<
"Cell balance flow rate control for the problem " <<
probleme().
le_nom() <<
" : " << finl;
1658 os <<
"Absolute value : " << LocalFlowRateError <<
" m"<<
dimension+
bidim_axi<<
"/s" << finl;
1659 os <<
"Relative value : " << LocalFlowRateRelativeError() << finl;
1666 os <<
"time step continuity errors : sum local = " << local <<
", global = " << global <<
", cumulative = " <<
cumulative_ << finl;
1672 Cerr <<
"The mass balance is too bad (relative value>1%)." << finl;
1673 Cerr <<
"Please check and lower the convergence value of the pressure solver." << finl;
1677#ifndef TRUST_USE_GPU
1682 Cerr << finl <<
"********************** Advice (printed only on the first " << nw <<
" time steps) *********************" << finl;
1683 Cerr <<
"You should use PETSc Cholesky solver instead of an iterative method for the pressure solver." << finl;
1684 Cerr <<
"For the caracteristics of your problem, it will be faster and give a better mass flow balance." << finl;
1685 Cerr <<
"**********************************************************************************************" << finl << finl;
1693 os <<
" convergence threshold of the iterative solver : " << solv_iter.
get_seuil() << finl;
1708 static Motcle domaine =
"Hydraulique";
1713 const DoubleTab& valeurs_inconnue,
1719 mat.typer(
"Matrice_Morse");
1732 if(type_solveur ==
"Solv_Cholesky" || type_solveur ==
"Solv_GCP")
1735 new_mat.set_est_definie(1);
1749 if (
gradient->has_interface_blocs())
1750 gradient->dimensionner_blocs({{
"vitesse", &matrice }});
1762 gradient->dimensionner_blocs(matrices, semi_impl);
1768 gradient->ajouter_blocs(matrices, secmem, semi_impl);
1792 static double dt_old=dt;
1819 DoubleTrav secmem(derivee);
1832 Cerr <<
"To be developped ... " << finl;
1857 DoubleTrav grad0(U);
1859 DoubleTrav residu(P);
1861 double dold,dnew,alfa;
1865 Cerr <<
"Begining Uzawa, secmem norm value : " << mp_norme_vect(secmem) << finl;
1868 solveur.
nommer(
"uzawa_solver");
1884 dold = mp_norme_vect(residu);
1891 Cerr <<
"Uzawa, initial residue : " << dnew << finl;
1893 while ( ( dnew > seuil ) && (niter++ < nmax) )
1903 s = mp_prodscal(resu, Cp);
1906 residu.
ajoute(alfa,resu);
1908 dnew = mp_norme_vect(residu);
1920 Cerr <<
"######## Uzawa, No convergence after : " << niter <<
" iterations\n";
1921 Cerr <<
"######## Uzawa, Residue : "<< dnew <<
"\n";
1927 Cerr << finl <<
"Uzawa, convergence reached after " << niter <<
" iterations" << finl;
1937 DoubleTrav F(secmem);
1946 double R_carre = local_carre_norme_vect(R);
1947 double UU_carre = local_carre_norme_vect(UU);
1949 Cerr <<
"Ending Uzawa : mass residue : " << sqrt(R_carre) <<finl;
1950 Cerr <<
"Ending Uzawa : Qdm residue : " << sqrt(UU_carre)<<finl;
1956 if (le_traitement_particulier)
1957 le_traitement_particulier->sauver_stat();
1962 Cerr<<
" Navier_Stokes_std::rho_la_vitesse() must be overloaded "<<finl;
1971 DoubleTab& tab_y_p =
y_plus->valeurs();
1974 for (
int n = 0 ; n < tab_y_p.
dimension_tot(1) ; n++) tab_y_p(i,n) = tab(i,n);
1977 for (
int n = 0 ; n < tab_y_p.
dimension_tot(1) ; n++) tab_y_p(i,n) = tab(i,0,n);
1982 if(
probleme().domaine().getCouplingMethod())
1997 if(
probleme().domaine().getCouplingMethod())
1999 Cout<<
" Implicit coupling: Navier_Stokes_std_ALE::updateFluidForce "<<finl;
2001 DoubleTab field_value = velocity;
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
void mettre_a_jour(double temps) override
Time update of the field.
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
void mettre_a_jour(double temps) override
Performs a time update of the unknown field.
void resetTime(double time) override
DoubleTab & valeurs() override
Returns the array of field values at the current time.
double changer_temps_futur(double, int i=1)
Sets the time of the i-th future field.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Champ_base & affecter(const Champ_base &)
Assign a field to another.
double temps() const
Returns the time of the field.
static void verifier(const char *const msg, double)
class Discret_Thyd This class is the base class representing a discretization
void gradient_P(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&, int nb_comp=1) const
void pression_en_pa(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&) const
void pression(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&) const
virtual void courant_maille(const Domaine_dis_base &, const Schema_Temps_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
virtual void y_plus(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
virtual void taux_cisaillement(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
virtual void creer_champ_vorticite(const Schema_Temps_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
virtual void grad_u(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
void divergence_U(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&) const
virtual void distance_paroi_globale(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Fonc_base)&) const
void vitesse(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Inc_base)&, int nb_comp=1) const
virtual void reynolds_maille(const Domaine_dis_base &, const Fluide_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
virtual void critere_Q(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
double volume_total() const
DoubleTab_t & les_sommets()
virtual void ajouter_correctif_volumique(const DoubleTab &, const DoubleTab &, double, DoubleTab &) const
virtual bool getCouplingMethod() 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
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 void set_param(Param &titi) const override
int reprendre(Entree &) override
We resume the unknown from an input stream.
virtual void dimensionner_matrice_sans_mem(Matrice_Morse &mat_morse)
virtual int verif_Cl() const
Verifies the compatibility of boundary conditions with the equation.
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the data to save/restore. This has to be overrode f...
virtual void associer_pb_base(const Probleme_base &)
Associates with the Problem passed as parameter.
Sources & sources()
Returns the source terms associated with the equation.
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
Solveur_Masse_base & solv_masse()
Returns the mass solver associated with the equation.
Nom create_polymacfamily_syno(const Nom &field_tag) const
Create a synonym of a field name in order to ensure backward compatibility with old names of the Poly...
virtual void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const
virtual void mettre_a_jour(double temps)
The value of the unknown at the time step has been calculated.
virtual int impr(Sortie &os) const
Prints the equation operators to an output stream, unconditionally.
virtual void abortTimeStep()
Reinitialize what must be.
virtual void completer()
Completes the construction (initialization) of objects associated with the equation.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
virtual int preparer_calcul()
Everything that does not depend on other possible problems.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
void initialise_residu(int=0)
virtual DoubleTab & derivee_en_temps_inco(DoubleTab &)
Returns the time derivative of the unknown I of the equation: dI/dt = M-1*(sum(operators(I) + sources...
int sauvegarder(Sortie &) const override
We save the unknown, then the source terms to an output stream.
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.
virtual void verifie_ch_init_nb_comp(const Champ_Inc_base &ch_ref, const int nb_comp) const
Verification of the number of components read for the specification of a field.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
int limpr() const
Ask the time scheme if an output is needed.
void creer_champ(const Motcle &motlu) override
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual bool initTimeStep(double dt)
Allocation and initialization of the unknown and boundary conditions until present+dt.
virtual void discretiser()
Discretizes the equation.
virtual int has_interface_blocs() const
virtual void resetTime(double time)
Reset current time of the equation. Used from ICoCo. See documentation of Problem_base::resetTime().
Champs_compris champs_compris_
virtual void assembler_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) const
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
virtual double calculer_pas_de_temps() const
Calculation of the next time step.
virtual int nb_comp() const
Base class for an incompressible fluid and its properties:
const Champ_Don_base & viscosite_cinematique() const
Matrice_Base class - Base class of the matrix hierarchy.
Matrice_Morse_Sym class - Represents a sparse symmetric matrix M stored in Morse format.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
Matrice class - Generic class in the matrix hierarchy.
Milieu_base This class is the base of the (physical) medium hierarchy.
virtual const Champ_base & masse_volumique() const
Returns the mass density of the medium (const version).
virtual const Champ_Don_base & gravite() const
Returns the gravity of the medium if it has been associated, raises an error otherwise (const version...
A character string (Nom) in uppercase.
An array of Motcle objects.
int rang(const char *const ch) const
Navier_Stokes_std This class carries the terms of the momentum equation.
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Operateur_Diff terme_diffusif
void dimensionner_matrice_sans_mem(Matrice_Morse &matrice) override
virtual const Champ_Inc_base & rho_la_vitesse() const
virtual void updateFluidForce(DoubleTab &)
const Milieu_base & milieu() const override
Returns the physical medium of the equation (Fluide_base upcast to Milieu_base).
const Motcle & domaine_application() const override
Returns the name of the application domain: "Hydraulique".
virtual void modify_initial_variable()
void resetTime(double time) override
Reset current time of the equation. Used from ICoCo. See documentation of Problem_base::resetTime().
int reprendre(Entree &) override
Performs a restart from an input stream.
Operateur_Conv terme_convectif
const Champ_Inc_base & inconnue() const override
Returns the velocity (unknown field of the equation) (const version).
void creer_champ(const Motcle &motlu) override
virtual const Champ_base & vitesse_pour_transport() const
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Entree & lire_cond_init(Entree &) override
Reading of initial conditions in an input stream.
DoubleTab & corriger_derivee_impl(DoubleTab &) override
Resolution de la pression, inconnue implicitee de Navier Stokes.
const Fluide_base & fluide() const
Returns the incompressible fluid (physical medium of the equation) associated with the equation.
void mettre_a_jour(double temps) override
Performs a time update of the equation.
virtual void projeter()
Computes the solution U of the equations: | M(U-V)/dt + BtP = 0.
Operateur_Div & operateur_divergence()
Returns the divergence operator associated with the equation.
void completer() override
Completes the base equation, associates the pressure with the equation,.
Matrice matrice_pression_
int sauvegarder(Sortie &) const override
Calls Equation_base::sauvegarder(Sortie&) and saves the pressure to an output stream.
const Champ_base & get_champ(const Motcle &nom) const override
Champ_Inc_base & pression_pa()
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
void abortTimeStep() override
Reinitialize what must be.
int impr(Sortie &os) const override
Prints some information to an output stream: - maximum of div U.
virtual void calculer_pression_hydrostatique(Champ_base &pression_hydro) const
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
void associer_pb_base(const Probleme_base &) override
Associates with the problem: calls Equation_base::associer_pb_base(const Probleme_base&).
virtual void sauver() const
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
Operateur_Grad & operateur_gradient()
Returns the gradient operator associated with the equation.
virtual void discretiser_grad_p()
bool postraiter_gradient_pression_sans_masse_
void update_y_plus(const DoubleTab &tab)
virtual void discretiser_assembleur_pression()
Types the pressure assembler.
virtual void modify_initial_gradP(DoubleTrav &)
DoubleTab & corriger_derivee_expl(DoubleTab &) override
Add a specific term for Navier Stokes (-gradP(n)) if necessary.
int has_interface_blocs() const override
void set_param(Param &titi) const override
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
int verif_Cl() const override
Verifies the compatibility of boundary conditions with the equation.
DoubleTab & derivee_en_temps_inco(DoubleTab &) override
Returns the time derivative of the unknown I of the equation: dI/dt = M-1*(sum(operators(I) + sources...
virtual int projection_a_faire()
int div_u_nul_et_non_dsurdt_divu_
virtual void discretiser_vitesse()
void discretiser() override
Discretizes the equation.
void uzawa(const DoubleTab &, const Matrice_Base &, SolveurSys &, DoubleTab &, DoubleTab &)
virtual bool getCouplingInfoForFiltering() const
virtual const Champ_Don_base & diffusivite_pour_transport() const
OWN_PTR(Assembleur_base) &assembleur_pression()
int preparer_calcul() override
cf Equation_base::preparer_calcul() Assembly of the pressure solver and
Operateur_Diff & operateur_diff()
const Operateur & operateur_fonctionnel(int) const override
void reassembler_pression_si_necessaire()
const Operateur & operateur(int) const override
Returns the i-th operator of the equation: - terme_diffusif if i = 0.
int nombre_d_operateurs_tot() const override
void associer_milieu_base(const Milieu_base &) override
Associates a physical medium with the equation by dynamically constructing (casting) an object of typ...
void assembler_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) const override
SolveurSys & solveur_pression()
Returns the pressure solver (const version).
SolveurSys solveur_pression_
OBS_PTR(Fluide_base) le_fluide
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
virtual void calculer_la_pression_en_pa()
Computes "la_pression_en_pa" from "la_pression".
int nombre_d_operateurs() const override
Returns the number of operators in the equation: 2 for the standard Navier-Stokes equations.
int methode_calcul_pression_initiale_
Champ_Inc_base & pression()
void associer_fluide(const Fluide_base &un_fluide)
class Nom: a character string for naming TRUST objects.
Nom & suffix(const char *const)
Suffix extraction: Nom x("azerty");.
const std::string & getString() const
An array of character strings (VECT(Nom)).
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.
Operateur_Diff Generic class of the hierarchy of operators representing a diffusion.
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
Call to the underlying object.
Operateur_Div Generic class of the hierarchy of operators computing the divergence.
void volumique(DoubleTab &) const
Initializes the array passed as parameter with the contribution of the operator.
Classe Operateur_Grad Generic class of the hierarchy of operators computing the gradient.
class Operateur_base This class is the base of the hierarchy of objects representing an
const SolveurSys & get_solveur() const
virtual void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const
DOES NOTHING - to override in derived classes.
SolveurSys & set_solveur()
int get_decal_temps() const
virtual void dimensionner(Matrice_Morse &) const
DOES NOTHING - to override in derived classes.
const Matrice & get_matrice() const
class Operateur Generic class of the operator hierarchy.
virtual Operateur_base & l_op_base()=0
virtual DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const =0
Helper class to factorize the readOn method of Objet_U classes.
void ajouter_flag(const char *keyword, const bool *value)
Register a boolean flag whose mere presence switches it to true.
void ajouter_condition(const char *condition, const char *message, const char *name=0)
Declare a post-read logical condition that must hold on the parameter values.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Probleme_base It is a Probleme_U that is not a coupling.
bool is_dilatable() const
const Domaine & domaine() const
Returns the domain associated with the problem.
static void mp_sum_for_each(T &arg1, T &arg2)
C++14 compatible mp_sum_for_each: combine multiple mp_sum calls into one collective operation Usage: ...
static int nproc()
Returns the number of processors in the current group. See Comm_Group::nproc() and PE_Groups::current...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
double temps_courant() const
Returns the current time.
virtual double temps_futur(int i) const =0
double pas_de_temps() const
Returns the current time step (delta_t).
virtual int nb_valeurs_futures() const =0
double temps_init() const
Returns the initial time.
class SolveurSys A SolveurSys represents any class
int resoudre_systeme(const Matrice_Base &matrice, const DoubleVect &secmem, DoubleVect &solution)
void nommer(const Nom &nom) override
Solveur_Masse_base Represents the mass matrix of an equation.
virtual Matrice_Base & ajouter_masse(double dt, Matrice_Base &matrice, int penalisation=1) const
virtual DoubleTab & corriger_solution(DoubleTab &x, const DoubleTab &y, int incr=0) const
Base class for output streams.
Source Generic class of the source term hierarchy. A Source object can.
void typer_direct(const Nom &)
void mettre_a_jour(double temps)
Time update of all sources in the list.
DoubleTab & ajouter(DoubleTab &) const
Adds the contribution of all sources in the list to the array passed as parameter,...
_SIZE_ dimension_tot(int) const override
void copy(const TRUSTTab &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const
void ajoute(_SCALAR_TYPE_ alpha, const TRUSTVect &y, Mp_vect_options opt=VECT_ALL_ITEMS)
virtual const MD_Vector & get_md_vector() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
static int is_PDI_restart()