TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Taux_dissipation_turbulent.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 <Taux_dissipation_turbulent.h>
17#include <Pb_Multiphase.h>
18#include <Discret_Thyd.h>
19#include <Domaine_VF.h>
20#include <Domaine.h>
21#include <Avanc.h>
22#include <Debog.h>
23#include <Frontiere_dis_base.h>
24#include <EcritureLectureSpecial.h>
25#include <Champ_Uniforme.h>
26#include <Matrice_Morse.h>
27#include <Navier_Stokes_std.h>
28#include <TRUSTTrav.h>
29#include <Neumann_sortie_libre.h>
30#include <Op_Conv_negligeable.h>
31#include <Param.h>
32#include <Schema_Implicite_base.h>
33#include <SETS.h>
34#include <EChaine.h>
35#include <Scalaire_impose_paroi.h>
36#include <Echange_global_impose.h>
37
38#define old_forme
39
40Implemente_instanciable(Taux_dissipation_turbulent,"Taux_dissipation_turbulent",Convection_diffusion_turbulence_multiphase);
41
42/*! @brief Simple appel a: Convection_diffusion_turbulence_multiphase::printOn(Sortie&)
43 *
44 * @param (Sortie& is) un flot de sortie
45 * @return (Sortie&) le flot de sortie modifie
46 */
48{
50}
51
52/*! @brief Verifie si l'equation a une inconnue et un fluide associe et appelle Convection_Diffusion_std::readOn(Entree&).
53 *
54 * @param (Entree& is) un flot d'entree
55 * @return (Entree& is) le flot d'entree modifie
56 */
58{
60 terme_convectif.set_fichier("Convection_taux_dissipation_turbulent");
61 terme_convectif.set_description((Nom)"Turbulent dissipation rate=Integral(-omega*ndS)");
62 terme_diffusif.set_fichier("Diffusion_taux_dissipation_turbulent");
63 terme_diffusif.set_description((Nom)"Turbulent dissipation rate=Integral(nu*grad(omega)*ndS)");
64 return is;
65}
66
68{
69 return ref_cast(Fluide_base, milieu()).viscosite_cinematique();
70}
71
73{
74 return ref_cast(Fluide_base, milieu()).viscosite_cinematique();
75}
76
77/*! @brief Discretise l'equation.
78 *
79 */
81{
82 const int nb_valeurs_temp = schema_temps().nb_valeurs_temporelles();
83 const double temps = schema_temps().temps_courant();
84 const Discret_Thyd& dis = ref_cast(Discret_Thyd, discretisation());
85 Cerr << "Turbulent dissipation rate discretization" << finl;
86 //On utilise temperature pour la directive car discretisation identique
87 dis.discretiser_champ("temperature", domaine_dis(), "omega", "s", 1,
88 nb_valeurs_temp, temps, l_inco_ch);//une seule compo, meme en multiphase
89 l_inco_ch->fixer_nature_du_champ(scalaire);
90 l_inco_ch->fixer_nom_compo(0, Nom("omega"));
91 champs_compris_.ajoute_champ(l_inco_ch);
93 Cerr << "Taux_dissipation_turbulent::discretiser() ok" << finl;
94}
95
97 DoubleTab& bval, tabs_t& deriv)
98{
99 const Equation_base& eqn = ref_cast(Equation_base, obj);
100 const DoubleTab& omega = eqn.inconnue().valeurs();
101
102 /* valeurs du champ */
103 const int N = val.dimension_tot(1);
104 const int Nl = val.dimension_tot(0);
105 for (int i = 0; i < Nl; i++)
106 for (int n = 0; n < N; n++)
107 val(i, n) = omega(i, n);
108
109 /* on ne peut utiliser valeur_aux_bords que si ch_rho a un domaine_dis_base */
110 const DoubleTab& b_omega = eqn.inconnue().valeur_aux_bords();
111 const int Nb = b_omega.dimension_tot(0);
112 for (int i = 0; i < Nb; i++)
113 for (int n = 0; n < N; n++)
114 bval(i, n) = b_omega(i, n);
115
116 //derivee en omega : 1.
117 DoubleTab& d_omega = deriv["omega"];
118 d_omega.resize(Nl, N);
119 for (int i = 0; i < Nl; i++)
120 for (int n = 0; n < N; n++)
121 d_omega(i, n) = 1.;
122}
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Returns the array of field values at the current time.
DoubleTab valeur_aux_bords() const override
Returns the field value at the boundary faces.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
classe Convection_diffusion_turbulence_multiphase Equation de transport des quantites turbulentes (k,...
const Milieu_base & milieu() const override
Renvoie le milieu physique de l'equation.
class Discret_Thyd This class is the base class representing a discretization
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual void discretiser()
Discretizes the equation.
Champs_compris champs_compris_
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Base class for TRUST objects (Objet_U).
Definition Objet_U.h:68
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
double temps_courant() const
Returns the current time.
virtual int nb_valeurs_temporelles() const =0
Base class for output streams.
Definition Sortie.h:52
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
classe Taux_dissipation_turbulent Equation de transport du taux de dissipation turbulen (modele k-ome...
static void calculer_omega(const Objet_U &obj, DoubleTab &val, DoubleTab &bval, tabs_t &deriv)
const Champ_Don_base & diffusivite_pour_transport() const override
void discretiser() override
Discretise l'equation.
const Champ_base & diffusivite_pour_pas_de_temps() const override