TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
IJK_Thermals.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_Thermal_Onefluid.h>
17#include <Probleme_FTD_IJK.h>
18#include <IJK_switch_FT.h>
19#include <IJK_Thermals.h>
20#include <IJK_switch.h>
21#include <Option_IJK.h>
22
23Implemente_instanciable( IJK_Thermals, "IJK_Thermals", Equation_base) ;
24
26{
27 return os;
28}
29
31{
32 if (liste_thermique_.size())
33 liste_thermique_.vide();
34
35 Motcle nom;
36 is >> nom;
37
38 if (nom != "{")
39 Process::exit("Error while reading the IJK_Thermals list. One expected an opened bracket '{' to start !!! \n");
40
41 while (1)
42 {
43 liste_thermique_.add(OWN_PTR(IJK_Thermal_base)());
44 IJK_Thermal_base::typer_lire_thermal_equation(liste_thermique_.dernier(), is);
45 is >> nom;
46 if (nom == "}") return is;
47 if (nom != ",")
48 {
49 Cerr << "Error while reading the IJK_Thermals list. One expected a comma ',' or a closing bracket '}' and not " << nom << finl;
50 Process::exit("Check your data file ! \n");
51 }
52 }
53
54}
55
56void IJK_Thermals::set_fichier_reprise(const char *lataname)
57{
58 if (!liste_thermique_.est_vide())
59 for (auto& itr : liste_thermique_)
60 itr->set_fichier_reprise(lataname);
61}
62
64{
65 assert(!liste_thermique_.est_vide());
66 return liste_thermique_[0]->get_fichier_reprise();
67}
68
70{
71 if (!le_fluide_)
72 {
73 Cerr << "You forgot to associate a fluid to the problem named " << probleme().le_nom() << finl;
75 }
76 return le_fluide_.valeur();
77}
78
80{
81 if (!le_fluide_)
82 {
83 Cerr << "You forgot to associate a fluid to the problem named " << probleme().le_nom() << finl;
85 }
86 return le_fluide_.valeur();
87}
88
90{
91 const Fluide_Diphasique_IJK& mil = milieu_ijk();
94 {
95 Cerr << "Error in IJK_Thermals::verifie_milieu() !! " << finl;
96 Cerr << "You forgot to define the cp and/or fields in your Fluide_Diphasique_IJK medium ! Update your data file." << finl;
98 }
99
100 const int nb_cp0 = mil.fluide_phase(0).capacite_calorifique().valeurs().size(),
101 nb_lamb0 = mil.fluide_phase(0).conductivite().valeurs().size(),
102 nb_cp1 = mil.fluide_phase(1).capacite_calorifique().valeurs().size(),
103 nb_lamb1 = mil.fluide_phase(1).conductivite().valeurs().size();
104
105 if (nb_cp0 != liste_thermique_.size() || nb_lamb0 != nb_cp0 || nb_cp1 != nb_cp0 || nb_lamb1 != nb_cp0)
106 {
107 Cerr << "Error in IJK_Thermals::verifie_milieu() !! " << finl;
108 Cerr << "You define " << liste_thermique_.size() << " thermal equations in your list which is not coherent with the medium :"<< finl;
109 Cerr << " - Size cp vapour field = " << nb_cp0 << finl;
110 Cerr << " - Size cp liquid field = " << nb_cp1 << finl;
111 Cerr << " - Size lambda vapour field = " << nb_lamb0 << finl;
112 Cerr << " - Size lambda liquid field = " << nb_lamb1 << finl;
114 }
115}
116
118{
119 if (sub_type(Fluide_Diphasique_IJK, un_milieu))
120 {
121 const Milieu_base& un_fluide = ref_cast(Milieu_base, un_milieu);
122 le_fluide_ = un_fluide;
123 }
124 else
125 {
126 Cerr << "Error of fluid type for the method IJK_Thermals::associer_milieu_base" << finl;
128 }
129
131
132 int idth =0;
133 for (auto& itr : liste_thermique_)
134 {
135 itr->associer_milieu_base(un_milieu, idth);
136 idth++;
137 }
138}
139
141{
142 if (!sub_type(Probleme_FTD_IJK_base, pb))
143 {
144 Cerr << "Error for the method IJK_Interfaces::associer_pb_base\n";
145 Cerr << " IJK_Thermals equation must be associated to\n";
146 Cerr << " a Probleme_FTD_IJK_base problem type\n";
148 }
149 mon_probleme = pb;
150 if (nom_ == "??")
151 {
152 nom_ = pb.le_nom();
153 nom_ += que_suis_je();
154 }
155
156 ref_ijk_ft_ = ref_cast(Probleme_FTD_IJK_base, pb);
157}
158
160{
161 associer_post(ref_ijk_ft_->get_post());
162 associer_interface_intersections(ref_ijk_ft_->get_interface().get_intersection_ijk_cell(), ref_ijk_ft_->get_interface().get_intersection_ijk_face());
163 for (auto& itr : liste_thermique_)
164 {
165 itr->associer(ref_ijk_ft_.valeur());
166 itr->associer_ghost_fluid_fields(ghost_fluid_fields_);
167 }
168 ghost_fluid_fields_.associer(ref_ijk_ft_.valeur());
169 if (!liste_thermique_.est_vide())
171}
172
174{
175 int compute_distance = 1;
176 int compute_curvature = 1;
177 int n_iter_distance = 3;
178 int avoid_gfm_parallel_calls = 0;
179 IJK_Field_local_double boundary_flux_kmin;
180 IJK_Field_local_double boundary_flux_kmax;
181 assert(!liste_thermique_.est_vide());
182 liste_thermique_[0]->get_boundary_fluxes(boundary_flux_kmin, boundary_flux_kmax);
183 for (auto& itr : liste_thermique_)
184 itr->retrieve_ghost_fluid_params(compute_distance,
185 compute_curvature,
186 n_iter_distance,
187 avoid_gfm_parallel_calls);
188 ghost_fluid_fields_.retrieve_ghost_fluid_params(compute_distance,
189 compute_curvature,
190 n_iter_distance,
191 avoid_gfm_parallel_calls,
192 boundary_flux_kmin,
193 boundary_flux_kmax);
194}
195
197{
198 ref_ijk_ft_post_ = ijk_ft_post;
199 for (auto& itr : liste_thermique_)
200 itr->associer_post(ijk_ft_post);
201}
202
204{
205 ref_ijk_ft_switch_ = ijk_ft_switch;
206 for (auto& itr : liste_thermique_)
207 itr->associer_switch(ref_ijk_ft_switch_);
208}
209/*
210* Here, Name is actually a prefix
211* In the individual thermal equations, it must be appended with "_" + Nom(rank_)
212* when named with method nommer (or at allocation with the 4th argument of allocate)
213* It must be named before being added to the list of understood fields (champs_compris, method ajoute_champ)
214*
215* See in Postprocessing_IJK::register_one_field what is done with these prefixes
216*/
217void IJK_Thermals::Fill_postprocessable_fields(std::vector<FieldInfo_t>& chps)
218{
219
220 std::vector<FieldInfo_t> c =
221 {
222 // Name / Localisation (elem, face, ...) / Nature (scalare, vector) / Located on interface?
223 { "TEMPERATURE", Entity::ELEMENT, Nature_du_champ::scalaire, false },
224 { "TEMPERATURE_ANA", Entity::ELEMENT, Nature_du_champ::scalaire, false },
225 { "ECART_T_ANA", Entity::ELEMENT, Nature_du_champ::scalaire, false },
226 { "TEMPERATURE_ADIMENSIONNELLE_THETA", Entity::ELEMENT, Nature_du_champ::scalaire, false },
227 { "TEMPERATURE_PHYSIQUE_T", Entity::ELEMENT, Nature_du_champ::scalaire, false },
228 { "SOURCE_TEMPERATURE", Entity::ELEMENT, Nature_du_champ::scalaire, false },
229 { "T_RUST", Entity::ELEMENT, Nature_du_champ::scalaire, false },
230 { "DIV_LAMBDA_GRAD_T_VOLUME", Entity::ELEMENT, Nature_du_champ::scalaire, false },
231 { "DIV_RHO_CP_T_VOLUME", Entity::ELEMENT, Nature_du_champ::scalaire, false },
232 { "U_T_CONVECTIVE_VOLUME", Entity::ELEMENT, Nature_du_champ::scalaire, false },
233 { "U_T_CONVECTIVE", Entity::ELEMENT, Nature_du_champ::scalaire, false }
234
235 };
236 chps.insert(chps.end(), c.begin(), c.end());
237}
238
240{
241 for (auto& itr : liste_thermique_)
242 {
243 itr->get_noms_champs_postraitables(noms,opt);
244 }
245
246 ghost_fluid_fields_.get_noms_champs_postraitables(noms,opt);
247}
248
249bool IJK_Thermals::has_champ(const Motcle& nom) const
250{
251
252 for (auto& itr : liste_thermique_)
253 {
254 if (itr->has_champ(nom))
255 {
256 return true;
257 }
258 }
259
260 if (ghost_fluid_fields_.has_champ(nom))
261 {
262 return true;
263 }
264 return false;
265
266}
267
268const IJK_Field_double& IJK_Thermals::get_IJK_field(const Motcle& nom)
269{
270 for (auto& itr : liste_thermique_)
271 {
272 if (itr->has_champ(nom))
273 {
274 return itr->get_IJK_field(nom);
275 }
276 }
277
278 if (ghost_fluid_fields_.has_champ(nom))
279 {
280 return ghost_fluid_fields_.get_IJK_field(nom);
281 }
282 Cerr << "IJK_Thermals::get_IJK_field requested field " << nom << " is not known by any equation"<< finl;
283 throw;
284}
285
286const IJK_Field_vector3_double& IJK_Thermals::get_IJK_field_vector(const Motcle& nom)
287{
288 for (auto& itr : liste_thermique_)
289 {
290 if (itr->has_champ(nom))
291 {
292 return itr->get_IJK_field_vector(nom);
293 }
294 }
295
296 if (ghost_fluid_fields_.has_champ(nom))
297 {
298 return ghost_fluid_fields_.get_IJK_field_vector(nom);
299 }
300 Cerr << "IJK_Thermals::get_IJK_field requested field vector " << nom << " is not known by any equation"<< finl;
301 throw;
302}
303
305 const Intersection_Interface_ijk_face& intersection_ijk_face)
306{
307 ref_intersection_ijk_cell_ = intersection_ijk_cell;
308 ref_intersection_ijk_face_ = intersection_ijk_face;
309 for (auto& itr : liste_thermique_)
310 itr->associer_interface_intersections(intersection_ijk_cell, intersection_ijk_face);
311}
312
314{
315 double modified_time;
316 if (liste_thermique_.est_vide())
317 modified_time = ref_ijk_ft_->schema_temps_ijk().get_current_time();
318 else
319 modified_time = 0.;
320 for (auto& itr : liste_thermique_)
321 modified_time = std::max(modified_time, itr->get_modified_time());
322 return modified_time;
323}
324
325void IJK_Thermals::get_rising_velocities_parameters(int& compute_rising_velocities,
326 int& fill_rising_velocities,
327 int& use_bubbles_velocities_from_interface,
328 int& use_bubbles_velocities_from_barycentres)
329{
330 if (!liste_thermique_.est_vide())
331 for (auto& itr : liste_thermique_)
332 itr->get_rising_velocities_parameters(compute_rising_velocities,
333 fill_rising_velocities,
334 use_bubbles_velocities_from_interface,
335 use_bubbles_velocities_from_barycentres);
336}
337
339 const int& stop)
340{
341 int idth = 0;
342 for (auto& itr : liste_thermique_)
343 {
344 itr->sauvegarder_temperature(lata_name, idth, stop);
345 idth++;
346 }
347}
348
350{
351 int flag_list_not_empty_th = 0;
352 if (liste_thermique_.size() > 0)
353 {
354 fichier << " thermals {\n" ;
355 flag_list_not_empty_th = 1;
356 }
357 for(auto itr = liste_thermique_.begin(); itr != liste_thermique_.end(); )
358 {
359 fichier << *itr ;
360 ++itr;
361 if (itr != liste_thermique_.end())
362 fichier << ", \n" ;
363 else
364 fichier << "\n" ;
365 }
366 if (flag_list_not_empty_th)
367 fichier << " } \n" ;
368}
369
370void IJK_Thermals::compute_timestep(double& dt_thermals, const double dxmin)
371{
372 for (auto& itr : liste_thermique_)
373 {
374 const double dt_th = itr->compute_timestep(dt_thermals, dxmin);
375 // We take the most restrictive of all thermal problems and use it for all:
376 dt_thermals = std::min(dt_thermals, dt_th);
377 }
378}
379
381{
382 if (!liste_thermique_.est_vide())
383 {
384 ghost_fluid_fields_.initialize(splitting);
385 int idth =0;
386 Nom thermal_outputs_rank_base = Nom("thermal_outputs_rank_");
387 const int max_digit = 3;
388 for (auto& itr : liste_thermique_)
389 {
390 itr->initialize(splitting);
392 itr->update_thermal_properties();
393 const int max_rank_digit = idth < 1 ? 1 : (int) (log10(idth) + 1);
394 thermal_rank_folder_.add(thermal_outputs_rank_base
395 + Nom(std::string(max_digit - max_rank_digit, '0')) + Nom(idth));
396 idth++;
397 }
399 {
400 overall_bubbles_quantities_folder_ = Nom("overall_bubbles_quantities");
401 interfacial_quantities_thermal_probes_folder_ = Nom("interfacial_quantities_thermal_probes");
402 shell_quantities_thermal_probes_folder_ = Nom("shell_quantities_thermal_probes");
403 local_quantities_thermal_probes_folder_ = Nom("local_quantities_thermal_probes");
404 local_quantities_thermal_probes_time_index_folder_ = Nom("local_quantities_thermal_probes_time_index_");
405 local_quantities_thermal_slices_folder_ = Nom("local_quantities_thermal_slices");
406 local_quantities_thermal_slices_time_index_folder_ = Nom("local_quantities_thermal_slices_time_index_");
407 local_quantities_thermal_lines_folder_ = Nom("local_quantities_thermal_lines");
408 local_quantities_thermal_lines_time_index_folder_ = Nom("local_quantities_thermal_lines_time_index_");
409 }
410 for (auto& itr : liste_thermique_)
411 {
412 lata_step_reprise_.push_back(itr->get_latastep_reprise());
413 lata_step_reprise_ini_.push_back(itr->get_latastep_reprise_ini());
414 }
415 }
416}
417
419{
420 for (auto& itr : liste_thermique_)
421 itr->recompute_temperature_init();
422}
423
425{
426 int size=0;
427 for (auto& itr : liste_thermique_)
428 {
429 if (thermal_problem == itr->get_thermal_problem_type())
430 size++;
431 }
432 return size;
433}
434
436{
437 for (auto& itr : liste_thermique_)
438 itr->update_thermal_properties();
439}
440
441void IJK_Thermals::euler_time_step(const double timestep)
442{
443 for (auto& itr : liste_thermique_)
444 itr->euler_time_step(timestep);
445 ghost_fluid_fields_.enforce_distance_curvature_values_for_post_processings();
446}
447
448void IJK_Thermals::euler_rustine_step(const double timestep)
449{
450 for (auto& itr : liste_thermique_)
451 // Make sense only if (sub_type(IJK_Thermal_Onefluid, itr.valeur())) but empty methods are coded otherwise...
452 itr->euler_rustine_step(timestep);
453}
454
455void IJK_Thermals::rk3_sub_step(const int rk_step, const double total_timestep, const double time)
456{
457 for (auto& itr : liste_thermique_)
458 {
459 int thermal_rank = itr->get_thermal_rank();
460 switch (thermal_rank)
461 {
462 case 0:
463 Cerr << "RK3 Time scheme is not implemented yet with" << itr->get_thermal_words()[thermal_rank] << finl;
464 break;
465 case 1:
466 Cerr << "RK3 Time scheme is not implemented yet with" << itr->get_thermal_words()[thermal_rank] << finl;
467 break;
468 case 2:
469 itr->rk3_sub_step(rk_step, total_timestep, time);
470 Cerr << "RK3 Time scheme is implemented with" << itr->get_thermal_words()[thermal_rank] << finl;
471 break;
472 case 3:
473 Cerr << "RK3 Time scheme is not implemented with" << itr->get_thermal_words()[thermal_rank] << finl;
474 break;
475 case 4:
476 itr->rk3_sub_step(rk_step, total_timestep, time);
477 Cerr << "RK3 Time scheme is implemented with" << itr->get_thermal_words()[thermal_rank] << finl;
478 break;
479 default:
481 }
482 }
483}
484
485void IJK_Thermals::rk3_rustine_sub_step(const int rk_step, const double total_timestep,
486 const double fractionnal_timestep, const double time)
487{
488 for (auto& itr : liste_thermique_)
489 itr->rk3_rustine_sub_step(rk_step, total_timestep, fractionnal_timestep, time);
490}
491
492void IJK_Thermals::ecrire_statistiques_bulles(int reset, const Nom& nom_cas, const double current_time, const ArrOfDouble& surface)
493{
494 int idx_th = 0;
495 for (auto &itr : liste_thermique_)
496 {
497 itr->ecrire_statistiques_bulles(reset, nom_cas, current_time, surface, idx_th);
498 ++idx_th;
499 }
500}
501
503{
504 int idx_th = 0;
505 for (auto &itr : liste_thermique_)
506 {
507 itr->posttraiter_tous_champs_thermal(liste_post_instantanes_, idx_th);
508 ++idx_th;
509 }
510}
511
513 const char *lata_name,
514 const int latastep,
515 const double current_time,
516 int& n)
517{
518 throw; // THIS METHOD SHOULD NOT BE CALLED ANYMORE
519
520 /* Cerr << "Post-process Eulerian fields related to the temperature resolution" << finl;
521 int idx_th = 0;
522 for (auto &itr : liste_thermique_)
523 {
524 int nb = itr->posttraiter_champs_instantanes_thermal(liste_post_instantanes,
525 lata_name,
526 latastep,
527 current_time,
528 idx_th);
529 // Interfacial thermal fields :
530 if (!Option_IJK::DISABLE_DIPHASIQUE)
531 nb += itr->posttraiter_champs_instantanes_thermal_interface(liste_post_instantanes,
532 lata_name,
533 latastep,
534 current_time,
535 idx_th);
536 if (idx_th == 0)
537 n -= nb; // On compte comme "un" tous les CHAMPS_N (ou N est la longueur de la liste)
538 ++idx_th;
539 } */
540}
541
543{
544 int idx =0;
545 for (auto& itr : liste_thermique_)
546 {
547 Cout << "Reading the old temperature field from " << Nom(itr->get_fichier_sauvegarde())
548 << " to fill the liste_thermique_ field."<< finl;
549 itr->initialize_switch(splitting, idx);
550 idx++;
551 }
552}
553
554void IJK_Thermals::prepare_thermals(const char *lata_name)
555{
556 for (auto& itr : liste_thermique_)
557 itr->set_fichier_sauvegarde(lata_name);
558}
559
560void IJK_Thermals::ecrire_fichier_reprise(SFichier& fichier, const char *lata_name)
561{
562 Cerr << " potentially saving temperature fields... " << finl;
563 int flag_list_not_empty = 0;
564 if ((int) liste_thermique_.size() > 0)
565 {
566 fichier << " thermals {\n" ;
567 flag_list_not_empty = 1;
568 }
569 int idx =0;
570 for (auto itr = liste_thermique_.begin(); itr != liste_thermique_.end(); )
571 {
572 (*itr)->set_fichier_sauvegarde(lata_name);
573 fichier << *itr ;
574 ++itr;
575 if (itr != liste_thermique_.end() )
576 fichier << ", \n" ;
577 else
578 fichier << "\n" ;
579 Cerr << " end of temperature field #" << idx << "... " << finl;
580 ++idx;
581 }
582 if (flag_list_not_empty)
583 fichier << " } \n" ;
584}
585
587{
588 int ghost_fluid = 0;
589 for (auto& itr : liste_thermique_)
590 {
591 ghost_fluid = itr->get_ghost_fluid_flag();
592 if (ghost_fluid)
593 return ghost_fluid;
594 }
595 return ghost_fluid;
596}
597
599{
600 for (auto& itr : liste_thermique_)
601 itr->compute_ghost_cell_numbers_for_subproblems(splitting, ghost_init);
602}
603
605{
606 int ghost_cells = ghost_init;
607 for (auto& itr : liste_thermique_)
608 {
609 const int itr_ghost_cells = itr->get_ghost_cells();
610 if (itr_ghost_cells > ghost_cells)
611 ghost_cells = itr_ghost_cells;
612 }
613 return ghost_cells;
614}
615
617{
618 for (auto& itr : liste_thermique_)
619 itr->update_intersections();
620}
621
623{
624 for (auto& itr : liste_thermique_)
625 itr->clean_ijk_intersections();
626}
627
629{
630 assert(!liste_thermique_.est_vide());
631 ghost_fluid_fields_.compute_eulerian_distance();
632}
633
635{
636 assert(!liste_thermique_.est_vide());
637 ghost_fluid_fields_.compute_eulerian_curvature();
638}
639
641{
642 assert(!liste_thermique_.est_vide());
643 ghost_fluid_fields_.compute_eulerian_curvature_from_interface();
644}
645
647{
648 if (!liste_thermique_.est_vide())
649 if (ghost_fluid_flag())
650 {
653 }
654}
655
657{
658 int disable_post_processing_probes_out_files = 1;
659 for (auto& itr : liste_thermique_)
660 disable_post_processing_probes_out_files = (disable_post_processing_probes_out_files && itr->get_disable_post_processing_probes_out_files());
661 return disable_post_processing_probes_out_files;
662}
663
665{
666 if (stop)
667 for (auto& itr : liste_thermique_)
668 itr->set_latastep_reprise(ref_ijk_ft_->schema_temps_ijk().get_tstep() + 1);
669}
670
671void IJK_Thermals::thermal_subresolution_outputs(const int& dt_post_thermals_probes)
672{
673 const int disable_post_processing_probes_out_files = get_disable_post_processing_probes_out_files();
674 if (!disable_post_processing_probes_out_files && post_pro_first_call_)
675 {
677 {
680 }
681 int rank = 0;
682 for (auto& itr : liste_thermique_)
683 {
684 const int last_time = ref_ijk_ft_->schema_temps_ijk().get_tstep() + lata_step_reprise_ini_[rank];
685 const int max_digit_time = 8;
686 const int nb_digit_tstep = last_time < 1 ? 1 : (int) (log10(last_time) + 1);
687 Nom prefix_local_quantities = thermal_rank_folder_[rank] + "/";
688 Nom suffix_local_quantities = Nom(std::string(max_digit_time - nb_digit_tstep, '0')) + Nom(last_time);
689 Nom local_quantities_thermal_probes_time_index_folder = prefix_local_quantities
692 + suffix_local_quantities;
693 Nom overall_bubbles_quantities = thermal_rank_folder_[rank] + "/" + overall_bubbles_quantities_folder_;
694 Nom interfacial_quantities_thermal_probes = thermal_rank_folder_[rank] + "/" + interfacial_quantities_thermal_probes_folder_;
695 Nom shell_quantities_thermal_probes = thermal_rank_folder_[rank] + "/" + shell_quantities_thermal_probes_folder_;
696 Nom local_quantities_thermal_slices_time_index_folder = prefix_local_quantities
699 + suffix_local_quantities;
700 Nom local_quantities_thermal_lines_time_index_folder = prefix_local_quantities
703 + suffix_local_quantities;
704
705 create_folders(local_quantities_thermal_probes_time_index_folder);
706 create_folders(local_quantities_thermal_slices_time_index_folder);
707 create_folders(local_quantities_thermal_lines_time_index_folder);
708
709 itr->thermal_subresolution_outputs(interfacial_quantities_thermal_probes,
710 shell_quantities_thermal_probes,
711 overall_bubbles_quantities,
712 local_quantities_thermal_probes_time_index_folder,
713 local_quantities_thermal_slices_time_index_folder,
714 local_quantities_thermal_lines_time_index_folder);
715 // .sauv written before the post-processing on probes
716 int latastep_reprise = lata_step_reprise_ini_[rank] + ref_ijk_ft_->schema_temps_ijk().get_tstep() + 2;
717 const int nb_dt_max = ref_ijk_ft_->schema_temps_ijk().get_nb_timesteps();
718 if ((ref_ijk_ft_->schema_temps_ijk().get_tstep() + dt_post_thermals_probes) >= nb_dt_max)
719 latastep_reprise = nb_dt_max + 1;
720 itr->set_latastep_reprise(latastep_reprise);
721 rank++;
722 }
723 }
725}
726
728{
729 for (int idth = 0; idth < liste_thermique_.size(); idth++)
730 {
731 create_folders(thermal_rank_folder_[idth]);
732 create_folders(thermal_rank_folder_[idth] + "/" + overall_bubbles_quantities_folder_);
733 create_folders(thermal_rank_folder_[idth] + "/" + interfacial_quantities_thermal_probes_folder_);
734 create_folders(thermal_rank_folder_[idth] + "/" + shell_quantities_thermal_probes_folder_);
735 create_folders(thermal_rank_folder_[idth] + "/" + local_quantities_thermal_probes_folder_);
736 create_folders(thermal_rank_folder_[idth] + "/" + local_quantities_thermal_slices_folder_);
737 create_folders(thermal_rank_folder_[idth] + "/" + local_quantities_thermal_lines_folder_);
738 }
739}
740
741void IJK_Thermals::create_folders(Nom folder_name_base)
742{
744 {
745 Nom spacing = " ";
746 Nom folder_name = "mkdir -p";
747 folder_name = folder_name + spacing + folder_name_base.getString(); // donothing";
748 Cerr << "Shell command executed: " << folder_name << finl;
749 int error = system(folder_name);
750 assert(!error);
751 if (error)
753 }
754}
755
756void IJK_Thermals::set_first_step_thermals_post(int& first_step_thermals_post)
757{
758 first_step_thermals_post = 0;
759 for (int idth = 0; idth < liste_thermique_.size(); idth++)
760 first_step_thermals_post = (first_step_thermals_post || liste_thermique_[idth]->get_first_step_thermals_post());
761}
762
764{
765 for (auto& itr : liste_thermique_)
766 itr->compute_temperature_init();
767}
768
770 const Domaine_IJK& new_mesh,
771 const Nom& lata_name,
772 DoubleTab& coeff_i,
773 IntTab Indice_i,
774 DoubleTab& coeff_j,
775 IntTab Indice_j,
776 DoubleTab& coeff_k,
777 IntTab Indice_k)
778{
779 IJK_Field_double new_thermal_field;
780 if (liste_thermique_.size() > 0)
781 {
782 switch_double_ft.calculer_coords_elem();
783 switch_double_ft.calculer_coeff(coeff_i,Indice_i,coeff_j,Indice_j,coeff_k,Indice_k);
784 new_thermal_field.allocate(new_mesh /* it is in fact a splitting */, Domaine_IJK::ELEM, 0);
785 }
786 int idth = 0;
787 for (auto& itr : liste_thermique_)
788 {
789 switch_double_ft.switch_scalar_field(*itr->get_temperature(),
790 new_thermal_field,
791 coeff_i, Indice_i,
792 coeff_j ,Indice_j,
793 coeff_k ,Indice_k);
794
795 Cout << "Writing " << Nom("TEMPERATURE_") + Nom(idth) << " into " << lata_name << finl;
796 dumplata_scalar(lata_name, Nom("TEMPERATURE_") + Nom(idth), new_thermal_field, 0 /*we store a 0 */);
797 ++idth;
798 }
799}
800
802{
803 for (auto& itr : liste_thermique_)
804 itr->copy_previous_interface_state();
805}
806
808{
809 for (auto& itr : liste_thermique_)
810 itr->copie_pure_vers_diph_sans_interpolation();
811}
812
814{
815 for (auto& itr : liste_thermique_)
816 itr->echange_pure_vers_diph_cellules_initialement_pures();
817}
818
820{
821 for (auto& itr : liste_thermique_)
822 itr->echange_diph_vers_pure_cellules_finalement_pures();
823}
824
826{
827 for (auto& itr : liste_thermique_)
828 itr->vide_phase_invalide_cellules_diphasiques();
829}
830
832{
833 for (auto& itr : liste_thermique_)
834 itr->remplir_tableau_pure_cellules_diphasiques(next_time);
835}
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
OWN_PTR(Parametre_equation_base) &parametre_equation()
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
const Fluide_Incompressible & fluide_phase(int la_phase) const
void allocate(const Domaine_IJK &d, Domaine_IJK::Localisation l, int ghost_size, int additional_k_layers=0, int nb_compo=1, const Nom &name=Nom(), bool external_storage=false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
static void typer_lire_thermal_equation(OWN_PTR(IJK_Thermal_base)&, Entree &)
void thermal_subresolution_outputs(const int &dt_post_thermals_probes=0)
std::vector< int > lata_step_reprise_
void set_first_step_thermals_post(int &first_step_thermals_post)
void associer_switch(const Switch_FT_double &ijk_ft_switch)
void prepare_thermals(const char *lataname)
void associer_post(const Postprocessing_IJK &ijk_ft_post)
void create_folders_for_probes()
void compute_ghost_cell_numbers_for_subproblems(const Domaine_IJK &splitting, int ghost_init)
void retrieve_ghost_fluid_params()
int get_disable_post_processing_probes_out_files() const
void ecrire_statistiques_bulles(int reset, const Nom &nom_cas, const double current_time, const ArrOfDouble &surface)
void rk3_rustine_sub_step(const int rk_step, const double total_timestep, const double fractionnal_timestep, const double time)
void verifie_milieu()
void update_intersections()
Nom local_quantities_thermal_lines_time_index_folder_
void get_noms_champs_postraitables(Noms &noms, Option opt=NONE) const override
void set_fichier_reprise(const char *lataname)
void vide_phase_invalide_cellules_diphasiques()
void set_temperature_ini()
void echange_diph_vers_pure_cellules_finalement_pures()
void get_rising_velocities_parameters(int &compute_rising_velocities, int &fill_rising_velocities, int &use_bubbles_velocities_from_interface, int &use_bubbles_velocities_from_barycentres)
Nom local_quantities_thermal_probes_folder_
Nom shell_quantities_thermal_probes_folder_
void echange_pure_vers_diph_cellules_initialement_pures()
int get_probes_ghost_cells(int ghost_init)
Nom overall_bubbles_quantities_folder_
void remplir_tableau_pure_cellules_diphasiques(bool next_time)
void associer_interface_intersections(const Intersection_Interface_ijk_cell &intersection_ijk_cell_, const Intersection_Interface_ijk_face &intersection_ijk_face_)
void associer_milieu_base(const Milieu_base &) override
int ini_folder_out_files_
const IJK_Field_vector3_double & get_IJK_field_vector(const Motcle &nom) override
bool has_champ(const Motcle &nom) const override
void clean_ijk_intersections()
void sauvegarder_temperature(Nom &lata_name, const int &stop)
void initialize(const Domaine_IJK &splitting)
void euler_rustine_step(const double timestep)
void set_latastep_reprise(const bool stop)
void ecrire_fichier_reprise(SFichier &fichier, const char *lata_name)
void posttraiter_tous_champs_thermal(Motcles &liste_post_instantanes_)
int post_pro_first_call_
void init_switch_thermals(const Domaine_IJK &splitting)
void copy_previous_interface_state()
const Nom & get_fichier_reprise()
Nom local_quantities_thermal_probes_time_index_folder_
int size() const
const IJK_Field_double & get_IJK_field(const Motcle &nom) override
Nom local_quantities_thermal_slices_folder_
static void Fill_postprocessable_fields(std::vector< FieldInfo_t > &chps)
std::vector< int > lata_step_reprise_ini_
void sauvegarder_thermals(SFichier &fichier)
Nom local_quantities_thermal_slices_time_index_folder_
int size_thermal_problem(Nom thermal_problem)
double get_modified_time()
IJK_Ghost_Fluid_Fields ghost_fluid_fields_
void posttraiter_champs_instantanes_thermal(const Motcles &liste_post_instantanes, const char *lata_name, const int latastep, const double current_time, int &n)
void update_thermal_properties()
void compute_new_thermal_field(Switch_FT_double &switch_double_ft, const Domaine_IJK &new_mesh, const Nom &lata_name, DoubleTab &coeff_i, IntTab Indice_i, DoubleTab &coeff_j, IntTab Indice_j, DoubleTab &coeff_k, IntTab Indice_k)
void compute_eulerian_distance_curvature()
Fluide_Diphasique_IJK & milieu_ijk()
void completer() override
Complete la construction (initialisation) des objets associes a l'equation.
void rk3_sub_step(const int rk_step, const double total_timestep, const double time)
void associer_pb_base(const Probleme_base &) override
S'associe au Probleme passe en parametre.
void create_folders(Nom folder_name_base)
void compute_eulerian_curvature()
void compute_timestep(double &dt_thermals, const double dxmin)
Nom local_quantities_thermal_lines_folder_
Nom interfacial_quantities_thermal_probes_folder_
void compute_eulerian_distance()
void recompute_temperature_init()
void compute_eulerian_curvature_from_interface()
const Milieu_base & milieu() const override
void euler_time_step(const double timestep)
void copie_pure_vers_diph_sans_interpolation()
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
Definition Milieu_base.h:50
bool has_conductivite() const
virtual const Champ_Don_base & capacite_calorifique() const
Renvoie la capacite calorifique du milieu.
bool has_capacite_calorifique() const
virtual const Champ_Don_base & conductivite() const
Renvoie la conductivite du milieu.
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
Un tableau d'objets de la classe Motcle.
Definition Motcle.h:63
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
const std::string & getString() const
Definition Nom.h:92
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static bool DISABLE_DIPHASIQUE
Definition Option_IJK.h:26
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Probleme_U.h:109
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
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
void calculer_coeff(DoubleTab &coeff_i, IntTab &Indice_i, DoubleTab &coeff_j, IntTab &Indice_j, DoubleTab &coeff_k, IntTab &Indice_k)
void calculer_coords_elem()
void switch_scalar_field(const IJK_Field_double &oldf, IJK_Field_double &newf, DoubleTab coeff_i, IntTab Indice_i, DoubleTab coeff_j, IntTab Indice_j, DoubleTab coeff_k, IntTab Indice_k) const
_SIZE_ size() const
Definition TRUSTVect.tpp:45