16#include <Terme_Puissance_Thermique_Echange_Impose_Elem_base.h>
17#include <Discretisation_base.h>
18#include <Schema_Temps_base.h>
19#include <Equation_base.h>
20#include <Probleme_base.h>
21#include <Champ_Don_base.h>
22#include <Domaine_VF.h>
42 param.ajouter_non_std(
"PID_controler_on_targer_power", (
this));
43 param.lire_avec_accolades_depuis(s);
44 set_fichier(
"Terme_Puissance_Thermique_Echange_Impose");
47 col_names.add(
"Power");
48 col_names.add(
"DT_regul");
55 if (mot ==
"PID_controler_on_targer_power")
58 Nom pow_str, Kp_str =
"0", Ki_str =
"0", Kd_str =
"0";
59 Param param(
"PID_controler_on_targer_power");
66 if (Kp_str ==
"0" && Ki_str ==
"0" && Kd_str ==
"0")
68 Cerr <<
"PID controler : you should provide at least one coefficient among Kp, Ki and Kd!" << finl;
72 pow_cible_.setString(pow_str),
Kp_.setString(Kp_str),
Ki_.setString(Ki_str),
Kd_.setString(Kd_str);
83 const DoubleVect& volumes = domaine.
volumes();
84 const DoubleTab& himp = himp_->valeurs();
85 const DoubleTab& Text =
Text_->valeurs();
87 int nb_elem = le_dom->nb_elem(), c_h = himp.
dimension(0) == 1, c_T = Text.
dimension(0) == 1, n, N = T.line_size();
91 for (
int e = 0; e < nb_elem; e++)
92 for (n = 0; n < N; n++)
93 bilan()(n) += himp(!c_h * e, n) * volumes(e) * (
DT_regul_ + Text(!c_T * e, n) - T(e, n));
99 himp_->mettre_a_jour(temps);
100 Text_->mettre_a_jour(temps);
107 const double pow_cible =
pow_cible_.eval(), Kp =
Kp_.eval(), Ki =
Ki_.eval(), Kd =
Kd_.eval(), error = (ptot - pow_cible) / pow_cible;
108 if (dt <
equation().probleme().schema_temps().pas_temps_min())
126 const DoubleVect& volumes = domaine.
volumes();
127 const DoubleTab& himp = himp_->valeurs();
128 const DoubleTab& Text =
Text_->valeurs();
130 int nb_elem = le_dom->nb_elem(), c_h = himp.
dimension(0) == 1, c_T = Text.
dimension(0) == 1, n, N = T.line_size();
132 Matrice_Morse *mat = matrices.count(nom_inco) ? matrices.at(nom_inco) :
nullptr;
134 for (
int e = 0; e < nb_elem; e++)
135 for (n = 0; n < N; n++)
137 secmem(e, n) -= volumes(e) * himp(!c_h * e, n) * (T(e, n) -
DT_regul_ - Text(!c_T * e, n));
139 (*mat)(N * e + n, N * e + n) += volumes(e) * himp(!c_h * e, n);
147 Nom nom_Text =
Text_->le_nom() !=
"??" ?
Text_->le_nom() :
"Text";
149 himp_->initialiser(temps);
150 Text_->initialiser(temps);
DoubleTab & valeurs() override
Returns the array of field values at the current time.
void nommer_completer_champ_physique(const Domaine_dis_base &domaine_vdf, const Nom &nom_champ, const Nom &unite, Champ_base &champ, const Probleme_base &pbi) const
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
double volumes(int i) const
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
const std::string & getString() const
const Nom & le_nom() const override
Returns *this.
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.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
int lire_avec_accolades(Entree &is)
Alias of lire_avec_accolades_depuis.
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
double temps_courant() const
Returns the current time.
double pas_de_temps() const
Returns the current time step (delta_t).
Base class for output streams.
Source_base A Source_base object is a term appearing on the right-hand side of an.
void set_fichier(const Nom &)
virtual int initialiser(double temps)
Unlike the mettre_a_jour methods, the initializer methods of sources cannot depend on the outside.
void set_col_names(const Noms &col_names)
void set_description(const Nom &nom)
_SIZE_ dimension(int d) const
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) const override
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Reads non-simple-type parameters of an Objet_U from an input stream.
int initialiser(double temps) override
Unlike the mettre_a_jour methods, the initializer methods of sources cannot depend on the outside.
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override