TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Schema_Euler_Implicite.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Schema_Euler_Implicite_included
17#define Schema_Euler_Implicite_included
18
19/*! @brief class Schema_Euler_Implicite Il herite de schema implicite base et porte un solveur par exemple
20 *
21 * le Simpler pour effectuer les Faire_un_pas_de_temps..
22 *
23 */
24
25#include <Schema_Implicite_base.h>
26#include <vector>
27#include <set>
28class Probleme_Couple;
29
31{
32
33 Declare_instanciable(Schema_Euler_Implicite);
34
35public :
36
37 bool initTimeStep(double dt) override;
38 void set_param(Param& ) const override;
39 int lire_motcle_non_standard(const Motcle& mot, Entree& is) override;
40
41 ////////////////////////////////
42 // //
43 // Caracteristiques du schema //
44 // //
45 ////////////////////////////////
46
47 int nb_valeurs_temporelles() const override;
48 int nb_valeurs_futures() const override;
49 double temps_futur(int i) const override;
50 double temps_defaut() const override;
51
52 /////////////////////////////////////////
53 // //
54 // Fin des caracteristiques du schema //
55 // //
56 /////////////////////////////////////////
57
60 int Iterer_Pb(Probleme_base&,int ite, int& ok);
61 bool iterateTimeStep(bool& converged) override;
64 inline const double& residu_old() const
65 {
66 return residu_old_ ;
67 };
68 int mettre_a_jour() override;
69 int reprendre(Entree& ) override;
70 inline void completer() override { }
71 int resolution_monolithique(const Nom& nom) const;
74 void calcul_fac_sec(double& residu_,double& residu_old,double& facsec_);
75 double facsec_cfl() const { return facsec_cfl_; }
76
77protected:
78 Parser_U facsec_fn_; // parser to set facsec as a function of time
79 bool facsec_func_ = false; // is the facsec a function of time (true) or a constant (false)
80 int nb_ite_max = 200;
81 double residu_old_ = 0, facsec_max_ = DMAXFLOAT;
82 bool facsec_cfl_ = false; // New keyword to manage time step based on CFL: dt=min(facsec,facsec_max)*dt(convection)
85 double rapport_residus_ = 1.2;
86 std::vector<std::set<std::string>> resolution_monolithique_;
87};
88
89#endif
90
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:76
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
classe Parser_U Version de la classe Parser, derivant de Objet_U.
Definition Parser_U.h:32
classe Probleme_Couple C'est la classe historique de couplage de TRUST.
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
double temps_futur(int i) const override
Renvoie le le temps a la i-eme valeur future.
int mettre_a_jour() override
Mise a jour du temps courant (t+=dt) et du nombre de pas de temps effectue (nb_pas_dt_++).
int reprendre(Entree &) override
Reprise d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual int faire_un_pas_de_temps_pb_couple(Probleme_Couple &, int &ok)
void set_param(Param &) const override
void Initialiser_Champs(Probleme_base &)
int Iterer_Pb(Probleme_base &, int ite, int &ok)
bool iterateTimeStep(bool &converged) override
Calculate the U(n+1) unknown for each equation (if solved) of the problem with the selected time sche...
int resolution_monolithique(const Nom &nom) const
double temps_defaut() const override
Renvoie le le temps le temps que doivent rendre les champs a l'appel de valeurs().
int nb_valeurs_futures() const override
Renvoie le nombre de valeurs temporelles futures.
int nb_valeurs_temporelles() const override
Renvoie le nombre de valeurs temporelles a conserver.
const double & residu_old() const
void calcul_fac_sec(double &residu_, double &residu_old, double &facsec_)
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
std::vector< std::set< std::string > > resolution_monolithique_
Entree & lire_facsec_expert(Entree &)
void test_stationnaire(Probleme_base &)
int faire_un_pas_de_temps_eqn_base(Equation_base &) override
bool initTimeStep(double dt) override
class Schema_Implicite_base Classe de base pour tous les schemas en temps implicite