16#include <Courant_impose.h>
17#include <Domaine_Cl_dis_base.h>
18#include <Equation_base.h>
19#include <Cahn_Hilliard.h>
20#include <Probleme_base.h>
21#include <Milieu_base.h>
22#include <Espece_intercalee.h>
35 Cerr <<
"*** Boundary conditions : Imposed courant for Lithium-ion Batteries case (only Cahn-Hilliard has been added yet) ***" << finl;
46 le_champ_front.typer(
"Champ_front_fonc");
47 le_champ_front->nommer(
"Courant_impose");
64 le_champ_front->fixer_nb_comp(dim_champ);
67 le_champ_front->verifier(*
this);
74 Cerr <<
"[Courant_impose::verifie_ch_init_nb_comp()] ..." << finl;
79 const int nb_comp = le_champ_front->nb_comp();
89 Cerr <<
"[Courant_impose::completer()] ..." << finl;
96 le_champ_front->valeurs().resize(
nb_faces_,dim_champ);
100 le_champ_front->set_instationnaire(
true);
103 if (le_champ_front->instationnaire())
104 Cerr <<
"[Courant_impose] : Instationnary field OK." << finl;
107 Cerr <<
"[Courant_impose] : Stationnary field... Not normal." << finl;
131 double mu_el(0.), numer(0.), denom(0.), numer_tot(0.), denom_tot(0.);
133 DoubleTab& courant(le_champ_front->valeurs());
137 double i0 = mil.
i0();
141 double S(0.), S_tot(0.), ds(0.);
145 for (
int j=0; j<nb_couches; j++)
146 for (
int face = 0; face <
nb_faces_; face++)
148 int facegl = face +
ndeb_;
155 numer += c(elem,j)*(1.-c(elem,j))*mutilde(elem,j)*ds;
156 denom += c(elem,j)*(1.-c(elem,j))*ds;
164 numer_tot =
mp_sum(numer);
167 denom_tot =
mp_sum(denom);
175 mu_el = ( ((
Iimp_/i0) * T_sur_Tref) + numer_tot ) / denom_tot;
179 const double constante = damkohler/(T_sur_Tref);
182 for (
int j=0; j<nb_couches; j++)
183 for (
int face = 0; face <
nb_faces_; face++)
185 int facegl = face +
ndeb_;
189 courant(face,j) = constante * c(elem,j)*(1.-c(elem,j))*(mu_el - mutilde(elem,j));
std::vector< Nom > supp_discs
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
std::vector< Motcle > app_domains
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
Classe Courant_impose Cette condition limite correspond a un courant imposé. Utile uniquement dans le...
void verifie_ch_init_nb_comp() const override
Calls the verification of the field read through the equation for which the boundary condition is con...
void mettre_a_jour_courant(const DoubleTab &, const DoubleTab &)
Met a jour les conditions aux limites sur le courant (spécifique à cette classe).
double flux_impose(int i) const override
Renvoie la valeur du flux impose sur la i-eme composante du champ representant le flux a la frontiere...
void completer() override
DOES NOTHING must be overridden in derived classes.
void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &) override
Associates the Domaine_Cl_dis_base (domain of discretized boundary conditions) with the object.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
virtual const DoubleVect & face_surfaces() const
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
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....
virtual const Milieu_base & milieu() const =0
virtual const Champ_Inc_base & inconnue() const =0
virtual void verifie_ch_init_nb_comp_cl(const Champ_Inc_base &ch_ref, const int nb_comp, const Cond_lim_base &cl) const
virtual int nb_comp() const
virtual const Equation_base & equation(const std::string &nom_inc) const
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
virtual double flux_impose(int i) const
Returns the value of the imposed flux on the i-th component of the field representing the flux at the...
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.
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.