TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Echange_contact_ODVM_VDF.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, 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 <Echange_contact_ODVM_VDF.h>
17#include <Pb_Conduction.h>
18#include <Equation_base.h>
19#include <Modele_turbulence_scal_base.h>
20#include <Paroi_ODVM_scal_VDF.h>
21
22
23// XD paroi_echange_contact_odvm_vdf paroi_echange_contact_vdf paroi_echange_contact_odvm_vdf INHERITS_BRACE not_set
24Implemente_instanciable(Echange_contact_ODVM_VDF,"Paroi_echange_contact_ODVM_VDF",Echange_contact_VDF);
25
26
27
29{
30 return s << que_suis_je() << "\n";
31}
32
34{
36}
37
38void Echange_contact_ODVM_VDF::calculer_Teta_equiv(DoubleTab& La_T_ext,const DoubleTab& mon_h,const DoubleTab& lautre_h,int i,double temps)
39{
40 const Equation_base& mon_eqn = domaine_Cl_dis().equation();
41 const DoubleTab& mon_inco=mon_eqn.inconnue().valeurs();
42 const Domaine_VDF& ma_zvdf = ref_cast(Domaine_VDF,domaine_Cl_dis().domaine_dis());
43 const Front_VF& ma_front_vf = ref_cast(Front_VF,frontiere_dis());
44 DoubleTab& t_autre=T_autre_pb().valeurs_au_temps(temps);
45 int ndeb = ma_front_vf.num_premiere_face();
46 int nb_faces_bord = ma_front_vf.nb_faces();
47 int ind_fac,elem, isfluide=0;
48 //La_T_ext.resize(nb_faces_bord,1);
49
50 if (mon_eqn.probleme().equation(0).has_champ("vitesse"))
51 {
52 mon_eqn.probleme().equation(0).get_champ("vitesse");
53 isfluide=1;
54 }
55
56 const Champ_front_calc& chcal=ref_cast(Champ_front_calc,T_autre_pb());
57 const Equation_base& eq = (isfluide==1?mon_eqn:chcal.inconnue().equation());
58 const Modele_turbulence_scal_base& modele_turbulence = ref_cast(Modele_turbulence_scal_base,eq.get_modele(TURBULENCE).valeur());
59 const Turbulence_paroi_scal_base& loipar = modele_turbulence.loi_paroi();
60
61 const Paroi_ODVM_scal_VDF& paroi_vdf = ref_cast(Paroi_ODVM_scal_VDF,loipar);
62 // Initialise la loi de paroi si necessaire:
63// GF non pas ici // paroi_vdf.init_lois_paroi();
64 if (paroi_vdf.get_Tf0().size_array()==0)
65 {
66 Cerr<<"pb !!!!!!!!"<<finl;
68 }
69
70 for (int numfa=0; numfa<nb_faces_bord; numfa++)
71 {
72 ind_fac = numfa+ndeb;
73 if (ma_zvdf.face_voisins(ind_fac,0)!= -1)
74 elem = ma_zvdf.face_voisins(ind_fac,0);
75 else
76 elem = ma_zvdf.face_voisins(ind_fac,1);
77 // double Delta_T= (mon_h(numfa,0)*mon_inco(elem)+autre_h(numfa,0)*T_autre_pb(numfa) - paroi_vdf.get_Tf0(numfa)*(mon_h(numfa,0)+autre_h(numfa,0)) );
78
79 double Delta_T= (mon_h(numfa,0)*mon_inco(elem)+lautre_h(numfa,0)*t_autre(numfa,0) - paroi_vdf.get_Tf0(numfa)*(mon_h(numfa,0)+lautre_h(numfa,0)));
80
81 // SI PB FLUIDE :
82 if(isfluide) La_T_ext(numfa,0) = t_autre(numfa,0)+Delta_T/mon_h(numfa,0);
83 // SINON (Solide)
84 else La_T_ext(numfa,0) = t_autre(numfa,0)-Delta_T/lautre_h(numfa,0);
85 }
86}
87
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs_au_temps(double temps)=0
class Champ_front_calc Derived class of Champ_front_var representing
const Champ_Inc_base & inconnue() const
Returns the associated unknown field.
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
class Domaine_VDF
Definition Domaine_VDF.h:61
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
Definition Domaine_VF.h:418
void calculer_Teta_equiv(DoubleTab &La_T_ext, const DoubleTab &mon_h, const DoubleTab &autre_h, int i, double temps) override
Fills Teta_eq using T_autre_pb at the time passed as parameter.
virtual Champ_front_base & T_autre_pb()
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....
virtual const RefObjU & get_modele(Type_modele type) const
virtual const Champ_Inc_base & inconnue() const =0
const Champ_base & get_champ(const Motcle &nom) const override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
Probleme_base & probleme()
Returns the problem associated with the equation.
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
Base class for scalar turbulence models coupled to a Navier-Stokes convection-diffusion equation.
const Turbulence_paroi_scal_base & loi_paroi() const
Returns the scalar wall-law turbulence model (const version).
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
CLASS: Paroi_ODVM_scal_VDF.
double get_Tf0(int num_face) const
virtual const Equation_base & equation(int) const =0
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
const Objet_U & valeur() const
Definition TRUST_Ref.h:134
Base class for the hierarchy of scalar wall-law models computing turbulent quantities near walls....