16#include <Milieu_Phase_field.h>
17#include <Pb_Phase_field.h>
18#include <Discret_Thyd.h>
88 if (mot ==
"approximation_de_boussinesq")
92 bool fonctionsALire =
false;
93 if (temp_boussi_ ==
"oui")
99 fonctionsALire =
true;
100 Cerr <<
"Approximation de Boussinesq utilisee mais beta_co non defini comme propriete du fluide" << finl;
101 Cerr <<
"On s'attend donc a lire les fonctions rho(c) et drho/dc" << finl;
107 fonctionsALire =
true;
112 Cerr <<
"Error while reading approximation_de_boussinesq" << finl;
113 Cerr <<
"We expected a { instead of " << motlu << finl;
119 if (motlu ==
"rho_fonc_c")
121 Cerr << motlu << finl;
132 if (motlu ==
"probleme")
134 if (motlu ==
"rho_1")
136 if (motlu ==
"rho_2")
140 Nom chaine(
"Champ_Fonc_Fonction ");
142 chaine +=
" concentration 1 ";
143 Nom rhoM(0.5 * (rho1 + rho2));
144 Nom drho(rho2 - rho1);
151 Nom chaine2(
"Champ_Uniforme 1 ");
154 Cerr <<
"@@@ " << chaine2 << finl;
160 Cerr <<
"Error while reading approximation_de_boussinesq" << finl;
161 Cerr <<
"We expected a } instead of " << motlu << finl;
166 else if (mot ==
"viscosite_dynamique_constante")
170 if (temp_diffbou_ ==
"oui")
178 assert(motlu ==
"{");
180 if (motlu ==
"mu_fonc_c")
182 Cerr << motlu << finl;
192 if (motlu ==
"probleme")
200 Nom chaine(
"Champ_Fonc_Fonction ");
202 chaine +=
" concentration 1 ";
203 Nom muM(0.5 * (mu1 + mu2));
212 assert(motlu ==
"}");
218 Cerr <<
"LE PAS DE TEMPS DE STABILITE (DE DIFFUSION) DOIT ETRE FORCE DANS VDF/Operateurs/OpDifVDFFaCs.cpp : ligne 115" << finl;
219 Cerr <<
"ATTENTION : LE PAS DE TEMPS DE DIFFUSION SERA ALORS FORCE A LA VALEUR DE 1 SECONDE !!!" << finl;
242 int dim = rho0Tab.
nb_dim();
246 rho0_ = rho0Tab(0, 0);
249 rho0_ = rho0Tab(0, 0, 0);
252 Cerr <<
"Milieu_Phase_field : Problem with rho0 dimension:" << dim << finl;
263 Process::exit(
"Milieu_Phase_field::discretiser : should not be here (1)");
270 if (rho_->le_nom() ==
"anonyme")
273 Process::exit(
"Milieu_Phase_field::discretiser : should not be here (2)");
290 int type_systeme_naire = fermeture_->get_type_systeme_naire();
293 double temps = pb_pf_->schema_temps().temps_futur(i);
297 temps = pb_pf_->schema_temps().temps_courant();
312 DoubleTab& rhoTab = rho_->valeurs();
313 DoubleTab& drhodcTab = drhodc_->valeurs();
314 DoubleTab rho0Tab(rhoTab);
316 if (type_systeme_naire == 0)
319 tab_multiply_any_shape(drhodcTab,
beta_c().valeurs());
321 tab_multiply_any_shape(rhoTab, drhodcTab);
326 else if (type_systeme_naire == 1)
328 DoubleTab beta_(rhoTab);
329 DoubleTab betacTab(c);
335 for (
int j = 0; j < betacTab.
line_size(); j++)
338 beta_(i) += betacTab(i, j);
341 tab_multiply_any_shape(drhodcTab, beta_);
345 tab_multiply_any_shape(betacTab, c);
346 for (i = 0; i < betacTab.
dimension(0); i++)
348 for (
int j = 0; j < betacTab.
line_size(); j++)
350 rhoTab(i) += betacTab(i, j);
354 tab_multiply_any_shape(rhoTab, rho0Tab);
358 rho_->valeurs().echange_espace_virtuel();
359 drhodc_->valeurs().echange_espace_virtuel();
368 double temps = pb_pf_->schema_temps().temps_futur(i);
372 temps = pb_pf_->schema_temps().temps_courant();
380 mu_->valeurs().echange_espace_virtuel();
387 Cerr <<
"Milieu_Phase_field::initialiser()" << finl;
389 rho_->initialiser(temps);
391 drhodc_->initialiser(temps);
397 mu_->initialiser(temps);
401 rho_->changer_temps(temps);
402 drhodc_->changer_temps(temps);
405 mu_->changer_temps(temps);
421 rho_->changer_temps(temps);
422 drhodc_->changer_temps(temps);
426 mu_->changer_temps(temps);
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
virtual DoubleTab & valeurs()=0
const Champ_Inc_base & inconnue() const override
Returns the unknown field of the equation: the concentration.
classe Convection_Diffusion_Phase_field Cas particulier de Convection_Diffusion_Concentration
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
An input stream whose source is a character string.
Class defining operators and methods for all reading operation in an input flow (file,...
Sources & sources()
Returns the source terms associated with the equation.
Represents an incompressible fluid and its properties:
void set_param(Param ¶m) const override
const Champ_Don_base & beta_c() const
void calculer_rho(const bool init=false)
Calcule rho_n+1 pour utilisation dans la pression.
void mettre_a_jour(double temps) override
Performs a time update of the medium and therefore of its characteristic parameters.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void calculer_mu(const bool init=false)
void set_param(Param ¶m) const override
int initialiser(const double temps) override
Initializes the fluid parameters.
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) override
void update_rho_mu(double temps)
virtual int initialiser(const double temps)
virtual void mettre_a_jour(double temps)
virtual void discretiser(const Probleme_base &pb, const Discretisation_base &dis)
virtual const Champ_base & masse_volumique() const
Returns the mass density of the medium (const version).
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Champs_compris champs_compris_
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
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.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Classe Pb_Phase_field Cette classe represente un probleme d'hydraulique avec transport.
class Probleme_base It is a Probleme_U that is not a coupling.
const Domaine_dis_base & domaine_dis() const
Returns the discretized domain associated with the problem (const version).
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
class Source_Con_Phase_field_base
virtual void calculer_champ_fonc_c(const double t, Champ_Don_base &champ_fonc_c, const DoubleTab &val_c) const =0
class Sources Sources represents a list of Source objects.
_SIZE_ dimension(int d) const