16#include <Fluide_Dilatable_base.h>
17#include <Loi_Etat_rhoT_GP_QC.h>
20#include <ParserView.h>
41 param.ajouter(
"Prandtl",&
Pr_);
43 param.ajouter(
"rho_xyz",&rho_xyz_);
45 param.ajouter(
"rho_t",&expression_);
49 param.lire_avec_accolades(is);
51 if (expression_ ==
"??" && !rho_xyz_)
53 Cerr <<
"Error in Loi_Etat_rhoT_GP_QC::readOn !" << finl;
54 Cerr <<
"The closure equation of rho is not read in your data file !" << finl;
55 Cerr <<
"Either use rho_t followed by an expression of T," << finl;
56 Cerr <<
"or use rho_xyz followed by a Champ_Fonc_xyz !" << finl;
60 if (expression_ !=
"??")
63 Cerr <<
"Parsing the expression " << expression_ << finl;
70 assert(rho_xyz_->que_suis_je() ==
"Champ_Fonc_xyz" );
80 if (le_fluide->masse_volumique().que_suis_je()==
"Champ_Fonc_P0_VDF") isVDF = 1;
82 int nb_elems = le_fluide->viscosite_dynamique().valeurs().size();
84 assert (rho_xyz_->valeurs().size() == nb_elems);
89 rho_.resize(nb_elems, 1);
90 DoubleTab& fld = rho_xyz_->valeurs();
91 for (
int i=0; i<nb_elems; i++)
rho_(i,0)=fld(i,0);
96 int nb_faces = le_fluide->masse_volumique().valeurs().size();
97 rho_.resize(nb_faces, 1);
99 Champ_base& ch_rho = le_fluide->masse_volumique();
101 DoubleTab& fld = ch_rho.
valeurs();
102 for (
int i = 0; i < nb_faces; i++)
rho_(i,0)= fld(i,0);
125 Cerr << finl <<
"Error, we find a temperature of " << T <<
" !" << finl;
126 Cerr <<
"Either your calculation has diverged or you don't define" << finl;
127 Cerr <<
"temperature in Kelvin somewhere in your data file." << finl;
128 Cerr <<
"It is mandatory for Quasi compressible model." << finl;
129 Cerr <<
"Check your data file." << finl;
156 const DoubleTab& tab_ICh = le_fluide->inco_chaleur().valeurs();
157 DoubleTab& tab_rho = le_fluide->masse_volumique().valeurs();
158 int n=tab_rho.
size();
163 CDoubleTabView ICh = tab_ICh.
view_ro();
164 CDoubleArrView
rho_n =
static_cast<const DoubleVect&
>(
tab_rho_n).view_ro();
166 DoubleTabView rho = tab_rho.
view_wo();
167 double eps = std::numeric_limits<double>::epsilon();
169 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), n, KOKKOS_LAMBDA(
const int i)
171 double T = ICh(i, 0);
172 if (Kokkos::abs(T) < eps)
176 if (T<=Tmin_for_exit)
Process::Kokkos_exit(
"Dumb temperature in Loi_Etat_rhoT_GP_QC::calculer_masse_volumique !");
177 int threadId = parser.
acquire();
178 parser.
setVar(0, T, threadId);
183 end_gpu_timer(__KERNEL_NAME__);
187 CDoubleTabView rho =
rho_.view_ro();
188 CDoubleArrView
rho_n =
static_cast<const DoubleVect&
>(
tab_rho_n).view_ro();
190 DoubleTabView masse_volumique = tab_rho.
view_rw();
191 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), n, KOKKOS_LAMBDA(
const int i)
196 end_gpu_timer(__KERNEL_NAME__);
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual Champ_base & affecter_(const Champ_base &)=0
Class defining operators and methods for all reading operation in an input flow (file,...
Base state law class for ideal gases, defining a dilatable fluid with the equation of state: Pth = rh...
virtual void initialiser_inco_ch()
Initialises the heat equation unknown; sets rho arrays and updates density.
const DoubleTab & rho_n() const
const DoubleTab & rho_np1() const
: class Loi_Etat_rhoT_GP_QC
void calculer_masse_volumique() override
Recomputes the density.
double inverser_Pth(double T, double rho) override
Computes the thermodynamic pressure from temperature and density.
void initialiser_inco_ch() override
Initialises the heat equation unknown; sets rho arrays and updates density.
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.
KOKKOS_INLINE_FUNCTION int acquire() const
KOKKOS_INLINE_FUNCTION void setVar(int i, double val, int threadId) const
void parseString() override
KOKKOS_INLINE_FUNCTION void release(int threadId) const
KOKKOS_INLINE_FUNCTION double eval(int threadId) const
static KOKKOS_INLINE_FUNCTION void Kokkos_exit(const char *)
Exit routine for TRUST within a Kokkos region.
static void abort()
Abort routine for TRUST on a fatal error.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, View< _TYPE_, _SHAPE_ > > view_wo()
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, ConstView< _TYPE_, _SHAPE_ > > view_ro() const
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, View< _TYPE_, _SHAPE_ > > view_rw()
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")