53 const int idir = (int)_DIR_;
54 const int icompo = (int)_VCOMPO_;
56 const int global_k_layer = k_layer +
channel_data_.offset_to_global_k_layer();
59 const int first_global_k_layer =
channel_data_.first_global_k_layer_flux(icompo, idir);
60 const int last_global_k_layer =
channel_data_.last_global_k_layer_flux(icompo, idir);
68 if(_DIR_ == DIRECTION::Z && _VCOMPO_ != DIRECTION::Z)
70 int top_wall = 0, bottom_wall = 0;
72 if (global_k_layer == first_global_k_layer-1)
74 bc_type = ref_bc_->get_bctype_k_min();
77 if (global_k_layer == last_global_k_layer + 1)
79 bc_type = ref_bc_->get_bctype_k_max();
83 if(bottom_wall || top_wall)
104 Cerr <<
"Operateur_IJK_faces_diff_base_double::compute_flux_ wrong boundary condition." << finl;
111 if (global_k_layer < first_global_k_layer || global_k_layer > last_global_k_layer)
126 const IJK_Field_local_double& vCOMPO =
get_v(_VCOMPO_);
127 const IJK_Field_local_double& vDIR =
get_v(_DIR_);
129 const int idir = (int)_DIR_;
130 const int nx = _DIR_ == DIRECTION::X ? vCOMPO.
ni() + 1 : vCOMPO.
ni() ;
131 const int ny = _DIR_ == DIRECTION::Y ? vCOMPO.
nj() + 1 : vCOMPO.
nj();
132 const int icompo = (int)_VCOMPO_;
134 const double surface = -
channel_data_.get_surface(k_layer, icompo, idir);
135 const double inv_distance_COMPO =
channel_data_.inv_distance_for_gradient(k_layer, idir, icompo);
136 const double inv_distance_DIR =
channel_data_.inv_distance_for_gradient(k_layer, icompo, idir);
139 ConstIJK_double_ptr vCOMPO_ptr(vCOMPO, 0, 0, k_layer);
140 ConstIJK_double_ptr vDIR_ptr(vDIR, 0, 0, k_layer);
142 const IJK_Field_local_double& dummy_field = vCOMPO;
158 ConstIJK_double_ptr turbulent_nu (
is_turb_ ?
get_nu() : dummy_field, 0, 0, k_layer);
159 ConstIJK_double_ptr turbulent_k_energy(
is_turb_ ?
get_nu() : dummy_field, 0, 0, k_layer );
163 IJK_double_ptr resu_ptr(resu, 0, 0, 0);
168 for (
int j = 0; ; j++)
170 for (
int i = 0; i < imax; i += vsize)
172 Simd_double flux = 0.;
173 if(_DIR_ == _VCOMPO_)
176 vCOMPO_ptr, vDIR_ptr,
177 molecular_nu, div_ptr,
178 turbulent_nu, turbulent_k_energy,
179 structural_model, flux);
184 top_wall, bottom_wall,
185 vCOMPO_ptr, vDIR_ptr,
186 molecular_nu, div_ptr,
187 turbulent_nu, turbulent_k_energy,
188 structural_model, flux);
199 if(_DIR_ != _VCOMPO_)
206 turbulent_k_energy.
next_j();
211 structural_model.
next_j();
220 const ConstIJK_double_ptr& vCOMPO_ptr,
const ConstIJK_double_ptr& vDIR_ptr,
221 const ConstIJK_double_ptr& molecular_nu,
const ConstIJK_double_ptr& div_ptr,
222 const ConstIJK_double_ptr& turbulent_nu,
const ConstIJK_double_ptr& turbulent_k_energy,
223 const ConstIJK_double_ptr& structural_model, Simd_double& flux )
227 Simd_double s_mo, s_mo_dummy;
229 flux = s_mo * surface;
234 Simd_double m_nu, m_nu_dummy;
239 Simd_double tau = (v2 - v1);
242 Simd_double minus_reyn = 0.;
245 Simd_double t_nu, t_nu_dummy;
247 minus_reyn = t_nu * tau * (2.);
251 Simd_double k, k_dummy;
254 minus_reyn += (-0.66666666666666666) * k;
257 Simd_double zeroVec = 0.;
258 minus_reyn = SimdMin(minus_reyn, zeroVec);
261 flux = (minus_reyn + m_nu * tau) * surface;
268 Simd_double v5, v6_dummy;
270 flux -= m_nu * surface * 0.66666666666666666 * v5;
279 const ConstIJK_double_ptr& vCOMPO_ptr,
const ConstIJK_double_ptr& vDIR_ptr,
280 const ConstIJK_double_ptr& molecular_nu,
const ConstIJK_double_ptr& div_ptr,
281 const ConstIJK_double_ptr& turbulent_nu,
const ConstIJK_double_ptr& turbulent_k_energy,
282 const ConstIJK_double_ptr& structural_model, Simd_double& flux )
287 Simd_double s_mo, s_mo_dummy;
293 flux = s_mo * surface;
301 Simd_double m_nu1, m_nu2, m_nu3, m_nu4;
303 double mult_coeff = 0.25;
313 m_nu1 = 1., m_nu2 = -1.;
317 m_nu1 = 0., m_nu2 = 0.;
328 m_nu3 = 1., m_nu4 = -1.;
332 m_nu3 = 0., m_nu4 = 0.;
342 m_nu = (1/mult_coeff)/(1./m_nu1 + 1./m_nu2 + 1./m_nu3 + 1./m_nu4) ;
346 m_nu = (m_nu1 + m_nu2 + m_nu3 + m_nu4) * mult_coeff;
355 if(_VCOMPO_ == DIRECTION::X)
357 v4 = ref_bc_->get_vx_kmax();
366 if(_VCOMPO_ == DIRECTION::X)
368 v3 = ref_bc_->get_vx_kmin();
377 Simd_double tau = (v4 - v3);
379 tau *= inv_distance_DIR;
381 Simd_double tau_tr = 0.;
385 if(!bottom_wall && !top_wall)
391 tau_tr *= inv_distance_COMPO;
395 Simd_double reyn = 0.;
398 Simd_double t_nu1, t_nu2, t_nu3, t_nu4;
404 t_nu1 = 0., t_nu2 = 0.;
409 t_nu3 = 0., t_nu4 = 0.;
412 Simd_double t_nu = (t_nu1 + t_nu2 + t_nu3 + t_nu4) * mult_coeff;
414 if(!bottom_wall && !top_wall)
418 tau_tr = (v2 - v1) * inv_distance_COMPO;
420 reyn = (tau + tau_tr) * t_nu;
423 flux = (m_nu * (tau+tau_tr) + reyn) * surface;
void get_left_center_c1c2(DIRECTION _COMPO1_, DIRECTION _COMPO2_, int i_offset, Simd_template< _TYPE_ > &leftc1_leftc2, Simd_template< _TYPE_ > &leftc1_centerc2, Simd_template< _TYPE_ > ¢erc1_leftc2, Simd_template< _TYPE_ > ¢erc1_centerc2) const
void get_left_center(DIRECTION _DIR_, int i_offset, _TYPE_ &left, _TYPE_ ¢er) const
returns left=field(i+i_offset-1, j, k) and center=field(i+i_offset, j, k)
void put_val(int i_offset, const _TYPE_ &val)
Performs the assignment: field(i+i_offset,j,k) = val.
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)