TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Eval_Conv_VDF_Elem.h
1/****************************************************************************
2* Copyright (c) 2026, 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#ifndef Eval_Conv_VDF_Elem_included
17#define Eval_Conv_VDF_Elem_included
18
19#include <CL_Types_include.h>
20#include <Eval_VDF_Elem.h>
21
22template <typename DERIVED_T>
24{
25public:
26 static constexpr bool IS_AMONT = false, IS_CENTRE = false, IS_CENTRE4 = false, IS_QUICK = false;
27 // Overload Eval_VDF_Elem
28 static constexpr bool CALC_FLUX_FACES_ECH_EXT_IMP = false, CALC_FLUX_FACES_ECH_GLOB_IMP = false, CALC_FLUX_FACES_PAR = false,
30
31 /* ************************************** *
32 * ********* POUR L'EXPLICITE ********** *
33 * ************************************** */
34
35 template <typename BC, typename Type_Double> // Generic return
36 inline void flux_face(const DoubleTab&, const DoubleTab&, const int, const BC&, const int, Type_Double& ) const { /* Do nothing */ }
37
38 // To overload
39 template <typename Type_Double> inline void flux_face(const DoubleTab&, const DoubleTab&, const int, const Dirichlet_entree_fluide&, const int, Type_Double& ) const;
40 template <typename Type_Double> inline void flux_face(const DoubleTab&, const DoubleTab&, const int, const Neumann_sortie_libre&, const int, Type_Double& ) const;
41 template <typename Type_Double> inline void flux_face(const DoubleTab&, const DoubleTab&, const int, const Periodique&, const int, Type_Double& ) const;
42 template <typename Type_Double> inline void flux_face(const DoubleTab&, const int, const int, const int, const Echange_externe_impose&, const int, Type_Double& ) const { /* Do nothing */ }
43 template <typename Type_Double> inline void flux_faces_interne(const DoubleTab&, const int, Type_Double& ) const;
44
45 /* ************************************** *
46 * ********* POUR L'IMPLICITE ********** *
47 * ************************************** */
48
49 template <typename BC, typename Type_Double> // Generic return
50 inline void coeffs_face(const int, const int, const BC&, Type_Double& , Type_Double& ) const { /* Do nothing */ }
51
52 // To overload
53 template <typename Type_Double> inline void coeffs_face(const int, const int, const Dirichlet_entree_fluide&, Type_Double&, Type_Double& ) const;
54 template <typename Type_Double> inline void coeffs_face(const int, const int, const Neumann_sortie_libre&, Type_Double&, Type_Double& ) const;
55 template <typename Type_Double> inline void coeffs_face(const int, const int, const Periodique&, Type_Double&, Type_Double& ) const;
56 template <typename Type_Double> inline void coeffs_face(const DoubleTab&, const int, const int, const int, const int, const Echange_externe_impose&, Type_Double&, Type_Double& ) const { /* Do nothing */ }
57 template <typename Type_Double> inline void coeffs_faces_interne(const int, Type_Double&, Type_Double& ) const;
58
59 // contribution de la derivee en vitesse d'une equation scalaire
60 template <typename BC, typename Type_Double> // Generic return
61 inline void coeffs_face_bloc_vitesse(const DoubleTab&, const DoubleTab&, const int, const BC&, const int, Type_Double& ) const { /* Do nothing */ }
62
63 // Type_Double
64 template <typename Type_Double> inline void coeffs_face_bloc_vitesse(const DoubleTab&, const DoubleTab&, const int, const Dirichlet_entree_fluide&, const int, Type_Double& ) const;
65 template <typename Type_Double> inline void coeffs_face_bloc_vitesse(const DoubleTab&, const DoubleTab&, const int, const Neumann_sortie_libre&, const int, Type_Double& ) const;
66 template <typename Type_Double> inline void coeffs_face_bloc_vitesse(const DoubleTab&, const DoubleTab&, const int, const Periodique&, const int, Type_Double& ) const;
67 template <typename Type_Double> inline void coeffs_face_bloc_vitesse(const DoubleTab&, const DoubleTab&, const int, const int, const int, const Echange_externe_impose&, const int, Type_Double& ) const { /* Do nothing */ }
68 template <typename Type_Double> inline void coeffs_faces_interne_bloc_vitesse(const DoubleTab&, const int, Type_Double& ) const;
69
70 // A virer un jour .. voir avec le baltik Rayonnement
71 template <typename BC, typename Type_Double> inline void secmem_face(const int, const BC&, const int, Type_Double& ) const { throw; }
72 template <typename Type_Double> inline void secmem_face(const int, const int, const int, const Echange_externe_impose&, const int, Type_Double& ) const { throw; }
73 template <typename Type_Double> inline void secmem_faces_interne(const int, Type_Double& ) const { throw; }
74
75private:
76 template <typename Type_Double> inline void coeffs_face_common(const int, Type_Double&, Type_Double& ) const;
77 template <typename Type_Double> inline void coeffs_face_bloc_vitesse_common(const DoubleTab&, const int, Type_Double& ) const;
78
79 // CRTP pattern to static_cast the appropriate class and get the implementation : This is magic !
80 inline int elem_(const int i, const int j) const { return static_cast<const DERIVED_T *>(this)->get_elem(i,j); }
81 inline int amont_amont_(const int face, const int i) const { return static_cast<const DERIVED_T *>(this)->amont_amont(face,i); }
82 inline double dt_vitesse(const int face, int comp = 0) const { return static_cast<const DERIVED_T *>(this)->get_dt_vitesse(face, comp); }
83 inline const DoubleTab& tab_vitesse() const { return static_cast<const DERIVED_T *>(this)->get_tab_vitesse(); }
84 inline double surface_porosite(const int face) const { return static_cast<const DERIVED_T *>(this)->get_surface_porosite(face); }
85
86 template <typename Type_Double> inline void quick_fram_(const Type_Double& psc, const int num0, const int num1, const int num0_0, const int num1_1, const int face, const DoubleTab& transporte, Type_Double& flux) const
87 { static_cast<const DERIVED_T *>(this)->template quick_fram<Type_Double>(psc, num0, num1, num0_0, num1_1, face, transporte, flux); }
88
89 template <typename Type_Double> inline void qcentre_(const double psc, const int num0, const int num1, const int num0_0, const int num1_1, const int face, const DoubleTab& transporte, Type_Double& flux) const
90 { static_cast<const DERIVED_T *>(this)->template qcentre<Type_Double>(psc,num0,num1,num0_0,num1_1,face,transporte,flux); }
91};
92
93#include <Eval_Conv_VDF_Elem.tpp> // templates specializations ici ;)
94
95#endif /* Eval_Conv_VDF_Elem_included */
classe Dirichlet_entree_fluide Cette classe represente une condition aux limite imposant une grandeur
Classe Echange_externe_impose: Cette classe represente le cas particulier de la classe.
static constexpr bool IS_AMONT
void secmem_face(const int, const int, const int, const Echange_externe_impose &, const int, Type_Double &) const
void coeffs_faces_interne(const int, Type_Double &, Type_Double &) const
static constexpr bool CALC_FLUX_FACES_ECH_GLOB_IMP
static constexpr bool CALC_FLUX_FACES_PAR_FIXE
static constexpr bool IS_QUICK
static constexpr bool IS_CENTRE
static constexpr bool CALC_FLUX_FACES_ECH_EXT_IMP
void coeffs_face_bloc_vitesse(const DoubleTab &, const DoubleTab &, const int, const int, const int, const Echange_externe_impose &, const int, Type_Double &) const
void secmem_face(const int, const BC &, const int, Type_Double &) const
void coeffs_face(const DoubleTab &, const int, const int, const int, const int, const Echange_externe_impose &, Type_Double &, Type_Double &) const
void secmem_faces_interne(const int, Type_Double &) const
void coeffs_face_bloc_vitesse(const DoubleTab &, const DoubleTab &, const int, const BC &, const int, Type_Double &) const
void coeffs_face(const int, const int, const BC &, Type_Double &, Type_Double &) const
static constexpr bool CALC_FLUX_FACES_SORTIE_LIB
void flux_faces_interne(const DoubleTab &, const int, Type_Double &) const
static constexpr bool IS_CENTRE4
void flux_face(const DoubleTab &, const DoubleTab &, const int, const BC &, const int, Type_Double &) const
void coeffs_faces_interne_bloc_vitesse(const DoubleTab &, const int, Type_Double &) const
void flux_face(const DoubleTab &, const int, const int, const int, const Echange_externe_impose &, const int, Type_Double &) const
static constexpr bool CALC_FLUX_FACES_PAR
class Eval_VDF_Elem Cette classe represente le prototype fonctionnel
classe Neumann_sortie_libre Cette classe represente une frontiere ouverte sans vitesse imposee
classe Periodique Cette classe represente une condition aux limites periodique.
Definition Periodique.h:31