TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Corrige_flux_FT_temperature_subresolution.h
1/****************************************************************************
2* Copyright (c) 2023, 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#ifndef Corrige_flux_FT_temperature_subresolution_included
16#define Corrige_flux_FT_temperature_subresolution_included
17
18#include <Corrige_flux_FT_base.h>
19#include <IJK_Field_vector.h>
20#include <IJK_One_Dimensional_Subproblems.h>
21#include <IJK_subres_constants.h>
22
23#define FLUXES_OUT {-1, 1, -1, 1, -1, 1}
24#define FACES_DIR {0, 0, 1, 1, 2, 2}
25// TODO: Be careful to operators ! (Left - Right) values
26#define FLUX_SIGN_DIFF {-1, -1, -1, -1, -1, -1}
27#define FLUX_SIGN_CONV {1, 1, 1, 1, 1, 1}
28#define FLUX_SIGN {FLUX_SIGN_CONV, FLUX_SIGN_DIFF}
29#define MAX_FLUX_VAL 1e16
30#define MAX_FLUX_DIFF 1e10
31
32
34{
35
36 Declare_instanciable( Corrige_flux_FT_temperature_subresolution ) ;
37
38public :
39
40 void initialize_with_subproblems(const Domaine_IJK& splitting,
41 const IJK_Field_double& field,
42 const IJK_Interfaces& interfaces,
43 const Probleme_FTD_IJK_base& ijk_ft,
44 Intersection_Interface_ijk_face& intersection_ijk_face,
45 Intersection_Interface_ijk_cell& intersection_ijk_cell,
46 IJK_One_Dimensional_Subproblems& thermal_subproblems) override;
47
49 void set_convection_diffusion_correction(const int& convective_flux_correction, const int& diffusive_flux_correction) override
50 {
51 convective_flux_correction_ = convective_flux_correction;
52 diffusive_flux_correction_ = diffusive_flux_correction;
53 }
54 void set_convection_negligible(const int& convection_negligible) override { convection_negligible_ = convection_negligible; };
55 void set_diffusion_negligible(const int& diffusion_negligible) override { diffusion_negligible_ = diffusion_negligible; };
56 void set_fluxes_feedback_params(const int discrete_integral, const int levels) override { discrete_integral_ = discrete_integral; levels_ = levels; };
57 void set_distance_cell_faces_from_lrs(const int& distance_cell_faces_from_lrs) override { distance_cell_faces_from_lrs_=distance_cell_faces_from_lrs; };
58 void set_correction_cell_neighbours(const int& correct_temperature_cell_neighbours,
59 const int& neighbours_colinearity_weighting,
60 const int& keep_max_flux_correction,
61 const int& smooth_temperature_field) override
62 {
63 find_temperature_cell_neighbours_ = correct_temperature_cell_neighbours;
64 neighbours_colinearity_weighting_ = neighbours_colinearity_weighting;
65 keep_max_flux_correction_ = keep_max_flux_correction;
66 smooth_temperature_field_ = smooth_temperature_field;
67 }
68
69 void set_cell_faces_neighbours_corrected_bool(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool) override
70 {
71 cell_faces_neighbours_corrected_bool_ = &cell_faces_neighbours_corrected_bool;
72 }
73
74 void set_eulerian_normal_vectors_ns_normed(const IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed) override
75 {
76 eulerian_normal_vectors_ns_normed_ = eulerian_normal_vectors_ns_normed;
77 }
78
79 void set_correction_cell_faces_neighbours(const int& find_cell_neighbours_for_fluxes_spherical_correction,
80 const int& use_cell_neighbours_for_fluxes_spherical_correction,
81 const int& find_reachable_fluxes,
82 const int& use_reachable_fluxes,
83 const int& keep_first_reachable_fluxes,
84 const int& store_flux_operators_for_energy_balance) override
85 {
86 find_cell_neighbours_for_fluxes_spherical_correction_ = find_cell_neighbours_for_fluxes_spherical_correction;
87 use_cell_neighbours_for_fluxes_spherical_correction_ = use_cell_neighbours_for_fluxes_spherical_correction;
88 find_reachable_fluxes_ = find_reachable_fluxes;
89 use_reachable_fluxes_ = use_reachable_fluxes;
90 keep_first_reachable_fluxes_ = keep_first_reachable_fluxes;
91 store_flux_operators_for_energy_balance_ = store_flux_operators_for_energy_balance;
92 }
93
94 void set_temperature_fluxes_periodic_sharing_strategy_on_processors(const int& copy_fluxes_on_every_procs,
95 const int& copy_temperature_on_every_procs) override
96 {
97 copy_fluxes_on_every_procs_ = copy_fluxes_on_every_procs;
98 copy_temperature_on_every_procs_ = copy_temperature_on_every_procs;
99 }
100
101 void set_debug(const int& debug) override { debug_ = debug; };
102 /*
103 * On va calculer sur la grille IJ du layer k_layer tous les flux a proximite de
104 * l'interface. On remplace les flux donnes en entree par ces flux la.
105 */
106 void corrige_flux_faceIJ_any_flux(IJK_Field_local_double *const flux,
107 FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz_sorted,
108 FixedVector<std::vector<ArrOfDouble>,3>& subgrid_fluxes_xyz,
109 const int k_layer,
110 const int dir);
111
112 void corrige_flux_faceIJ(IJK_Field_local_double *const flux,
113 const int k_layer, const int dir) override;
114
115 void corrige_flux_conv_faceIJ(IJK_Field_local_double *const flux,
116 const int k_layer, const int dir) { corrige_flux_faceIJ(flux, k_layer, dir); };
117
118 void corrige_flux_diff_faceIJ(IJK_Field_local_double *const flux,
119 const int k_layer, const int dir) override;
120
121 void correct_flux_spherical(Simd_double& a,
122 Simd_double& b,
123 const int& i,
124 const int& j,
125 const int& k_layer,
126 const int dir) override;
127
128 void calcul_temperature_flux_interface(const IJK_Field_double& temperature, const double ldal, const double ldav,
129 const double dist, const DoubleTab& positions, const DoubleTab& normale,
130 ArrOfDouble& temperature_interp, ArrOfDouble& flux_normal_interp,
131 ArrOfDouble& temp_liqu, ArrOfDouble& temp_vap, DoubleTab& coo_liqu,
132 DoubleTab& coo_vap) const override { ; };
133
134 void update_intersections() override;
135 void update() override;
137
138 void compute_temperature_cell_centre(IJK_Field_double& temperature) const override;
139 void compute_temperature_cell_centre_neighbours(IJK_Field_double& temperature_neighbours,
140 IJK_Field_int& neighbours_weighting,
141 IJK_Field_double& neighbours_weighting_colinearity) override;
142 void compute_temperature_cell_centre_neighbours_on_procs(const double& temperature_neighbours,
143 const double& neighbours_weighting_colinearity,
144 const int& index_i_neighbour_global,
145 const int& index_j_neighbour_global,
146 const int& index_k_neighbour_global);
148 void combine_temperature_cell_centre_neighbours_from_procs(IJK_Field_double& temperature_neighbours,
149 IJK_Field_int& neighbours_weighting,
150 IJK_Field_double& neighbours_weighting_colinearity,
151 const int& ni,
152 const int& nj,
153 const int& nk,
154 const int& offset_i,
155 const int& offset_j,
156 const int& offset_k);
157 void replace_temperature_cell_centre_neighbours(IJK_Field_double& temperature,
158 IJK_Field_double& temperature_neighbours,
159 IJK_Field_int& neighbours_weighting,
160 IJK_Field_double& neighbours_weighting_colinearity) const override;
161 void smooth_temperature_cell_centre_neighbours(IJK_Field_double& temperature,
162 ArrOfInt& corrected_values,
163 ArrOfInt& out_of_bounds_corrected_values,
164 ArrOfDouble& out_of_bounds_values,
165 IJK_Field_double& distance) const;
167 void initialise_fixed_vectors(FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& fixed_vectors,
168 const int nb_k_layer);
169 void initialise_fixed_vector(FixedVector<std::vector<ArrOfInt>,3>& fixed_vector,
170 const int nb_k_layer);
171 void initialise_fixed_vector_values(FixedVector<std::vector<ArrOfDouble>,3>& fixed_vector_values,
172 const int nb_k_layer);
173 void initialise_any_cell_neighbours_indices_to_correct(FixedVector<FixedVector<std::vector<ArrOfInt>,3>, 2>& index_face_ij_flux_xyz_faces_sorted,
174 const int global_indices = 0);
175 void initialise_any_cell_neighbours_indices_to_correct_with_flux(FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz_faces_sorted,
176 FixedVector<std::vector<ArrOfDouble>,3>& fluxes,
177 FixedVector<std::vector<ArrOfInt>,3>& weighting_flux_xyz_faces_sorted,
178 FixedVector<std::vector<ArrOfDouble>,3>& colinearity_flux_xyz_faces_sorted,
179 FixedVector<std::vector<ArrOfDouble>,3>& temperature_flux_xyz_faces_sorted,
180 const bool& ini_index,
181 const int global_indices=0,
182 const int weighting_colinearity=0);
183 void compute_cell_neighbours_faces_indices_for_spherical_correction(const int& n_iter_distance) override;
184 void compute_cell_neighbours_mixed_cell_faces_indices_to_correct(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool_mixed_cell,
185 IJK_Field_vector3_double& cell_faces_neighbours_corrected_velocity_temperature,
186 IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective_mixed_cell,
187 IJK_Field_vector3_double& cell_faces_neighbours_corrected_diffusive_mixed_cell,
188 IJK_Field_vector3_double& neighbours_weighting_colinearity_mixed_cell);
189 void compute_cell_neighbours_mixed_cell_faces_any_field(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool,
190 IJK_Field_local_double& cell_faces_neighbours_corrected_field,
191 IJK_Field_vector3_double& cell_faces_neighbours_corrected_field_mixed_cell);
192 void compute_cell_neighbours_faces_indices_to_correct(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool,
193 IJK_Field_vector3_double& cell_faces_neighbours_corrected_velocity_temperature,
194 IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective,
195 IJK_Field_vector3_double& cell_faces_neighbours_corrected_diffusive,
196 IJK_Field_vector3_double& neighbours_weighting_colinearity) override;
197 void compute_flux_neighbours_on_procs(const int& index_i_neighbour_global,
198 const int& index_j_neighbour_global,
199 const int& index_k_neighbour_global,
200 const int& subproblem_index,
201 const double& dist,
202 const int& dir,
203 const double& colinearity,
204 const int& index_i,
205 const int& index_j,
206 const int& index_k,
207 const double& convective_flux_computed=0,
208 const double& diffusive_flux_computed=0);
210 void combine_all_fluxes_from_outisde_frontier_on_procs(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool,
211 IJK_Field_vector3_double& cell_faces_neighbours_corrected_velocity_temperature,
212 IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective,
213 IJK_Field_vector3_double& cell_faces_neighbours_corrected_diffusive,
214 IJK_Field_vector3_double& neighbours_weighting_colinearity);
215
216 bool identify_wrong_predicted_values(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool,
217 IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective_diffusive_flux,
218 const int& dir,
219 const int& index_i,
220 const int& index_j,
221 const int& index_k,
222 double& convective_diffusive_flux);
223 void get_add_replace_flux_value(IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective_diffusive_flux,
224 const int& dir,
225 const int& i,
226 const int& j,
227 const int& k,
228 double& convective_diffusive_flux,
229 const double& replace_weighting_values);
230
231 void complete_neighbours_and_weighting_colinearity(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool,
232 IJK_Field_vector3_double& cell_faces_neighbours_corrected_velocity_temperature,
233 IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective,
234 IJK_Field_vector3_double& cell_faces_neighbours_corrected_diffusive,
235 IJK_Field_vector3_double& neighbours_weighting_colinearity,
236 const int& compute_fluxes_values);
237 void compute_cell_neighbours_fluxes_to_correct(IJK_Field_vector3_int& cell_faces_neighbours_corrected_bool,
238 IJK_Field_vector3_double& neighbours_weighting_colinearity,
239 IJK_Field_vector3_double& cell_faces_neighbours_corrected_convective,
240 IJK_Field_vector3_double& cell_faces_neighbours_corrected_diffusive,
241 IJK_Field_vector3_double& cell_faces_neighbours_corrected_velocity_temperature,
242 const int& subproblem_index,
243 const int& index_i, const int& index_j, const int& index_k,
244 const double& dist,
245 const int& dir,
246 const double& colinearity,
247 const int& compute_fluxes_values,
248 double& convective_flux,
249 double& diffusive_flux);
250 bool compute_cell_neighbours_convective_fluxes_to_correct(double& convective_flux,
251 const int& subproblem_index,
252 const double& dist,
253 const int& dir,
254 const double& colinearity,
255 const int& index_i,
256 const int& index_j,
257 const int& index_k,
258 const int& temperature=0);
260 const int& subproblem_index,
261 const double& dist,
262 const int& dir,
263 const double& colinearity,
264 const int& index_i,
265 const int& index_j,
266 const int& index_k,
267 const int& temperature=0);
269 const int& subproblem_index,
270 const double& dist,
271 const int& dir,
272 const double& colinearity,
273 const int& index_i,
274 const int& index_j,
275 const int& index_k);
276 bool compute_cell_neighbours_diffusive_fluxes_to_correct(double& diffusive_flux,
277 const int& subproblem_index,
278 const double& dist,
279 const int& dir,
280 const double& colinearity,
281 const int& index_i,
282 const int& index_j,
283 const int& index_k);
285 const int& subproblem_index,
286 const double& dist,
287 const int& dir,
288 const double& colinearity,
289 const int& index_i,
290 const int& index_j,
291 const int& index_k);
293 const int& subproblem_index,
294 const double& dist,
295 const int& dir,
296 const double& colinearity,
297 const int& index_i,
298 const int& index_j,
299 const int& index_k);
301 const int fluxes_type,
302 const int& subproblem_index,
303 const double& dist,
304 const int& dir,
305 const double& colinearity,
306 const int& index_i,
307 const int& index_j,
308 const int& index_k,
309 const int& temperature=0);
311 const int fluxes_type,
312 const int& subproblem_index,
313 const double& dist,
314 const int& dir,
315 const double& colinearity,
316 const int& index_i,
317 const int& index_j,
318 const int& index_k);
319 void replace_cell_neighbours_thermal_convective_diffusive_fluxes_faces(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_min_max_bool,
320 const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
321 const IJK_Field_vector3_double& cell_faces_neighbours_fluxes_corrected,
322 const int& fluxes_type) override;
323 void replace_cell_neighbours_thermal_fluxes_faces(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_min_max_bool,
324 const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
325 const IJK_Field_vector3_double& cell_faces_neighbours_fluxes_corrected,
326 FixedVector<std::vector<ArrOfDouble>,3>& flux_xyz,
327 const int counter);
328
329 void set_zero_temperature_increment(IJK_Field_double& d_temperature) const override;
330 void compute_thermal_convective_fluxes(const int& last_flux) override;
331 void compute_thermal_diffusive_fluxes(const int& last_flux) override;
332 void compute_thermal_convective_fluxes_face_centre(const int& last_flux);
333 void compute_thermal_diffusive_fluxes_face_centre(const int& last_flux);
334 void compute_thermal_fluxes_face_centre(DoubleVect& fluxes, const int fluxes_type, const int& last_flux);
335
336 void complete_thermal_fluxes_face_centre(const int& fluxes_correction_conservations) override;
337 void complete_thermal_fluxes_face_centre(DoubleVect * fluxes,
338 const int& fluxes_correction_conservations);
339
340 double compute_thermal_flux_face_centre(const int fluxes_type,
341 const int& index_subproblem,
342 const double& dist,
343 const int& dir,
344 bool& valid_val,
345 const int& l=-1,
346 const int& index_i=INVALID_INDEX,
347 const int& index_j=INVALID_INDEX,
348 const int& index_k=INVALID_INDEX,
349 const int& temperature=0);
352 void compute_thermal_fluxes_face_centre_discrete_integral(DoubleVect& fluxes, const int fluxes_type);
353 DoubleVect compute_thermal_flux_face_centre_discrete_integral(const int fluxes_type,
354 const int& index_subproblem,
355 const double& dist,
356 const int& dir,
357 const int& l=-1);
358 void get_discrete_surface_at_level(const int& dir, const int& level);
359 void clean() override;
360 void compute_ijk_pure_faces_indices() override;
362 void sort_ijk_intersections_subproblems_indices_fluxes_by_k_layers(FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz,
363 FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz_remaining_global,
364 FixedVector<std::vector<ArrOfDouble>, 3>& flux_xyz,
365 FixedVector<std::vector<ArrOfDouble>, 3>& flux_xyz_remaining_global,
366 FixedVector<std::map<int, int>, 3>& flux_frontier_map,
367 const DoubleVect& fluxes_subgrid,
368 const int ini_index);
369 int get_linear_index_local(const int& i, const int& j, const int& k, const int& dir);
370 int get_linear_index_global(const int& i, const int& j, const int& k, const int& dir);
371 void receive_fluxes_from_frontier_on_procs(FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz_remaining_global,
372 FixedVector<std::vector<ArrOfDouble>,3>& flux_xyz_remaining_global,
373 const int ini_index);
374 void combine_fluxes_from_frontier_on_procs(FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz,
375 FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz_remaining_global,
376 FixedVector<std::vector<ArrOfDouble>,3>& flux_xyz,
377 FixedVector<std::vector<ArrOfDouble>,3>& flux_xyz_remaining_global,
378 FixedVector<std::map<int, int>, 3>& flux_frontier_map,
379 const int ini_index);
380
381 void initialise_any_cell_neighbours_indices_to_correct_on_processors(FixedVector<FixedVector<std::vector<std::vector<ArrOfInt>>,3>,2>& index_face_ij_flux_xyz,
382 FixedVector<std::vector<std::vector<ArrOfDouble>>,3>& flux_xyz,
383 const int ini_index);
384 void redistribute_indices_fluxes_by_k_layers(FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_i_flux_x,
385 FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_i_flux_x_remaining_global,
386 FixedVector<std::vector<ArrOfDouble>,3>& flux_xyz,
387 FixedVector<std::vector<ArrOfDouble>,3>& flux_xyz_remaining_global,
388 const int ini_index);
389
390 void store_cell_faces_corrected(IJK_Field_vector3_int& cell_faces_corrected_bool,
391 IJK_Field_vector3_double& cell_faces_corrected_convective,
392 IJK_Field_vector3_double& cell_faces_corrected_diffusive) override;
393 void store_any_cell_faces_corrected(IJK_Field_vector3_int& cell_faces_corrected_bool,
394 FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2>& index_face_ij_flux_xyz_sorted,
395 IJK_Field_vector3_double& cell_faces_corrected,
396 const DoubleVect& fluxes,
397 FixedVector<std::vector<ArrOfDouble>,3>& flux_xyz,
398 const int counter);
399 void check_pure_fluxes_duplicates(const DoubleVect& fluxes, DoubleVect& fluxes_unique, IntVect& pure_face_unique, const int known_unique);
400 void clear_vectors() override;
401 void clear_std_vectors_array_of_int(std::vector<ArrOfInt>& indices_to_clear);
402 void clear_std_vectors_array_of_double(std::vector<ArrOfDouble>& values_to_clear);
403 void compute_min_max_ijk_reachable_fluxes(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
404 const IJK_Field_int& neighbours_temperature_to_correct,
405 IJK_Field_vector3_int& cell_faces_neighbours_corrected_min_max_bool,
406 const int& max_flux_per_dir,
407 const int& check_cell_center_neighbour,
408 const int& remove_external_neighbour_values,
409 IJK_Field_int& neighbours_temperature_to_correct_trimmed) override;
410
411 void compute_min_max_ijk_any_reachable_fluxes(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
412 const IJK_Field_int& neighbours_temperature_to_correct,
413 IJK_Field_vector3_int& cell_faces_neighbours_corrected_min_max_bool,
414 const int& max_flux_per_dir,
415 const int& check_cell_center_neighbour,
416 const int& remove_external_neighbour_values,
417 IJK_Field_int& neighbours_temperature_to_correct_trimmed) override;
418 void sort_ini_end_arrays(ArrOfInt& indices_found_transition_ini,
419 ArrOfInt& indices_found_transition_end,
420 ArrOfInt& indices_found_ini,
421 ArrOfInt& indices_found_end,
422 FixedVector<ArrOfInt,2>& indices_sorted,
423 const int& max_n_layer);
424 void sort_ini_end_arrays(ArrOfInt& indices_found_ini,
425 ArrOfInt& indices_found_end,
426 FixedVector<ArrOfInt,2>& indices_sorted,
427 const int& max_n_layer);
429 const FixedVector<ArrOfInt,2>& indices_fluxes_sorted,
430 ArrOfInt& indices_to_remove,
431 ArrOfInt& indices_fluxes_to_remove,
432 int& index_bis,
433 int& index_ter,
434 const int& dir);
435 void remove_min_max_ijk_reachable_fluxes_discontinuous(const IJK_Field_vector3_int& cell_faces_neighbours_corrected_all_bool,
436 FixedVector<IJK_Field_local_int, 3>& cell_faces_neighbours_corrected_min_max_bool);
437
438 // FixedVector<FixedVector<std::vector<ArrOfInt>,3>,2> index_face_ij_flux_xyz_sorted_;
439 // FixedVector<FixedVector<std::vector<ArrOfDouble>,3>,2> convective_diffusive_flux_xyz_sorted_;
440protected :
442 DoubleVect dist_;
451
452
456
457 /*
458 * To be used in the operator
459 * Store (i, j, flux) at a given row (k)
460 * convective_flux_x_sorted_.pushback(double_tab_ij_flux)
461 */
462
463 /*
464 * Face fluxes in the immediate interface vicinity !
465 */
466
469
470 /*
471 * Face fluxes in the immediate interface vicinity (Parallel) !
472 */
473
476
477 /*
478 * Map linear flux index to indices in Array to accelerate fusion of flux duplicates !
479 */
480
482 // FixedVector<std::map<int, int>, 3> flux_remaining_global_map_;
484
485 /*
486 * M.G (07/12/23) All fluxes may be useless; Diagonal fluxes are not relevant for the moment
487 */
488
490
492
493 /*
494 * Face fluxes on a reconstructed convex shell around the bubble !
495 */
496
499
500 /*
501 * Face fluxes on a reconstructed convex shell around the bubble (Parallel) !
502 */
503
509
512
513
516 int debug_ = 0;
517 int levels_ = 0;
519 bool flux_init_ = false;
520
526
528
532 IJK_Field_vector3_int * cell_faces_neighbours_corrected_bool_ = nullptr;
533 const IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed_ = nullptr;
534
536
539
541 /*
542 * Very large memory footprint ?
543 */
546
547};
548
549#endif /* Corrige_flux_FT_temperature_subresolution_included */
: class Corrige_flux_FT API pour modifier un champ de flux à partir de donnees à l'interface....
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_subproblems) override
void get_add_replace_flux_value(IJK_Field_vector3_double &cell_faces_neighbours_corrected_convective_diffusive_flux, const int &dir, const int &i, const int &j, const int &k, double &convective_diffusive_flux, const double &replace_weighting_values)
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) override
void store_any_cell_faces_corrected(IJK_Field_vector3_int &cell_faces_corrected_bool, FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz_sorted, IJK_Field_vector3_double &cell_faces_corrected, const DoubleVect &fluxes, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz, const int counter)
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) override
bool compute_cell_neighbours_thermal_convective_fluxes_face_centre(double &convective_flux, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k, const int &temperature=0)
void compute_cell_neighbours_thermal_fluxes_face_centre_discrete_integral(double &flux, const int fluxes_type, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k)
void combine_all_fluxes_from_outisde_frontier_on_procs(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)
void redistribute_indices_fluxes_by_k_layers(FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_i_flux_x, FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_i_flux_x_remaining_global, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz_remaining_global, const int ini_index)
void corrige_flux_diff_faceIJ(IJK_Field_local_double *const flux, const int k_layer, const int dir) override
void compute_cell_neighbours_faces_indices_for_spherical_correction(const int &n_iter_distance) override
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) override
FixedVector< FixedVector< std::vector< ArrOfDouble >, 3 >, 2 > convective_diffusive_flux_xyz_sorted_
void sort_ijk_intersections_subproblems_indices_fluxes_by_k_layers(FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz, FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz_remaining_global, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz_remaining_global, FixedVector< std::map< int, int >, 3 > &flux_frontier_map, const DoubleVect &fluxes_subgrid, const int ini_index)
void set_convection_diffusion_correction(const int &convective_flux_correction, const int &diffusive_flux_correction) override
void combine_fluxes_from_frontier_on_procs(FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz, FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz_remaining_global, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz_remaining_global, FixedVector< std::map< int, int >, 3 > &flux_frontier_map, const int ini_index)
void initialise_any_cell_neighbours_indices_to_correct(FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz_faces_sorted, const int global_indices=0)
void clear_std_vectors_array_of_double(std::vector< ArrOfDouble > &values_to_clear)
int get_linear_index_local(const int &i, const int &j, const int &k, const int &dir)
void remove_min_max_ijk_reachable_fluxes_discontinuous(const IJK_Field_vector3_int &cell_faces_neighbours_corrected_all_bool, FixedVector< IJK_Field_local_int, 3 > &cell_faces_neighbours_corrected_min_max_bool)
void check_pure_fluxes_duplicates(const DoubleVect &fluxes, DoubleVect &fluxes_unique, IntVect &pure_face_unique, const int known_unique)
void receive_fluxes_from_frontier_on_procs(FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz_remaining_global, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz_remaining_global, const int ini_index)
int get_linear_index_global(const int &i, const int &j, const int &k, const int &dir)
FixedVector< FixedVector< std::vector< ArrOfDouble >, 3 >, 2 > convective_diffusive_flux_xyz_remaining_global_sorted_
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 override
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) override
void compute_thermal_fluxes_face_centre(DoubleVect &fluxes, const int fluxes_type, const int &last_flux)
bool compute_cell_neighbours_diffusive_fluxes_to_correct(double &diffusive_flux, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k)
FixedVector< std::vector< ArrOfDouble >, 3 > colinearity_flux_xyz_neighbours_all_faces_remaining_global_sorted_
void initialise_fixed_vectors(FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &fixed_vectors, const int nb_k_layer)
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) override
FixedVector< std::vector< ArrOfDouble >, 3 > temperature_flux_all_faces_remaining_global_sorted_
void corrige_flux_conv_faceIJ(IJK_Field_local_double *const flux, const int k_layer, const int dir)
FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > index_face_ij_flux_xyz_remaining_global_sorted_
void compute_cell_neighbours_thermal_convective_fluxes_face_centre_discrete_integral(double &convective_flux, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k)
void set_distance_cell_faces_from_lrs(const int &distance_cell_faces_from_lrs) override
void corrige_flux_faceIJ(IJK_Field_local_double *const flux, const int k_layer, const int dir) override
void compute_flux_neighbours_on_procs(const int &index_i_neighbour_global, const int &index_j_neighbour_global, const int &index_k_neighbour_global, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k, const double &convective_flux_computed=0, const double &diffusive_flux_computed=0)
FixedVector< std::vector< ArrOfInt >, 3 > weighting_flux_xyz_neighbours_all_faces_remaining_global_sorted_
void clear_std_vectors_array_of_int(std::vector< ArrOfInt > &indices_to_clear)
DoubleVect compute_thermal_flux_face_centre_discrete_integral(const int fluxes_type, const int &index_subproblem, const double &dist, const int &dir, const int &l=-1)
void set_fluxes_feedback_params(const int discrete_integral, const int levels) override
bool compute_cell_neighbours_thermal_fluxes_face_centre(double &flux, const int fluxes_type, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k, const int &temperature=0)
void smooth_temperature_cell_centre_neighbours(IJK_Field_double &temperature, ArrOfInt &corrected_values, ArrOfInt &out_of_bounds_corrected_values, ArrOfDouble &out_of_bounds_values, IJK_Field_double &distance) const
void initialise_any_cell_neighbours_indices_to_correct_with_flux(FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz_faces_sorted, FixedVector< std::vector< ArrOfDouble >, 3 > &fluxes, FixedVector< std::vector< ArrOfInt >, 3 > &weighting_flux_xyz_faces_sorted, FixedVector< std::vector< ArrOfDouble >, 3 > &colinearity_flux_xyz_faces_sorted, FixedVector< std::vector< ArrOfDouble >, 3 > &temperature_flux_xyz_faces_sorted, const bool &ini_index, const int global_indices=0, const int weighting_colinearity=0)
double compute_thermal_flux_face_centre(const int fluxes_type, const int &index_subproblem, const double &dist, const int &dir, bool &valid_val, const int &l=-1, const int &index_i=INVALID_INDEX, const int &index_j=INVALID_INDEX, const int &index_k=INVALID_INDEX, const int &temperature=0)
void set_zero_temperature_increment(IJK_Field_double &d_temperature) const override
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) override
void replace_cell_neighbours_thermal_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, FixedVector< std::vector< ArrOfDouble >, 3 > &flux_xyz, const int counter)
void compute_temperature_cell_centre_neighbours(IJK_Field_double &temperature_neighbours, IJK_Field_int &neighbours_weighting, IJK_Field_double &neighbours_weighting_colinearity) override
void compute_cell_neighbours_mixed_cell_faces_any_field(IJK_Field_vector3_int &cell_faces_neighbours_corrected_bool, IJK_Field_local_double &cell_faces_neighbours_corrected_field, IJK_Field_vector3_double &cell_faces_neighbours_corrected_field_mixed_cell)
FixedVector< FixedVector< std::vector< ArrOfDouble >, 3 >, 2 > convective_diffusive_flux_all_faces_remaining_global_sorted_
void corrige_flux_faceIJ_any_flux(IJK_Field_local_double *const flux, FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > &index_face_ij_flux_xyz_sorted, FixedVector< std::vector< ArrOfDouble >, 3 > &subgrid_fluxes_xyz, const int k_layer, const int dir)
void complete_neighbours_and_weighting_colinearity(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 int &compute_fluxes_values)
void sort_ini_end_arrays(ArrOfInt &indices_found_transition_ini, ArrOfInt &indices_found_transition_end, ArrOfInt &indices_found_ini, ArrOfInt &indices_found_end, FixedVector< ArrOfInt, 2 > &indices_sorted, const int &max_n_layer)
bool compute_cell_neighbours_convective_fluxes_to_correct(double &convective_flux, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k, const int &temperature=0)
void compute_cell_neighbours_fluxes_to_correct(IJK_Field_vector3_int &cell_faces_neighbours_corrected_bool, IJK_Field_vector3_double &neighbours_weighting_colinearity, IJK_Field_vector3_double &cell_faces_neighbours_corrected_convective, IJK_Field_vector3_double &cell_faces_neighbours_corrected_diffusive, IJK_Field_vector3_double &cell_faces_neighbours_corrected_velocity_temperature, const int &subproblem_index, const int &index_i, const int &index_j, const int &index_k, const double &dist, const int &dir, const double &colinearity, const int &compute_fluxes_values, double &convective_flux, double &diffusive_flux)
void set_temperature_fluxes_periodic_sharing_strategy_on_processors(const int &copy_fluxes_on_every_procs, const int &copy_temperature_on_every_procs) override
void set_cell_faces_neighbours_corrected_bool(IJK_Field_vector3_int &cell_faces_neighbours_corrected_bool) override
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) override
void associate_thermal_problems(IJK_One_Dimensional_Subproblems &thermal_subproblems)
FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > index_face_ij_flux_xyz_sorted_
bool compute_cell_neighbours_thermal_diffusive_fluxes_face_centre(double &diffusive_flux, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k)
FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > index_face_ij_flux_xyz_neighbours_min_max_faces_sorted_
bool identify_wrong_predicted_values(IJK_Field_vector3_int &cell_faces_neighbours_corrected_bool, IJK_Field_vector3_double &cell_faces_neighbours_corrected_convective_diffusive_flux, const int &dir, const int &index_i, const int &index_j, const int &index_k, double &convective_diffusive_flux)
void initialise_fixed_vector(FixedVector< std::vector< ArrOfInt >, 3 > &fixed_vector, const int nb_k_layer)
void complete_thermal_fluxes_face_centre(const int &fluxes_correction_conservations) override
FixedVector< std::map< int, int >, 3 > flux_outside_frontier_all_map_
void set_eulerian_normal_vectors_ns_normed(const IJK_Field_vector3_double *eulerian_normal_vectors_ns_normed) override
void combine_temperature_cell_centre_neighbours_from_procs(IJK_Field_double &temperature_neighbours, IJK_Field_int &neighbours_weighting, IJK_Field_double &neighbours_weighting_colinearity, const int &ni, const int &nj, const int &nk, const int &offset_i, const int &offset_j, const int &offset_k)
void set_diffusion_negligible(const int &diffusion_negligible) override
FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > index_face_ij_flux_xyz_neighbours_all_faces_sorted_
void initialise_any_cell_neighbours_indices_to_correct_on_processors(FixedVector< FixedVector< std::vector< std::vector< ArrOfInt > >, 3 >, 2 > &index_face_ij_flux_xyz, FixedVector< std::vector< std::vector< ArrOfDouble > >, 3 > &flux_xyz, const int ini_index)
void compute_cell_neighbours_thermal_diffusive_fluxes_face_centre_discrete_integral(double &diffusive_flux, const int &subproblem_index, const double &dist, const int &dir, const double &colinearity, const int &index_i, const int &index_j, const int &index_k)
void correct_flux_spherical(Simd_double &a, Simd_double &b, const int &i, const int &j, const int &k_layer, const int dir) override
FixedVector< FixedVector< std::vector< ArrOfDouble >, 3 >, 2 > convective_diffusive_flux_xyz_min_max_faces_sorted_
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 override
void set_convection_negligible(const int &convection_negligible) override
void remove_non_overlapping_fluxes_values(const FixedVector< ArrOfInt, 2 > &indices_sorted, const FixedVector< ArrOfInt, 2 > &indices_fluxes_sorted, ArrOfInt &indices_to_remove, ArrOfInt &indices_fluxes_to_remove, int &index_bis, int &index_ter, const int &dir)
void compute_temperature_cell_centre_neighbours_on_procs(const double &temperature_neighbours, const double &neighbours_weighting_colinearity, const int &index_i_neighbour_global, const int &index_j_neighbour_global, const int &index_k_neighbour_global)
FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > index_face_ij_flux_xyz_neighbours_diag_faces_sorted_
void initialise_fixed_vector_values(FixedVector< std::vector< ArrOfDouble >, 3 > &fixed_vector_values, const int nb_k_layer)
FixedVector< FixedVector< std::vector< ArrOfInt >, 3 >, 2 > index_face_ij_flux_xyz_neighbours_all_faces_remaining_global_sorted_
void compute_temperature_cell_centre(IJK_Field_double &temperature) const override
void compute_thermal_fluxes_face_centre_discrete_integral(DoubleVect &fluxes, const int fluxes_type)
void compute_cell_neighbours_mixed_cell_faces_indices_to_correct(IJK_Field_vector3_int &cell_faces_neighbours_corrected_bool_mixed_cell, IJK_Field_vector3_double &cell_faces_neighbours_corrected_velocity_temperature, IJK_Field_vector3_double &cell_faces_neighbours_corrected_convective_mixed_cell, IJK_Field_vector3_double &cell_faces_neighbours_corrected_diffusive_mixed_cell, IJK_Field_vector3_double &neighbours_weighting_colinearity_mixed_cell)
void get_discrete_surface_at_level(const int &dir, const int &level)
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
: class IJK_Interfaces