TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
IJK_One_Dimensional_Subproblems.cpp
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
16#include <IJK_One_Dimensional_Subproblems.h>
17#include <IJK_Field_vector.h>
18#include <Probleme_FTD_IJK.h>
19#include <IJK_switch_FT.h>
20#include <IJK_Bubble_tools.h>
21#include <IJK_Thermal_base.h>
22#include <IJK_Thermal_Subresolution.h>
23
24Implemente_instanciable_sans_constructeur(IJK_One_Dimensional_Subproblems, "IJK_One_Dimensional_Subproblems", LIST(IJK_One_Dimensional_Subproblem));
25
30
32{
33 ref_ijk_ft_ = ijk_ft;
34}
35
36Sortie& IJK_One_Dimensional_Subproblems::printOn( Sortie& os ) const
37{
38 return os;
39}
40
41Entree& IJK_One_Dimensional_Subproblems::readOn( Entree& is )
42{
43 LIST(IJK_One_Dimensional_Subproblem)::readOn( is );
44 return is;
45}
46
47void IJK_One_Dimensional_Subproblems::initialise_thermal_subproblems_list_params(const int& pre_initialise_thermal_subproblems_list,
48 const double& pre_factor_subproblems_number,
49 const int& remove_append_subproblems,
50 const int& use_sparse_matrix)
51{
52 pre_initialise_thermal_subproblems_list_ = pre_initialise_thermal_subproblems_list;
53 pre_factor_subproblems_number_ = pre_factor_subproblems_number;
54 remove_append_subproblems_ = remove_append_subproblems;
55 use_sparse_matrix_ = use_sparse_matrix;
56}
57
62
82
87
92
97
99{
100 if (init_)
101 {
102 // int total_subproblems = subproblems_counter_;
103 int total_subproblems = subproblems_counter_;
104 if (!(ref_ijk_ft_->eq_ns().get_disable_convection_qdm() && ref_ijk_ft_->eq_ns().get_disable_diffusion_qdm()))
105 total_subproblems = Process::check_int_overflow(Process::mp_sum(total_subproblems));
106 max_subproblems_ = (int) (pre_factor_subproblems_number_ * total_subproblems);
108 {
109 const int sub_problem_end_index = effective_subproblems_counter_ - 1;
110 IJK_One_Dimensional_Subproblem subproblem = (*this)[sub_problem_end_index];
112 {
113 (*this).add(subproblem);
115 }
116 init_ = 0;
117 }
118 }
119}
120
122{
123 const int active_subproblems = subproblems_counter_;
124 const int total_subproblems = (*this).size();
125 for (int i=0; i<(total_subproblems - active_subproblems); i++)
126 (*this).suppr((*this).dernier());
127 assert((*this).size() == subproblems_counter_);
128 init_ = 0;
129}
130
132{
133 for (int i=0; i<n; i++)
134 {
136 (*this).add(subproblem);
137 }
139}
140
142{
145 const int proc_number = Process::nproc();
146 ArrOfInt indices(proc_number);
147 const int my_process_number = Process::me();
148 indices(my_process_number) = subproblems_counter_;
149 mp_sum_for_each_item(indices);
150 ArrOfInt indices_ini(proc_number);
151 ArrOfInt indices_max(proc_number);
152 indices_ini(0) = 0;
153 indices_max(0) = indices(0);
154 for (int i=1; i<proc_number; i++)
155 {
156 indices_ini(i) = indices_ini(i-1) + indices(i-1);
157 indices_max(i) = indices_max(i-1) + indices(i);
158 }
159 assert(indices_max(proc_number - 1) == global_subproblems_counter_);
160 index_ini_ = indices_ini(my_process_number);
161 index_end_ = indices_max(my_process_number);
163}
164
166{
167 int index_counter = index_ini_;
168 for (int itr=0; itr < subproblems_counter_; itr++)
169 {
170 (*this)[itr].set_global_index(index_counter);
171 index_counter++;
172 }
173}
174
176 const int& j,
177 const int& k)
178{
179 ijk_indices_to_subproblem_[0].append_array(i);
180 ijk_indices_to_subproblem_[1].append_array(j);
181 ijk_indices_to_subproblem_[2].append_array(k);
182}
183
185 int& i,
186 int& j,
187 int& k)
188{
189 i = ijk_indices_to_subproblem_[0][rank];
190 j = ijk_indices_to_subproblem_[1][rank];
191 k = ijk_indices_to_subproblem_[2][rank];
192}
193
195 const int& i,
196 const int& j,
197 const int& k)
198{
199 subproblem_to_ijk_indices_[i][j][k] = rank;
200 // void print_map(std::string_view comment, const std::map<std::string, std::string>& m)
201 // {
202 // std::cout << comment;
203 // // Iterate using C++17 facilities
204 // for (const auto& [key, value] : m)
205 // std::cout << '[' << key << "] = " << value << "; ";
206 //
207 // // C++11 alternative:
208 // // for (const auto& n : m)
209 // // std::cout << n.first << " = " << n.second << "; ";
210 // //
211 // // C++98 alternative:
212 // // for (std::map<std::string, int>::const_iterator it = m.begin(); it != m.end(); ++it)
213 // // std::cout << it->first << " = " << it->second << "; ";
214 //
215 // std::cout << '\n';
216 // }
217 // std::map<std::string, std::string> inner;
218 // inner.insert(std::make_pair("key2", "value2"));
219 // someStorage.insert(std::make_pair("key", inner));
220}
221
223 const int& j,
224 const int& k) const
225{
226 return ((subproblem_to_ijk_indices_.at(i)).at(j)).at(k);
227}
228
230{
231 if (init_)
232 {
233 debug_ = ref_thermal_subresolution.debug_;
234 reference_gfm_on_probes_ = ref_thermal_subresolution.reference_gfm_on_probes_;
235 bubbles_barycentres_ = ref_thermal_subresolution.bubbles_barycentre_;
236 bubbles_volume_ = ref_thermal_subresolution.bubbles_volume_;
237 bubbles_rising_velocities_ = ref_thermal_subresolution.rising_velocities_;
238 bubbles_rising_vectors_per_bubble_ = ref_thermal_subresolution.rising_vectors_;
239 liquid_velocity_ = ref_thermal_subresolution.liquid_velocity_;
240 prandtl_number_ = &ref_thermal_subresolution.prandtl_number_;
241 latastep_reprise_= &ref_thermal_subresolution.latastep_reprise_ini_;
243 bubbles_barycentres_old_ = ref_thermal_subresolution.bubbles_barycentres_old_;
244 bubbles_barycentres_new_ = ref_thermal_subresolution.bubbles_barycentres_new_;
247 }
248}
249
251 int i, int j, int k,
252 const double& indicator,
253 double global_time_step,
254 double current_time,
255 const IJK_Interfaces& interfaces,
256 const IJK_Field_vector3_double& velocity,
257 const IJK_Field_vector3_double& velocity_ft,
258 const IJK_Field_double& pressure)
259{
261 {
262 Cerr << max_subproblems_ << "subproblems were expected but" << subproblems_counter_ << "subproblem try to be associated with the list of subproblems";
264 }
265
266 associate_variables_for_post_processing(ref_thermal_subresolution);
268
269 ArrOfDouble bubble_rising_vector(3);
270 ArrOfDouble normal_vector(3);
271 ArrOfDouble facet_barycentre(3);
272 ArrOfDouble bubble_barycentre(3);
273
274
275 if (debug_)
276 Cerr << "Mixed cell indices (i,j,k) : (" << i << ";" << j << ";" << k << ")" << finl;
277 const int compo_connex = (*ref_thermal_subresolution.eulerian_compo_connex_from_interface_int_ns_)(i, j, k);
278 const int compo_connex_ghost = (*ref_thermal_subresolution.eulerian_compo_connex_from_interface_int_ns_)(i,j,k);
279 if (debug_)
280 {
281 Cerr << "compo_connex : " << compo_connex << finl;
282 Cerr << "compo_connex_ghost : " << compo_connex_ghost << finl;
283 Cerr << "bubbles_barycentre : " << *ref_thermal_subresolution.bubbles_barycentre_ << finl;
284 }
285
286 // Need for a Navier-Stokes field (NOT FT)
287 const double distance = (*ref_thermal_subresolution.eulerian_distance_ns_)(i, j ,k);
288 const double curvature = (*ref_thermal_subresolution.eulerian_curvature_ns_)(i, j ,k);
289 const double interfacial_area = (*ref_thermal_subresolution.eulerian_interfacial_area_ns_)(i, j ,k);
290
291 //Domaine_IJK splitting = (*ref_thermal_subresolution.eulerian_compo_connex_from_interface_int_ns_).get_domaine();
292 const double bubble_rising_velocity = (*ref_thermal_subresolution.rising_velocities_)(compo_connex);
293
294 for (int dir=0; dir < 3; dir++)
295 {
296 facet_barycentre(dir) = (*ref_thermal_subresolution.eulerian_facets_barycentre_ns_)[dir](i, j, k);
297 normal_vector(dir) = (*ref_thermal_subresolution.eulerian_normal_vectors_ns_)[dir](i, j, k);
298 bubble_rising_vector(dir) = (*ref_thermal_subresolution.rising_vectors_)(compo_connex, dir);
299 bubble_barycentre(dir) = (*ref_thermal_subresolution.bubbles_barycentre_)(compo_connex_ghost, dir);
300 }
301
302 const int total_subproblems = (*this).size();
303 if (subproblems_counter_ >= total_subproblems)
304 {
305 IJK_One_Dimensional_Subproblem subproblem(ref_ijk_ft_);
306 (*this).add(subproblem);
307 init_ = 1;
308 }
309
310 (*this)[subproblems_counter_].associate_sub_problem_to_inputs(ref_thermal_subresolution,
311 (*this),
312 i, j, k,
313 init_,
315 global_time_step,
316 current_time,
317 compo_connex,
318 distance,
319 curvature,
320 interfacial_area,
321 facet_barycentre,
322 normal_vector,
323 bubble_rising_velocity,
324 bubble_rising_vector,
325 bubble_barycentre,
326 indicator,
327 interfaces,
328 velocity,
329 velocity_ft,
330 pressure);
331
334}
335
337{
342 for (int itr=0; itr < subproblems_counter_; itr++)
343 {
344 temperature_probes_previous_.push_back((*this)[itr].get_current_temperature_solution());
345 indicator_probes_previous_.push_back((*this)[itr].get_current_indicator());
346 velocities_probes_previous_.push_back((*this)[itr].get_current_cell_xyz_velocities());
347 normal_vector_compo_probes_previous_.push_back((*this)[itr].get_normal_vector_compo());
348 }
350}
351
353{
354 const int nk_tot = ref_ijk_ft_->get_domaine().get_nb_elem_tot(2);
355
356 if (ref_ijk_ft_->schema_temps_ijk().get_tstep() == 0)
357 {
358 for (int ij = 0; ij<2; ij++)
359 index_ij_subproblems_local_perio_[ij].resize(nk_tot);
364
365 for (int ij = 0; ij<2; ij++)
366 index_ij_subproblems_global_[ij].resize(nk_tot);
371
372 for (int k=0; k<nk_tot; k++)
373 {
380 }
381 }
382 else
383 {
384 for (int k=0; k<nk_tot; k++)
385 {
386 for (int ij = 0; ij<2; ij++)
388 for (int point=0; point<(*points_per_thermal_subproblem_); point++)
391 for (int compo=0; compo<3; compo++)
392 {
395 }
396
397 for (int ij = 0; ij<2; ij++)
398 index_ij_subproblems_global_[ij][k].reset();
399 for (int point=0; point<(*points_per_thermal_subproblem_); point++)
400 temperature_probes_previous_global_[k][point].reset();
402 for (int compo=0; compo<3; compo++)
403 {
404 velocities_probes_previous_global_[k][compo].reset();
406 }
407 }
408 }
412}
413
415{
416 const int ni = ref_ijk_ft_->get_interface().I().ni();
417 const int nj = ref_ijk_ft_->get_interface().I().nj();
418 const int nk = ref_ijk_ft_->get_interface().I().nk();
419
420 const int offset_i = ref_ijk_ft_->get_domaine().get_offset_local(0);
421 const int offset_j = ref_ijk_ft_->get_domaine().get_offset_local(1);
422 const int offset_k = ref_ijk_ft_->get_domaine().get_offset_local(2);
423
424 for (int itr=0; itr < subproblems_counter_; itr++)
425 {
426 int i, j, k;
427 (*this)[itr].get_ijk_indices(i, j, k);
428 if ((i==ni-1 || i==0) || (j==nj-1 || j==0) || (k==nk-1 || k==0))
429 {
430 const int i_global = i + offset_i;
431 const int j_global = j + offset_j;
432 const int k_global = k + offset_k;
433 index_ij_subproblems_local_perio_[0][k_global].append_array(i_global);
434 index_ij_subproblems_local_perio_[1][k_global].append_array(j_global);
435 DoubleVect& temperature_vect = temperature_probes_previous_[itr];
436 Vecteur3& velocities_xyz = velocities_probes_previous_[itr];
437 Vecteur3& normal_vector_compo = normal_vector_compo_probes_previous_[itr];
438 for (int point=0; point<(*points_per_thermal_subproblem_); point++)
439 temperature_probes_previous_local_perio_[k_global][point].append_array(temperature_vect[point]);
441 for (int compo=0; compo<3; compo++)
442 {
443 velocities_probes_previous_local_perio_[k_global][compo].append_array(velocities_xyz[compo]);
444 normal_vector_compo_probes_previous_local_perio_[k_global][compo].append_array(normal_vector_compo[compo]);
445 }
446 }
447 }
448}
449
451{
452 const int nb_procs = Process::nproc();
453 const int proc_num = Process::me();
454 if (nb_procs)
455 {
456 const int size_k_layers = (int) index_ij_subproblems_local_perio_[0].size();
457 for (int k=0; k<size_k_layers; k++)
458 {
459 const int size_array = index_ij_subproblems_local_perio_[0][k].size_array();
460 int size_array_global = size_array;
461 size_array_global = Process::check_int_overflow(mp_sum(size_array_global));
462 ArrOfInt overall_numerotation(nb_procs);
463 ArrOfInt start_indices(nb_procs);
464 overall_numerotation(proc_num) = size_array;
465 mp_sum_for_each_item(overall_numerotation);
466 int l;
467 for (l=1; l<overall_numerotation.size_array(); l++)
468 start_indices(l) = start_indices(l-1) + overall_numerotation(l-1);
469
470 const ArrOfInt& local_indices_i_tmp = index_ij_subproblems_local_perio_[0][k];
471 const ArrOfInt& local_indices_j_tmp = index_ij_subproblems_local_perio_[1][k];
472 const ArrOfDouble& local_indicator = indicator_probes_previous_local_perio_[k];
473
474
475 ArrOfInt& global_indices_i_tmp = index_ij_subproblems_global_[0][k];
476 ArrOfInt& global_indices_j_tmp = index_ij_subproblems_global_[1][k];
477 ArrOfDouble& global_indicator = indicator_probes_previous_global_[k];
478
479 global_indices_i_tmp.resize(size_array_global);
480 global_indices_j_tmp.resize(size_array_global);
481 global_indicator.resize(size_array_global);
482
483 global_indices_i_tmp *= 0;
484 global_indices_j_tmp *= 0;
485 global_indicator *= 0.;
486
487 for (l=0; l<local_indices_i_tmp.size_array(); l++)
488 {
489 global_indices_i_tmp(start_indices(proc_num) + l) = local_indices_i_tmp(l);
490 global_indices_j_tmp(start_indices(proc_num) + l) = local_indices_j_tmp(l);
491 global_indicator(start_indices(proc_num) + l) = local_indicator(l);
492 }
493 mp_sum_for_each_item(global_indices_i_tmp);
494 mp_sum_for_each_item(global_indices_j_tmp);
495 mp_sum_for_each_item(global_indicator);
496
497 for (int point=0; point<(*points_per_thermal_subproblem_); point++)
498 {
499 const ArrOfDouble& local_temperature = temperature_probes_previous_local_perio_[k][point];
500 ArrOfDouble& global_temperature = temperature_probes_previous_global_[k][point];
501 global_temperature.resize(size_array_global);
502 global_temperature *= 0.;
503 for (l=0; l<local_temperature.size_array(); l++)
504 global_temperature(start_indices(proc_num) + l) = local_temperature(l);
505 mp_sum_for_each_item(global_temperature);
506 }
507
508 for (int compo=0; compo<3; compo++)
509 {
510 const ArrOfDouble& local_velocity = velocities_probes_previous_local_perio_[k][compo];
511 const ArrOfDouble& local_normal_compo = normal_vector_compo_probes_previous_local_perio_[k][compo];
512 ArrOfDouble& global_velocity = velocities_probes_previous_global_[k][compo];
513 ArrOfDouble& global_normal_compo = normal_vector_compo_probes_previous_global_[k][compo];
514 global_velocity.resize(size_array_global);
515 global_normal_compo.resize(size_array_global);
516 global_velocity *= 0.;
517 global_normal_compo *= 0.;
518 for (l=0; l<local_velocity.size_array(); l++)
519 {
520 global_velocity(start_indices(proc_num) + l) = local_velocity(l);
521 global_normal_compo(start_indices(proc_num) + l) = local_normal_compo(l);
522 }
523 mp_sum_for_each_item(global_velocity);
524 mp_sum_for_each_item(global_normal_compo);
525 }
526 }
527 }
528}
529
531{
532 const int ni = ref_ijk_ft_->get_interface().I().ni();
533 const int nj = ref_ijk_ft_->get_interface().I().nj();
534 const int nk = ref_ijk_ft_->get_interface().I().nk();
535
536 const int offset_i = ref_ijk_ft_->get_domaine().get_offset_local(0);
537 const int offset_j = ref_ijk_ft_->get_domaine().get_offset_local(1);
538 const int offset_k = ref_ijk_ft_->get_domaine().get_offset_local(2);
539
540 const int ni_tot = ref_ijk_ft_->get_domaine().get_nb_elem_tot(0);
541 const int nj_tot = ref_ijk_ft_->get_domaine().get_nb_elem_tot(1);
542 const int nk_tot = ref_ijk_ft_->get_domaine().get_nb_elem_tot(2);
543
544 const int nb_procs = Process::nproc();
545 int counter_prev = subproblems_counter_;
546 if (nb_procs)
547 {
548 const int size_k_layers = (int) index_ij_subproblems_global_[0].size();
549 for (int k_global=0; k_global<size_k_layers; k_global++)
550 {
551 const int size_val = (int) index_ij_subproblems_global_[0][k_global].size_array();
552 for (int ival=0; ival<size_val; ival++)
553 {
554 const int i_global = index_ij_subproblems_global_[0][k_global][ival];
555 const int j_global = index_ij_subproblems_global_[1][k_global][ival];
556 /*
557 * Global perio
558 */
559 int i = i_global - offset_i;
560 int j = j_global - offset_j;
561 int k = k_global - offset_k;
562 if (i_global == ni_tot-1 && offset_i==0)
563 i = -1;
564 if (i_global == 0 && (ni + offset_i==ni_tot))
565 i = ni;
566 if (j_global == nj_tot-1 && offset_j==0)
567 j = -1;
568 if (j_global == 0 && (nj + offset_j==nj_tot))
569 j = nj;
570 if (k_global == nk_tot-1 && offset_k==0)
571 k = -1;
572 if (k_global == 0 && (nk + offset_k==nk_tot))
573 k = nk;
574 /*
575 * Neighbours
576 */
577 const int i_dir = (i==-1 || i==ni) && (0 <= j && j < nj) && (0 <= k && k < nk);
578 const int j_dir = (0 <= i && i < ni) && (j==-1 || j==nj) && (0 <= k && k < nk);
579 const int k_dir = (0 <= i && i < ni) && (0 <= j && j < nj) && (k==-1 || k==nk);
580 if (i_dir || j_dir || k_dir)
582 {
583 subproblem_to_ijk_indices_[i][j][k] = counter_prev;
584
585 DoubleVect temperature_prev;
586 temperature_prev.resize((*points_per_thermal_subproblem_));
587 for (int point=0; point<(*points_per_thermal_subproblem_); point++)
588 temperature_prev[point] = temperature_probes_previous_global_[k_global][point][ival];
589 temperature_probes_previous_.push_back(temperature_prev);
590
592
593 Vecteur3 velocities_compo;
594 Vecteur3 normal_vector_compo;
595 for (int compo=0; compo<3; compo++)
596 {
597 velocities_compo[compo] = velocities_probes_previous_global_[k_global][compo][ival];
598 normal_vector_compo[compo] = normal_vector_compo_probes_previous_global_[k_global][compo][ival];
599 }
600 velocities_probes_previous_.push_back(velocities_compo);
601 normal_vector_compo_probes_previous_.push_back(normal_vector_compo);
602
603 counter_prev++;
604 }
605 }
606 }
607 }
608 else
609 {
610 const int size_k_layers = (int) index_ij_subproblems_local_perio_[0].size();
611 for (int k_global=0; k_global<size_k_layers; k_global++)
612 {
613 const int size_val = (int) index_ij_subproblems_global_[0][k_global].size_array();
614 for (int ival=0; ival<size_val; ival++)
615 {
616 /*
617 * Global perio
618 */
619 int i = index_ij_subproblems_local_perio_[0][k_global][ival];
620 int j = index_ij_subproblems_local_perio_[1][k_global][ival];
621 int k = k_global - offset_k;
622 if (i == ni-1)
623 i = 0;
624 if (i == 0)
625 i = ni-1;
626 if (j == nj-1)
627 j = 0;
628 if (j == 0)
629 j = nj-1;
630 if (k == nk-1)
631 k = 0;
632 if (k == 0)
633 k = nk-1;
634 const int i_dir = (i == ni-1 || i == 0);
635 const int j_dir = (j == nj-1 || j == 0);
636 const int k_dir = (k == nk-1 || k == 0);
637 if (i_dir || j_dir || k_dir)
639 {
640 subproblem_to_ijk_indices_[i][j][k] = counter_prev;
641
642 DoubleVect temperature_prev;
643 temperature_prev.resize((*points_per_thermal_subproblem_));
644 for (int point=0; point<(*points_per_thermal_subproblem_); point++)
645 temperature_prev[point] = temperature_probes_previous_local_perio_[k_global][point][ival];
646 temperature_probes_previous_.push_back(temperature_prev);
647
649
650 Vecteur3 velocities_compo;
651 Vecteur3 normal_vector_compo;
652 for (int compo=0; compo<3; compo++)
653 {
654 velocities_compo[compo] = velocities_probes_previous_local_perio_[k_global][compo][ival];
655 normal_vector_compo[compo] = normal_vector_compo_probes_previous_local_perio_[k_global][compo][ival];
656 }
657 velocities_probes_previous_.push_back(velocities_compo);
658 normal_vector_compo_probes_previous_.push_back(normal_vector_compo);
659
660 counter_prev++;
661 }
662 }
663 }
664 }
665}
666
667void IJK_One_Dimensional_Subproblems::dispatch_interfacial_heat_flux_correction(IJK_Field_vector3_double& interfacial_heat_flux_dispatched,
668 FixedVector<ArrOfInt, 4>& ijk_indices_out,
669 ArrOfDouble& thermal_flux_out,
670 IJK_Field_vector3_double& interfacial_heat_flux_current)
671{
672
673 for (int c=0; c<3; c++)
674 {
675 interfacial_heat_flux_dispatched[c].data() = 0.;
676 interfacial_heat_flux_current[c].data() = 0.;
677 }
678 for (int l=0; l<4; l++)
679 ijk_indices_out[l].reset();
680 thermal_flux_out.reset();
681
682 for (int itr=0; itr < effective_subproblems_counter_; itr++)
684 ijk_indices_out,
685 thermal_flux_out,
686 interfacial_heat_flux_current);
687
688 share_interfacial_heat_flux_correction_on_procs(ijk_indices_out, thermal_flux_out);
689 retrieve_interfacial_heat_flux_correction_on_procs(ijk_indices_out, thermal_flux_out, interfacial_heat_flux_dispatched);
690 // share_interfacial_heat_flux_correction_on_procs(ijk_indices_out, thermal_flux_out);
691 // retrieve_interfacial_heat_flux_correction_on_procs();
692
693 for (int itr=0; itr < effective_subproblems_counter_; itr++)
694 one_dimensional_effective_subproblems_[itr]->add_interfacial_heat_flux_neighbours_correction(interfacial_heat_flux_dispatched,
695 interfacial_heat_flux_current);
696}
697
699 ArrOfDouble& thermal_flux_out)
700{
701 const int nb_procs = Process::nproc();
702 const int proc_num = Process::me();
703 if (nb_procs > 1)
704 {
705 const int size_array = thermal_flux_out.size_array();
706 int size_array_global = size_array;
707 size_array_global = Process::check_int_overflow(mp_sum(size_array_global));
708
709 ArrOfInt overall_numerotation(nb_procs);
710 ArrOfInt start_indices(nb_procs);
711 overall_numerotation(proc_num) = size_array;
712 mp_sum_for_each_item(overall_numerotation);
713 int l;
714 for (l=1; l<overall_numerotation.size_array(); l++)
715 start_indices(l) = start_indices(l-1) + overall_numerotation(l-1);
716
717 if (debug_)
718 {
719 Cerr << "Size array" << size_array << finl;
720 Cerr << "Size array global" << size_array_global << finl;
721 Cerr << "Overall_numerotation" << overall_numerotation(0) << "-" << overall_numerotation(1) << finl;
722 }
723
724 ArrOfInt local_indices_i_tmp;
725 ArrOfInt local_indices_j_tmp;
726 ArrOfInt local_indices_k_tmp;
727 ArrOfInt local_indices_dir_tmp;
728 ArrOfDouble local_values_tmp;
729
730 ArrOfInt& global_indices_i_tmp = ijk_indices_out[0];
731 ArrOfInt& global_indices_j_tmp = ijk_indices_out[1];
732 ArrOfInt& global_indices_k_tmp = ijk_indices_out[2];
733 ArrOfInt& global_indices_dir_tmp = ijk_indices_out[3];
734 ArrOfDouble& global_values_tmp = thermal_flux_out;
735
736 local_indices_i_tmp = global_indices_i_tmp;
737 local_indices_j_tmp = global_indices_j_tmp;
738 local_indices_k_tmp = global_indices_k_tmp;
739 local_indices_dir_tmp = global_indices_dir_tmp;
740 local_values_tmp = global_values_tmp;
741
742 global_indices_i_tmp.resize(size_array_global);
743 global_indices_j_tmp.resize(size_array_global);
744 global_indices_k_tmp.resize(size_array_global);
745 global_indices_dir_tmp.resize(size_array_global);
746 global_values_tmp.resize(size_array_global);
747
748 global_indices_i_tmp *= 0;
749 global_indices_j_tmp *= 0;
750 global_indices_k_tmp *= 0;
751 global_indices_dir_tmp *= 0;
752 global_values_tmp *= 0;
753
754 for (l=0; l<local_indices_i_tmp.size_array(); l++)
755 {
756 global_indices_i_tmp(start_indices(proc_num) + l) = local_indices_i_tmp(l);
757 global_indices_j_tmp(start_indices(proc_num) + l) = local_indices_j_tmp(l);
758 global_indices_k_tmp(start_indices(proc_num) + l) = local_indices_k_tmp(l);
759 global_indices_dir_tmp(start_indices(proc_num) + l) = local_indices_dir_tmp(l);
760 global_values_tmp(start_indices(proc_num) + l) = local_values_tmp(l);
761 }
762
763 mp_sum_for_each_item(global_indices_i_tmp);
764 mp_sum_for_each_item(global_indices_j_tmp);
765 mp_sum_for_each_item(global_indices_k_tmp);
766 mp_sum_for_each_item(global_indices_dir_tmp);
767 mp_sum_for_each_item(global_values_tmp);
768 }
769}
770
772 const ArrOfDouble& thermal_flux_out,
773 IJK_Field_vector3_double& interfacial_heat_flux_dispatched)
774{
775 const int ni = ref_ijk_ft_->get_interface().I().ni();
776 const int nj = ref_ijk_ft_->get_interface().I().nj();
777 const int nk = ref_ijk_ft_->get_interface().I().nk();
778
779 const Domaine_IJK& splitting_ns = ref_ijk_ft_->get_interface().I().get_domaine();
780 const int offset_i = splitting_ns.get_offset_local(0);
781 const int offset_j = splitting_ns.get_offset_local(1);
782 const int offset_k = splitting_ns.get_offset_local(2);
783
784 const int size_array = thermal_flux_out.size_array();
785 for (int m=0; m<size_array; m++)
786 {
787 const int i_global = ijk_indices_out[0][m];
788 const int j_global = ijk_indices_out[1][m];
789 const int k_global = ijk_indices_out[2][m];
790 const int i = i_global - offset_i;
791 const int j = j_global - offset_j;
792 const int k = k_global - offset_k;
793 if ((0 <= i && i < ni) && (0 <= j && j < nj) && (0 <= k && k < nk))
794 {
795 const int dir = ijk_indices_out[3][m];
796 const double flux_val = thermal_flux_out[m];
797 interfacial_heat_flux_dispatched[dir](i,j,k) += flux_val;
798 }
799 }
800}
801
802void IJK_One_Dimensional_Subproblems::dispatch_interfacial_heat_flux(IJK_Field_vector3_double& interfacial_heat_flux_dispatched,
803 FixedVector<ArrOfInt, 3>& ijk_indices_out,
804 FixedVector<ArrOfDouble, 3>& thermal_flux_out)
805{
806 for (int c=0; c<3; c++)
807 {
808 interfacial_heat_flux_dispatched[c].data() = 0;
809 ijk_indices_out[c].reset();
810 thermal_flux_out[c].reset();
811 }
812 for (int itr=0; itr < effective_subproblems_counter_; itr++)
813 one_dimensional_effective_subproblems_[itr]->dispatch_interfacial_heat_flux(interfacial_heat_flux_dispatched,
814 ijk_indices_out,
815 thermal_flux_out);
816 for (int itr=0; itr < effective_subproblems_counter_; itr++)
817 one_dimensional_effective_subproblems_[itr]->add_interfacial_heat_flux_neighbours(interfacial_heat_flux_dispatched);
818}
819
820int IJK_One_Dimensional_Subproblems::is_in_map_index_ijk(const std::map<int, std::map<int, std::map<int, int>>>& subproblem_to_ijk_indices,
821 const int& index_i,
822 const int& index_j,
823 const int& index_k)
824{
825 const int count_index_i = (int) subproblem_to_ijk_indices.count(index_i);
826 int count_index_j = 0;
827 int count_index_k = 0;
828 if (count_index_i)
829 {
830 count_index_j = (int) subproblem_to_ijk_indices.at(index_i).count(index_j);
831 if (count_index_j)
832 count_index_k = (int) subproblem_to_ijk_indices.at(index_i).at(index_j).count(index_k);
833 }
834 return (count_index_i && count_index_j && count_index_k);
835}
836
837void IJK_One_Dimensional_Subproblems::set_effective_subproblems(const int& enable_probe_collision_detection)
838{
839 if (!enable_probe_collision_detection)
840 {
843 for (int itr=0; itr < effective_subproblems_counter_; itr++)
844 one_dimensional_effective_subproblems_.push_back(&((*this)[itr]));
845 }
846}
847
849{
850 for (int itr=0; itr < subproblems_counter_; itr++)
851 (*this)[itr].interpolate_indicator_on_probes();
852}
853
855{
857 collision_indices_.reset();
858 // if ((*bubbles_rising_velocities_).size_array() == 1)
859 // return;
860 int disable_probe_collision = 0;
861 int counter_enabled = 0;
862 for (int itr=0; itr < subproblems_counter_; itr++)
863 {
864 disable_probe_collision = (*this)[itr].get_disable_probe_collision();
865 if (disable_probe_collision)
866 {
867 collision_indices_.append_array(itr);
868 (*this)[itr].set_reference_gfm_on_probes(1);
869 }
870 else
871 {
872 (*this)[itr].set_subproblem_index(counter_enabled);
873 one_dimensional_effective_subproblems_.push_back(&((*this)[itr]));
874 counter_enabled++;
875 }
876 }
878 assert(effective_subproblems_counter_==counter_enabled);
879 int counter_disabled = effective_subproblems_counter_;
880 for (int itr=0; itr < collision_indices_.size_array(); itr++)
881 {
882 (*this)[collision_indices_[itr]].set_subproblem_index(counter_disabled);
884 counter_disabled++;
885 }
889}
890
892{
893 for (int itr=0; itr < subproblems_counter_; itr++)
894 (*this)[itr].interpolate_project_velocities_on_probes();
895}
896
898{
899 for (int itr=0; itr < effective_subproblems_counter_; itr++)
900 (*this)[itr].reajust_probe_length();
901}
902
903void IJK_One_Dimensional_Subproblems::reajust_probes_length(const int probe_length_condition)
904{
905 for (int itr=0; itr < effective_subproblems_counter_; itr++)
906 (*this)[itr].compute_modified_probe_length_condition(probe_length_condition);
907}
908
910{
911 if (probe_variations_priority)
913 else
915}
916
918{
919 int probe_variations_enabled = 0;
920 for (int itr=0; itr < effective_subproblems_counter_; itr++)
921 probe_variations_enabled = (probe_variations_enabled || one_dimensional_effective_subproblems_[itr]->get_probe_variations_enabled());
922 return probe_variations_enabled;
923}
924
926{
927 int probe_variations_enabled = 1;
928 for (int itr=0; itr < effective_subproblems_counter_; itr++)
929 probe_variations_enabled = (probe_variations_enabled && one_dimensional_effective_subproblems_[itr]->get_probe_variations_enabled());
930 return probe_variations_enabled;
931}
932
934{
935 for (int itr=0; itr < effective_subproblems_counter_; itr++)
936 (*this)[itr].compute_modified_probe_length(probe_variations_enabled);
937}
938
944
946 const double& interfacial_boundary_condition_value,
947 const int& impose_boundary_condition_interface_from_simulation,
948 const int& boundary_condition_end,
949 const double& end_boundary_condition_value,
950 const int& impose_user_boundary_condition_end_value)
951{
952 for (int itr=0; itr < effective_subproblems_counter_; itr++)
954 interfacial_boundary_condition_value,
955 impose_boundary_condition_interface_from_simulation,
956 boundary_condition_end,
957 end_boundary_condition_value,
958 impose_user_boundary_condition_end_value);
959}
960
968
976
978{
979 for (int itr=0; itr < effective_subproblems_counter_; itr++)
980 one_dimensional_effective_subproblems_[itr]->retrieve_temperature_solution();
981}
982
984{
985 for (int itr=0; itr < effective_subproblems_counter_; itr++)
986 one_dimensional_effective_subproblems_[itr]->compute_local_temperature_gradient_solution();
987}
988
994
995void IJK_One_Dimensional_Subproblems::get_subproblem_ijk_indices(int& i, int& j, int& k, int& subproblem_index) const
996{
997 one_dimensional_effective_subproblems_[subproblem_index]->get_ijk_indices(i,j,k);
998}
999
1000const int& IJK_One_Dimensional_Subproblems::get_dxyz_increment_bool(const int& subproblem_index) const
1001{
1002 return one_dimensional_effective_subproblems_[subproblem_index]->get_dxyz_increment_bool();
1003}
1004
1006{
1007 return one_dimensional_effective_subproblems_[subproblem_index]->get_dxyz_over_two_increment_bool();
1008}
1009
1011{
1012 return one_dimensional_effective_subproblems_[subproblem_index]->get_pure_neighbours_corrected_sign();
1013}
1014
1015const std::vector<std::vector<std::vector<bool>>>& IJK_One_Dimensional_Subproblems::get_pure_neighbours_to_correct(const int& subproblem_index) const
1016{
1017 return one_dimensional_effective_subproblems_[subproblem_index]->get_pure_neighbours_to_correct();
1018}
1019
1020const std::vector<std::vector<std::vector<double>>>& IJK_One_Dimensional_Subproblems::get_pure_neighbours_corrected_distance(const int& subproblem_index) const
1021{
1022 return one_dimensional_effective_subproblems_[subproblem_index]->get_pure_neighbours_corrected_distance();
1023}
1024
1025const std::vector<std::vector<std::vector<double>>>& IJK_One_Dimensional_Subproblems::get_pure_neighbours_corrected_colinearity(const int& subproblem_index) const
1026{
1027 return one_dimensional_effective_subproblems_[subproblem_index]->get_pure_neighbours_corrected_colinearity();
1028}
1029
1030const std::vector<std::vector<std::vector<std::vector<bool>>>> IJK_One_Dimensional_Subproblems::get_pure_neighbours_last_faces_to_correct(const int& subproblem_index) const
1031{
1032 return one_dimensional_effective_subproblems_[subproblem_index]->get_pure_neighbours_last_faces_to_correct();
1033}
1034const std::vector<std::vector<std::vector<std::vector<double>>>> IJK_One_Dimensional_Subproblems::get_pure_neighbours_last_faces_corrected_distance(const int& subproblem_index) const
1035{
1036 return one_dimensional_effective_subproblems_[subproblem_index]->get_pure_neighbours_last_faces_corrected_distance();
1037}
1038const std::vector<std::vector<std::vector<std::vector<double>>>> IJK_One_Dimensional_Subproblems::get_pure_neighbours_last_faces_corrected_colinearity(const int& subproblem_index) const
1039{
1040 return one_dimensional_effective_subproblems_[subproblem_index]->get_pure_neighbours_last_faces_corrected_colinearity();
1041}
1042
1044{
1045 return one_dimensional_effective_subproblems_[i]->get_interfacial_gradient_corrected();
1046}
1047
1048double IJK_One_Dimensional_Subproblems::get_temperature_profile_at_point(const int& i, const double& dist) const
1049{
1050 return one_dimensional_effective_subproblems_[i]->get_temperature_profile_at_point(dist);
1051}
1052
1054{
1055 return one_dimensional_effective_subproblems_[i]->get_bary_facet();
1056}
1057
1059{
1060 return one_dimensional_effective_subproblems_[i]->get_dist_cell();
1061}
1062
1067
1069 const int& i,
1070 const int& l,
1071 const int& flux_type)
1072{
1073 one_dimensional_effective_subproblems_[i]->set_pure_flux_corrected(flux_face, l, flux_type);
1074}
1075
1077{
1078 one_dimensional_effective_subproblems_[i]->compute_error_flux_interface();
1079}
1080
1086
1087void IJK_One_Dimensional_Subproblems::compare_flux_interface(const int& i, std::vector<double>& radial_flux_error)
1088{
1089 one_dimensional_effective_subproblems_[i]->compare_flux_interface(radial_flux_error);
1090}
1091
1093{
1094 return one_dimensional_effective_subproblems_[i]->get_corrective_flux_from_neighbours(l);
1095}
1096
1098{
1099 return one_dimensional_effective_subproblems_[i]->get_corrective_flux_from_current(l);
1100}
1101
1107
1108
1110 const double& dist,
1111 const int& dir,
1112 bool& valid_val,
1113 const int& l,
1114 const int& index_i,
1115 const int& index_j,
1116 const int& index_k,
1117 const int& temperature) const
1118{
1119 return one_dimensional_effective_subproblems_[i]->get_temperature_times_velocity_profile_at_point(dist,
1120 dir,
1121 valid_val,
1122 l,
1123 index_i,
1124 index_j,
1125 index_k,
1126 temperature);
1127}
1128
1129DoubleVect IJK_One_Dimensional_Subproblems::get_temperature_profile_discrete_integral_at_point(const int& i, const double& dist, const int& level, const int& dir)
1130{
1131 return one_dimensional_effective_subproblems_[i]->get_temperature_profile_discrete_integral_at_point(dist, level, dir);
1132}
1133
1135 const double& dist,
1136 const int& level,
1137 const int& dir,
1138 const int& l)
1139{
1140 return one_dimensional_effective_subproblems_[i]->get_temperature_times_velocity_profile_discrete_integral_at_point(dist, level, dir, l);
1141}
1142
1143double IJK_One_Dimensional_Subproblems::get_temperature_gradient_profile_at_point(const int& i, const double& dist, const int& dir)
1144{
1145 return one_dimensional_effective_subproblems_[i]->get_temperature_gradient_profile_at_point(dist, dir);
1146}
1147
1148double IJK_One_Dimensional_Subproblems::get_temperature_gradient_times_conductivity_profile_at_point(const int& i, const double& dist, const int& dir, bool& valid_val)
1149{
1150 return one_dimensional_effective_subproblems_[i]->get_temperature_gradient_times_conductivity_profile_at_point(dist, dir, valid_val);
1151}
1152
1153DoubleVect IJK_One_Dimensional_Subproblems::get_temperature_gradient_profile_discrete_integral_at_point(const int& i, const double& dist, const int& level, const int& dir)
1154{
1155 return one_dimensional_effective_subproblems_[i]->get_temperature_gradient_profile_discrete_integral_at_point(dist, level, dir);
1156}
1157
1158DoubleVect IJK_One_Dimensional_Subproblems::get_temperature_gradient_times_conductivity_profile_discrete_integral_at_point(const int& i, const double& dist, const int& level, const int& dir)
1159{
1160 return one_dimensional_effective_subproblems_[i]->get_temperature_gradient_times_conductivity_profile_discrete_integral_at_point(dist, level, dir);
1161}
1162
1163void IJK_One_Dimensional_Subproblems::compare_fluxes_thermal_subproblems(const IJK_Field_vector3_double& convective_diffusive_fluxes_raw,
1164 const int flux_type,
1165 const int inv_sign)
1166{
1167 for (int itr=0; itr < effective_subproblems_counter_; itr++)
1169 flux_type,
1170 inv_sign);
1171}
1172
1173
1174Nom IJK_One_Dimensional_Subproblems::get_header_from_string_lists(const std::vector<std::string>& key_results_int,
1175 const std::vector<std::string>& key_results_double)
1176{
1177 Nom probe_header;
1178 int i;
1179 probe_header = key_results_int[0];
1180 const int size_int = (int) key_results_int.size();
1181 const int size_double = (int) key_results_double.size();
1182 for (i=1; i<size_int; i++)
1183 probe_header += ("\t" + key_results_int[i]);
1184 for (i=0; i<size_double; i++)
1185 probe_header += ("\t" + key_results_double[i]);
1186 return probe_header;
1187}
1188
1189void IJK_One_Dimensional_Subproblems::set_results_probes_size(const std::vector<std::string>& key_results_int,
1190 const std::vector<std::string>& key_results_double,
1191 std::map<std::string, ArrOfInt>& results_probes_int,
1192 std::map<std::string, ArrOfDouble>& results_probes_double)
1193{
1194 // Below 1000 per simu ? * nb_procs ? Is it a problem ?
1195 const int size_outputs = global_subproblems_counter_;
1196 const int size_int = (int) key_results_int.size();
1197 const int size_double = (int) key_results_double.size();
1198 int i;
1199 for (i=0; i<size_int; i++)
1200 results_probes_int[key_results_int[i]] = ArrOfInt(size_outputs);
1201 for (i=0; i<size_double; i++)
1202 results_probes_double[key_results_double[i]] = ArrOfDouble(size_outputs);
1203}
1204
1206 const std::vector<std::string>& key_results_int,
1207 const std::vector<std::string>& key_results_double,
1208 std::map<std::string, ArrOfInt>& results_probes_int,
1209 std::map<std::string, ArrOfDouble>& results_probes_double)
1210{
1211 const int size_outputs = global_subproblems_counter_;
1212 const int size_int = (int) results_probes_int.size();
1213 const int size_double = (int) results_probes_double.size();
1214 int i,j;
1215 for (j=0; j<size_outputs; j++)
1216 {
1217 for (i=0; i<size_int; i++)
1218 fic << results_probes_int[key_results_int[i]](j) << " ";
1219 for (i=0; i<size_double-1; i++)
1220 fic << results_probes_double[key_results_double[i]](j) << " ";
1221 fic << results_probes_double[key_results_double[size_double-1]](j) << finl;
1222 }
1223}
1224
1226 const Nom& interfacial_quantities_thermal_probes,
1227 const Nom& shell_quantities_thermal_probes,
1228 const Nom& overall_bubbles_quantities,
1229 const Nom& local_quantities_thermal_probes_time_index_folder)
1230{
1231
1232 std::map<std::string, ArrOfDouble> results_probes_interf_double;
1233 std::map<std::string, ArrOfInt> results_probes_interf_int;
1234 std::map<std::string, ArrOfDouble> results_probes_shell_double;
1235 std::map<std::string, ArrOfInt> results_probes_shell_int;
1236
1237 std::vector<std::string> key_results_int = {"tstep", "thermal_rank", "post_pro_index", "global_subproblem", "local_subproblem"};
1238 std::vector<std::string> key_results_double = {"time",
1239 "coord",
1240 "nx", "ny", "nz",
1241 "t1x", "t1y", "t1z", "t2x", "t2y", "t2z",
1242 "s1x", "s1y", "s1z", "s2x", "s2y", "s2z",
1243 "r_sph", "theta_sph", "phi_sph",
1244 "temperature_interp","temperature_sol", "temperature_prev",
1245 "temperature_gradient", "temperature_gradient_sol",
1246 "temperature_gradient_gfm",
1247 "temperature_double_deriv", "temperature_double_deriv_sol",
1248 "temperature_gradient_tangential","temperature_gradient_tangential2",
1249 "temperature_gradient_tangential_rise","temperature_gradient_azymuthal",
1250 "temperature_diffusion_hessian_cartesian_trace",
1251 "temperature_diffusion_hessian_trace",
1252 "radial_temperature_diffusion",
1253 "radial_temperature_diffusion_sol",
1254 "tangential_temperature_diffusion",
1255 "radial_scale_factor_inerp", "radial_scale_factor_sol",
1256 "radial_convection_interp", "radial_convection_sol",
1257 "tangential_convection_first", "tangential_convection_second",
1258 "surface","thermal_flux",
1259 "thermal_flux_gfm", "thermal_flux_raw",
1260 "thermal_flux_lrs", "thermal_flux_max",
1261 "lambda_liq","alpha_liq","prandtl_liq",
1262 "nusselt_number","nusselt_number_liquid_temperature",
1263 "nusselt_number_integrand","nusselt_number_liquid_temperature_integrand",
1264 "shear","force",
1265 "pressure",
1266 "u_x","u_y","u_z",
1267 "u_r","u_r_corr","u_r_static","u_r_advected",
1268 "u_theta","u_theta_corr","u_theta_static","u_theta_advected",
1269 "u_theta2","u_theta2_corr","u_theta2_static","u_theta2_advected",
1270 "u_theta_rise","u_theta_rise_corr","u_theta_rise_static","u_theta_rise_advected",
1271 "u_phi","u_phi_corr","u_phi_static","u_phi_advected",
1272 "du_r_dr","du_theta_dr","du_theta2_dr","du_theta_rise_dr","du_phi_dr",
1273 "total_surface", "total_volume", "radius_from_surface", "radius_from_volume",
1274 "delta_temperature", "mean_liquid_temperature",
1275 "rising_dir_x", "rising_dir_y", "rising_dir_z",
1276 "rising_vel_x","rising_vel_y", "rising_vel_z",
1277 "rising_vel"
1278 };
1279
1280 Nom probe_header = get_header_from_string_lists(key_results_int, key_results_double);
1281 set_results_probes_size(key_results_int,
1282 key_results_double,
1283 results_probes_interf_int,
1284 results_probes_interf_double);
1285 set_results_probes_size(key_results_int,
1286 key_results_double,
1287 results_probes_shell_int,
1288 results_probes_shell_double);
1289 // Common to all procs
1290 int i;
1291 const int size_outputs = global_subproblems_counter_;
1292 const int size_int = (int) key_results_int.size();
1293 const int size_double = (int) key_results_double.size();
1294
1295
1296 for (int itr=0; itr < size_outputs; itr++)
1297 {
1298 // const int global_index_post_processed = global_indices_post_processed_(itr);
1299 if (itr >= index_ini_ && itr < index_end_)
1300 {
1301
1302 Cerr << "Post-process this probe on proc:" << Process::me() << finl;
1303 (*this)[itr - index_ini_].retrieve_interfacial_quantities(rank,
1304 itr,
1305 key_results_int,
1306 key_results_double,
1307 results_probes_interf_int,
1308 results_probes_interf_double);
1309 (*this)[itr - index_ini_].retrieve_shell_quantities(rank,
1310 itr,
1311 key_results_int,
1312 key_results_double,
1313 results_probes_shell_int,
1314 results_probes_shell_double);
1315 }
1316 }
1317 for (i=0; i<size_int; i++)
1318 {
1319 ArrOfInt& array_int_interf_tmp = results_probes_interf_int[key_results_int[i]];
1320 mp_sum_for_each_item(array_int_interf_tmp);
1321 ArrOfInt& array_int_shell_tmp = results_probes_shell_int[key_results_int[i]];
1322 mp_sum_for_each_item(array_int_shell_tmp);
1323 }
1324 for (i=0; i<size_double; i++)
1325 {
1326 ArrOfDouble& array_double_interf_tmp = results_probes_interf_double[key_results_double[i]];
1327 mp_sum_for_each_item(array_double_interf_tmp);
1328 ArrOfDouble& array_double_shell_tmp = results_probes_shell_double[key_results_double[i]];
1329 mp_sum_for_each_item(array_double_shell_tmp);
1330 }
1331 /*
1332 * Post-process all probes for interfacial quantities
1333 */
1334 const int reset = 1;
1335 const int last_time_index = ref_ijk_ft_->schema_temps_ijk().get_tstep() + (*latastep_reprise_);
1336 const int max_digit = 3;
1337 const int max_digit_time = 8;
1338 const int max_rank_digit = rank < 1 ? 1 : (int) (log10(rank) + 1);
1339 const int nb_digit_tstep = last_time_index < 1 ? 1 : (int) (log10(last_time_index) + 1);
1340
1341 if (debug_)
1342 Cerr << "Post-process interfacial quantities" << finl;
1343 Nom probe_interf_name = Nom("_thermal_rank_") + Nom(std::string(max_digit - max_rank_digit, '0')) + Nom(rank)
1344 + Nom("_thermal_subproblems_interfacial_quantities_time_index_")
1345 + Nom(std::string(max_digit_time - nb_digit_tstep, '0')) + Nom(last_time_index) + Nom(".out");
1346 Nom probe_shell_name = Nom("_thermal_rank_") + Nom(std::string(max_digit - max_rank_digit, '0')) + Nom(rank)
1347 + Nom("_thermal_subproblems_shell_quantities_time_index_")
1348 + Nom(std::string(max_digit_time - nb_digit_tstep, '0')) + Nom(last_time_index) + Nom(".out");
1349
1351 {
1352 SFichier fic_interf = Open_file_folder(interfacial_quantities_thermal_probes, probe_interf_name, probe_header, reset);
1353 set_results_probes_fic(fic_interf,
1354 key_results_int,
1355 key_results_double,
1356 results_probes_interf_int,
1357 results_probes_interf_double);
1358 fic_interf.close();
1359 SFichier fic_shell = Open_file_folder(shell_quantities_thermal_probes, probe_shell_name, probe_header, reset);
1360 set_results_probes_fic(fic_shell,
1361 key_results_int,
1362 key_results_double,
1363 results_probes_shell_int,
1364 results_probes_shell_double);
1365 fic_shell.close();
1366 }
1367
1368 if (debug_)
1369 Cerr << "Post-process local radial quantities" << finl;
1370 for (int itr=0; itr < subproblems_counter_; itr++)
1371 (*this)[itr].thermal_subresolution_outputs_parallel(rank, local_quantities_thermal_probes_time_index_folder);
1372
1373 if (debug_)
1374 Cerr << "Post-process overall bubble quantities" << finl;
1375 post_process_overall_bubbles_quantities(rank, overall_bubbles_quantities);
1376}
1377
1379 const Nom& interfacial_quantities_thermal_probes,
1380 const Nom& shell_quantities_thermal_probes,
1381 const Nom& overall_bubbles_quantities,
1382 const Nom& local_quantities_thermal_probes_time_index_folder)
1383{
1384 /*
1385 * Replace routines for parallel calculation
1386 */
1387 Cerr << "Post-processing on the probes" << finl;
1388 const int reset = 1;
1389 const int last_time_index = ref_ijk_ft_->schema_temps_ijk().get_tstep() + (*latastep_reprise_);
1390 Nom probe_header = Nom("tstep\tthermal_rank\tpost_pro_index\tglobal_subproblem\tlocal_subproblem\ttime"
1391 "\tcoord\tnx\tny\tnz\tt1x\tt1y\tt2z\tt2x\tt2y\tt2z\ts1x\ts1y\ts1z\ts2x\ts2y\ts2z"
1392 "\tr_sph\ttheta_sph\tphi_sph"
1393 "\ttemperature_interp\ttemperature_sol\ttemperature_prev"
1394 "\ttemperature_gradient\ttemperature_gradient_sol"
1395 "\temperature_gradient_gfm"
1396 "\ttemperature_double_deriv\ttemperature_double_deriv_sol"
1397 "\ttemperature_gradient_tangential\ttemperature_gradient_tangential2"
1398 "\ttemperature_gradient_tangential_rise\ttemperature_gradient_azymuthal"
1399 "\ttemperature_diffusion_hessian_cartesian_trace"
1400 "\ttemperature_diffusion_hessian_trace"
1401 "\tradial_temperature_diffusion"
1402 "\tradial_temperature_diffusion_sol"
1403 "\ttangential_temperature_diffusion"
1404 "\tradial_scale_factor_interp\tradial_scale_factor_sol"
1405 "\tradial_convection_interp\tradial_convection_sol"
1406 "\ttangential_convection_first\ttangential_convection_second"
1407 "\tsurface\tthermal_flux\tlambda_liq\talpha_liq\tprandtl_liq"
1408 "\tnusselt_number\tnusselt_number_liquid_temperature"
1409 "\tnusselt_number_integrand\tnusselt_number_liquid_temperature_integrand"
1410 "\tshear\tforce"
1411 "\tpressure"
1412 "\tu_x\tu_y\tu_z"
1413 "\tu_r\tu_r_corr\tu_r_static\tu_r_advected"
1414 "\tu_theta\tu_theta_corr\tu_theta_static\tu_theta_advected"
1415 "\tu_theta2\tu_theta2_corr\tu_theta2_static\tu_theta2_advected"
1416 "\tu_theta_rise\tu_theta_rise_corr\tu_theta_rise_static\tu_theta_rise_advected"
1417 "\tu_phi\tu_phi_corr\tu_phi_static\tu_phi_advected"
1418 "\tdu_r_dr\tdu_theta_dr\tdu_theta2_dr\tdu_theta_rise_dr\tdu_phi_dr"
1419 "\ttotal_surface\ttotal_volume\tradius_from_surface\tradius_from_volume"
1420 "\tdelta_temperature\tmean_liquid_temperature"
1421 "\trising_dir_x\trising_dir_y\trising_dir_z"
1422 "\trising_vel_x\trising_vel_y\trising_vel_z"
1423 "\trising_vel");
1424
1425 const int max_digit = 3;
1426 const int max_digit_time = 8;
1427 const int max_rank_digit = rank < 1 ? 1 : (int) (log10(rank) + 1);
1428 const int nb_digit_tstep = last_time_index < 1 ? 1 : (int) (log10(last_time_index) + 1);
1429
1430 Nom interf_probe_name = Nom("_thermal_rank_") + Nom(std::string(max_digit - max_rank_digit, '0')) + Nom(rank)
1431 + Nom("_thermal_subproblems_interfacial_quantities_time_index_")
1432 + Nom(std::string(max_digit_time - nb_digit_tstep, '0')) + Nom(last_time_index) + Nom(".out");
1433 Nom shell_probe_name = Nom("_thermal_rank_") + Nom(std::string(max_digit - max_rank_digit, '0')) + Nom(rank)
1434 + Nom("_thermal_subproblems_shell_quantities_time_index_")
1435 + Nom(std::string(max_digit_time - nb_digit_tstep, '0')) + Nom(last_time_index) + Nom(".out");
1436
1437 const int proc_number = Process::nproc();
1438 if (proc_number != 1)
1439 {
1440 const int my_process_number = Process::me();
1441 Nom my_process_string = Nom(".processor_") + Nom(my_process_number);
1442 interf_probe_name += my_process_string;
1443 shell_probe_name += my_process_string;
1444 }
1445
1446 /*
1447 * Post-process all probes for interfacial quantities
1448 */
1449 SFichier fic_interf = Open_file_folder(interfacial_quantities_thermal_probes, interf_probe_name, probe_header, reset);
1450 SFichier fic_shell = Open_file_folder(shell_quantities_thermal_probes, shell_probe_name, probe_header, reset);
1451
1452 for (int itr=0; itr < subproblems_counter_; itr++)
1453 (*this)[itr].thermal_subresolution_outputs(fic_interf,
1454 fic_shell,
1455 rank,
1456 local_quantities_thermal_probes_time_index_folder);
1457 fic_interf.close();
1458 fic_shell.close();
1459
1460 post_process_overall_bubbles_quantities(rank, overall_bubbles_quantities);
1461}
1462
1464{
1465 double min_temperature = 1e20;
1466 for (int itr=0; itr < subproblems_counter_; itr++)
1467 {
1468 min_temperature = std::min(min_temperature, (*this)[itr].get_min_temperature());
1469 }
1470 min_temperature = Process::mp_min(min_temperature);
1471 return min_temperature;
1472}
1473
1475{
1476 double max_temperature = -1e20;
1477 for (int itr=0; itr < subproblems_counter_; itr++)
1478 {
1479 max_temperature = std::max(max_temperature, (*this)[itr].get_max_temperature());
1480 }
1481 max_temperature = Process::mp_max(max_temperature);
1482 return max_temperature;
1483}
1484
1486{
1487 double min_temperature = -1e20;
1488 for (int itr=0; itr < subproblems_counter_; itr++)
1489 {
1490 min_temperature = std::min(min_temperature, (*this)[itr].get_min_temperature_domain_ends());
1491 }
1492 min_temperature = Process::mp_min(min_temperature);
1493 return min_temperature;
1494}
1495
1497{
1498 double max_temperature = -1e20;
1499 for (int itr=0; itr < subproblems_counter_; itr++)
1500 {
1501 max_temperature = std::max(max_temperature, (*this)[itr].get_max_temperature_domain_ends());
1502 }
1503 max_temperature = Process::mp_max(max_temperature);
1504 return max_temperature;
1505}
1506
1508{
1509 double min_euler_time_step = 1e20;
1510 nb_iter_explicit = 1;
1511 for (int itr=0; itr < subproblems_counter_; itr++)
1512 {
1513 min_euler_time_step = std::min(min_euler_time_step, (*this)[itr].get_local_time_step_round());
1514 nb_iter_explicit = std::max(nb_iter_explicit, (*this)[itr].get_nb_iter_explicit());
1515 }
1516 min_euler_time_step = Process::mp_min(min_euler_time_step);
1517 nb_iter_explicit = Process::mp_max(nb_iter_explicit);
1518 return min_euler_time_step;
1519}
1520
1522{
1523 double max_local_fourier_time_step_probe_length = 0.;
1524 for (int itr=0; itr < subproblems_counter_; itr++)
1525 {
1526 max_local_fourier_time_step_probe_length = std::max(max_local_fourier_time_step_probe_length,
1527 (*this)[itr].get_local_fourier_time_step_probe_length());
1528 }
1529 max_local_fourier_time_step_probe_length = Process::mp_max(max_local_fourier_time_step_probe_length);
1530 return max_local_fourier_time_step_probe_length;
1531}
1532
1533
1535{
1536 double max_local_cfl_time_step_probe_length = 0.;
1537 for (int itr=0; itr < subproblems_counter_; itr++)
1538 {
1539 max_local_cfl_time_step_probe_length = std::max(max_local_cfl_time_step_probe_length,
1540 (*this)[itr].get_local_cfl_time_step_probe_length());
1541 }
1542 max_local_cfl_time_step_probe_length = Process::mp_max(max_local_cfl_time_step_probe_length);
1543 return max_local_cfl_time_step_probe_length;
1544}
1545
1547{
1548 double min_local_fourier_time_step_probe_length = 1.e20;
1549 for (int itr=0; itr < subproblems_counter_; itr++)
1550 {
1551 min_local_fourier_time_step_probe_length = std::min(min_local_fourier_time_step_probe_length,
1552 (*this)[itr].get_local_fourier_time_step_probe_length());
1553 }
1554 min_local_fourier_time_step_probe_length = Process::mp_min(min_local_fourier_time_step_probe_length);
1555 return min_local_fourier_time_step_probe_length;
1556}
1557
1558
1560{
1561 double min_local_cfl_time_step_probe_length = 1.e20;
1562 for (int itr=0; itr < subproblems_counter_; itr++)
1563 {
1564 min_local_cfl_time_step_probe_length = std::min(min_local_cfl_time_step_probe_length,
1565 (*this)[itr].get_local_cfl_time_step_probe_length());
1566 }
1567 min_local_cfl_time_step_probe_length = Process::mp_min(min_local_cfl_time_step_probe_length);
1568 return min_local_cfl_time_step_probe_length;
1569}
1570
1572{
1573 double min_local_dt_cfl = 1.e20;
1574 for (int itr=0; itr < subproblems_counter_; itr++)
1575 {
1576 min_local_dt_cfl = std::min(min_local_dt_cfl, (*this)[itr].get_local_dt_cfl());
1577 }
1578 min_local_dt_cfl = Process::mp_min(min_local_dt_cfl);
1579 return min_local_dt_cfl;
1580}
1581
1583{
1584 double min_local_dt_cfl_min_delta_xyz = 1.e20;
1585 for (int itr=0; itr < subproblems_counter_; itr++)
1586 {
1587 min_local_dt_cfl_min_delta_xyz = std::min(min_local_dt_cfl_min_delta_xyz, (*this)[itr].get_local_dt_cfl_min_delta_xyz());
1588 }
1589 min_local_dt_cfl_min_delta_xyz = Process::mp_min(min_local_dt_cfl_min_delta_xyz);
1590 return min_local_dt_cfl_min_delta_xyz;
1591}
1592
1594{
1595 for (int itr=0; itr < subproblems_counter_; itr++)
1596 (*this)[itr].set_local_time_step(local_time_step);
1597}
1598
1600{
1601 for (int itr=0; itr < subproblems_counter_; itr++)
1602 (*this)[itr].prepare_temporal_schemes();
1603}
1604
1606{
1607 return (*this)[index].get_end_index_subproblem();
1608}
1609
1611{
1612 for (int itr=0; itr < subproblems_counter_; itr++)
1613 (*this)[itr].set_post_processing_theta_phi_scope(0);
1614}
1615
1617 const int& nb_theta, const int& nb_phi,
1618 const int theta_diag_val, const int phi_diag_val)
1619{
1620 if (post_process_all_probes)
1622 else
1623 {
1624 const int nb_subproblems_total = global_subproblems_counter_;
1625 Cerr << global_subproblems_counter_ << finl;
1626
1627 ArrOfDouble r_sph(nb_subproblems_total);
1628 ArrOfDouble theta_sph(nb_subproblems_total);
1629 ArrOfDouble phi_sph(nb_subproblems_total);
1630 ArrOfDouble theta_scope;
1631 ArrOfDouble phi_scope;
1632 int nb_theta_even = nb_theta;
1633 int nb_phi_even = nb_phi;
1634 if (nb_theta_even % 2)
1635 nb_theta_even += 1;
1636 if (nb_phi_even % 2)
1637 nb_phi_even += 1;
1638 int i, j, k;
1639 for (i=0; i<subproblems_counter_; i++)
1640 {
1641 r_sph(i + index_ini_) = (*this)[i].get_radius_spherical_coords();
1642 theta_sph(i + index_ini_) = (*this)[i].get_theta_spherical_coords();
1643 phi_sph(i + index_ini_) = (*this)[i].get_phi_spherical_coords();
1644 }
1645
1646 mp_sum_for_each_item(r_sph);
1647 mp_sum_for_each_item(theta_sph);
1648 mp_sum_for_each_item(phi_sph);
1649
1650 int nb_outputs = ((nb_phi_even * nb_theta_even) > nb_subproblems_total) ? nb_subproblems_total : (nb_phi_even * nb_theta_even);
1651 nb_theta_even = (nb_outputs == nb_subproblems_total) ? (int) sqrt(2 * nb_subproblems_total) / 2 : nb_theta_even;
1652 nb_phi_even = (nb_outputs == nb_subproblems_total) ? (int) sqrt(2 * nb_subproblems_total) : nb_phi_even;
1653 nb_outputs = nb_phi_even * nb_theta_even;
1654 double theta_incr, phi_incr;
1655 theta_incr = (double) (M_PI / (double) nb_theta_even);
1656 phi_incr = (double) ((2 * M_PI) / (double) nb_phi_even);
1657 const double atan_theta_incr_ini = M_PI / 2;
1658 const double atan_incr_factor = -1;
1659 const double atan_phi_incr_ini = M_PI;
1660 // PI/2 -> -PI/2
1661 if (theta_diag_val)
1662 for (i=0; i<nb_theta_even; i++)
1663 theta_scope.append_array((theta_incr * (i + 0.5) - atan_theta_incr_ini) * atan_incr_factor);
1664 else
1665 for (i=0; i<nb_theta_even; i++)
1666 theta_scope.append_array((theta_incr * i - atan_theta_incr_ini) * atan_incr_factor);
1667 if (phi_diag_val)
1668 for (i=0; i<nb_phi_even; i++)
1669 phi_scope.append_array(phi_incr * (i + 0.5) - atan_phi_incr_ini);
1670 else
1671 for (i=0; i<nb_phi_even; i++)
1672 phi_scope.append_array(phi_incr * i - atan_phi_incr_ini);
1673 /*
1674 * Sort by phi and theta simultaneously
1675 */
1676 radius_outputs_.resize(nb_outputs);
1677 theta_outputs_.resize(nb_outputs);
1678 phi_outputs_.resize(nb_outputs);
1679 global_indices_post_processed_.resize(nb_outputs);
1680 int phi_theta_counter = 0;
1681 for (j=0; j<nb_phi_even; j++)
1682 for (i=0; i<nb_theta_even; i++)
1683 {
1684 ArrOfDouble theta_diff = theta_sph;
1685 ArrOfDouble phi_diff = phi_sph;
1686 std::vector<double> sum_errors_theta_phi_scope;
1687 theta_diff -= theta_scope(i);
1688 phi_diff -= phi_scope(j);
1689 for (k=0; k<nb_subproblems_total; k++)
1690 {
1691 theta_diff(k) = abs(theta_diff(k));
1692 phi_diff(k) = abs(phi_diff(k));
1693 sum_errors_theta_phi_scope.push_back(theta_diff(k));
1694 sum_errors_theta_phi_scope[k] += phi_diff(k);
1695 }
1696
1697
1698 const int theta_phi_scope_index = (int) std::distance(sum_errors_theta_phi_scope.begin(),
1699 std::min_element(sum_errors_theta_phi_scope.begin(),
1700 sum_errors_theta_phi_scope.end()));
1701
1702 radius_outputs_(phi_theta_counter) = r_sph(theta_phi_scope_index);
1703 theta_outputs_(phi_theta_counter) = theta_sph(theta_phi_scope_index);
1704 phi_outputs_(phi_theta_counter) = phi_sph(theta_phi_scope_index);
1705 global_indices_post_processed_(phi_theta_counter) = theta_phi_scope_index;
1706 phi_theta_counter ++;
1707 }
1708
1709 if (debug_)
1710 {
1711 Cerr << radius_outputs_ << finl;
1712 Cerr << theta_outputs_ << finl;
1713 Cerr << phi_outputs_ << finl;
1714 Cerr << global_indices_post_processed_ << finl;
1715 }
1716
1717 ArrOfDouble radius_outputs_tmp = radius_outputs_;
1718 ArrOfDouble theta_outputs_tmp = theta_outputs_;
1719 ArrOfDouble phi_outputs_tmp = phi_outputs_;
1720 ArrOfInt global_indices_post_processed_tmp = global_indices_post_processed_;
1721
1722 int ii;
1723 std::vector<int> indices_theta_sorted = arg_sort_array(theta_outputs_);
1724 for (ii=0; ii<nb_outputs; ii++)
1725 {
1726 radius_outputs_(ii) = radius_outputs_tmp(indices_theta_sorted[ii]);
1727 theta_outputs_(ii) = theta_outputs_tmp(indices_theta_sorted[ii]);
1728 phi_outputs_(ii) = phi_outputs_tmp(indices_theta_sorted[ii]);
1729 global_indices_post_processed_(ii) = global_indices_post_processed_tmp(indices_theta_sorted[ii]);
1730 }
1731
1732 std::vector<int> indices_phi_sorted = arg_sort_array_phi(theta_scope, theta_outputs_, phi_outputs_);
1733 radius_outputs_tmp = radius_outputs_;
1734 theta_outputs_tmp = theta_outputs_;
1735 phi_outputs_tmp = phi_outputs_;
1736 global_indices_post_processed_tmp = global_indices_post_processed_;
1737 for (ii=0; ii<nb_outputs; ii++)
1738 {
1739 radius_outputs_(ii) = radius_outputs_tmp(indices_phi_sorted[ii]);
1740 theta_outputs_(ii) = theta_outputs_tmp(indices_phi_sorted[ii]);
1741 phi_outputs_(ii) = phi_outputs_tmp(indices_phi_sorted[ii]);
1742 global_indices_post_processed_(ii) = global_indices_post_processed_tmp(indices_phi_sorted[ii]);
1743 }
1744
1745 phi_theta_counter = 0;
1746 for (ii=0; ii<nb_outputs; ii++)
1747 {
1748 const int global_index = global_indices_post_processed_(ii);
1749 if (global_index >= index_ini_ && global_index < index_end_)
1750 (*this)[global_index - index_ini_].set_post_processing_theta_phi_scope(phi_theta_counter);
1751 phi_theta_counter++;
1752 }
1753 }
1754}
1755
1756void IJK_One_Dimensional_Subproblems::compute_overall_quantities_per_bubbles(const IJK_Field_double& temperature_gradient_ghost,
1757 const double& delta_temperature,
1758 const double& lambda)
1759{
1760 std::vector<int> compo_found;
1761 int local_compo;
1762 for (int itr=0; itr < subproblems_counter_; itr++)
1763 {
1764 local_compo = (*this)[itr].get_compo();
1765 if (std::find(compo_found.begin(), compo_found.end(), local_compo) == compo_found.end())
1766 compo_found.push_back(local_compo);
1767 }
1768 // First bubble at index zero
1769 nb_bubbles_ = (int) std::distance(compo_found.begin(), std::max_element(compo_found.begin(), compo_found.end()));
1770 nb_bubbles_ += 1;
1772
1773 /*
1774 * Should be the same size on each processor
1775 */
1784
1786
1794
1802
1805
1806 //--------------------------------------------------------------------------------------------
1807
1812
1815
1816 //--------------------------------------------------------------------------------------------
1817
1820
1823
1826
1829
1830 //--------------------------------------------------------------------------------------------
1831
1836
1840
1844
1848
1852
1853 //--------------------------------------------------------------------------------------------
1854
1858
1862
1866
1870
1871 //--------------------------------------------------------------------------------------------
1872
1877
1880
1884
1885 //--------------------------------------------------------------------------------------------
1886
1891
1894
1898
1899 //--------------------------------------------------------------------------------------------
1900
1905
1908
1912
1913 //--------------------------------------------------------------------------------------------
1914
1917
1920
1923
1926
1929
1932
1933 //--------------------------------------------------------------------------------------------
1934
1935 for (int dir=0; dir<3; dir++)
1936 {
1941 }
1942
1943 assert((*bubbles_rising_velocities_).size_array() == nb_bubbles_);
1945
1946 compute_nusselt_numbers_per_bubbles(temperature_gradient_ghost, delta_temperature, lambda);
1948 compo_found.clear();
1949}
1950
1952{
1953 uniform_alpha_ = ref_thermal_subresolution.uniform_alpha_;
1957 caracteristic_length_ = (ref_thermal_subresolution.single_centred_bubble_radius_ini_) * 2;
1958
1959 spherical_nusselt_ = ref_thermal_subresolution.nusselt_spherical_diffusion_;
1961
1962 heat_flux_spherical_ = ref_thermal_subresolution.heat_flux_spherical_;
1963 mean_liquid_temperature_ = ref_thermal_subresolution.mean_liquid_temperature_;
1964
1965 velocity_upstream_ = ref_ijk_ft_->eq_ns().get_vitesse_upstream();
1966 if (velocity_upstream_ < -1.e20)
1967 velocity_upstream_ = 0.;
1968 gravity_dir_ = ref_ijk_ft_->milieu_ijk().get_direction_gravite();
1970 ref_thermal_subresolution.delta_T_subcooled_overheated_,
1971 ref_thermal_subresolution.uniform_lambda_);
1973 for (auto& itr : *this)
1974 itr.compute_bubble_related_quantities();
1975 is_updated_ = true;
1976}
1977
1979{
1980 bubbles_rising_relative_velocities_ = (*bubbles_rising_velocities_);
1981 bubbles_rising_relative_velocities_upstream_ = (*bubbles_rising_velocities_);
1982
1983 bubbles_rising_relative_velocities_barycentres_ = (*bubbles_rising_velocities_from_barycentres_);
1984 bubbles_rising_relative_velocities_barycentres_upstream_ = (*bubbles_rising_velocities_from_barycentres_);
1985
1986 Vecteur3 upstream_velocity_vector;
1987 upstream_velocity_vector = 0.;
1988 upstream_velocity_vector[gravity_dir_] = 1.;
1989 upstream_velocity_vector *= velocity_upstream_;
1990
1991 for (int i=0; i<(*bubbles_rising_vectors_per_bubble_).dimension(0); i++)
1992 {
1993 //--------------------------------------------------------------------------------------------
1994
1995 Vecteur3 rising_velocity_vector;
1996 rising_velocity_vector = 1.;
1997 for (int dir=0; dir<3; dir++)
1998 rising_velocity_vector[dir] = (*bubbles_rising_vectors_per_bubble_)(i, dir);
1999 rising_velocity_vector *= (*bubbles_rising_velocities_)(i);
2000
2001 Vecteur3 rising_relative_velocity_vector = (*liquid_velocity_);
2002 rising_relative_velocity_vector *= (-1);
2003 rising_relative_velocity_vector += rising_velocity_vector;
2004 double rising_relative_velocity = rising_relative_velocity_vector.length();
2005 rising_relative_velocity_vector *= (1 / (rising_relative_velocity + 1e-30));
2006 for (int dir=0; dir<3; dir++)
2007 relative_rising_dir_compo_[dir](i) = rising_relative_velocity_vector[dir];
2008
2009 Vecteur3 rising_relative_velocity_vector_upstream = upstream_velocity_vector;
2010 rising_relative_velocity_vector_upstream *= (-1);
2011 rising_relative_velocity_vector_upstream += rising_velocity_vector;
2012 double rising_relative_velocity_upstream = rising_relative_velocity_vector_upstream.length();
2013 rising_relative_velocity_vector_upstream *= (1 / (rising_relative_velocity_upstream + 1e-30));
2014 for (int dir=0; dir<3; dir++)
2015 relative_rising_dir_compo_upstream_[dir](i) = rising_relative_velocity_vector_upstream[dir];
2016
2017 //--------------------------------------------------------------------------------------------
2018
2019 Vecteur3 rising_velocity_vector_barycentres;
2020 rising_velocity_vector_barycentres = 1.;
2021 for (int dir=0; dir<3; dir++)
2022 rising_velocity_vector_barycentres[dir] = (*bubbles_rising_vectors_from_barycentres_)(i, dir);
2023 rising_velocity_vector_barycentres *= (*bubbles_rising_velocities_from_barycentres_)(i);
2024
2025 Vecteur3 rising_relative_velocity_vector_barycentres = (*liquid_velocity_);
2026 rising_relative_velocity_vector_barycentres *= (-1);
2027 rising_relative_velocity_vector += rising_velocity_vector_barycentres;
2028 double rising_relative_velocity_barycentres = rising_relative_velocity_vector_barycentres.length();
2029 rising_relative_velocity_vector_barycentres *= (1 / (rising_relative_velocity_barycentres + 1e-30));
2030 for (int dir=0; dir<3; dir++)
2031 relative_rising_dir_compo_barycentres_[dir](i) = rising_relative_velocity_vector_barycentres[dir];
2032
2033 Vecteur3 rising_relative_velocity_vector_barycentres_upstream = upstream_velocity_vector;
2034 rising_relative_velocity_vector_barycentres_upstream *= (-1);
2035 rising_relative_velocity_vector_barycentres_upstream += rising_velocity_vector_barycentres;
2036 double rising_relative_velocity_barycentres_upstream = rising_relative_velocity_vector_barycentres_upstream.length();
2037 rising_relative_velocity_vector_barycentres_upstream *= (1 / (rising_relative_velocity_barycentres_upstream + 1e-30));
2038 for (int dir=0; dir<3; dir++)
2039 relative_rising_dir_compo_barycentres_upstream_[dir](i) = rising_relative_velocity_vector_barycentres_upstream[dir];
2040
2041 //--------------------------------------------------------------------------------------------
2042
2043 const double reynolds_coeff = (caracteristic_length_ * ref_ijk_ft_->milieu_ijk().get_rho_liquid()) / ref_ijk_ft_->milieu_ijk().get_mu_liquid();
2044
2045 bubbles_rising_relative_velocities_(i) = rising_relative_velocity;
2046 bubbles_reynolds_numbers_per_bubble_(i) = (rising_relative_velocity * reynolds_coeff);
2047
2048 bubbles_rising_relative_velocities_upstream_(i) = rising_relative_velocity_upstream;
2049 bubbles_reynolds_numbers_per_bubble_upstream_(i) = (rising_relative_velocity_upstream * reynolds_coeff);
2050
2051 bubbles_rising_relative_velocities_barycentres_(i) = rising_relative_velocity_barycentres;
2052 bubbles_reynolds_numbers_per_bubble_barycentres_(i) = (rising_relative_velocity_barycentres * reynolds_coeff);
2053
2054 bubbles_rising_relative_velocities_barycentres_upstream_(i) = rising_relative_velocity_barycentres_upstream;
2055 bubbles_reynolds_numbers_per_bubble_barycentres_upstream_(i) = (rising_relative_velocity_barycentres_upstream * reynolds_coeff);
2056 }
2057}
2058
2059
2060void IJK_One_Dimensional_Subproblems::compute_nusselt_numbers_per_bubbles(const IJK_Field_double& temperature_gradient_ghost,
2061 const double& delta_temperature,
2062 const double& lambda)
2063{
2064 lambda_ = lambda;
2065 delta_temperature_ = delta_temperature;
2066
2067 int local_compo;
2068
2070
2078
2086
2094
2097
2100
2103
2106
2109
2112
2113 //--------------------------------------------------------------------------------------------
2114
2119
2122
2126
2127 //--------------------------------------------------------------------------------------------
2128
2133
2136
2140
2141 //--------------------------------------------------------------------------------------------
2142
2147
2150
2154
2155 //--------------------------------------------------------------------------------------------
2156
2157 // int index_i, index_j, index_k;
2158 for (int itr=0; itr < subproblems_counter_; itr++)
2159 {
2160
2161 local_compo = (*this)[itr].get_compo();
2162 // (*this)[itr].get_ijk_indices(index_i, index_j, index_k);
2163 // const double local_temperature_gradient_gfm = temperature_gradient_ghost(index_i, index_j, index_k);
2164 // const double ai = (*this)[itr].get_local_surface_area();
2165
2166 // interfacial_thermal_flux_per_bubble_gfm_(local_compo) += (local_temperature_gradient_gfm * ai * lambda_);
2167 interfacial_thermal_flux_per_bubble_(local_compo) += (*this)[itr].get_interfacial_thermal_flux();
2168 interfacial_thermal_flux_per_bubble_raw_(local_compo) += (*this)[itr].get_interfacial_thermal_flux_raw();
2169 interfacial_thermal_flux_per_bubble_gfm_(local_compo) += (*this)[itr].get_interfacial_thermal_flux_gfm();
2170 interfacial_thermal_flux_per_bubble_lrs_(local_compo) += (*this)[itr].get_interfacial_thermal_flux_lrs();
2171 interfacial_thermal_flux_per_bubble_max_raw_(local_compo) += (*this)[itr].get_interfacial_thermal_flux_max_raw();
2172 interfacial_thermal_flux_per_bubble_max_gfm_(local_compo) += (*this)[itr].get_interfacial_thermal_flux_max_gfm();
2173 interfacial_thermal_flux_per_bubble_max_(local_compo) += (*this)[itr].get_interfacial_thermal_flux_max();
2174
2175 total_surface_per_bubble_(local_compo) += (*this)[itr].get_local_surface_area();
2176
2177 sum_convective_fluxes_liquid_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value(0);
2178 sum_convective_fluxes_vapour_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_vap(0);
2179 sum_convective_fluxes_mixed_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_mixed(0);
2180 sum_convective_fluxes_liquid_normal_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_normal(0);
2181
2182 sum_convective_fluxes_liquid_leaving_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_leaving(0);
2183 sum_convective_fluxes_liquid_entering_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_entering(0);
2184
2185 sum_convective_fluxes_lrs_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_lrs(0);
2186 sum_convective_fluxes_lrs_leaving_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_leaving_lrs(0);
2187 sum_convective_fluxes_lrs_entering_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_entering_lrs(0);
2188
2189 sum_diffusive_fluxes_liquid_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value(1);
2190 sum_diffusive_fluxes_vapour_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_vap(1);
2191 sum_diffusive_fluxes_mixed_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_mixed(1);
2192 sum_diffusive_fluxes_liquid_normal_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_normal(1);
2193
2194 sum_diffusive_fluxes_liquid_leaving_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_leaving(1);
2195 sum_diffusive_fluxes_liquid_entering_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_entering(1);
2196
2197 sum_diffusive_fluxes_lrs_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_lrs(1);
2198 sum_diffusive_fluxes_lrs_leaving_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_leaving_lrs(1);
2199 sum_diffusive_fluxes_lrs_entering_faces_per_bubble_(local_compo) += (*this)[itr].get_sum_convective_diffusive_flux_op_value_entering_lrs(1);
2200
2201 }
2202
2203 //--------------------------------------------------------------------------------------------
2204
2205 mp_sum_for_each_item(interfacial_thermal_flux_per_bubble_);
2206 mp_sum_for_each_item(interfacial_thermal_flux_per_bubble_raw_);
2207 mp_sum_for_each_item(interfacial_thermal_flux_per_bubble_gfm_);
2208 mp_sum_for_each_item(interfacial_thermal_flux_per_bubble_lrs_);
2211 mp_sum_for_each_item(interfacial_thermal_flux_per_bubble_max_);
2212 mp_sum_for_each_item(total_surface_per_bubble_);
2213
2218
2221
2222 mp_sum_for_each_item(sum_convective_fluxes_lrs_faces_per_bubble_);
2225
2230
2233
2234 mp_sum_for_each_item(sum_diffusive_fluxes_lrs_faces_per_bubble_);
2237
2238 //--------------------------------------------------------------------------------------------
2239
2243
2247
2251
2255
2256 // sum_fluxes_liquid_leaving_faces_per_bubble_ = sum_convective_fluxes_liquid_leaving_faces_per_bubble_;
2257 // sum_fluxes_liquid_leaving_faces_per_bubble_ *= (-1);
2258 // sum_fluxes_liquid_leaving_faces_per_bubble_ += sum_diffusive_fluxes_liquid_leaving_faces_per_bubble_;
2259 //
2260 // sum_fluxes_liquid_entering_faces_per_bubble_ = sum_convective_fluxes_liquid_entering_faces_per_bubble_;
2261 // sum_fluxes_liquid_entering_faces_per_bubble_ *= (-1);
2262 // sum_fluxes_liquid_entering_faces_per_bubble_ += sum_diffusive_fluxes_liquid_entering_faces_per_bubble_;
2263
2267
2271
2275
2276 // sum_fluxes_lrs_leaving_faces_per_bubble_ = sum_convective_fluxes_lrs_leaving_faces_per_bubble_;
2277 // sum_fluxes_lrs_leaving_faces_per_bubble_ *= (-1);
2278 // sum_fluxes_lrs_leaving_faces_per_bubble_ += sum_diffusive_fluxes_lrs_leaving_faces_per_bubble_;
2279 //
2280 // sum_fluxes_lrs_entering_faces_per_bubble_ = sum_convective_fluxes_lrs_entering_faces_per_bubble_;
2281 // sum_fluxes_lrs_entering_faces_per_bubble_ *= (-1);
2282 // sum_fluxes_lrs_entering_faces_per_bubble_ += sum_diffusive_fluxes_lrs_entering_faces_per_bubble_;
2283
2287
2291
2292 //--------------------------------------------------------------------------------------------
2293
2294 // Same on each proc
2295 for (int i=0; i < nb_bubbles_; i++)
2296 {
2297
2298 const double delta_nusselt_coeff = caracteristic_length_ / (total_surface_per_bubble_(i) * delta_temperature_ * lambda_);;
2299 const double liquid_nusselt_coeff = caracteristic_length_ / (total_surface_per_bubble_(i) * mean_liquid_temperature_ * lambda_);
2300
2308
2316
2319
2322
2325
2328
2331
2334 }
2335}
2336
2338{
2339 int local_compo;
2342 for (int itr=0; itr < subproblems_counter_; itr++)
2343 {
2344 local_compo = (*this)[itr].get_compo();
2345 overall_shear_force_per_bubble_(local_compo) += (*this)[itr].get_shear_force();
2346 }
2347 mp_sum_for_each_item(overall_shear_force_per_bubble_);
2348
2349 // Same on each proc
2351 for (int i=0; i < nb_bubbles_; i++)
2353}
2354
2356{
2364
2372
2375
2383
2384 total_surface_ = 0.;
2385 total_volume_ = 0.;
2386
2389
2390 //--------------------------------------------------------------------------------------------
2391
2396
2401
2402 //--------------------------------------------------------------------------------------------
2403
2406
2411
2412 //--------------------------------------------------------------------------------------------
2413
2417
2421
2425
2429
2430 //--------------------------------------------------------------------------------------------
2431
2435
2439
2443
2447
2448 //--------------------------------------------------------------------------------------------
2449
2454
2455 //--------------------------------------------------------------------------------------------
2456
2461
2464
2468
2473
2476
2480
2485
2488
2492
2493 //--------------------------------------------------------------------------------------------
2494
2497
2500
2503
2506
2509
2512
2513 //--------------------------------------------------------------------------------------------
2514
2515 for (int i=0; i < nb_bubbles_; i++)
2516 {
2517
2525
2527
2535
2543
2545
2547 total_volume_ += (*bubbles_volume_)(i);
2548
2550 radius_from_volumes_per_bubble_(i) = pow((*bubbles_volume_)(i) * 3. / (4. * M_PI), (1. / 3.));
2551
2554
2555 //--------------------------------------------------------------------------------------------
2556
2557 const double coeff_delta_surface = caracteristic_length_from_surfaces_per_bubble_(i) / (delta_temperature_ * lambda_);
2558 const double coeff_liquid_surface = caracteristic_length_from_surfaces_per_bubble_(i) / (mean_liquid_temperature_ * lambda_);
2559
2562
2565
2568
2573
2574 //--------------------------------------------------------------------------------------------
2575
2578
2581
2582 const double reynolds_surface = (caracteristic_length_from_surfaces_per_bubble_(i) * ref_ijk_ft_->milieu_ijk().get_rho_liquid()) / ref_ijk_ft_->milieu_ijk().get_mu_liquid();
2583 const double reynolds_volume = (caracteristic_length_from_volumes_per_bubble_(i) * ref_ijk_ft_->milieu_ijk().get_rho_liquid()) / ref_ijk_ft_->milieu_ijk().get_mu_liquid();
2584
2587
2590
2593
2596
2599
2602
2605
2608
2609 //--------------------------------------------------------------------------------------------
2610
2611 bubbles_total_rising_velocities_ += (*bubbles_rising_velocities_)(i) * (*bubbles_volume_)(i);
2612 bubbles_total_rising_velocities_barycentres_ += (*bubbles_rising_velocities_from_barycentres_)(i) * (*bubbles_volume_)(i);
2613
2618
2619 //--------------------------------------------------------------------------------------------
2620
2621 for (int dir=0; dir<3; dir++)
2622 {
2623 total_rising_dir_compo_[dir] = (*bubbles_rising_vectors_per_bubble_)(i, dir) * (*bubbles_volume_)(i);
2624 total_rising_dir_compo_barycentres_= (*bubbles_rising_vectors_from_barycentres_)(i, dir) * (*bubbles_volume_)(i);
2625
2628
2631 }
2632
2633 //--------------------------------------------------------------------------------------------
2634
2638
2642
2646
2650
2651 //--------------------------------------------------------------------------------------------
2652
2656
2660
2664
2668
2669 //--------------------------------------------------------------------------------------------
2670
2675
2678
2682
2687
2690
2694
2699
2702
2706
2707 //--------------------------------------------------------------------------------------------
2708
2711
2714
2717
2720
2723
2726 }
2727
2728 //--------------------------------------------------------------------------------------------
2729
2737
2745
2746 //--------------------------------------------------------------------------------------------
2747
2750
2753
2756
2759
2762
2765
2766 //--------------------------------------------------------------------------------------------
2767
2773
2777
2781
2785
2789
2790 //--------------------------------------------------------------------------------------------
2791
2792 const double total_rising_dir_norm = total_rising_dir_compo_.length();
2793 total_rising_dir_compo_ *= (1. / (total_rising_dir_norm + 1e-30));
2794 const double total_rising_dir_norm_barycentres = total_rising_dir_compo_barycentres_.length();
2795 total_rising_dir_compo_barycentres_ *= (1. / (total_rising_dir_norm_barycentres + 1e-30));
2796
2797 const double total_relative_rising_dir_norm = total_relative_rising_dir_compo_.length();
2798 total_relative_rising_dir_compo_ *= (1. / (total_relative_rising_dir_norm + 1e-30));
2799 const double total_relative_rising_dir_norm_upstream = total_relative_rising_dir_compo_upstream_.length();
2800 total_relative_rising_dir_compo_upstream_ *= (1. / (total_relative_rising_dir_norm_upstream + 1e-30));
2801
2802 const double total_relative_rising_dir_norm_barycentres = total_relative_rising_dir_compo_barycentres_.length();
2803 total_relative_rising_dir_compo_barycentres_ *= (1. / (total_relative_rising_dir_norm_barycentres + 1e-30));
2804 const double total_relative_rising_dir_norm_barycentres_upstream = total_relative_rising_dir_compo_barycentres_upstream_.length();
2805 total_relative_rising_dir_compo_barycentres_upstream_ *= (1. / (total_relative_rising_dir_norm_barycentres_upstream + 1e-30));
2806
2807 //--------------------------------------------------------------------------------------------
2808
2810
2811 radius_from_surfaces_ = sqrt((total_surface_ / nb_bubbles_) / (4. * M_PI));
2812 radius_from_volumes_ = pow((total_volume_ / nb_bubbles_) * 3. / (4. * M_PI), (1. / 3.));
2813
2816
2818
2819 //--------------------------------------------------------------------------------------------
2820
2823
2826
2831
2836
2837 //--------------------------------------------------------------------------------------------
2838
2842
2846
2850
2854}
2855
2856void IJK_One_Dimensional_Subproblems::post_process_overall_bubbles_quantities(const int rank, const Nom& overall_bubbles_quantities)
2857{
2859 {
2860 const int reset = 1;
2861 const int last_time_index = (*latastep_reprise_) + ref_ijk_ft_->schema_temps_ijk().get_tstep();
2862 const int max_digit = 3;
2863 const int max_digit_time = 8;
2864 const int max_rank_digit = rank < 1 ? 1 : (int) (log10(rank) + 1);
2865 const int nb_digit_tstep = last_time_index < 1 ? 1 : (int) (log10(last_time_index) + 1);
2866
2867 Nom probe_name = Nom("_thermal_rank_") + Nom(std::string(max_digit - max_rank_digit,'0')) + Nom(rank)
2868 + Nom("_thermal_subproblems") + ("_overall_bubbles_quantities_")
2869 + Nom(std::string(max_digit_time - nb_digit_tstep, '0')) + Nom(last_time_index) + Nom(".out");
2870 Nom probe_header = Nom("tstep\ttime\tthermal_rank\tbubble_index"
2871 "\ttime_dimensionless"
2872 "\tbubble_coord_x\tbubble_coord_y\tbubble_coord_z"
2873 "\tbubble_coord_x_old\tbubble_coord_y_old\tbubble_coord_z_old"
2874 "\tbubble_coord_x_new\tbubble_coord_y_new\tbubble_coord_z_new"
2875 "\tnusselt_overall\tnusselt_overall_raw\tnusselt_overall_gfm\tnusselt_overall_lrs"
2876 "\tnusselt_overall_max_raw\tnusselt_overall_max_gfm\tnusselt_overall_max"
2877 "\tnusselt_spherical\tnusselt_spherical_th"
2878 "\tnusselt_overall_liq\tnusselt_overall_raw_liq\tnusselt_overall_gfm_liq\tnusselt_overall_lrs_liq"
2879 "\tnusselt_overall_max_raw_liq\tnusselt_overall_max_gfm_liq\tnusselt_overall_max_liq"
2880 "\tnusselt_spherical_liq\tnusselt_spherical_th_liq"
2881 "\tnusselt_overall_error\tnusselt_overall_gfm_error\tnusselt_overall_liq_error\tnusselt_overall_gfm_liq_error"
2882 "\tnusselt_overall_error_rel\tnusselt_overall_gfm_error_rel\tnusselt_overall_liq_error_rel\tnusselt_overall_gfm_liq_error_rel"
2883 "\theat_flux\theat_flux_raw\theat_flux_gfm\theat_flux_lrs"
2884 "\theat_flux_max_raw\theat_flux_max_gfm\theat_flux_max"
2885 "\theat_flux_spherical"
2886 "\ttotal_surface\ttotal_volume"
2887 "\tradius_surface\tradius_volume"
2888 "\terror_temperature_ana\terror_temperature_ana_norm\terror_temperature_ana_rel"
2889 "\tdelta_temperature\tmean_liquid_temperature"
2890 "\tliquid_velocity"
2891 "\tliquid_velocity_x\tliquid_velocity_y\tliquid_velocity_z"
2892 "\tgravity_dir\tupstream_velocity"
2893 "\trising_dir_x\trising_dir_y\trising_dir_z"
2894 "\trising_dir_bary_x\trising_dir_bary_y\trising_dir_bary_z"
2895 "\trelative_rising_dir_x\trelative_rising_dir_y\trelative_rising_dir_z"
2896 "\trelative_rising_dir_upstream_x\trelative_rising_dir_upstream_y\trelative_rising_dir_upstream_z"
2897 "\trelative_rising_dir_bary_x\trelative_rising_dir_bary_y\trelative_rising_dir_bary_z"
2898 "\trelative_rising_dir_bary_upstream_x\trelative_rising_dir_bary_upstream_y\trelative_rising_dir_bary_upstream_z"
2899 "\trising_velocity\trising_relative_velocity\trising_relative_velocity_upstream"
2900 "\trising_velocity_bary\trising_relative_velocity_bary\trising_relative_velocity_bary_upstream"
2901 "\treynolds_number\treynolds_number_surface\treynolds_number_volume"
2902 "\treynolds_number_upstream\treynolds_number_surface_upstream\treynolds_number_volume_upstream"
2903 "\treynolds_number_bary\treynolds_number_surface_bary\treynolds_number_volume_bary"
2904 "\treynolds_number_bary_upstream\treynolds_number_surface_bary_upstream\treynolds_number_volume_bary_upstream"
2905 "\tprandtl_liq"
2906 "\tpeclet_number\tpeclet_number_surface\tpeclet_number_volume"
2907 "\tpeclet_number_upstream\tpeclet_number_surface_upstream\tpeclet_number_volume_upstream"
2908 "\tpeclet_number_bary\tpeclet_number_surface_bary\tpeclet_number_volume_bary"
2909 "\tpeclet_number_bary_upstream\tpeclet_number_surface_bary_upstream\tpeclet_number_volume_bary_upstream"
2910 "\tsum_conv_flux_liq\tsum_conv_flux_vap\tsum_conv_flux_mixed"
2911 "\tsum_conv_flux_liq_normal"
2912 "\tsum_conv_flux_liq_leaving\tsum_conv_flux_liq_entering"
2913 "\tsum_conv_flux_lrs"
2914 "\tsum_conv_flux_lrs_leaving\tsum_conv_flux_lrs_entering"
2915 "\tsum_diff_flux_liq\tsum_diff_flux_vap\tsum_diff_flux_mixed"
2916 "\tsum_diff_flux_liq_normal"
2917 "\tsum_diff_flux_liq_leaving\tsum_diff_flux_liq_entering"
2918 "\tsum_diff_flux_lrs"
2919 "\tsum_diff_flux_lrs_leaving\tsum_diff_flux_lrs_entering"
2920 "\tsum_fluxes_liq\tsum_fluxes_vap\tsum_fluxes_mixed"
2921 "\tsum_fluxes_liq_normal"
2922 "\tsum_fluxes_liq_leaving\tsum_fluxes_liq_entering"
2923 "\tsum_fluxes_lrs"
2924 "\tsum_fluxes_lrs_leaving\tsum_fluxes_lrs_entering"
2925 "\tnusselt_number_face_fluxes\tnusselt_number_face_fluxes_liquid"
2926 "\tnusselt_number_leaving_face_fluxes\tnusselt_number_leaving_face_fluxes_liquid"
2927 "\tnusselt_number_entering_face_fluxes\tnusselt_number_entering_face_fluxes_liquid"
2928 "\tnusselt_number_lrs_face_fluxes\tnusselt_number_lrs_face_fluxes_liquid"
2929 "\tnusselt_number_lrs_leaving_face_fluxes\tnusselt_number_lrs_leaving_face_fluxes_liquid"
2930 "\tnusselt_number_lrs_entering_face_fluxes\tnusselt_number_lrs_entering_face_fluxes_liquid");
2931 SFichier fic = Open_file_folder(overall_bubbles_quantities, probe_name, probe_header, reset);
2932 int max_counter = nb_bubbles_;
2933 const double last_time = ref_ijk_ft_->schema_temps_ijk().get_current_time() - ref_ijk_ft_->schema_temps_ijk().get_timestep();
2934 const double dimensionless_time = caracteristic_length_ / (1e-16 + sqrt(M_PI * last_time * uniform_alpha_));
2935 /*
2936 * TODO: fill the Array in parallel
2937 */
2938 for (int i=0; i<max_counter; i++)
2939 {
2940 fic << last_time_index << " " << last_time << " ";
2941 fic << rank << " ";
2942 fic << i << " ";
2943 fic << dimensionless_time << " ";
2944 //--------------------------------------------------------------------------------------------
2945 fic << (*bubbles_barycentres_)(i, 0) << " ";
2946 fic << (*bubbles_barycentres_)(i, 1) << " ";
2947 fic << (*bubbles_barycentres_)(i, 2) << " ";
2948 fic << (*bubbles_barycentres_old_)(i, 0) << " ";
2949 fic << (*bubbles_barycentres_old_)(i, 1) << " ";
2950 fic << (*bubbles_barycentres_old_)(i, 2) << " ";
2951 fic << (*bubbles_barycentres_new_)(i, 0) << " ";
2952 fic << (*bubbles_barycentres_new_)(i, 1) << " ";
2953 fic << (*bubbles_barycentres_new_)(i, 2) << " ";
2954 //--------------------------------------------------------------------------------------------
2955 fic << overall_nusselt_number_per_bubble_(i) << " ";
2963 fic << spherical_nusselt_ << " ";
2972 fic << spherical_nusselt_liquid_ << " ";
2973 //--------------------------------------------------------------------------------------------
2982 //--------------------------------------------------------------------------------------------
2983 fic << interfacial_thermal_flux_per_bubble_(i) << " ";
2991 fic << total_surface_per_bubble_(i) << " ";
2992 fic << (*bubbles_volume_)(i) << " ";
2993 fic << radius_from_surfaces_per_bubble_(i) << " ";
2994 fic << radius_from_volumes_per_bubble_(i) << " ";
2995 //--------------------------------------------------------------------------------------------
2996 fic << error_temperature_ana_total_ << " ";
2999 //--------------------------------------------------------------------------------------------
3000 fic << delta_temperature_ << " ";
3001 fic << mean_liquid_temperature_ << " ";
3002 //--------------------------------------------------------------------------------------------
3003 fic << (*liquid_velocity_).length() << " ";
3004 fic << (*liquid_velocity_)[0] << " ";
3005 fic << (*liquid_velocity_)[1] << " ";
3006 fic << (*liquid_velocity_)[2] << " ";
3007 //--------------------------------------------------------------------------------------------
3008 fic << gravity_dir_ << " ";
3009 fic << velocity_upstream_ << " ";
3010 //--------------------------------------------------------------------------------------------
3011 fic << (*bubbles_rising_vectors_per_bubble_)(i, 0) << " ";
3012 fic << (*bubbles_rising_vectors_per_bubble_)(i, 1) << " ";
3013 fic << (*bubbles_rising_vectors_per_bubble_)(i, 2) << " ";
3014 fic << (*bubbles_rising_vectors_from_barycentres_)(i, 0) << " ";
3015 fic << (*bubbles_rising_vectors_from_barycentres_)(i, 1) << " ";
3016 fic << (*bubbles_rising_vectors_from_barycentres_)(i, 2) << " ";
3017 //--------------------------------------------------------------------------------------------
3018 fic << relative_rising_dir_compo_[0](i) << " ";
3019 fic << relative_rising_dir_compo_[1](i) << " ";
3020 fic << relative_rising_dir_compo_[2](i) << " ";
3021 fic << relative_rising_dir_compo_upstream_[0](i) << " ";
3022 fic << relative_rising_dir_compo_upstream_[1](i) << " ";
3023 fic << relative_rising_dir_compo_upstream_[2](i) << " ";
3024 //--------------------------------------------------------------------------------------------
3025 fic << relative_rising_dir_compo_barycentres_[0](i) << " ";
3026 fic << relative_rising_dir_compo_barycentres_[1](i) << " ";
3027 fic << relative_rising_dir_compo_barycentres_[2](i) << " ";
3031 //--------------------------------------------------------------------------------------------
3032 fic << (*bubbles_rising_velocities_)(i) << " ";
3033 fic << bubbles_rising_relative_velocities_(i) << " ";
3035 //--------------------------------------------------------------------------------------------
3036 fic << (*bubbles_rising_velocities_from_barycentres_)(i) << " ";
3039 //--------------------------------------------------------------------------------------------
3040 fic << bubbles_reynolds_numbers_per_bubble_(i) << " ";
3046 //--------------------------------------------------------------------------------------------
3053 //--------------------------------------------------------------------------------------------
3054 fic << (*prandtl_number_) << " ";
3055 //--------------------------------------------------------------------------------------------
3056 fic << bubbles_peclet_numbers_per_bubble_(i) << " ";
3062 //--------------------------------------------------------------------------------------------
3069 //--------------------------------------------------------------------------------------------
3074
3077
3081 //--------------------------------------------------------------------------------------------
3085
3089
3093 //--------------------------------------------------------------------------------------------
3094 fic << sum_fluxes_liquid_faces_per_bubble_(i) << " ";
3095 fic << sum_fluxes_vapour_faces_per_bubble_(i) << " ";
3096 fic << sum_fluxes_mixed_faces_per_bubble_(i) << " ";
3098
3101
3102 fic << sum_fluxes_lrs_faces_per_bubble_(i) << " ";
3105 //--------------------------------------------------------------------------------------------
3108
3113
3116
3121 fic << finl;
3122 }
3123 /*
3124 * Should be good for parallel
3125 */
3126 if(max_counter > 1)
3127 {
3128 fic << last_time_index << " " << last_time << " ";
3129 fic << rank << " ";
3130 fic << nb_bubbles_ << " ";
3131 fic << dimensionless_time << " ";
3132 //--------------------------------------------------------------------------------------------
3133 fic << (*bubbles_barycentres_)(0, 0) << " ";
3134 fic << (*bubbles_barycentres_)(0, 1) << " ";
3135 fic << (*bubbles_barycentres_)(0, 2) << " ";
3136 fic << (*bubbles_barycentres_old_)(0, 0) << " ";
3137 fic << (*bubbles_barycentres_old_)(0, 1) << " ";
3138 fic << (*bubbles_barycentres_old_)(0, 2) << " ";
3139 fic << (*bubbles_barycentres_new_)(0, 0) << " ";
3140 fic << (*bubbles_barycentres_new_)(0, 1) << " ";
3141 fic << (*bubbles_barycentres_new_)(0, 2) << " ";
3142 //--------------------------------------------------------------------------------------------
3143 fic << overall_nusselt_number_ << " ";
3144 fic << overall_nusselt_number_raw_ << " ";
3145 fic << overall_nusselt_number_gfm_ << " ";
3146 fic << overall_nusselt_number_lrs_ << " ";
3147 fic << overall_nusselt_number_max_raw_ << " ";
3148 fic << overall_nusselt_number_max_gfm_ << " ";
3149 fic << overall_nusselt_number_max_ << " ";
3151 fic << spherical_nusselt_ << " ";
3152 fic << overall_nusselt_number_liquid_ << " ";
3160 fic << spherical_nusselt_liquid_ << " ";
3161 //--------------------------------------------------------------------------------------------
3162 fic << overall_nusselt_number_error_ << " ";
3170 //--------------------------------------------------------------------------------------------
3171 fic << interfacial_thermal_flux_ << " ";
3172 fic << interfacial_thermal_flux_raw_ << " ";
3173 fic << interfacial_thermal_flux_gfm_ << " ";
3174 fic << interfacial_thermal_flux_lrs_ << " ";
3177 fic << interfacial_thermal_flux_max_ << " ";
3178
3179 fic << heat_flux_spherical_ << " ";
3180 fic << total_surface_ << " ";
3181 fic << total_volume_ << " ";
3182 fic << radius_from_surfaces_ << " ";
3183 fic << radius_from_volumes_ << " ";
3184 //--------------------------------------------------------------------------------------------
3185 fic << error_temperature_ana_total_ << " ";
3188 //--------------------------------------------------------------------------------------------
3189 fic << delta_temperature_ << " ";
3190 fic << mean_liquid_temperature_ << " ";
3191 //--------------------------------------------------------------------------------------------
3192 fic << (*liquid_velocity_).length() << " ";
3193 fic << (*liquid_velocity_)[0] << " ";
3194 fic << (*liquid_velocity_)[1] << " ";
3195 fic << (*liquid_velocity_)[2] << " ";
3196 //--------------------------------------------------------------------------------------------
3197 fic << gravity_dir_ << " ";
3198 fic << velocity_upstream_ << " ";
3199 //--------------------------------------------------------------------------------------------
3200 fic << total_rising_dir_compo_[0] << " ";
3201 fic << total_rising_dir_compo_[1] << " ";
3202 fic << total_rising_dir_compo_[2] << " ";
3203 fic << total_rising_dir_compo_barycentres_[0] << " ";
3204 fic << total_rising_dir_compo_barycentres_[1] << " ";
3205 fic << total_rising_dir_compo_barycentres_[2] << " ";
3206 //--------------------------------------------------------------------------------------------
3207 fic << total_relative_rising_dir_compo_[0] << " ";
3208 fic << total_relative_rising_dir_compo_[1] << " ";
3209 fic << total_relative_rising_dir_compo_[2] << " ";
3213 //--------------------------------------------------------------------------------------------
3220 //--------------------------------------------------------------------------------------------
3224 //--------------------------------------------------------------------------------------------
3228 //--------------------------------------------------------------------------------------------
3229 fic << bubbles_total_reynolds_numbers_ << " ";
3235 //--------------------------------------------------------------------------------------------
3242 //--------------------------------------------------------------------------------------------
3243 fic << (*prandtl_number_) << finl;
3244 //--------------------------------------------------------------------------------------------
3245 fic << bubbles_total_peclet_numbers_ << " ";
3251 //--------------------------------------------------------------------------------------------
3258 //--------------------------------------------------------------------------------------------
3263
3266
3270 //--------------------------------------------------------------------------------------------
3275
3278
3279 fic << sum_diffusive_fluxes_lrs_faces_ << " ";
3282 //--------------------------------------------------------------------------------------------
3283 fic << sum_fluxes_liquid_faces_ << " ";
3284 fic << sum_fluxes_vapour_faces_ << " ";
3285 fic << sum_fluxes_mixed_faces_ << " ";
3286 fic << sum_fluxes_liquid_normal_faces_ << " ";
3287
3290
3291 fic << sum_fluxes_lrs_faces_ << " ";
3292 fic << sum_fluxes_lrs_leaving_faces_ << " ";
3293 fic << sum_fluxes_lrs_entering_faces_ << " ";
3294 //--------------------------------------------------------------------------------------------
3297
3302
3305
3310 fic << finl;
3311 }
3312 fic.close();
3313 }
3314}
3315
3316
3318 int& index_i,
3319 int& index_j,
3320 int& index_k,
3321 const int& val_index)
3322{
3324 one_dimensional_effective_subproblems_[m]->get_ijk_indices(index_i, index_j, index_k);
3325 return one_dimensional_effective_subproblems_[m]->get_value_from_index(val_index);
3326}
3327
3328
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
int get_offset_local(int direction) const
Returns the local offset in requested direction.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
: class IJK_Interfaces
DoubleVect get_temperature_profile_discrete_integral_at_point(const int &i, const double &dist, const int &level, const int &dir)
const int & get_dxyz_over_two_increment_bool(const int &subproblem_index) const
DoubleVect get_temperature_gradient_times_conductivity_profile_discrete_integral_at_point(const int &i, const double &dist, const int &level, const int &dir)
std::vector< IJK_One_Dimensional_Subproblem * > one_dimensional_disabled_subproblems_
void initialise_thermal_subproblems_list_params(const int &pre_initialise_thermal_subproblems_list, const double &pre_factor_subproblems_number, const int &remove_append_subproblems, const int &use_sparse_matrix)
std::vector< std::vector< ArrOfDouble > > normal_vector_compo_probes_previous_local_perio_
const FixedVector< double, 6 > & get_dist_faces_interface(const int &i) const
IJK_One_Dimensional_Subproblems(const Probleme_FTD_IJK_base &ijk_ft)
void share_interfacial_heat_flux_correction_on_procs(FixedVector< ArrOfInt, 4 > &ijk_indices_out, ArrOfDouble &thermal_flux_out)
void thermal_subresolution_outputs(const int &rank, const Nom &interfacial_quantities_thermal_probes, const Nom &shell_quantities_thermal_probes, const Nom &overall_bubbles_quantities, const Nom &local_quantities_thermal_probes_time_index_folder)
void compute_modified_probe_length(const int &probe_variations_enabled)
void set_local_time_step(const double &local_time_step)
void dispatch_interfacial_heat_flux(IJK_Field_vector3_double &interfacial_heat_flux_dispatched, FixedVector< ArrOfInt, 3 > &ijk_indices_out, FixedVector< ArrOfDouble, 3 > &thermal_flux_out)
FixedVector< ArrOfDouble, 3 > relative_rising_dir_compo_barycentres_upstream_
double get_temperature_gradient_times_conductivity_profile_at_point(const int &i, const double &dist, const int &dir, bool &valid_val)
std::vector< std::vector< ArrOfDouble > > temperature_probes_previous_global_
int is_in_map_index_ijk(const std::map< int, std::map< int, std::map< int, int > > > &subproblem_to_ijk_indices, const int &index_i, const int &index_j, const int &index_k)
const FixedVector< int, 3 > & get_pure_neighbours_corrected_sign(const int &subproblem_index) const
const std::vector< std::vector< std::vector< std::vector< bool > > > > get_pure_neighbours_last_faces_to_correct(const int &subproblem_index) const
std::vector< ArrOfDouble > indicator_probes_previous_global_
std::vector< ArrOfDouble > indicator_probes_previous_local_perio_
double get_min_euler_time_step(int &nb_iter_explicit)
FixedVector< ArrOfInt, 3 > ijk_indices_to_subproblem_
void associate_variables_for_post_processing(IJK_Thermal_Subresolution &ref_thermal_subresolution)
const int & get_end_index_subproblem(const int index) const
std::vector< Vecteur3 > normal_vector_compo_probes_previous_
void compare_fluxes_thermal_subproblems(const IJK_Field_vector3_double &convective_diffusive_fluxes_raw, const int flux_type, const int inv_sign=0)
int get_probe_variations_enabled(const int &probe_variations_priority)
FixedVector< std::vector< ArrOfInt >, 2 > index_ij_subproblems_global_
const std::vector< std::vector< std::vector< std::vector< double > > > > get_pure_neighbours_last_faces_corrected_distance(const int &subproblem_index) const
std::vector< std::vector< ArrOfDouble > > temperature_probes_previous_local_perio_
void compute_source_terms_impose_boundary_conditions(const int &boundary_condition_interface, const double &interfacial_boundary_condition_value, const int &impose_boundary_condition_interface_from_simulation, const int &boundary_condition_end, const double &end_boundary_condition_value, const int &impose_user_boundary_condition_end_value)
const std::vector< std::vector< std::vector< double > > > & get_pure_neighbours_corrected_colinearity(const int &subproblem_index) const
std::vector< std::vector< ArrOfDouble > > normal_vector_compo_probes_previous_global_
const std::vector< std::vector< std::vector< std::vector< double > > > > get_pure_neighbours_last_faces_corrected_colinearity(const int &subproblem_index) const
void set_results_probes_size(const std::vector< std::string > &key_results_int, const std::vector< std::string > &key_results_double, std::map< std::string, ArrOfInt > &results_probes_int, std::map< std::string, ArrOfDouble > &results_probes_double)
const std::vector< std::vector< std::vector< double > > > & get_pure_neighbours_corrected_distance(const int &subproblem_index) const
std::vector< IJK_One_Dimensional_Subproblem * > one_dimensional_effective_subproblems_
void compute_overall_quantities_per_bubbles(const IJK_Field_double &temperature_ghost, const double &delta_temperature, const double &lambda)
int get_subproblem_index_from_ijk_indices(const int &i, const int &j, const int &k) const
double get_corrective_flux_from_current(const int &i, const int &l)
void retrieve_interfacial_heat_flux_correction_on_procs(const FixedVector< ArrOfInt, 4 > &ijk_indices_out, const ArrOfDouble &thermal_flux_out, IJK_Field_vector3_double &interfacial_heat_flux_dispatched)
void set_effective_subproblems(const int &enable_probe_collision_detection)
std::map< int, std::map< int, std::map< int, int > > > subproblem_to_ijk_indices_previous_
FixedVector< std::vector< ArrOfInt >, 2 > index_ij_subproblems_local_perio_
void compare_flux_interface(const int &i, std::vector< double > &radial_flux_error)
void associate_subproblem_to_ijk_indices(const int &i, const int &j, const int &k)
const std::vector< std::vector< std::vector< bool > > > & get_pure_neighbours_to_correct(const int &subproblem_index) const
const int & get_dxyz_increment_bool(const int &subproblem_index) const
std::vector< std::vector< ArrOfDouble > > velocities_probes_previous_local_perio_
DoubleVect get_temperature_gradient_profile_discrete_integral_at_point(const int &i, const double &dist, const int &level, const int &dir)
DoubleVect get_temperature_times_velocity_profile_discrete_integral_at_point(const int &i, const double &dist, const int &level, const int &dir, const int &l)
void compute_overall_bubbles_quantities(IJK_Thermal_Subresolution &ref_thermal_subresolution)
void get_ijk_indices_from_subproblems(const int &rank, int &i, int &j, int &k)
std::map< int, std::map< int, std::map< int, int > > > subproblem_to_ijk_indices_
void associate_ijk_indices_to_subproblem(const int &rank, const int &i, const int &j, const int &k)
double get_temperature_gradient_profile_at_point(const int &i, const double &dist, const int &dir)
std::vector< std::vector< ArrOfDouble > > velocities_probes_previous_global_
double get_corrective_flux_from_neighbours(const int &i, const int &l)
double get_temperature_times_velocity_profile_at_point(const int &i, const double &dist, const int &dir, bool &valid_val, const int &l, const int &index_i, const int &index_j, const int &index_k, const int &temperature=0) const
void dispatch_interfacial_heat_flux_correction(IJK_Field_vector3_double &interfacial_heat_flux_dispatched, FixedVector< ArrOfInt, 4 > &ijk_indices_out, ArrOfDouble &thermal_flux_out, IJK_Field_vector3_double &interfacial_heat_flux_current)
const Vecteur3 & get_bary_facet(const int &i) const
double get_temperature_profile_at_point(const int &i, const double &dist) const
void set_results_probes_fic(SFichier &fic, const std::vector< std::string > &key_results_int, const std::vector< std::string > &key_results_double, std::map< std::string, ArrOfInt > &results_probes_int, std::map< std::string, ArrOfDouble > &results_probes_double)
void compute_nusselt_numbers_per_bubbles(const IJK_Field_double &temperature_gradient_ghost, const double &delta_temperature, const double &lambda)
double get_thermal_subproblem_value_at_ijk_index(const int &m, int &index_i, int &index_j, int &index_k, const int &val_index)
FixedVector< ArrOfDouble, 3 > relative_rising_dir_compo_barycentres_
void sort_limited_probes_spherical_coords_post_processing(const int &post_process_all_probes, const int &nb_theta, const int &nb_phi, const int theta_diag_val, const int phi_diag_val)
void thermal_subresolution_outputs_parallel(const int &rank, const Nom &interfacial_quantities_thermal_probes, const Nom &shell_quantities_thermal_probes, const Nom &overall_bubbles_quantities, const Nom &local_quantities_thermal_probes_time_index_folder)
void associate_sub_problem_to_inputs(IJK_Thermal_Subresolution &ref_thermal_subresolution, int i, int j, int k, const double &indicator, double global_time_step, double current_time, const IJK_Interfaces &interfaces, const IJK_Field_vector3_double &velocity, const IJK_Field_vector3_double &velocity_ft, const IJK_Field_double &pressure)
FixedVector< ArrOfDouble, 3 > relative_rising_dir_compo_upstream_
void get_subproblem_ijk_indices(int &i, int &j, int &k, int &subproblem_index) const
Nom get_header_from_string_lists(const std::vector< std::string > &key_results_int, const std::vector< std::string > &key_results_double)
void set_pure_flux_corrected(const double &flux_face, const int &i, const int &l, const int &flux_type)
const double & get_dist_cell_interface(const int &i) const
void post_process_overall_bubbles_quantities(const int rank, const Nom &overall_bubbles_quantities)
FixedVector< ArrOfDouble, 3 > relative_rising_dir_compo_
const IJK_Field_double * eulerian_interfacial_area_ns_
const DoubleTab * bubbles_barycentres_old_
const IJK_Field_double * eulerian_curvature_ns_
const IJK_Field_int * eulerian_compo_connex_from_interface_int_ns_
const Vecteur3 * liquid_velocity_
const DoubleTab * bubbles_barycentres_new_
const IJK_Field_double * eulerian_distance_ns_
const DoubleTab * rising_vectors_from_barycentres_
const IJK_Field_vector3_double * eulerian_facets_barycentre_ns_
const DoubleTab * rising_vectors_
const DoubleTab * bubbles_barycentre_
IJK_Field_double eulerian_grad_T_interface_ns_
const ArrOfDouble * bubbles_volume_
const ArrOfDouble * rising_velocities_
const IJK_Field_vector3_double * eulerian_normal_vectors_ns_
const ArrOfDouble * rising_velocities_from_barycentres_
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
static double mp_min(double)
Definition Process.cpp:386
static int check_int_overflow(trustIdType)
Definition Process.cpp:428
static double mp_max(double)
Definition Process.cpp:376
static int nproc()
renvoie le nombre de processeurs dans le groupe courant Voir Comm_Group::nproc() et PE_Groups::curren...
Definition Process.cpp:104
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
static int me()
renvoie mon rang dans le groupe de communication courant.
Definition Process.cpp:125
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
Cette classe est a la classe C++ ofstream ce que la classe Sortie est a la classe C++ ostream Elle re...
Definition SFichier.h:27
Classe de base des flux de sortie.
Definition Sortie.h:52
virtual void reset()
Definition TRUSTArray.h:240
void append_array(_TYPE_ valeur)
_SIZE_ size_array() const
void resize(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTArray.h:156
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTVect.tpp:91
double length() const
Definition Vecteur3.h:51