TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Production_echelle_temp_taux_diss_turb.cpp
1/****************************************************************************
2* Copyright (c) 2021, 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 <Source_Production_echelle_temp_taux_diss_turb.h>
17
18#include <Dissipation_type_helpers.h>
19#include <Pb_Multiphase.h>
20#include <Domaine_VF.h>
21
22Implemente_base(Source_Production_echelle_temp_taux_diss_turb,"Source_Production_echelle_temp_taux_diss_turb", Sources_Multiphase_base);
23
25{
26 return os;
27}
28
30{
31 Param param(que_suis_je());
32 param.ajouter("alpha_omega", &alpha_omega_, Param::REQUIRED);
33 param.lire_avec_accolades_depuis(is);
34 equation().probleme().creer_champ("gradient_vitesse"); // Besoin du gradient de vitesse
35
36 return is;
37}
38
39void Source_Production_echelle_temp_taux_diss_turb::dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl) const
40{
41 const Domaine_VF& domaine = ref_cast(Domaine_VF, equation().domaine_dis());
42 const DoubleTab& k = equation().inconnue().valeurs();
43 const int ne = domaine.nb_elem();
44 const int ne_tot = domaine.nb_elem_tot();
45 const int Nk = k.line_size();
46
47 const std::string Type_diss = find_dissipation_type(equation().probleme());
48
49 assert(Nk == 1); // si plus d'une phase turbulente, il vaut mieux iterer sur les id_composites des phases turbulentes modelisees par un modele k-tau
50
51 if (Type_diss == "tau")
52 assert(equation().probleme().get_champ("tau").valeurs().line_size() == 1);
53 if (Type_diss == "omega")
54 assert(equation().probleme().get_champ("omega").valeurs().line_size() == 1);
55
56 dimensionner_blocs_diagonal(matrices, equation().probleme(), ne, ne_tot, Nk,
57 {"alpha"}, /* handle_pression */ false);
58}
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Domaine_VF
Definition Domaine_VF.h:44
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
@ REQUIRED
Definition Param.h:115
void creer_champ(const Motcle &motlu) override
Base class for output streams.
Definition Sortie.h:52
Classe Source_Production_echelle_temp_taux_diss_turb Classe de base pour un operateur de production d...
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
const Champ_base & get_champ(const Motcle &nom) const override
static void dimensionner_blocs_diagonal(matrices_t matrices, const Probleme_base &pb, int ne, int ne_tot, int Nk, const std::set< std::string > &diagonal_fields, bool handle_pression)
Allocates diagonal stencils in the given matrices for field names listed in diagonal_fields (and opti...
int line_size() const
Definition TRUSTVect.tpp:67