TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Dift_VDF_Face_leaves.h
1/****************************************************************************
2* Copyright (c) 2024, 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_Dift_VDF_Face_leaves_included
17#define Op_Dift_VDF_Face_leaves_included
18
19#include <Op_Dift_VDF_Face_Axi_base.h>
20#include <Op_Dift_VDF_Face_base.h>
21#include <Eval_Dift_VDF_leaves.h>
22#include <Op_Diff_Dift_VDF.h>
23
24/// \cond DO_NOT_DOCUMENT
25class Op_Dift_VDF_Face_leaves
26{ };
27/// \endcond
28
30
47
48// ===========================================================================================================================================
49
51{
52 Declare_instanciable(Op_Dift_VDF_Face_Axi);
53public:
54
55 inline bool is_var() const override { return is_var_ ? true : false; }
56 inline double nu_(const int i) const override
57 {
58 return diffusivite_->valeurs()(is_var_ * i);
59 }
60
61 inline double nu_mean_2_pts_(const int i, const int j) const override
62 {
63 return 0.5 * (diffusivite_->valeurs()(is_var_ * i) + diffusivite_->valeurs()(is_var_ * j));
64 }
65 inline double nu_mean_4_pts_(const int, const int) const override;
66 inline double nu_mean_4_pts_(const int i, const int j, const int k, const int l) const override
67 {
68 return 0.25 * (diffusivite_->valeurs()(is_var_ * i) + diffusivite_->valeurs()(is_var_ * j) + diffusivite_->valeurs()(is_var_ * k) + diffusivite_->valeurs()(is_var_ * l));
69 }
70 inline void associer_diffusivite(const Champ_base& diffu) override
71 {
72 diffusivite_ = diffu;
73 is_var_ = sub_type(Champ_Uniforme, diffu) ? 0 : 1;
74 }
75
76 inline void mettre_a_jour_var(double t) const override
77 {
78 if (is_var_)
79 ref_cast_non_const(Op_Dift_VDF_Face_Axi,(*this)).mettre_a_jour(t);
80 }
81
82 inline const Champ_base& diffusivite() const override { return diffusivite_; }
83
84protected:
85 int is_var_ = 0;
86 OBS_PTR(Champ_base) diffusivite_;
87};
88
89inline double Op_Dift_VDF_Face_Axi::nu_mean_4_pts_(const int i, const int j) const
90{
91 if (!is_var_) return nu_(i); // can help here ;)
92
93 int element;
94 double d_visco_lam = 0;
95 if ((element=face_voisins(i,0)) != -1) d_visco_lam += diffusivite_->valeurs()(element);
96 if ((element=face_voisins(i,1)) != -1) d_visco_lam += diffusivite_->valeurs()(element);
97 if ((element=face_voisins(j,0)) != -1) d_visco_lam += diffusivite_->valeurs()(element);
98 if ((element=face_voisins(j,1)) != -1) d_visco_lam += diffusivite_->valeurs()(element); // XXX : BUG FIXED HERE
99
100 d_visco_lam /= 3.0;
101 return d_visco_lam;
102}
103
104#endif /* Op_Dift_VDF_Face_leaves_included */
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Class Champ_Inc_base.
Champ_Uniforme Represents a field that is constant in space and time.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Base class for the turbulence model hierarchy for Navier-Stokes equations.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
void associer_diffusivite_impl(const Champ_base &ch_diff)
std::enable_if_t< _TYPE_==Type_Operateur::Op_DIFF_ELEM||_TYPE_==Type_Operateur::Op_DIFT_ELEM||_TYPE_==Type_Operateur::Op_DIFT_MULTIPHASE_ELEM, void > associer_impl(const Domaine_dis_base &domaine_dis, const Domaine_Cl_dis_base &domaine_cl_dis, const Champ_Inc_base &ch_diffuse)
const Champ_base & diffusivite_impl() const
void associer_pb(const Probleme_base &pb)
std::enable_if_t< _TYPE_==Type_Operateur::Op_DIFT_ELEM||_TYPE_==Type_Operateur::Op_DIFT_FACE, void > associer_diffusivite_turbulente_impl(const Champ_Fonc_base &visc_ou_diff_turb)
std::enable_if_t< _TYPE_==Type_Operateur::Op_DIFT_ELEM, void > completer_impl()
double nu_mean_4_pts_(const int i, const int j, const int k, const int l) const override
double nu_(const int i) const override
void mettre_a_jour_var(double t) const override
bool is_var() const override
void associer_diffusivite(const Champ_base &diffu) override
double nu_mean_2_pts_(const int i, const int j) const override
OBS_PTR(Champ_base) diffusivite_
double nu_mean_4_pts_(const int, const int) const override
const Champ_base & diffusivite() const override
Op_Dift_VDF_Face_base(const Iterateur_VDF_base &iter_base)
void associer_diffusivite_turbulente(const Champ_Fonc_base &ch)
void associer(const Domaine_dis_base &zd, const Domaine_Cl_dis_base &zcd, const Champ_Inc_base &ch) override
const Champ_base & diffusivite() const override
void associer_diffusivite(const Champ_base &ch) override
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.