TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Cond_lim_k_simple_flux_nul.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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 <Cond_lim_k_simple_flux_nul.h>
17
18#include <Energie_cinetique_turbulente.h>
19#include <Op_Dift_Multiphase_VDF_Elem.h>
20#include <Op_Diff_PolyMAC_MPFA_base.h>
21#include <Loi_paroi_adaptative.h>
22#include <Domaine_VF.h>
23
24Implemente_instanciable(Cond_lim_k_simple_flux_nul,"Cond_lim_k_simple_flux_nul",Echange_global_impose_turbulent);
25// XD Cond_lim_k_simple_flux_nul condlim_base Cond_lim_k_simple_flux_nul NO_BRACE Adaptive wall law boundary condition
26// XD_CONT for turbulent kinetic energy
27
28
30{
32}
33
35{
37}
38
40{
41 if (!sub_type(Energie_cinetique_turbulente, domaine_Cl_dis().equation()))
42 Process::exit("Cond_lim_k_simple : equation must be k !");
43
44 if (domaine_Cl_dis().equation().inconnue().valeurs().line_size() != 1)
45 Process::exit("Cond_lim_k_simple : Only one phase for turbulent wall law is coded for now");
46}
47
49{
51
52 const int nf = la_frontiere_dis->frontiere().nb_faces();
53 for (int f = 0; f < nf; f++)
54 T_(f, 0) = 0 ; // K is 0 on the wall
55
56 return init;
57}
58
60{
61 Loi_paroi_adaptative& corr_loi_paroi = ref_cast(Loi_paroi_adaptative, correlation_loi_paroi_.valeur());
62 const Domaine_VF& domaine = ref_cast(Domaine_VF, domaine_Cl_dis().equation().domaine_dis());
63 const DoubleTab& u_tau = corr_loi_paroi.get_tab("u_tau");
64
66 const DoubleTab& visc_c = equa.diffusivite_pour_pas_de_temps().passe();
67 const DoubleTab& mu_visc = equa.diffusivite_pour_transport().passe();
68
69 const int cvisc = visc_c.dimension(0) == 1;
70 const int cmu = mu_visc.dimension(0) == 1;
71
72 // On va chercher le mu turbulent de PolyMAC et celui de vdf et on prend le bon dans la suite
73 const DoubleTab* mu_poly = domaine.que_suis_je().debute_par("Domaine_PolyMAC") ? &ref_cast(Op_Diff_PolyMAC_MPFA_base, domaine_Cl_dis().equation().operateur(0).l_op_base()).nu() : nullptr;
74 const DoubleTab* mu_vdf = domaine.que_suis_je().debute_par("Domaine_VDF") ? &ref_cast(Op_Dift_Multiphase_VDF_Elem, domaine_Cl_dis().equation().operateur(0).l_op_base()).get_diffusivite_turbulente() : nullptr;
75 assert((mu_poly) || (mu_vdf));
76
77 const int nf = la_frontiere_dis->frontiere().nb_faces();
78 const int f1 = la_frontiere_dis->frontiere().num_premiere_face();
79 const IntTab& f_e = domaine.face_voisins();
80
81 int n = 0; // Turbulence only in first phase for now
82
83 for (int f = 0; f < nf; f++)
84 {
85 const int f_domaine = f + f1; // number of the face in the domaine
86 const int e_domaine = (f_e(f_domaine,0)>=0) ? f_e(f_domaine,0) : f_e(f_domaine,1) ; // Make orientation vdf-proof
87 const double mu_tot_loc = (mu_poly) ? (*mu_poly)(e_domaine, n) : (mu_vdf) ? (*mu_vdf)(e_domaine, n) + mu_visc(!cmu * e_domaine, n) : -1;
88 const double y_loc = f_e(f_domaine, 0) >= 0 ? domaine.dist_face_elem0(f_domaine, e_domaine) : domaine.dist_face_elem1(f_domaine, e_domaine) ;
89
90 // The /10 division is an adjusted empirical parameter. First attempt was 20.
91 const double rey_wall_loc = y_loc*u_tau(f_domaine, 0)/visc_c(!cvisc * e_domaine, 0)/10;
92 const double fac = 1. / y_loc * (1 - std::tanh( rey_wall_loc*rey_wall_loc));
93
94 h_(f, 0) = mu_tot_loc * fac; // Coeff d'echange de mu/y
95 h_grad_(f, 0) = fac;
96 }
97
98 h_.echange_espace_virtuel();
99 h_grad_.echange_espace_virtuel();
100}
virtual DoubleTab & passe(int i=1)
Definition Champ_Proto.h:50
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
Classe Cond_lim_k_simple_flux_nul:
int initialiser(double temps) override
Initialization at the beginning of the calculation.
void completer() override
DOES NOTHING must be overridden in derived classes.
virtual const Champ_Don_base & diffusivite_pour_transport() const
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
classe Convection_diffusion_turbulence_multiphase Equation de transport des quantites turbulentes (k,...
class Domaine_VF
Definition Domaine_VF.h:44
Base class for turbulent boundary conditions of type Echange_global_impose.
virtual int initialiser(double temps) override
Initialization at the beginning of the calculation.
classe Energie_cinetique_turbulente Equation de transport d'une energie cinetique turbulente (modeles...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Loi_paroi_adaptative correlation pour une loi de paroi adaptative qui calcule u_tau et du y_pl...
DoubleTab & get_tab(std::string str)
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
class Op_Diff_PolyMAC_MPFA_base
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133