TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_IJK_elem_conv_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_elem_conv_base_included
17#define Operateur_IJK_elem_conv_base_included
18
19#include <Domaine_IJK.h>
20#include <IJK_Field_vector.h>
21#include <Operateur_IJK_base.h>
22#include <Cut_cell_FT_Disc.h>
23#include <Cut_cell_convection_auxiliaire.h>
24#include <Corrige_flux_FT_base.h>
25#include <TRUST_Deriv.h>
26
28{
30public:
31 void initialize(const Domaine_IJK& splitting) override;
32 virtual void set_indicatrice(const IJK_Field_double& indicatrice) { indicatrice_= &indicatrice; };
33 virtual void set_corrige_flux(OWN_PTR(Corrige_flux_FT_base)& corrige_flux) { corrige_flux_ = &corrige_flux; };
34 virtual void set_velocity_frame_of_reference(const Vecteur3& velocity_frame_of_reference) { velocity_frame_of_reference_ = velocity_frame_of_reference; };
35 virtual void calculer(const IJK_Field_double& field,
36 const IJK_Field_double& vx,
37 const IJK_Field_double& vy,
38 const IJK_Field_double& vz,
39 IJK_Field_double& result);
40
41 virtual void ajouter(const IJK_Field_double& field,
42 const IJK_Field_double& vx,
43 const IJK_Field_double& vy,
44 const IJK_Field_double& vz,
45 IJK_Field_double& result);
46
47protected:
48
49 void compute_curv_fram(DIRECTION _DIR_, int k_layer);
50 void shift_curv_fram(IJK_Field_local_double& tmp_curv_fram);
51 inline const IJK_Field_double& get_input_velocity(DIRECTION _DIR_)
52 {
53 switch(_DIR_)
54 {
55 case DIRECTION::X:
56 return *input_velocity_x_;
57 case DIRECTION::Y:
58 return *input_velocity_y_;
59 case DIRECTION::Z:
60 return *input_velocity_z_;
61 default:
62 Cerr << "Error in OpConvDiscIJKQuickScalar::get_input_velocity: wrong direction..." << finl;
64 }
65 //for compilation only...
66 return *input_velocity_x_;
67 }
68
70
71 // Pointers to input data (set by calculer, used by compute_flux_...)
72 const IJK_Field_double *input_field_;
73
74 const IJK_Field_double *input_velocity_x_;
75 const IJK_Field_double *input_velocity_y_;
76 const IJK_Field_double *input_velocity_z_;
78
79 // Temporary array to store curvature and fram coefficients
80 // for the current computed flux.
81 // layer k=0 and k=1 are used for "curv", k=2 and k=3 are used for "fram".
82 // layer k=0 and k=2 store the previous values computed in direction "k" (which is used 2 times)
83 IJK_Field_local_double tmp_curv_fram_;
84 int stored_curv_fram_layer_z_; // which (local) layer is currently stored in layer 0 of the tmp array ?
85
87 const IJK_Field_local_double *indicatrice_;
88
93 IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed_ = nullptr;
94
95private:
96
97 void compute_curv_fram_loop_(DIRECTION _DIR_, int iter, double factor12, double factor01, const ConstIJK_double_ptr& input_field, IJK_double_ptr& curv_values, IJK_double_ptr& fram_values );
98
99};
100
101inline Simd_double operator/(const Simd_double& x, const Simd_double& y)
102{
103 return SimdDivideMed(x, y);
104}
105
106#endif
: class Corrige_flux_FT API pour modifier un champ de flux à partir de donnees à l'interface....
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
const IJK_Field_double & get_input_velocity(DIRECTION _DIR_)
virtual void set_velocity_frame_of_reference(const Vecteur3 &velocity_frame_of_reference)
IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed_
virtual void ajouter(const IJK_Field_double &field, const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, IJK_Field_double &result)
void initialize(const Domaine_IJK &splitting) override
virtual void set_corrige_flux(OWN_PTR(Corrige_flux_FT_base)&corrige_flux)
void compute_curv_fram(DIRECTION _DIR_, int k_layer)
OWN_PTR(Corrige_flux_FT_base) *corrige_flux_
void shift_curv_fram(IJK_Field_local_double &tmp_curv_fram)
virtual void set_indicatrice(const IJK_Field_double &indicatrice)
virtual void calculer(const IJK_Field_double &field, const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, IJK_Field_double &result)
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455