TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_K_Eps_QC_VEF_Face.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#include <Op_Diff_K_Eps_QC_VEF_Face.h>
17#include <Modele_turbulence_hyd_K_Eps.h>
18#include <Champ_P1NC.h>
19#include <Periodique.h>
20#include <Paroi_hyd_base_VEF.h>
21#include <Fluide_Quasi_Compressible.h>
22#include <TRUSTTrav.h>
23
24Implemente_instanciable(Op_Diff_K_Eps_QC_VEF_Face,"Op_Diff_K_Eps_QC_VEF_P1NC",Op_Diff_K_Eps_VEF_Face);
25
26//// printOn
27//
28
29
31{
32 return s << que_suis_je() ;
33}
34
35//// readOn
36//
37
39{
40 return s ;
41}
42
43DoubleTab& Op_Diff_K_Eps_QC_VEF_Face::ajouter(const DoubleTab& tab_inconnue, DoubleTab& resu) const
44{
45 DoubleTrav tab_KEps_divided_by_rho(tab_inconnue);
46 const Transport_K_Eps& eqn_transport = ref_cast(Transport_K_Eps,mon_equation.valeur());
47 const Fluide_Quasi_Compressible& mil = ref_cast(Fluide_Quasi_Compressible,eqn_transport.milieu());
48 const DoubleTab& tab_rho=mil.masse_volumique().valeurs();
49 const int size = tab_inconnue.dimension_tot(0);
50 CDoubleTabView inconnue = tab_inconnue.view_ro();
51 CDoubleArrView rho = static_cast<const ArrOfDouble&>(tab_rho).view_ro();
52 DoubleTabView KEps_divided_by_rho = tab_KEps_divided_by_rho.view_wo();
53 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), size, KOKKOS_LAMBDA(const int i)
54 {
55 KEps_divided_by_rho(i,0) = inconnue(i,0) / rho(i); // k/rho
56 KEps_divided_by_rho(i,1) = inconnue(i,1) / rho(i); // eps/rho
57 });
58 end_gpu_timer(__KERNEL_NAME__);
59
60 return Op_Diff_K_Eps_VEF_Face::ajouter(tab_KEps_divided_by_rho, resu);
61}
virtual DoubleTab & valeurs()=0
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Fluide_Quasi_Compressible Cette classe represente un d'un fluide quasi compressible
virtual const Champ_base & masse_volumique() const
Renvoie la masse volumique du milieu.
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
class Op_Diff_K_Eps_QC_VEF_Face Cette classe represente l'operateur de diffusion turbulente
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
class Op_Diff_K_Eps_VEF_Face Cette classe represente l'operateur de diffusion turbulente
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
Classe de base des flux de sortie.
Definition Sortie.h:52
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, View< _TYPE_, _SHAPE_ > > view_wo()
Definition TRUSTTab.h:276
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, ConstView< _TYPE_, _SHAPE_ > > view_ro() const
Definition TRUSTTab.h:261
Milieu_base & milieu() override
Renvoie le milieu (fluide) associe a l'equation.
classe Transport_K_Eps Cette classe represente l'equation de transport de l'energie cinetique