TrioCFD 1.9.9_beta
TrioCFD documentation
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 It inherits from the implicit base scheme and carries a solver, for example
20 *
21 * the Simpler solver, to perform the time-stepping operations.
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 // Schema characteristics //
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 // End of schema characteristics //
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
class Equation_base The role of an equation is the calculation of one or more fields....
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
class Parser_U Version of the Parser class, deriving from Objet_U.
Definition Parser_U.h:32
Probleme_Couple This is the historical coupling class of TRUST.
class Probleme_base It is a Probleme_U that is not a coupling.
double temps_futur(int i) const override
Returns the time at the i-th future value.
int mettre_a_jour() override
Updates the current time (t+=dt) and the number of time steps performed (nb_pas_dt_++).
int reprendre(Entree &) override
Restores an Objet_U from an input stream. Virtual method to override.
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
Returns the time that fields must return when valeurs() is called.
int nb_valeurs_futures() const override
Returns the number of future temporal values.
int nb_valeurs_temporelles() const override
Returns the number of temporal values to keep.
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
Reads non-simple-type parameters of an Objet_U from an input stream.
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 Base class for all implicit time schemes.