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>
40 os <<
"kappa " << coeff_absorption_ << finl;
42 os <<
"longueur_rayo " << longueur_rayo_ << finl;
43 os <<
"mu " << ch_mu_ << finl;
71 if (ch_mu_) champs_don_.add(ch_mu_.valeur());
74 if (coeff_absorption_) champs_don_.add(coeff_absorption_.valeur());
76 if (longueur_rayo_) champs_don_.add(longueur_rayo_.valeur());
86 param.
ajouter(
"kappa", &coeff_absorption_);
104 Cerr <<
" converting the champ_fonc_med to champ_don" << finl;
106 dis.
discretiser_champ(
"champ_elem", domaine_dis,
"neant",
"neant", 1, temps, mu_prov);
107 mu_prov->affecter(ch_mu_.valeur());
110 dis.
discretiser_champ(
"champ_elem", domaine_dis,
"neant",
"neant", 1, temps, ch_mu_);
112 ch_mu_->valeurs() = mu_prov->valeurs();
117 dis.
discretiser_champ(
"champ_elem", domaine_dis,
"neant",
"neant", 1, temps, ch_mu_);
161 if (mp_min_vect(ch_rho_->valeurs()) <= 0)
163 msg +=
"The density rho is not striclty positive. \n";
169 msg +=
"The density rho has not been specified. \n";
176 if (
ch_Cp_->valeurs()(0, 0) <= 0)
178 msg +=
"The heat capacity Cp is not striclty positive. \n";
184 msg +=
"The heat capacity Cp is not of type Champ_Uniforme. \n";
191 msg +=
"The conductivity lambda is not positive. \n";
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;
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;
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;
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";
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";
235 if (coeff_absorption_->valeurs()(0, 0) <= 0)
237 msg +=
"The absorption coefficient kappa is not striclty positive. \n";
254 ch_nu_->valeurs().resize(ch_rho_->valeurs().dimension_tot(0), ch_rho_->valeurs().line_size());
260 const DoubleTab& tabmu = ch_mu_->valeurs();
261 const DoubleTab& tabrho = ch_rho_->valeurs();
262 DoubleTab& tabnu =
ch_nu_->valeurs();
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];
297 ch_mu_->mettre_a_jour(temps);
299 ch_nu_->changer_temps(temps);
300 ch_nu_->valeurs().echange_espace_virtuel();
302 ch_e_int_->mettre_a_jour(temps);
308 coeff_absorption_->mettre_a_jour(temps);
312 longueur_rayo_->mettre_a_jour(temps);
321 DoubleTab& l_rayo = longueur_rayo_->valeurs();
324 l_rayo[i] = 1 / (3 * K[i]);
335 Cerr <<
"Fluide_base::initialiser()" << finl;
337 ch_mu_->initialiser(temps);
343 ch_nu_->valeurs().echange_espace_virtuel();
344 ch_nu_->changer_temps(temps);
350 Cerr <<
"Semi transparent fluid properties initialization." << finl;
351 coeff_absorption_->initialiser(temps);
355 longueur_rayo_->initialiser(temps);
360 DoubleTab& l_rayo = longueur_rayo_->valeurs();
363 l_rayo[i] = 1 / (3 * K[i]);
380 e_int_inc->associer_eqn(eq), e_int_inc->init_champ_calcule(*
this,
calculer_e_int);
381 ch_e_int_ = e_int_inc;
388 const bool res_en_T =
equation_.count(
"temperature") ? true :
false;
389 if (res_en_T)
return;
394 const DoubleTab& h = ch_h.
valeurs(), &Cp_ = ch_Cp.valeurs();
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));
406 if (ch_Cp.a_un_domaine_dis_base())
407 bCp = ch_Cp.valeur_aux_bords();
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));
421 const bool res_en_T =
equation_.count(
"temperature") ? true :
false;
422 if (res_en_T)
return;
434 const bool res_en_T = fl.
equation_.count(
"temperature") ? true :
false;
438 const DoubleTab& T_ou_h = ch_T_ou_h.
valeurs(), &Cp = ch_Cp.valeurs();
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_);
452 if (ch_Cp.a_un_domaine_dis_base())
453 bCp = ch_Cp.valeur_aux_bords();
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_);
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);
472 for (i = 0; i < Ni; i++)
473 for (n = 0; n < N; n++)
474 val(i, n) = T_ou_h(i, n0 + n);
476 for (i = 0; i < Nb; i++)
477 for (n = 0; n < N; n++)
478 bval(i, n) = bT_ou_h(i, n0 + n);
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++)
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.
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
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
class Champ_base This class is the base of the fields hierarchy.
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_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,...
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:
virtual void set_h0_T0(double h0, double T0)
void set_param(Param ¶m) 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
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()
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.
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 ¶m) const override
std::map< std::string, const Equation_base * > equation_
class Nom: a character string for naming TRUST objects.
const std::string & getString() const
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
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.
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
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.
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension_tot(int) const override
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")