16#include <Terme_Source_Canal_perio_VEF_P1NC.h>
17#include <Domaine_VEF.h>
18#include <Domaine_Cl_VEF.h>
19#include <Periodique.h>
20#include <Probleme_base.h>
21#include <Equation_base.h>
22#include <Fluide_Dilatable_base.h>
23#include <communications.h>
25#include <Convection_Diffusion_std.h>
75 const Domaine_VF& domaine_VF = le_dom_VEF.valeur();
76 int premiere_face_std = le_dom_VEF->premiere_face_std() ;
79 int nb_faces = domaine_VF.
nb_faces();
81 CDoubleArrView volumes_entrelaces_Cl = le_dom_Cl_VEF->volumes_entrelaces_Cl().view_ro();
84 CDoubleArrView s = tab_s.view_ro();
88 DoubleTabView resu = tab_resu.
view_rw();
89 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), nb_faces, KOKKOS_LAMBDA(
92 double vol = (num_face<premiere_face_std ? volumes_entrelaces_Cl(num_face) : volumes_entrelaces(num_face))*porosite_face(num_face);
93 for (
int i=0; i<dim; i++)
94 resu(num_face,i) += s(i)*vol;
96 end_gpu_timer(__KERNEL_NAME__);
104 DoubleArrView resu =
static_cast<DoubleVect&
>(tab_resu).view_rw();
105 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), nb_faces, KOKKOS_LAMBDA(
108 double vol = (num_face < premiere_face_std ? volumes_entrelaces_Cl(num_face) : volumes_entrelaces(num_face))*porosite_face(num_face);
109 double contrib = s[num_face]*vol;
110 resu(num_face)+= contrib;
111 Kokkos::atomic_add(&
bilan(0), contrib*(1-0.5*fd[num_face]));
113 end_gpu_timer(__KERNEL_NAME__);
121 const Domaine_VF& domaine_VF = le_dom_VEF.valeur();
124 for (
int n_bord=0; n_bord<nb_bords; n_bord++)
134 assert(velocity.
le_nom()==
"vitesse");
136 int nfin = ndeb + le_bord.
nb_faces()/2;
145 CDoubleArrView rho_face =
static_cast<const DoubleVect&
>(tab_rho_face).view_ro();
146 CDoubleTabView face_normales = domaine_VF.
face_normales().view_ro();
149 Kokkos::parallel_reduce(start_gpu_timer(__KERNEL_NAME__),
150 Kokkos::RangePolicy<>(ndeb, nfin), KOKKOS_LAMBDA(
151 const int num_face,
double& debit)
153 double debit_face = 0;
155 debit_face += porosite_face(num_face) * vitesse(num_face, axe) *
156 std::fabs(face_normales(num_face, axe));
159 for (
int i = 0; i < dim; i++)
160 debit_face += porosite_face(num_face) * vitesse(num_face, i) *
161 face_normales(num_face, i);
163 debit += (is_dilatable ? rho_face(num_face) : 1) * debit_face;
164 }, Kokkos::Sum<double>(debit_e));
165 end_gpu_timer(__KERNEL_NAME__);
169 debit_e =
mp_sum(debit_e);
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Cond_lim Generic class used to represent any class
Convection_Diffusion_std This class is the base for equations modelling the transport.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
int nb_faces() const
Returns the total number of faces.
DoubleVect & volumes_entrelaces()
virtual double face_normales(int face, int comp) const
ArrOfInt & faces_doubles()
Returns 1 for faces belonging to a periodic boundary or a shared item, 0 by default.
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,...
virtual const Milieu_base & milieu() const =0
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
Base class for a dilatable fluid, inheriting from Fluide_base.
int num_premiere_face() const
const Nom & le_nom() const override
Returns the name of the geometric boundary.
DoubleVect & porosite_face()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
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.
class Periodique This class represents a periodic boundary condition.
bool is_dilatable() const
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
Base class for output streams.
_SIZE_ size_array() const
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()
DoubleTab & ajouter(DoubleTab &) const override
public_for_cuda void calculer_debit(double &) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
Source term to keep a constant flow rate in a channel with periodic boundary conditions.
int direction_ecoulement_
ArrOfDouble source() const
Term source calculation (called by VDF and VEF implementations) TODO: returning an ArrOfDouble is baa...