TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Fluide_base.cpp
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#include <Fluide_Incompressible.h>
17#include <Discretisation_base.h>
18#include <Champ_Fonc_Tabule.h>
19#include <Schema_Temps_base.h>
20#include <Navier_Stokes_std.h>
21#include <Champ_Fonc_MED.h>
22#include <Champ_Uniforme.h>
23#include <Champ_Inc_base.h>
24#include <Probleme_base.h>
25#include <Equation_base.h>
26#include <Fluide_base.h>
27#include <EChaine.h>
28#include <Motcle.h>
29#include <Param.h>
30
31
32Implemente_instanciable(Fluide_base, "Fluide_base", Milieu_base);
33// XD fluide_base milieu_base fluide_base BRACE Basic class for fluids.
34// XD attr indice field_base indice OPT Refractivity of fluid.
35// XD attr kappa field_base kappa OPT Absorptivity of fluid (m-1).
36
38{
39 os << "{" << finl;
40 os << "kappa " << coeff_absorption_ << finl;
41 os << "indice " << indice_refraction_ << finl;
42 os << "longueur_rayo " << longueur_rayo_ << finl;
43 os << "mu " << ch_mu_ << finl;
44 os << "beta_co " << ch_beta_co_ << finl;
46 os << "}" << finl;
47 return os;
48}
49
50/*! @brief Reads the fluid characteristics from an input stream.
51 *
52 * Format:
53 * Fluide_base
54 * {
55 * Mu type_champ field reading block
56 * Rho Champ_Uniforme 1 vrel
57 * [Cp Champ_Uniforme 1 vrel]
58 * [Lambda type_champ field reading block]
59 * [Beta_th type_champ field reading block]
60 * [Beta_co type_champ field reading block]
61 * }
62 * cf Milieu_base::readOn
63 *
64 * @param is input stream
65 * @return modified input stream
66 * @throws opening brace expected
67 */
69{
71 if (ch_mu_) champs_don_.add(ch_mu_.valeur());
72 if (ch_nu_) champs_don_.add(ch_nu_.valeur());
73 if (ch_beta_co_) champs_don_.add(ch_beta_co_.valeur());
74 if (coeff_absorption_) champs_don_.add(coeff_absorption_.valeur());
75 if (indice_refraction_) champs_don_.add(indice_refraction_.valeur());
76 if (longueur_rayo_) champs_don_.add(longueur_rayo_.valeur());
77 return is;
78}
79
80void Fluide_base::set_param(Param& param) const
81{
83 //Reading rho is not mandatory here because this field must not be read for a dilatable fluid
84 param.ajouter("mu", &ch_mu_, Param::REQUIRED);
85 param.ajouter("beta_co", &ch_beta_co_);
86 param.ajouter("kappa", &coeff_absorption_);
87 param.ajouter("indice", &indice_refraction_);
88}
89
95
97{
98 const Domaine_dis_base& domaine_dis = pb.equation(0).domaine_dis();
99 // mu rho nu to review
100 double temps = pb.schema_temps().temps_courant();
101 if (ch_mu_)
102 if (sub_type(Champ_Fonc_MED, ch_mu_.valeur()))
103 {
104 Cerr << " converting the champ_fonc_med to champ_don" << finl;
105 OWN_PTR(Champ_Don_base) mu_prov;
106 dis.discretiser_champ("champ_elem", domaine_dis, "neant", "neant", 1, temps, mu_prov);
107 mu_prov->affecter(ch_mu_.valeur());
108 ch_mu_.detach();
109 ch_nu_.detach();
110 dis.discretiser_champ("champ_elem", domaine_dis, "neant", "neant", 1, temps, ch_mu_);
111
112 ch_mu_->valeurs() = mu_prov->valeurs();
113
114 }
115 if (!ch_mu_)
116 {
117 dis.discretiser_champ("champ_elem", domaine_dis, "neant", "neant", 1, temps, ch_mu_);
118 dis.discretiser_champ("champ_elem", domaine_dis, "neant", "neant", 1, temps, ch_nu_);
119 }
120 if (ch_mu_)
121 {
122 dis.nommer_completer_champ_physique(domaine_dis, "viscosite_dynamique", "kg/m/s", ch_mu_.valeur(), pb);
123 champs_compris_.ajoute_champ(ch_mu_.valeur());
124 }
125 if (sub_type(Champ_Fonc_Tabule, ch_mu_.valeur()))
126 {
127 dis.discretiser_champ("champ_elem", domaine_dis, "neant", "neant", 1, temps, ch_nu_);
128 }
129 if (!ch_nu_)
130 dis.discretiser_champ("champ_elem", domaine_dis, "neant", "neant", 1, temps, ch_nu_);
131
132 if (ch_nu_)
133 {
134 dis.nommer_completer_champ_physique(domaine_dis, "viscosite_cinematique", "m2/s", ch_nu_.valeur(), pb);
135 champs_compris_.ajoute_champ(ch_nu_.valeur());
136 }
137 if (ch_beta_co_)
138 {
139 dis.nommer_completer_champ_physique(domaine_dis, "dilatabilite_solutale", ".", ch_beta_co_.valeur(), pb);
140 champs_compris_.ajoute_champ(ch_beta_co_.valeur());
141 }
142
144}
145/*! @brief Verifies that the fields read have been set correctly.
146 *
147 * @throws density (rho) is not strictly positive
148 * @throws density (rho) is not of type Champ_Uniforme
149 * @throws viscosity (mu) is not strictly positive
150 * @throws one of the fluid properties (rho or mu) has not been defined
151 * @throws heat capacity (Cp) is not strictly positive
152 * @throws heat capacity (Cp) is not of type Champ_Uniforme
153 * @throws conductivity (lambda) is not strictly positive
154 * @throws not all properties of the anisotherm fluid have been defined
155 */
157{
158 msg = "";
159 if (ch_rho_)
160 {
161 if (mp_min_vect(ch_rho_->valeurs()) <= 0)
162 {
163 msg += "The density rho is not striclty positive. \n";
164 err = 1;
165 }
166 }
167 else
168 {
169 msg += "The density rho has not been specified. \n";
170 err = 1;
171 }
172 if ((bool(ch_Cp_)) && ((bool(ch_lambda_)) && (bool(ch_beta_th_)))) // Fluide anisotherme
173 {
174 if (sub_type(Champ_Uniforme, ch_Cp_.valeur()))
175 {
176 if (ch_Cp_->valeurs()(0, 0) <= 0)
177 {
178 msg += "The heat capacity Cp is not striclty positive. \n";
179 err = 1;
180 }
181 }
182 else
183 {
184 msg += "The heat capacity Cp is not of type Champ_Uniforme. \n";
185 err = 1;
186 }
187 if (sub_type(Champ_Uniforme, ch_lambda_.valeur()))
188 {
189 if (ch_lambda_->valeurs()(0, 0) < 0)
190 {
191 msg += "The conductivity lambda is not positive. \n";
192 err = 1;
193 }
194 }
195
196 }
197 if (((bool(ch_Cp_)) || (bool(ch_beta_th_))) && (!ch_lambda_))
198 {
199 msg += " Physical properties for an anisotherm case : \n";
200 msg += "the conductivity lambda has not been specified. \n";
201 if (err == 0) err = 2; // if err=1 we keep it since err=1 exits while err=2 displays warning!
202 }
203 if (((bool(ch_lambda_)) || (bool(ch_beta_th_))) && (!ch_Cp_))
204 {
205 msg += " Physical properties for an anisotherm case : \n";
206 msg += "the heat capacity Cp has not been specified. \n";
207 if (err == 0) err = 2;
208 }
209 if (((bool(ch_lambda_)) || (bool(ch_Cp_))) && (!ch_beta_th_))
210 {
211 msg += " Physical properties for an anisotherm case : \n";
212 msg += "the thermal expansion coefficient beta_th has not been specified. \n";
213 if (err == 0) err = 2;
214 }
215
216 // Check consistency of the radiative properties of the incompressible fluid
217 // (for a semi-transparent medium)
218 if ((bool(coeff_absorption_)) && (!indice_refraction_))
219 {
220 msg += " Physical properties for semi tranparent radiation case : \n";
221 msg += "Refraction index has not been specfied while it has been done for absorption coefficient. \n";
222 err = 1;
223 }
224 if ((!coeff_absorption_) && (bool(indice_refraction_)))
225 {
226 msg += " Physical properties for semi tranparent radiation case : \n";
227 msg += "Absorption coefficient has not been specfied while it has been done for refraction index. \n";
228 err = 1;
229 }
230
231 if ((bool(coeff_absorption_)) && indice_refraction_)
232 {
233 if (sub_type(Champ_Uniforme, coeff_absorption_.valeur()))
234 {
235 if (coeff_absorption_->valeurs()(0, 0) <= 0)
236 {
237 msg += "The absorption coefficient kappa is not striclty positive. \n";
238 err = 1;
239 }
240 }
241 }
243}
244
245/*! @brief @brief If the object referenced by nu is of type Champ_Uniforme, types nu as "Champ_Uniforme" and fills it with mu(0,0)/rho(0,0). Otherwise does nothing.
246 *
247 */
249{
250 assert(ch_mu_);
251 assert(ch_rho_);
252 ch_nu_ = ch_mu_;
253 if (sub_type(Champ_Uniforme, ch_mu_.valeur()) && !sub_type(Champ_Uniforme, ch_rho_.valeur()))
254 ch_nu_->valeurs().resize(ch_rho_->valeurs().dimension_tot(0), ch_rho_->valeurs().line_size());
255 ch_nu_->nommer("nu");
256}
257
259{
260 const DoubleTab& tabmu = ch_mu_->valeurs();
261 const DoubleTab& tabrho = ch_rho_->valeurs();
262 DoubleTab& tabnu = ch_nu_->valeurs();
263
264 int cRho = sub_type(Champ_Uniforme, ch_rho_.valeur()),
265 cMu = sub_type(Champ_Uniforme, ch_mu_.valeur());
266 int i, j, n;
267 int Nl = tabnu.dimension_tot(0), N = tabnu.line_size();
268
269 /* valeurs : mu / rho */
270 for (i = j = 0; i < Nl; i++)
271 for (n = 0; n < N; n++, j++)
272 tabnu.addr()[j] = tabmu.addr()[cMu ? n : j] / tabrho.addr()[cRho ? n : j];
273}
274
276{
277 if (!equation_.size() || !e_int_auto_)
278 return true; //no associated equation or no e_int to manage
279 const Schema_Temps_base& sch = equation_.begin()->second->schema_temps(); //retrieve the time scheme from the first equation
280 Champ_Inc_base& ch = ref_cast(Champ_Inc_base, ch_e_int_.valeur());
281 for (int i = 1; i <= sch.nb_valeurs_futures(); i++)
282 ch.changer_temps_futur(sch.temps_futur(i), i), ch.futur(i) = ch.valeurs();
283 return true;
284}
285
286/*! @brief Performs a time update of the medium and therefore of its characteristic parameters.
287 *
288 * @brief Uniform fields are recomputed for the new specified time; others are updated by calling FIELD_CLASS::mettre_a_jour(double temps).
289 *
290 * @param temps the update time
291 */
293{
295 if (ch_beta_co_)
296 ch_beta_co_->mettre_a_jour(temps);
297 ch_mu_->mettre_a_jour(temps);
298 calculer_nu();
299 ch_nu_->changer_temps(temps);
300 ch_nu_->valeurs().echange_espace_virtuel();
301 if (e_int_auto_)
302 ch_e_int_->mettre_a_jour(temps);
303
304 // Update of the radiative properties of the incompressible fluid
305 // (for a semi-transparent incompressible fluid).
306 if (coeff_absorption_ && indice_refraction_)
307 {
308 coeff_absorption_->mettre_a_jour(temps);
309 indice_refraction_->mettre_a_jour(temps);
310
311 // Update of longueur_rayo
312 longueur_rayo_->mettre_a_jour(temps);
313
314 if (sub_type(Champ_Uniforme, kappa()))
315 {
316 longueur_rayo().valeurs()(0, 0) = 1 / (3 * kappa().valeurs()(0, 0));
318 }
319 else
320 {
321 DoubleTab& l_rayo = longueur_rayo_->valeurs();
322 const DoubleTab& K = kappa().valeurs();
323 for (int i = 0; i < kappa().nb_valeurs_nodales(); i++)
324 l_rayo[i] = 1 / (3 * K[i]);
325 l_rayo.echange_espace_virtuel();
326 }
327 }
328}
329
330/*! @brief Initializes the fluid parameters.
331 *
332 */
333int Fluide_base::initialiser(const double temps)
334{
335 Cerr << "Fluide_base::initialiser()" << finl;
337 ch_mu_->initialiser(temps);
338
339 if (ch_beta_co_)
340 ch_beta_co_->initialiser(temps);
341
342 calculer_nu();
343 ch_nu_->valeurs().echange_espace_virtuel();
344 ch_nu_->changer_temps(temps);
345
346 // Initialization of the radiative properties of the incompressible fluid
347 // (for a semi-transparent incompressible fluid).
348 if (coeff_absorption_ && indice_refraction_)
349 {
350 Cerr << "Semi transparent fluid properties initialization." << finl;
351 coeff_absorption_->initialiser(temps);
352 indice_refraction_->initialiser(temps);
353
354 // Initialization of longueur_rayo
355 longueur_rayo_->initialiser(temps);
356 if (sub_type(Champ_Uniforme, kappa()))
357 longueur_rayo().valeurs()(0, 0) = 1 / (3 * kappa().valeurs()(0, 0));
358 else
359 {
360 DoubleTab& l_rayo = longueur_rayo_->valeurs();
361 const DoubleTab& K = kappa().valeurs();
362 for (int i = 0; i < kappa().nb_valeurs_nodales(); i++)
363 l_rayo[i] = 1 / (3 * K[i]);
364 }
365 }
366 return 1;
367}
368
369void Fluide_base::set_h0_T0(double h0, double T0)
370{
371 T0_ = T0;
372 h0_ = h0;
373}
374
376{
377 OWN_PTR(Champ_Inc_base) e_int_inc;
378 const Equation_base& eq = equation_.count("temperature") ? equation("temperature") : equation("enthalpie");
379 eq.discretisation().discretiser_champ("champ_elem", eq.domaine_dis(), "energie_interne", "J/kg", 1, eq.inconnue().nb_valeurs_temporelles(), eq.inconnue().temps(), e_int_inc);
380 e_int_inc->associer_eqn(eq), e_int_inc->init_champ_calcule(*this, calculer_e_int);
381 ch_e_int_ = e_int_inc;
382 ch_e_int_->mettre_a_jour(eq.inconnue().temps());
383 e_int_auto_ = 1;
384}
385
387{
388 const bool res_en_T = equation_.count("temperature") ? true : false;
389 if (res_en_T) return; /* Do nothing */
390
391 const Equation_base& eq = equation("enthalpie");
392 const Champ_base& ch_h = eq.inconnue(), &ch_Cp = capacite_calorifique();
393 Champ_Inc_base& ch_T = ref_cast_non_const(Champ_Inc_base, ch_h_ou_T_.valeur());
394 const DoubleTab& h = ch_h.valeurs(), &Cp_ = ch_Cp.valeurs();
395 DoubleTab& T = ch_T.valeurs(), &bT = ch_T.val_bord();;
396
397 DoubleTab bh = ch_h.valeur_aux_bords(), bCp;
398
399 int i, zero = 0, Ni = h.dimension_tot(0), Nb = bh.dimension_tot(0), n, n0 = std::max(id_composite_, zero), cCp = Cp_.dimension_tot(0) == 1, N = id_composite_ >= 0 ? 1 : Cp_.dimension(1);
400
401 // T = T0 + (h - h0) / cp
402 for (i = 0; i < Ni; i++)
403 for (n = 0; n < N; n++)
404 T(i, n) = T0_ + (( h(i, n0 + n) - h0_) / Cp_(!cCp * i, n));
405
406 if (ch_Cp.a_un_domaine_dis_base())
407 bCp = ch_Cp.valeur_aux_bords();
408 else
409 {
410 bCp.resize(bh.dimension_tot(0), N);
411 ch_Cp.valeur_aux(ref_cast(Domaine_VF, ch_h.domaine_dis_base()).xv_bord(), bCp);
412 }
413
414 for (i = 0; i < Nb; i++)
415 for (n = 0; n < N; n++)
416 bT(i, n) = T0_ + (( bh(i, n0 + n) - h0_) / bCp(!cCp * i, n));
417}
418
420{
421 const bool res_en_T = equation_.count("temperature") ? true : false;
422 if (res_en_T) return; /* Do nothing */
423
424 const Equation_base& eq = equation("enthalpie");
425 if (!ch_e_int_) creer_e_int();
426 ch_h_ou_T_ = ch_e_int_; // initialize
427 ch_h_ou_T_->nommer("temperature");
428 ch_h_ou_T_->mettre_a_jour(eq.inconnue().temps());
429}
430
431void Fluide_base::calculer_e_int(const Objet_U& obj, DoubleTab& val, DoubleTab& bval, tabs_t& deriv)
432{
433 const Fluide_base& fl = ref_cast(Fluide_base, obj);
434 const bool res_en_T = fl.equation_.count("temperature") ? true : false;
435
436 const Equation_base& eq = res_en_T ? fl.equation("temperature") : fl.equation("enthalpie");
437 const Champ_base& ch_T_ou_h = eq.inconnue(), &ch_Cp = fl.capacite_calorifique();
438 const DoubleTab& T_ou_h = ch_T_ou_h.valeurs(), &Cp = ch_Cp.valeurs();
439 int i, zero = 0, Ni = val.dimension_tot(0), Nb = bval.dimension_tot(0), n, n0 = std::max(fl.id_composite_, zero), cCp = Cp.dimension_tot(0) == 1, N = fl.id_composite_ >= 0 ? 1 : Cp.dimension(1);
440
441 DoubleTab bT_ou_h = ch_T_ou_h.valeur_aux_bords();
442
443 if (res_en_T)
444 {
445 // e = h0 + Cp * (T - T0)
446 for (i = 0; i < Ni; i++)
447 for (n = 0; n < N; n++)
448 val(i, n) = fl.h0_ + Cp(!cCp * i, n) * (T_ou_h(i, n0 + n) - fl.T0_);
449
450 DoubleTab bCp;
451
452 if (ch_Cp.a_un_domaine_dis_base())
453 bCp = ch_Cp.valeur_aux_bords();
454 else
455 {
456 bCp.resize(bval.dimension_tot(0), N);
457 ch_Cp.valeur_aux(ref_cast(Domaine_VF, ch_T_ou_h.domaine_dis_base()).xv_bord(), bCp);
458 }
459
460 for (i = 0; i < Nb; i++)
461 for (n = 0; n < N; n++)
462 bval(i, n) = fl.h0_ + bCp(i, n) * (bT_ou_h(i, n0 + n) - fl.T0_);
463
464 DoubleTab& der_T = deriv[ch_T_ou_h.le_nom().getString()];
465 for (der_T.resize(Ni, N), i = 0; i < Ni; i++)
466 for (n = 0; n < N; n++)
467 der_T(i, n) = Cp(!cCp * i, n);
468 }
469 else
470 {
471 // e = h - P / rho
472 for (i = 0; i < Ni; i++)
473 for (n = 0; n < N; n++)
474 val(i, n) = T_ou_h(i, n0 + n);
475
476 for (i = 0; i < Nb; i++)
477 for (n = 0; n < N; n++)
478 bval(i, n) = bT_ou_h(i, n0 + n);
479
480 DoubleTab& der_T = deriv["enthalpie"];
481 for (der_T.resize(Ni, N), i = 0; i < Ni; i++)
482 for (n = 0; n < N; n++)
483 der_T(i, n) = 1.;
484 }
485}
486
488{
489 if (!ch_e_int_) creer_e_int();
490 return ch_e_int_;
491}
492
494{
495 if (!ch_e_int_) creer_e_int();
496 return ch_e_int_;
497}
498
500{
501 if (!ch_h_ou_T_ && !ch_e_int_) creer_e_int();
502 return ch_h_ou_T_ ? ch_h_ou_T_ : ch_e_int_;
503}
504
506{
507 if (!ch_h_ou_T_ && !ch_e_int_) creer_e_int();
508 return ch_h_ou_T_ ? ch_h_ou_T_ : ch_e_int_;
509}
510
512{
513 if (!ch_h_ou_T_)
515
516 if (sub_type(Fluide_Incompressible, *this))
517 calculer_temperature_multiphase(); /* sinon rempli dans Fluide_reel_base */
518
519 return ch_h_ou_T_;
520}
521
523{
524 if (!ch_h_ou_T_)
526
527 if (sub_type(Fluide_Incompressible, *this))
528 calculer_temperature_multiphase(); /* sinon rempli dans Fluide_reel_base */
529
530 return ch_h_ou_T_;
531}
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
int nb_valeurs_nodales() const override
Returns the number of degrees of freedom per component: the number of nodes.
class Champ_Fonc_MED Load a field from a MED file for a given time.
Class Champ_Fonc_Tabule Derived class of Champ_Fonc_base representing.
Class Champ_Inc_base.
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
DoubleTab & val_bord()
virtual int nb_valeurs_temporelles() const
Returns the number of temporal values currently kept.
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
Champ_Uniforme Represents a field that is constant in space and time.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
virtual const Domaine_dis_base & domaine_dis_base() const
virtual DoubleTab valeur_aux_bords() const
Returns the field value at the boundary faces.
double temps() const
Returns the time of the field.
class Discretisation_base This class represents a spatial discretization scheme, which
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
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
class Domaine_VF
Definition Domaine_VF.h:44
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,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
Represents an incompressible fluid and its properties:
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
virtual void set_h0_T0(double h0, double T0)
void set_param(Param &param) const override
virtual void calculer_nu()
void mettre_a_jour(double) override
Performs a time update of the medium and therefore of its characteristic parameters.
void calculer_temperature_multiphase() const
const Champ_base & energie_interne() const
OWN_PTR(Champ_base) ch_e_int_
int initialiser(const double temps) override
Initializes the fluid parameters.
void creer_temperature_multiphase() const
static void calculer_e_int(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
void verifier_coherence_champs(int &err, Nom &message) override
Verifies that the fields read have been set correctly.
const Champ_base & enthalpie() const
void creer_champs_non_lus() override
Champ_Don_base & kappa()
Definition Fluide_base.h:68
void creer_e_int() const
void creer_nu()
If the object referenced by nu is of type Champ_Uniforme, types nu as "Champ_Uniforme" and fills it w...
Champ_Don_base & longueur_rayo()
Definition Fluide_base.h:77
bool initTimeStep(double dt) override
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) override
const Champ_base & temperature_multiphase() const
Milieu_base This class is the base of the (physical) medium hierarchy.
Definition Milieu_base.h:50
void ecrire(Sortie &) const
Writes a medium object to an output stream.
virtual int initialiser(const double temps)
virtual void creer_champs_non_lus()
virtual const Equation_base & equation(const std::string &nom_inc) const
virtual void mettre_a_jour(double temps)
virtual const Champ_Don_base & capacite_calorifique() const
Returns the heat capacity of the medium (const version).
virtual void discretiser(const Probleme_base &pb, const Discretisation_base &dis)
virtual void verifier_coherence_champs(int &err, Nom &message)
Champs_compris champs_compris_
virtual void set_param(Param &param) const override
std::map< std::string, const Equation_base * > equation_
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
const std::string & getString() const
Definition Nom.h:92
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
@ REQUIRED
Definition Param.h:115
class Probleme_base It is a Probleme_U that is not a coupling.
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
virtual const Equation_base & equation(int) const =0
class Schema_Temps_base
double temps_courant() const
Returns the current time.
virtual double temps_futur(int i) const =0
virtual int nb_valeurs_futures() const =0
Base class for output streams.
Definition Sortie.h:52
_TYPE_ * addr()
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
int line_size() const
Definition TRUSTVect.tpp:67
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")