TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_K_Eps_Bas_Re_VDF_base.h
1/****************************************************************************
2* Copyright (c) 2019, 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 Op_Diff_K_Eps_Bas_Re_VDF_base_included
17#define Op_Diff_K_Eps_Bas_Re_VDF_base_included
18
19#include <Modele_turbulence_hyd_K_Eps_Bas_Reynolds.h>
20#include <Modele_turbulence_hyd_K_Eps_2_Couches.h>
21#include <Eval_Diff_K_Eps_Bas_Re_VDF_leaves.h>
22#include <Op_Dift_VDF_base.h>
23#include <Iterateur_VDF_Elem.h>
24#include <Op_VDF_Elem.h>
25#include <Perf_counters.h>
26
28{
30public:
31 Op_Diff_K_Eps_Bas_Re_VDF_base(const Iterateur_VDF_base& iter_base) { iter = iter_base; }
32
33 void completer() override;
34
35 inline void mettre_a_jour_diffusivite() const { /* do nothing */ }
36 inline void modifier_pour_Cl(Matrice_Morse& matrice, DoubleTab& secmem) const override { Op_VDF_Elem::modifier_pour_Cl(iter->domaine(), iter->domaine_Cl(), matrice, secmem); }
37 inline DoubleTab& calculer(const DoubleTab& inco, DoubleTab& resu) const override { return iter->calculer(inco, resu); }
38
39 inline void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl) const override
40 {
41 const std::string& nom_inco = equation().inconnue().le_nom().getString();
42 Matrice_Morse *mat = matrices.count(nom_inco) ? matrices.at(nom_inco) : nullptr, mat2;
43 if (!mat)
44 return;
45 Op_VDF_Elem::dimensionner(iter->domaine(), iter->domaine_Cl(), mat2, equation().diffusion_multi_scalaire());
46 mat->nb_colonnes() ? *mat += mat2 : *mat = mat2;
47 }
48
49 void ajouter_blocs(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl) const override
50 {
51 statistics().begin_count(STD_COUNTERS::diffusion, statistics().get_last_opened_counter_level()+1);
52 iter->ajouter_blocs(matrices,secmem,semi_impl);
53 statistics().end_count(STD_COUNTERS::diffusion);
54 }
55 inline int has_interface_blocs() const override { return 1; }
56
57 inline OWN_PTR(Iterateur_VDF_base)& get_iter() { return iter; }
58
59 template <typename EVAL_TYPE>
61 {
62 EVAL_TYPE& eval_diff_turb = static_cast<EVAL_TYPE&> (iter->evaluateur());
63 eval_diff_turb.associer(ch_diff);
64 }
65
66 template <typename EVAL_TYPE>
68 {
69 const EVAL_TYPE& eval_diff = static_cast<const EVAL_TYPE&> (iter->evaluateur());
70 return eval_diff.diffusivite_turbulente();
71 }
72
73 template <typename EVAL_TYPE>
75 {
76 const EVAL_TYPE& eval_diff_turb = static_cast<const EVAL_TYPE&> (iter->evaluateur());
77 return eval_diff_turb.diffusivite();
78 }
79
80 template <typename EVAL_TYPE, typename EVAL_TYPE2 = EVAL_TYPE /* for var only */>
82
83protected:
85};
86
87template <typename EVAL_TYPE, typename EVAL_TYPE2>
89{
90 assert(mon_equation);
91 if(sub_type(Transport_K_KEps,mon_equation.valeur()))
92 {
93 const Transport_K_KEps& eqn_transport = ref_cast(Transport_K_KEps,mon_equation.valeur());
95 const Champ_Fonc_base& diff_turb = mod_turb.viscosite_turbulente();
96 EVAL_TYPE& eval_diff = static_cast<EVAL_TYPE&> (iter->evaluateur());
97 eval_diff.associer_diff_turb(diff_turb);
98 }
99 else if(sub_type(Transport_K_Eps_Bas_Reynolds,mon_equation.valeur()))
100 {
101 const Transport_K_Eps_Bas_Reynolds& eqn_transport = ref_cast(Transport_K_Eps_Bas_Reynolds,mon_equation.valeur());
103 const Champ_Fonc_base& diff_turb = mod_turb.viscosite_turbulente();
104 EVAL_TYPE& eval_diff = static_cast<EVAL_TYPE&> (iter->evaluateur());
105 eval_diff.associer_diff_turb(diff_turb);
106 }
107 else if(sub_type(Transport_K_Eps,mon_equation.valeur()))
108 {
109 const Transport_K_Eps& eqn_transport = ref_cast(Transport_K_Eps,mon_equation.valeur());
110 const Modele_turbulence_hyd_K_Eps& mod_turb = ref_cast(Modele_turbulence_hyd_K_Eps,eqn_transport.modele_turbulence());
111 const Champ_Fonc_base& diff_turb = mod_turb.viscosite_turbulente();
112 EVAL_TYPE2& eval_diff = static_cast<EVAL_TYPE2&> (iter->evaluateur());
113 eval_diff.associer_diff_turb(diff_turb);
114 }
115}
116
117#endif /* Op_Diff_K_Eps_Bas_Re_VDF_base_included */
classe Champ_Fonc_base Classe de base des champs qui sont fonction d'une grandeur calculee
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual const Champ_Inc_base & inconnue() const =0
const Nom & le_nom() const override
Renvoie le nom du champ.
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
int nb_colonnes() const override
Return local number of columns (=size on the current proc).
Classe Modele_turbulence_hyd_K_Eps_2_Couches Cette classe represente le modele de turbulence (k,...
class Modele_turbulence_hyd_K_Eps_Bas_Reynolds
Classe Modele_turbulence_hyd_K_Eps Cette classe represente le modele de turbulence (k,...
const Champ_Fonc_base & viscosite_turbulente() const
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
const std::string & getString() const
Definition Nom.h:92
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl) const override
DoubleTab & calculer(const DoubleTab &inco, DoubleTab &resu) const override
const Champ_base & diffusivite_impl() const
OWN_PTR(Iterateur_VDF_base) &get_iter()
void modifier_pour_Cl(Matrice_Morse &matrice, DoubleTab &secmem) const override
DOES NOTHING - to override in derived classes.
void completer() override
Associe l'operateur au domaine_dis, le domaine_Cl_dis, et a l'inconnue de son equation.
const Champ_Fonc_base & diffusivite_turbulente_impl() const
Op_Diff_K_Eps_Bas_Re_VDF_base(const Iterateur_VDF_base &iter_base)
OWN_PTR(Iterateur_VDF_base) iter
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl) const override
void associer_diffusivite_impl(const Champ_base &ch_diff)
Op_Dift_VDF_base(const Iterateur_VDF_base &iter_base)
void modifier_pour_Cl(const Domaine_VDF &, const Domaine_Cl_VDF &, Matrice_Morse &, DoubleTab &) const
void dimensionner(const Domaine_VDF &, const Domaine_Cl_VDF &, Matrice_Morse &, const bool) const
const Modele_turbulence_hyd_2_eq_base & modele_turbulence() const
Renvoie le modele de turbulence associe a l'equation.
classe Transport_K_Eps Cette classe represente l'equation de transport de l'energie cinetique
classe Transport_K_KEps Cette classe represente l'equation de transport de l'energie cinetique