TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Schema_Temps_IJK_base.h
1/****************************************************************************
2* Copyright (c) 2022, 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_Temps_IJK_base_included
17#define Schema_Temps_IJK_base_included
18
19#include <Schema_Temps_base.h>
20
22{
23 Declare_base(Schema_Temps_IJK_base);
24public :
25 // Renvoie le nombre de valeurs temporelles a conserver. Ici : n et n+1, donc 2.
26 int nb_valeurs_temporelles() const override { return 2 ; }
27
28 // Renvoie le nombre de valeurs temporelles futures. Ici : n+1, donc 1.
29 int nb_valeurs_futures() const override { return 1 ; }
30
31 // Renvoie le le temps a la i-eme valeur future. Ici : t(n+1)
32 double temps_futur(int i) const override
33 {
34 assert(i == 1);
35 return temps_courant() + pas_de_temps();
36 }
37
38 // Renvoie le le temps le temps que doivent rendre les champs a l'appel de valeurs(). Ici : t(n+1)
39 double temps_defaut() const override { return temps_courant() + pas_de_temps(); }
40
41 // a surcharger si utile
42 void completer() override;
43 double computeTimeStep(bool& stop) const override;
44
45 void set_param(Param& ) const override;
47
48 double get_dt_cfl() const { return dt_cfl_; }
49 double get_dt_fo() const { return dt_fo_; }
50 double get_dt_oh() const { return dt_oh_; }
51 double get_dt_cfl_liq() const { return dt_cfl_liq_; }
52 double get_dt_cfl_vap_() const { return dt_cfl_vap_; }
53 double get_dt_fo_liq() const { return dt_fo_liq_; }
54 double get_dt_fo_vap_() const { return dt_fo_vap_; }
55 double get_timestep_facsec() const { return timestep_facsec_; }
56 double get_modified_time_ini() const { return modified_time_ini_; }
57 double get_max_simu_time() const { return max_simu_time_; }
58 double get_max_timestep() const { return max_timestep_; }
59 double get_current_time() const { return temps_courant(); }
60 double get_timestep() const { return pas_de_temps(); } // en double
61 double& set_timestep() { return set_dt(); } // en double
62
63 int get_nb_timesteps() const { return nb_pas_dt_max() ; }
64 int get_tstep() const { return nb_pas_dt(); }
65 int& get_tstep() { return nb_pas_dt_; }
66 int get_tstep_init() const { return tstep_init_; }
67 int get_tstep_sauv() const { return tstep_sauv_; }
68 int get_use_tstep_init() const { return use_tstep_init_; }
72 int get_dt_sauvegarde() const { return dt_sauvegarde_; }
73
74 double find_timestep(const double max_timestep, const double cfl, const double fo, const double oh);
75
76 void set_modified_time_ini(const double t) { modified_time_ini_ = t; }
77 void set_max_timestep(const double t) { max_timestep_ = t; }
78 void set_max_timestep_if_smaller(const double t) { max_timestep_ = std::min(max_timestep_, t); }
79 void set_current_time(const double t) { changer_temps_courant(t); }
80 void set_tstep_sauv(const int ts) { tstep_sauv_ = ts; }
81
82 void check_stop_criteria(bool& stop) const;
83
84protected:
85 double dt_cfl_ = 1.e20, dt_fo_ = 1.e20, dt_oh_ = 1.e20, dt_fo_liq_ = 1.e20;
86 double dt_fo_vap_ = 1.e20, dt_cfl_liq_ = 1.e20, dt_cfl_vap_ = 1.e20;
87 double timestep_facsec_ = 1., max_simu_time_ = 1e6;
88 double modified_time_ini_ = 0., max_timestep_ = -123.;
89 double cfl_ = 1., fo_ = 1., oh_ = 1.;
90
94 int dt_sauvegarde_ = 2000000000;
95
96 Nom stop_file_; // Nom du fichier stop
97};
98
99#endif /* Schema_Temps_IJK_base_included */
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
bool get_enable_dt_oh_ideal_length_factor() const
void set_max_timestep(const double t)
int nb_valeurs_temporelles() const override
double computeTimeStep(bool &stop) const override
double get_modified_time_ini() const
void set_max_timestep_if_smaller(const double t)
double find_timestep(const double max_timestep, const double cfl, const double fo, const double oh)
void set_modified_time_ini(const double t)
void set_tstep_sauv(const int ts)
void set_current_time(const double t)
bool get_first_step_interface_smoothing() const
void check_stop_criteria(bool &stop) const
double temps_defaut() const override
double temps_futur(int i) const override
int nb_valeurs_futures() const override
void set_param(Param &) const override
class Schema_Temps_base
double temps_courant() const
Renvoie le temps courant.
virtual void changer_temps_courant(const double)
Change le temps courant.
virtual int stop() const
Renvoie 1 si il y lieu de stopper le calcul pour differente raisons: - le temps final est atteint.
double pas_de_temps() const
Renvoie le pas de temps (delta_t) courant.
int nb_pas_dt() const
Renvoie le nombre de pas de temps effectues.
int nb_pas_dt_max() const
Renvoie une reference sur le nombre de pas maxi.