TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_IJK_faces_diff_base.h
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#ifndef Operateur_IJK_faces_diff_base_included
17#define Operateur_IJK_faces_diff_base_included
18#include <Operateur_IJK_base.h>
19#include <Boundary_Conditions.h>
20
21/*
22 * Options for CASE
23 *
24 * Yes_Turb: the flux is turbulent_mu * (grad u + grad^T u) - 2/3 * k + molecular_mu * grad u)'
25 * Yes_M_Grad: the flux is 'molecular_mu * grad u'
26 * Yes_M_Trans: the flux is 'molecular_mu * (grad u + grad^T u)'
27 * Yes_M_Div: the flux is 'molecular_mu * (grad u + grad^T u - 2/3 * div u * Id)'
28 * Yes_M_GradAnisotropic: the flux is 'molecular_mu^a * grad^a u' where (grad^a)_i = Delta_i (grad)_i
29 * Yes_M_TransAnisotropic: the flux is 'molecular_mu^a * (grad^a u + grad^a^T u)' where (grad^a)_i = Delta_i (grad)_i
30 * Yes_M_DivAnisotropic: the flux is 'molecular_mu^a * (grad^a u + grad^a^T u - 2/3 * div^a u * Id)' where (grad^a)_i = Delta_i (grad)_i
31 * Yes_M_GradTensorial: the flux is 'molecular_mu_tensor * grad u'
32 * Yes_M_TransTensorial: the flux is 'molecular_mu_tensor * (grad u + grad^T u)'
33 * Yes_M_DivTensorial: the flux is 'molecular_mu_tensor * (grad u + grad^T u - 2/3 * div u * Id)'
34 * Yes_M_GradTensorialAnisotropic: the flux is 'molecular_mu_tensor^a * grad^a u' where (grad^a)_i = Delta_i (grad)_i
35 * Yes_M_TransTensorialAnisotropic: the flux is 'molecular_mu_tensor^a * (grad^a u + grad^a^T u)' where (grad^a)_i = Delta_i (grad)_i
36 * Yes_M_DivTensorialAnisotropic: the flux is 'molecular_mu_tensor^a * (grad^a u + grad^a^T u - 2/3 * div^a u * Id)' where (grad^a)_i = Delta_i (grad)_i
37 * Yes_M_Struct: the flux is 'structural_model'
38 */
40{
41 Declare_base_sans_constructeur(Operateur_IJK_faces_diff_base_double);
42
43public:
45
46 inline virtual void initialize(const Domaine_IJK& splitting, const int harmonic_nu = 0)
47 {
48 perio_k_= splitting.get_periodic_flag(DIRECTION_K);
49 channel_data_.initialize(splitting);
50 harmonic_nu_=harmonic_nu;
51 }
52
53 inline void set_bc(const Boundary_Conditions& bc) { ref_bc_ = bc; };
54
55 void ajouter(const IJK_Field_double& vx, const IJK_Field_double& vy, const IJK_Field_double& vz,
56 IJK_Field_double& dvx, IJK_Field_double& dvy, IJK_Field_double& dvz);
57
58 void calculer(const IJK_Field_double& vx, const IJK_Field_double& vy, const IJK_Field_double& vz,
59 IJK_Field_double& dvx, IJK_Field_double& dvy, IJK_Field_double& dvz);
60
61 inline void compute_flux_x_vx(IJK_Field_local_double& resu, const int k_layer) override
62 {
64 }
65 inline void compute_flux_x_vy(IJK_Field_local_double& resu, const int k_layer) override
66 {
68 }
69 inline void compute_flux_x_vz(IJK_Field_local_double& resu, const int k_layer) override
70 {
72 }
73 inline void compute_flux_y_vx(IJK_Field_local_double& resu, const int k_layer) override
74 {
76 }
77 inline void compute_flux_y_vy(IJK_Field_local_double& resu, const int k_layer) override
78 {
80 }
81 inline void compute_flux_y_vz(IJK_Field_local_double& resu, const int k_layer) override
82 {
84 }
85 inline void compute_flux_z_vx(IJK_Field_local_double& resu, const int k_layer) override
86 {
88 }
89 inline void compute_flux_z_vy(IJK_Field_local_double& resu, const int k_layer) override
90 {
92 }
93 inline void compute_flux_z_vz(IJK_Field_local_double& resu, const int k_layer) override
94 {
96 }
97
98 void set_coeff_x_y_z(const IJK_Field_double& coeff_tensor_xx,
99 const IJK_Field_double& coeff_tensor_xy,
100 const IJK_Field_double& coeff_tensor_xz,
101 const IJK_Field_double& coeff_tensor_yx,
102 const IJK_Field_double& coeff_tensor_yy,
103 const IJK_Field_double& coeff_tensor_yz,
104 const IJK_Field_double& coeff_tensor_zx,
105 const IJK_Field_double& coeff_tensor_zy,
106 const IJK_Field_double& coeff_tensor_zz);
107 inline void set_uniform_nu(const double& uniform_nu) { uniform_nu_ = &uniform_nu; };
108 inline void set_nu(const IJK_Field_local_double& nu) { nu_ = &nu; };
109 inline void set_divergence(const IJK_Field_local_double& divergence) { divergence_ = &divergence; };
110
111 const IJK_Field_local_double& get_v(DIRECTION _DIR_);
112 const IJK_Field_local_double& get_nu();
113 const double& get_uniform_nu();
114 const IJK_Field_local_double& get_divergence();
115 const IJK_Field_local_double& get_coeff_tensor(DIRECTION _COMPO1_, DIRECTION _COMPO2_);
116
117protected:
118
119 /*
120 * Function cannot be virtual as it is a template... (MG)
121 */
122 template <DIRECTION _DIR_, DIRECTION _VCOMPO_>
123 inline void compute_flux_(IJK_Field_local_double& resu, const int k_layer);
124
125 template <DIRECTION _DIR_, DIRECTION _VCOMPO_>
126 inline void flux_loop_(IJK_Field_local_double& resu, int k_layer, int top_wall = 0, int bottom_wall = 0);
127
128 template <DIRECTION _DIR_, DIRECTION _VCOMPO_>
129 inline void flux_loop_same_dir_compo_(int i, double surface, double inv_distance_DIR, double inv_distance_COMPO,
130 const ConstIJK_double_ptr& vCOMPO_ptr, const ConstIJK_double_ptr& vDIR_ptr,
131 const ConstIJK_double_ptr& molecular_nu, const ConstIJK_double_ptr& div_ptr,
132 const ConstIJK_double_ptr& turbulent_nu, const ConstIJK_double_ptr& turbulent_k_energy,
133 const ConstIJK_double_ptr& structural_model, Simd_double& flux);
134
135 template<DIRECTION _DIR_, DIRECTION _VCOMPO_>
136 inline void flux_loop_different_dir_compo_(int i, double surface, double inv_distance_DIR, double inv_distance_COMPO,
137 int top_wall, int bottom_wall,
138 const ConstIJK_double_ptr& vCOMPO_ptr, const ConstIJK_double_ptr& vDIR_ptr,
139 const ConstIJK_double_ptr& molecular_nu, const ConstIJK_double_ptr& div_ptr,
140 const ConstIJK_double_ptr& turbulent_nu, const ConstIJK_double_ptr& turbulent_k_energy,
141 const ConstIJK_double_ptr& structural_model, Simd_double& flux);
142
145 bool perio_k_ ;
146
147 // Pointers to input data (velocity at faces, diffustion coeffs at elements)
148 const IJK_Field_local_double *vx_;
149 const IJK_Field_local_double *vy_;
150 const IJK_Field_local_double *vz_;
151
152 const double *uniform_nu_;
153 const IJK_Field_local_double *nu_;
154 const IJK_Field_local_double *divergence_;
155
156 const IJK_Field_local_double *coeff_tensor_xx_;
157 const IJK_Field_local_double *coeff_tensor_xy_;
158 const IJK_Field_local_double *coeff_tensor_xz_;
159 const IJK_Field_local_double *coeff_tensor_yx_;
160 const IJK_Field_local_double *coeff_tensor_yy_;
161 const IJK_Field_local_double *coeff_tensor_yz_;
162 const IJK_Field_local_double *coeff_tensor_zx_;
163 const IJK_Field_local_double *coeff_tensor_zy_;
164 const IJK_Field_local_double *coeff_tensor_zz_;
165
174
175};
176
178{
179 Declare_instanciable_sans_constructeur(OpDiffIJK_double);
180public:
182};
183
185{
186 Declare_instanciable_sans_constructeur(OpDiffTurbIJK_double);
187public:
189};
190
197
204
211
218
225
226//FixMe:: for zeroAtWall, where to put the zero and when???
233
240
247
248
255
262
269
276
277#include <Operateur_IJK_faces_diff_base.tpp>
278
279#endif /* Operateur_IJK_faces_diff_base_included */
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
bool get_periodic_flag(int direction) const
Method returns true if periodic in this direction.
void set_nu(const IJK_Field_local_double &nu)
void compute_flux_y_vx(IJK_Field_local_double &resu, const int k_layer) override
void compute_flux_z_vy(IJK_Field_local_double &resu, const int k_layer) override
void ajouter(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, IJK_Field_double &dvx, IJK_Field_double &dvy, IJK_Field_double &dvz)
const IJK_Field_local_double & get_v(DIRECTION _DIR_)
void compute_flux_z_vz(IJK_Field_local_double &resu, const int k_layer) override
void set_divergence(const IJK_Field_local_double &divergence)
void compute_flux_x_vz(IJK_Field_local_double &resu, const int k_layer) override
void set_bc(const Boundary_Conditions &bc)
void set_coeff_x_y_z(const IJK_Field_double &coeff_tensor_xx, const IJK_Field_double &coeff_tensor_xy, const IJK_Field_double &coeff_tensor_xz, const IJK_Field_double &coeff_tensor_yx, const IJK_Field_double &coeff_tensor_yy, const IJK_Field_double &coeff_tensor_yz, const IJK_Field_double &coeff_tensor_zx, const IJK_Field_double &coeff_tensor_zy, const IJK_Field_double &coeff_tensor_zz)
void flux_loop_(IJK_Field_local_double &resu, int k_layer, int top_wall=0, int bottom_wall=0)
void compute_flux_x_vx(IJK_Field_local_double &resu, const int k_layer) override
void compute_flux_y_vz(IJK_Field_local_double &resu, const int k_layer) override
void compute_flux_y_vy(IJK_Field_local_double &resu, const int k_layer) override
void flux_loop_different_dir_compo_(int i, double surface, double inv_distance_DIR, double inv_distance_COMPO, int top_wall, int bottom_wall, const ConstIJK_double_ptr &vCOMPO_ptr, const ConstIJK_double_ptr &vDIR_ptr, const ConstIJK_double_ptr &molecular_nu, const ConstIJK_double_ptr &div_ptr, const ConstIJK_double_ptr &turbulent_nu, const ConstIJK_double_ptr &turbulent_k_energy, const ConstIJK_double_ptr &structural_model, Simd_double &flux)
void flux_loop_same_dir_compo_(int i, double surface, double inv_distance_DIR, double inv_distance_COMPO, const ConstIJK_double_ptr &vCOMPO_ptr, const ConstIJK_double_ptr &vDIR_ptr, const ConstIJK_double_ptr &molecular_nu, const ConstIJK_double_ptr &div_ptr, const ConstIJK_double_ptr &turbulent_nu, const ConstIJK_double_ptr &turbulent_k_energy, const ConstIJK_double_ptr &structural_model, Simd_double &flux)
void compute_flux_x_vy(IJK_Field_local_double &resu, const int k_layer) override
virtual void initialize(const Domaine_IJK &splitting, const int harmonic_nu=0)
void compute_flux_z_vx(IJK_Field_local_double &resu, const int k_layer) override
void calculer(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, IJK_Field_double &dvx, IJK_Field_double &dvy, IJK_Field_double &dvz)
const IJK_Field_local_double & get_coeff_tensor(DIRECTION _COMPO1_, DIRECTION _COMPO2_)
OBS_PTR(Boundary_Conditions) ref_bc_
void compute_flux_(IJK_Field_local_double &resu, const int k_layer)
compute fluxes in direction DIR for velocity component COMPO for the layer of fluxes k_layer