TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Corrige_flux_FT_base.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 Corrige_flux_FT_base_included
17#define Corrige_flux_FT_base_included
18
19#include <MonofluidVar.h>
20#include <IJK_Field_vector.h>
21#include <Boundary_Conditions_Thermique.h>
22#include <Domaine_IJK.h>
23#include <Objet_U.h>
24#include <Parser.h>
25#include <IJK_Interfaces.h>
26#include <IJK_Lata_writer.h>
27#include <Intersection_Interface_ijk.h>
28#include <Ouvrir_fichier.h>
29#include <TRUST_Ref.h>
30#include <ParcoursIJKDir.h>
31#include <IJK_One_Dimensional_Subproblems.h>
32
34
35/*! @brief : class Corrige_flux_FT
36 * API pour modifier un champ de flux à partir de donnees à l'interface. Cette
37 * classe est abstraite, elle est vouée à être héritée pour être adaptée aux
38 * différents cas / conditions aux limites. Par ex sur la température pour
39 * imposer la continuité de lda grad T à l'interface. Mais ça pourrait être
40 * pareil pour la vitesse pour imposer la continuité tangentielle et normale
41 * dans le cas sans changement de phase, ou pour imposer la bonne différence de
42 * vitesse normale dans le cas du changement de phase.
43 */
44
46{
47 Declare_base( Corrige_flux_FT_base ) ;
48public:
49 virtual void initialize(const Domaine_IJK& dom,
50 const IJK_Field_double& field,
51 const IJK_Interfaces& interfaces,
52 const Probleme_FTD_IJK_base& ijk_ft,
53 Intersection_Interface_ijk_face& intersection_ijk_face,
54 Intersection_Interface_ijk_cell& intersection_ijk_cell);
55
56 virtual void initialize_with_subproblems(const Domaine_IJK& splitting,
57 const IJK_Field_double& field,
58 const IJK_Interfaces& interfaces,
59 const Probleme_FTD_IJK_base& ijk_ft,
60 Intersection_Interface_ijk_face& intersection_ijk_face,
61 Intersection_Interface_ijk_cell& intersection_ijk_cell,
62 IJK_One_Dimensional_Subproblems& thermal_local_subproblems);
63
64 virtual void set_fluxes_feedback_params(const int discrete_integral, const int levels) { ; };
65
66 void set_physical_parameters(const double rhocpl,
67 const double rhocpv,
68 const double ldal,
69 const double ldav);
70
71 virtual void set_convection_diffusion_correction(const int& convective_flux_correction, const int& diffusive_flux_correction) { ; };
72 /*
73 * On va calculer sur la grille IJ du layer k_layer tous les flux a proximite de
74 * l'interface. On remplace les flux donnes en entree par ces flux la.
75 */
76 virtual void corrige_flux_faceIJ(IJK_Field_local_double *const flux,
77 const int k_layer, const int dir)=0;
78
79 virtual void corrige_flux_diff_faceIJ(IJK_Field_local_double *const flux,
80 const int k_layer, const int dir) { ; };
81
82 virtual void correct_flux_spherical(Simd_double& a,
83 Simd_double& b,
84 const int& i,
85 const int& j,
86 const int& k_layer,
87 const int dir) { ; };
88
89 virtual void update_intersections() { ; };
90 virtual void update()=0;
91
92 virtual void calcul_temperature_flux_interface(const IJK_Field_double& temperature, const double ldal, const double ldav,
93 const double dist, const DoubleTab& positions, const DoubleTab& normale,
94 ArrOfDouble& temperature_interp, ArrOfDouble& flux_normal_interp,
95 ArrOfDouble& temp_liqu, ArrOfDouble& temp_vap, DoubleTab& coo_liqu,
96 DoubleTab& coo_vap) const = 0 ;
97
98
99 virtual void compute_temperature_cell_centre(IJK_Field_double& temperature) const { ; };
100 virtual void set_zero_temperature_increment(IJK_Field_double& d_temperature) const { ; };
101
102 virtual void compute_thermal_convective_fluxes(const int& last_flux) { ; };
103 virtual void compute_thermal_diffusive_fluxes(const int& last_flux) { ; };
104 virtual void complete_thermal_fluxes_face_centre(const int& fluxes_correction_conservations) { ; };
105
106 virtual void set_convection_negligible(const int& convection_negligible) { ; };
107 virtual void set_diffusion_negligible(const int& diffusion_negligible) { ; };
108 virtual void clean() { ; };
109 virtual void compute_ijk_pure_faces_indices() { ; };
111
112 virtual void set_debug(const int& debug) { ; };
113 virtual void set_distance_cell_faces_from_lrs(const int& distance_cell_faces_from_lrs) { ; };
114 virtual void set_correction_cell_neighbours(const int& correct_temperature_cell_neighbours,
115 const int& neighbours_colinearity_weighting,
116 const int& keep_max_flux_correction,
117 const int& smooth_temperature_field) { ; };
118 virtual void set_cell_faces_neighbours_corrected_bool(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool) { ; };
119 virtual void set_eulerian_normal_vectors_ns_normed(const IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed) { ; };
120
121 virtual void set_correction_cell_faces_neighbours(const int& find_cell_neighbours_for_fluxes_spherical_correction,
122 const int& use_cell_neighbours_for_fluxes_spherical_correction,
123 const int& find_reachable_fluxes,
124 const int& use_reachable_fluxes,
125 const int& keep_first_reachable_fluxes,
126 const int& store_flux_operators_for_energy_balance) { ; };
128 virtual void compute_cell_neighbours_faces_indices_for_spherical_correction(const int& n_iter_distance) { ; };
129 virtual void compute_cell_neighbours_faces_indices_to_correct(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool,
130 IJK_Field_vector3_double& cell_faces_neighbours_corrected_velocity_temperature,
131 IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective,
132 IJK_Field_vector3_double& cell_faces_neighbours_corrected_diffusive,
133 IJK_Field_vector3_double& neighbours_weighting_colinearity) { ; };
134 virtual void compute_temperature_cell_centre_neighbours(IJK_Field_double& temperature_neighbours,
135 IJK_Field_int& neighbours_weighting,
136 IJK_Field_double& neighbours_weighting_colinearity) { ; };
137 virtual void replace_temperature_cell_centre_neighbours(IJK_Field_double& temperature,
138 IJK_Field_double& temperature_neighbours,
139 IJK_Field_int& neighbours_weighting,
140 IJK_Field_double& neighbours_weighting_colinearity) const { ; };
141
142 virtual void store_cell_faces_corrected(IJK_Field_vector3_int& cell_faces_corrected_bool,
143 IJK_Field_vector3_double& cell_faces_corrected_convective,
144 IJK_Field_vector3_double& cell_faces_corrected_diffusive) { ; };
145 virtual void clear_vectors() { ; };
146 virtual void compute_min_max_ijk_reachable_fluxes(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
147 const IJK_Field_int& neighbours_temperature_to_correct,
148 IJK_Field_vector3_int& cell_faces_neighbours_corrected_min_max_bool,
149 const int& max_flux_per_dir,
150 const int& check_cell_center_neighbour,
151 const int& remove_external_neighbour_values,
152 IJK_Field_int& neighbours_temperature_to_correct_trimmed) { ; };
153 virtual void compute_min_max_ijk_any_reachable_fluxes(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
154 const IJK_Field_int& neighbours_temperature_to_correct,
155 IJK_Field_vector3_int& cell_faces_neighbours_corrected_min_max_bool,
156 const int& max_flux_per_dir,
157 const int& check_cell_center_neighbour,
158 const int& remove_external_neighbour_values,
159 IJK_Field_int& neighbours_temperature_to_correct_trimmed) { ; };
160 virtual void replace_cell_neighbours_thermal_convective_diffusive_fluxes_faces(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_min_max_bool,
161 const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
162 const IJK_Field_vector3_double& cell_faces_neighbours_fluxes_corrected,
163 const int& fluxes_type) { ; };
164
165 virtual void set_temperature_fluxes_periodic_sharing_strategy_on_processors(const int& copy_fluxes_on_every_procs,
166 const int& copy_temperature_on_every_procs) { ; };
167
168protected:
172 const IJK_Field_double *field_ = nullptr;
173
174
175 double rhocp_l_= 0.;
176 double rhocp_v_ = 0.;
177 double lda_l_ = 0.;
178 double lda_v_ = 0.;
179
182 /*
183 * TODO: mettre ces méthodes dans une petite classe pour parcourir
184 * les trois directions.
185 */
189};
190
191#endif /* Corrige_flux_FT_base_included */
: class Corrige_flux_FT API pour modifier un champ de flux à partir de donnees à l'interface....
Intersection_Interface_ijk_cell * intersection_ijk_cell_
virtual void initialize_with_subproblems(const Domaine_IJK &splitting, const IJK_Field_double &field, const IJK_Interfaces &interfaces, const Probleme_FTD_IJK_base &ijk_ft, Intersection_Interface_ijk_face &intersection_ijk_face, Intersection_Interface_ijk_cell &intersection_ijk_cell, IJK_One_Dimensional_Subproblems &thermal_local_subproblems)
virtual void set_distance_cell_faces_from_lrs(const int &distance_cell_faces_from_lrs)
virtual void set_convection_diffusion_correction(const int &convective_flux_correction, const int &diffusive_flux_correction)
virtual void compute_temperature_cell_centre(IJK_Field_double &temperature) const
bool test_if_stencil_inclut_bout_interface_vapeur() const
virtual void replace_cell_neighbours_thermal_convective_diffusive_fluxes_faces(const IJK_Field_vector3_int &cell_faces_neighbours_corrected_min_max_bool, const IJK_Field_vector3_int &cell_faces_neighbours_corrected_all_bool, const IJK_Field_vector3_double &cell_faces_neighbours_fluxes_corrected, const int &fluxes_type)
virtual void corrige_flux_diff_faceIJ(IJK_Field_local_double *const flux, const int k_layer, const int dir)
virtual void complete_thermal_fluxes_face_centre(const int &fluxes_correction_conservations)
virtual void set_convection_negligible(const int &convection_negligible)
bool test_if_stencil_inclut_bout_interface_liquide() const
OBS_PTR(IJK_Interfaces) interfaces_
virtual void set_zero_temperature_increment(IJK_Field_double &d_temperature) const
virtual void set_eulerian_normal_vectors_ns_normed(const IJK_Field_vector3_double *eulerian_normal_vectors_ns_normed)
virtual void set_correction_cell_faces_neighbours(const int &find_cell_neighbours_for_fluxes_spherical_correction, const int &use_cell_neighbours_for_fluxes_spherical_correction, const int &find_reachable_fluxes, const int &use_reachable_fluxes, const int &keep_first_reachable_fluxes, const int &store_flux_operators_for_energy_balance)
virtual void compute_min_max_ijk_any_reachable_fluxes(const IJK_Field_vector3_int &cell_faces_neighbours_corrected_all_bool, const IJK_Field_int &neighbours_temperature_to_correct, IJK_Field_vector3_int &cell_faces_neighbours_corrected_min_max_bool, const int &max_flux_per_dir, const int &check_cell_center_neighbour, const int &remove_external_neighbour_values, IJK_Field_int &neighbours_temperature_to_correct_trimmed)
virtual void set_temperature_fluxes_periodic_sharing_strategy_on_processors(const int &copy_fluxes_on_every_procs, const int &copy_temperature_on_every_procs)
virtual void store_cell_faces_corrected(IJK_Field_vector3_int &cell_faces_corrected_bool, IJK_Field_vector3_double &cell_faces_corrected_convective, IJK_Field_vector3_double &cell_faces_corrected_diffusive)
virtual void set_correction_cell_neighbours(const int &correct_temperature_cell_neighbours, const int &neighbours_colinearity_weighting, const int &keep_max_flux_correction, const int &smooth_temperature_field)
virtual void compute_cell_neighbours_faces_indices_for_spherical_correction(const int &n_iter_distance)
virtual void calcul_temperature_flux_interface(const IJK_Field_double &temperature, const double ldal, const double ldav, const double dist, const DoubleTab &positions, const DoubleTab &normale, ArrOfDouble &temperature_interp, ArrOfDouble &flux_normal_interp, ArrOfDouble &temp_liqu, ArrOfDouble &temp_vap, DoubleTab &coo_liqu, DoubleTab &coo_vap) const =0
OBS_PTR(Probleme_FTD_IJK_base) ref_ijk_ft_
OBS_PTR(Domaine_IJK) domaine_
Intersection_Interface_ijk_face * intersection_ijk_face_
virtual void compute_thermal_diffusive_fluxes(const int &last_flux)
virtual void update_intersections()
virtual void correct_flux_spherical(Simd_double &a, Simd_double &b, const int &i, const int &j, const int &k_layer, const int dir)
virtual void compute_ijk_pure_faces_indices()
virtual void compute_thermal_convective_fluxes(const int &last_flux)
virtual void initialize(const Domaine_IJK &dom, const IJK_Field_double &field, const IJK_Interfaces &interfaces, const Probleme_FTD_IJK_base &ijk_ft, Intersection_Interface_ijk_face &intersection_ijk_face, Intersection_Interface_ijk_cell &intersection_ijk_cell)
virtual void initialise_cell_neighbours_indices_to_correct()
virtual void set_debug(const int &debug)
virtual void set_cell_faces_neighbours_corrected_bool(IJK_Field_vector3_int &cell_faces_neighbours_corrected_bool)
virtual void compute_cell_neighbours_faces_indices_to_correct(IJK_Field_vector3_int &cell_faces_neighbours_corrected_bool, IJK_Field_vector3_double &cell_faces_neighbours_corrected_velocity_temperature, IJK_Field_vector3_double &cell_faces_neighbours_corrected_convective, IJK_Field_vector3_double &cell_faces_neighbours_corrected_diffusive, IJK_Field_vector3_double &neighbours_weighting_colinearity)
const IJK_Field_double * field_
virtual void set_diffusion_negligible(const int &diffusion_negligible)
virtual void compute_min_max_ijk_reachable_fluxes(const IJK_Field_vector3_int &cell_faces_neighbours_corrected_all_bool, const IJK_Field_int &neighbours_temperature_to_correct, IJK_Field_vector3_int &cell_faces_neighbours_corrected_min_max_bool, const int &max_flux_per_dir, const int &check_cell_center_neighbour, const int &remove_external_neighbour_values, IJK_Field_int &neighbours_temperature_to_correct_trimmed)
virtual void sort_ijk_intersections_subproblems_indices_by_k_layers()
virtual void corrige_flux_faceIJ(IJK_Field_local_double *const flux, const int k_layer, const int dir)=0
void set_physical_parameters(const double rhocpl, const double rhocpv, const double ldal, const double ldav)
virtual void update()=0
virtual void set_fluxes_feedback_params(const int discrete_integral, const int levels)
virtual void replace_temperature_cell_centre_neighbours(IJK_Field_double &temperature, IJK_Field_double &temperature_neighbours, IJK_Field_int &neighbours_weighting, IJK_Field_double &neighbours_weighting_colinearity) const
virtual void compute_temperature_cell_centre_neighbours(IJK_Field_double &temperature_neighbours, IJK_Field_int &neighbours_weighting, IJK_Field_double &neighbours_weighting_colinearity)
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
: class IJK_Interfaces
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55