TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Fluide_Dilatable_base.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Navier_Stokes_Fluide_Dilatable_base.h>
17#include <Fluide_Dilatable_base.h>
18#include <Neumann_sortie_libre.h>
19#include <Loi_Etat_Multi_GP_QC.h>
20#include <Discretisation_base.h>
21#include <Champ_Fonc_Fonction.h>
22#include <Champ_Uniforme.h>
23#include <Probleme_base.h>
24#include <Domaine_VF.h>
25#include <Param.h>
26
27Implemente_base(Fluide_Dilatable_base,"Fluide_Dilatable_base",Fluide_base);
28
30{
31 os << que_suis_je() << finl;
33 return os;
34}
35
37{
38 return Fluide_base::readOn(is);
39}
40
42{
43 Cerr<<"Fluide_Dilatable_base::discretiser"<<finl;
44 if (!le_probleme_) le_probleme_ = pb;
45
46 const Domaine_dis_base& domaine_dis=pb.equation(0).domaine_dis();
47 double temps=pb.schema_temps().temps_courant();
48
49 // fields will be named by milieu_base
50 OWN_PTR(Champ_Don_base) ch_rho;
51 dis.discretiser_champ("temperature",domaine_dis,"masse_volumique_p","neant",1,temps,ch_rho);
52 ch_rho_ = ch_rho.valeur();
53
54 if (!ch_Cp_ || !sub_type(Champ_Uniforme,ch_Cp_.valeur())) //ie Cp non constant : real gases
55 {
56 Cerr<<"Heat capacity Cp is discretized once more for space variable case."<<finl;
57 dis.discretiser_champ("temperature",domaine_dis,"cp_prov","neant",1,temps,ch_Cp_);
58 }
59
60 if (!ch_lambda_ || ((!sub_type(Champ_Uniforme,ch_lambda_.valeur())) && (!sub_type(Champ_Fonc_Tabule,ch_lambda_.valeur()))))
61 {
62 // special case was wrong in VEF; see when this is used (FM only): will be named by milieu_base
63 dis.discretiser_champ("champ_elem",domaine_dis,"neant","neant",1,temps,ch_lambda_);
64 }
65
66 dis.discretiser_champ("vitesse", domaine_dis,"rho_comme_v","kg/m3",1,temps,ch_rho_comme_v_);
67 champs_compris_.ajoute_champ(ch_rho_comme_v_);
68
69 dis.discretiser_champ("champ_elem",domaine_dis,"mu_sur_Schmidt","kg/(m.s)",1,temps,ch_mu_sur_Sc);
70 champs_compris_.ajoute_champ(ch_mu_sur_Sc);
71
72 dis.discretiser_champ("champ_elem",domaine_dis,"nu_sur_Schmidt","m2/s",1,temps,ch_nu_sur_Sc);
73 champs_compris_.ajoute_champ(ch_nu_sur_Sc);
74
75 dis.discretiser_champ("champ_elem",domaine_dis,"pression_tot","Pa",1,temps,ch_pression_tot_);
76 champs_compris_.ajoute_champ(ch_pression_tot_.valeur());
77
78 dis.discretiser_champ("temperature",domaine_dis,"rho_gaz","kg/m3",1,temps,ch_rho_gaz_);
79 champs_compris_.ajoute_champ(ch_rho_gaz_);
80
82}
83
85{
87 param.ajouter_non_std("loi_etat",(this),Param::REQUIRED);
88 param.ajouter_non_std("Traitement_PTh",(this));
89 // Reading mu and lambda is not mandatory because the Sutherland option is possible
90 // Remove and re-add as non-standard
91 param.supprimer("mu");
92 param.ajouter_non_std("mu",(this));
93 param.ajouter_non_std("sutherland",(this));
94 param.supprimer("beta_th");
95 param.ajouter_non_std("beta_th",(this));
96 param.supprimer("beta_co");
97 param.ajouter_non_std("beta_co",(this));
98}
99
101{
102 Motcle motlu;
103 if (mot=="loi_etat")
104 {
105 loi_etat_.typer_lire(is,"Loi_Etat_", "Lecture et typage de la loi d'etat ...");
106 loi_etat_->associer_fluide(*this);
107 return 1;
108 }
109 else if (mot=="Traitement_PTh")
110 {
111 Motcle trait;
112 is >> trait;
113 Motcles les_options(3);
114 {
115 les_options[0] = "edo";
116 les_options[1] = "conservation_masse";
117 les_options[2] = "constant";
118 }
119 traitement_PTh_=les_options.search(trait);
120 if (traitement_PTh_ == -1)
121 {
122 Cerr<< trait << " is not understood as an option of the keyword " << mot <<finl;
123 Cerr<< "One of the following options was expected : " << les_options << finl;
125 }
126 return 1;
127 }
128 else if (mot=="mu")
129 {
130 is>>ch_mu_;
131 ch_mu_->nommer("mu");
132 return 1;
133 }
134 else if (mot=="sutherland")
135 {
136 double mu0,T0,C=-1,Slambda=-1;
137 Nom prob;
138 is>>prob;
139 is>>motlu;
140 if (motlu!="MU0") warn_syntax_Sutherland();
141 is>>mu0;
142 is>>motlu;
143 if (motlu!="T0") warn_syntax_Sutherland();
144 is>>T0;
145 is>>motlu;
146 if (motlu=="SLAMBDA")
147 {
148 is >> Slambda;
149 is >> motlu;
150 }
151 if (motlu!="C") warn_syntax_Sutherland();
152 is>>C;
153
154 ch_mu_.typer("Sutherland");
155 Sutherland& mu_suth = ref_cast(Sutherland,ch_mu_.valeur());
156 mu_suth.set_val_params(prob,mu0,C,T0);
157 mu_suth.lire_expression();
158
159 // Store the value of C (here Slambda) to build (cf creer_champs_non_lus())
160 // the Sutherland law for the conductivity
161 if (Slambda!=-1)
162 {
163 ch_lambda_.typer("Sutherland");
164 Sutherland& lambda_suth = ref_cast(Sutherland,ch_lambda_.valeur());
165 lambda_suth.set_prob(prob);
166 lambda_suth.set_Tref(T0);
167 lambda_suth.set_C(Slambda);
168 }
169 return 1;
170 }
171 else if ((mot=="beta_th") || (mot=="beta_co"))
172 {
173 Cerr<<"The keyword "<<mot<<" has not to be read for a "<<que_suis_je()<<" type medium."<<finl;
174 Cerr<<"Please remove it from your data set."<<finl;
176 return -1;
177 }
178 else return Fluide_base::lire_motcle_non_standard(mot,is);
179}
180
181/*
182 * traitement_PTh=0 => classical EDO resolution
183 * traitement_PTh=1 => pressure computed to conserve mass
184 * traitement_PTh=2 => pressure kept constant.
185 */
187{
188 if (traitement_PTh_==0)
189 {
190 /* Do nothing*/
191 }
192 else
193 {
194 int pression_imposee=0;
195 int size=domaine_cl.les_conditions_limites().size();
196 assert(size!=0);
197 for (int n=0; n<size; n++)
198 {
199 const Cond_lim& la_cl = domaine_cl.les_conditions_limites(n);
200 if (sub_type(Neumann_sortie_libre, la_cl.valeur())) pression_imposee=1;
201 }
202
203 if (pression_imposee && traitement_PTh_!=2)
204 {
205 Cerr << "The Traitement_Pth option selected is not coherent with the boundaries conditions." << finl;
206 Cerr << "Traitement_Pth constant must be used for the case of free outlet." << finl;
208 }
209
210 if (!pression_imposee && traitement_PTh_!=1)
211 {
212 Cerr << "The Traitement_Pth option selected is not coherent with the boundaries conditions." << finl;
213 Cerr << "Traitement_Pth conservation_masse must be used for the case without free outlet." << finl;
215 }
216 }
217}
218
220{
221 Cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << finl;
222 Cerr << "Error in call to Sutherland function :" << finl;
223 Cerr << "The syntax has changed in version 1.8.4." << finl;
224 Cerr << finl << " A specification of kind : sutherland problem_name mu0 1.85e-5 T0 300 [Slambda 10] C 10 was expected. "<<finl;
225 Cerr << finl << "Please update your dataset or contact TRUST support team." << finl;
227}
228
229/*! @brief Verifies that the fields read have been correctly set.
230 *
231 * @throws if one of the properties (rho mu Cp or lambda) of the fluid has not been defined
232 */
234{
235 msg="";
236 if (ch_rho_) { }
237 else
238 {
239 msg += "The density rho has not been specified. \n";
240 err = 1;
241 }
242 if (ch_mu_)
243 {
244 if (sub_type(Champ_Uniforme,ch_mu_.valeur()))
245 {
246 if (ch_mu_->valeurs()(0,0) <= 0)
247 {
248 msg += "The dynamical viscosity mu is not striclty positive. \n";
249 err = 1;
250 }
251 }
252 }
253 else
254 {
255 msg += "The dynamical viscosity mu has not been specified. \n";
256 err = 1;
257 }
258 if (ch_lambda_) { }
259 else
260 {
261 msg += "The conductivity lambda has not been specified. \n";
262 err = 1;
263 }
264 if (ch_Cp_) { }
265 else
266 {
267 msg += "The heat capacity Cp has not been specified. \n";
268 err = 1;
269 }
270
272}
273
274/*! @brief Completes the fluid with a constant Cp.
275 *
276 * @param Cp_ the heat capacity of the fluid
277 */
279{
280 ch_Cp_.typer("Champ_Uniforme");
281 Champ_Uniforme& ch_Cp = ref_cast(Champ_Uniforme,ch_Cp_.valeur());
282 ch_Cp.dimensionner(1,1);
283 DoubleTab& tab_Cp = ch_Cp_->valeurs();
284 tab_Cp(0,0) = Cp_;
285}
286
288{
289 // If the unknown is on the device, copy the data there too:
290 if (equation_.size() && (*(equation_.begin()->second)).inconnue().valeurs().isDataOnDevice())
291 {
292 // ToDo_Kokkos move all this into Milieu_base::initialiser ?
293 mapToDevice(ch_rho_->valeurs());
294 mapToDevice(ch_rho_Cp_elem_->valeurs());
295 mapToDevice(ch_rho_Cp_comme_T_->valeurs());
296 }
297 ch_rho_Cp_comme_T_->changer_temps(temps);
298 ch_rho_Cp_comme_T_->changer_temps(temps);
299 DoubleTab& rho_cp = ch_rho_Cp_comme_T_->valeurs();
300 if (sub_type(Champ_Uniforme,ch_rho_.valeur()))
301 rho_cp = ch_rho_->valeurs()(0, 0);
302 else
303 {
304 // AB: rho_cp = rho->valeurs() turns rho_cp into a 2 dimensional array with 1 compo. We want to stay mono-dim:
305 rho_cp = 1.;
306 tab_multiply_any_shape(rho_cp, ch_rho_->valeurs());
307 }
308 if (sub_type(Champ_Uniforme, ch_Cp_.valeur()))
309 rho_cp *= ch_Cp_->valeurs()(0, 0);
310 else
311 tab_multiply_any_shape(rho_cp,ch_Cp_->valeurs());
312}
313
314/*! @brief Returns the array of temperature values.
315 *
316 * @return Array of temperature values.
317 */
319{
320 return ch_temperature().valeurs();
321}
322
323/*! @brief Returns the temperature field.
324 *
325 * @return Const reference to the temperature field.
326 */
328{
329 return loi_etat_->ch_temperature();
330}
331
333{
334 return loi_etat_->ch_temperature();
335}
336
337/*! @brief Prepares the time step.
338 *
339 */
341{
342 loi_etat_->mettre_a_jour(le_probleme_->schema_temps().temps_courant());
343 eos_tools_->mettre_a_jour(le_probleme_->schema_temps().temps_courant());
344 if (traitement_PTh_ != 2 ) EDO_Pth_->mettre_a_jour_CL(Pth_);
345}
346
348{
349 loi_etat()->abortTimeStep();
350 Pth_=Pth_n_;
351}
352
354{
355 // handle lambda if mu is uniform and Cp is uniform
356 // type lambda as uniform field and set lambda=mu*Cp/Pr
357 //
358 if (ch_mu_)
359 {
360 if ((!ch_lambda_)||(!sub_type(Champ_Fonc_Tabule,ch_lambda_.valeur())))
361 if ((sub_type(Champ_Uniforme,ch_mu_.valeur()))&&(sub_type(Loi_Etat_GP_base,loi_etat_.valeur())))
362 {
363 if (!sub_type(Loi_Etat_Multi_GP_QC,loi_etat_.valeur()))
364 {
365 // If mu is uniform and the equation of state corresponds to an ideal gas
366 double lold=-1;
367 if (ch_lambda_)
368 lold=ch_lambda_->valeurs()(0,0);
369 ch_lambda_.typer(ch_mu_->le_type());
370 ch_lambda_=ch_mu_;
371
372 loi_etat_->calculer_lambda();
373 double lo=ch_lambda_->valeurs()(0,0);
374 if (lold!=-1)
375 {
376 if (!est_egal(lold,lo))
377 {
378 Cerr << "Error : mu, lambda, Cp and Prandtl are all specified in your data set." << finl;
379 Cerr << "It is observed that your imput values leads to :" << finl;
380 Cerr.precision(20);
381 Cerr << "mu/(lambda*Cp)=" << loi_etat_->Prandt()*(lo/lold) << " and Prandtl=" << loi_etat_->Prandt() << finl;
382 Cerr<<"Please modify your data set by specifying for instance Prandtl = "<<loi_etat_->Prandt()*(lo/lold)<<finl;
384 }
385 }
386 }
387 }
388
389 if (ch_lambda_)
390 {
391 if (sub_type(Sutherland,ch_lambda_.valeur()))
392 {
393 if (!sub_type(Champ_Uniforme,ch_Cp_.valeur()))
394 {
395 Cerr << "A sutherland law cannot be requested for the conductivity "<<finl;
396 Cerr << "by indicating Slambda if the heat capacity (Cp) is not uniform."<<finl;
398 }
399 Sutherland& mu_suth = ref_cast(Sutherland,ch_mu_.valeur());
400 const double mu0 = mu_suth.get_A();
401 Sutherland& lambda_suth = ref_cast(Sutherland,ch_lambda_.valeur());
402 double lambda0 = mu0/loi_etat_->Prandt()*ch_Cp_->valeurs()(0,0);
403 lambda_suth.set_A(lambda0);
404 lambda_suth.lire_expression();
405 }
406 }
407 }
408}
409
410/*! @brief Initializes the fluid parameters.
411 *
412 * @param temps Current time.
413 * @return Always returns 1.
414 */
416{
417 Cerr << "Fluide_Dilatable_base::initialiser()" << finl;
418 if (sub_type(Champ_Don_base, ch_rho_.valeur()))
419 ref_cast(Champ_Don_base, ch_rho_.valeur()).initialiser(temps);
420
421 ch_mu_->initialiser(temps);
422 ch_lambda_->initialiser(temps);
423 ch_Cp_->initialiser(temps);
424 update_rho_cp(temps);
425
426 if (coeff_absorption_ && indice_refraction_)
428
429 if (equation_.size() && (*(equation_.begin()->second)).inconnue().valeurs().isDataOnDevice())
430 {
431 // ToDo_Kokkos move all this into Milieu_base::initialiser ?
432 mapToDevice(ch_rho_->valeurs());
433 mapToDevice(ch_rho_Cp_elem_->valeurs());
434 mapToDevice(ch_rho_Cp_comme_T_->valeurs());
435 }
436 return 1;
437}
438
439// Initialization of the radiative properties of the incompressible fluid
440// (for a semi-transparent incompressible fluid).
442{
443 coeff_absorption_->initialiser(temps);
444 indice_refraction_->initialiser(temps);
445 longueur_rayo_->initialiser(temps);
446 if (sub_type(Champ_Uniforme,kappa()))
447 longueur_rayo().valeurs()(0,0)=1/(3*kappa().valeurs()(0,0));
448 else
449 {
450 DoubleTab& l_rayo = longueur_rayo_->valeurs();
451 const DoubleTab& K = kappa().valeurs();
452 for (int i=0; i<kappa().nb_valeurs_nodales(); i++)
453 l_rayo[i] = 1/(3*K[i]);
454 }
455}
456
457/*! @brief Computes the total pressure: thermodynamic pressure + hydrodynamic pressure.
458 *
459 */
461{
462 DoubleTab& tab_Ptot = ch_pression_tot_->valeurs();
463 const int n = tab_Ptot.dimension_tot(0);
464 DoubleTrav tab_PHyd(n, 1);
465 if( n != ch_pression_->valeurs().dimension_tot(0) )
466 {
467 // Interpolation of pression_ to elements (e.g.: P1P0)
468 const Domaine_dis_base& domaine_dis= ch_pression_->domaine_dis_base();
469 const Domaine_VF& domaine = ref_cast(Domaine_VF, domaine_dis);
470 const DoubleTab& centres_de_gravites=domaine.xp();
471 ch_pression_->valeur_aux(centres_de_gravites,tab_PHyd);
472 }
473 else tab_PHyd = ch_pression_->valeurs();
474 // implemented in child classes
475 remplir_champ_pression_tot(n,tab_PHyd,tab_Ptot);
476}
477
479{
480 if(motlu == "source_masse_espece")
481 {
482 if (!ch_source_masse_esp_)
483 {
484 double temps = le_probleme_->schema_temps().temps_courant();
485
486 le_probleme_->discretisation().discretiser_champ("champ_elem", le_probleme_->equation(0).domaine_dis(), "source_masse_espece", "Kg/m3/s", 1, temps, ch_source_masse_esp_);
487 champs_compris_.ajoute_champ(ch_source_masse_esp_);
488 }
489 }
490 else if (motlu == "source_masse_projection")
491 {
493 {
494 double temps = le_probleme_->schema_temps().temps_courant();
495
496 le_probleme_->discretisation().discretiser_champ("pression", le_probleme_->equation(0).domaine_dis(), "source_masse_projection", "Kg/m3/s", 1, temps, ch_source_masse_proj_);
498 }
499 }
500 else
502}
503
504bool Fluide_Dilatable_base::has_champ(const Motcle& nom, OBS_PTR(Champ_base)& ref_champ) const
505{
506 if (Fluide_base::has_champ(nom, ref_champ))
507 return true;
508
509 if (loi_etat_->has_champ(nom, ref_champ))
510 return true;
511
512 return false; /* nothing found */
513}
514
516{
517 if (Fluide_base::has_champ(nom))
518 return true;
519
520 if (loi_etat_->has_champ(nom))
521 return true;
522
523 return false; /* nothing found */
524}
525
527{
528 OBS_PTR(Champ_base) ref_champ;
529
530 if (Fluide_base::has_champ(nom, ref_champ))
531 return ref_champ;
532
533 if (loi_etat_->has_champ(nom, ref_champ))
534 return ref_champ;
535
536 throw std::runtime_error(std::string("Field ") + nom.getString() + std::string(" not found !"));
537}
538
540{
542 loi_etat_->get_noms_champs_postraitables(nom,opt);
543}
544
546{
547 ch_rho_->mettre_a_jour(temps);
548 ch_temperature().mettre_a_jour(temps); // Note : it denotes the species Y1 for Pb_Hydraulique_Melange_Binaire_QC
549 ch_rho_->changer_temps(temps);
551 ch_mu_->changer_temps(temps);
552 ch_lambda_->changer_temps(temps);
553 ch_Cp_->mettre_a_jour(temps);
554 update_rho_cp(temps);
555 write_mean_edo(temps); // if needed (i.e. QC)
556}
557
558/*! @brief Prepares the fluid for computation.
559 *
560 */
562{
563 Cerr << "Fluide_Dilatable_base::preparer_calcul()" << finl;
564 //Milieu_base::preparer_calcul(); // Does nothing!!
565 Fluide_Dilatable_base::update_pressure_fields(le_probleme_->schema_temps().temps_courant()); // Child can have an overload
566 loi_etat_->preparer_calcul();
567 prepare_pressure_edo(); // if needed (i.e. QC)
569}
570
572{
574 ch_pression_tot_->mettre_a_jour(temps);
575}
576
577/*! @brief Completes the fluid with the unknown fields associated with the problem.
578 *
579 * @param pb The problem to solve.
580 */
582{
583 if (!le_probleme_) le_probleme_ = pb;
584 ch_inco_chaleur_ = pb.equation(1).inconnue();
585 ch_vitesse_ = pb.equation(0).inconnue();
586 ch_pression_ = ref_cast(Navier_Stokes_std, pb.equation(0)).pression();
587
588 Nom typ = pb.equation(0).discretisation().que_suis_je();
589 if (typ == "VEFPreP1B")
590 typ = "VEF";
591
592 eos_tools_.typer(Nom("EOS_Tools_") + typ);
593 eos_tools_->associer_domaines(pb.equation(0).domaine_dis(), pb.equation(0).domaine_Cl_dis());
594 eos_tools_->associer_fluide(*this);
595 loi_etat_->assoscier_probleme(pb);
597 eos_tools_->mettre_a_jour(pb.schema_temps().temps_courant());
598 loi_etat_->initialiser();
599
600 if (traitement_PTh_ != 2) completer_edo(pb);
601}
602
604{
605 assert(traitement_PTh_ != 2);
606 Nom typ = pb.equation(0).discretisation().que_suis_je();
607 if (typ=="VEFPreP1B") typ = "VEF";
608 typ += "_";
609
610 // EDO_Pression_th_VDF/VEF_Melange_Binaire not implemented yet
611 // typer Gaz_Parfait instead to use when traitement_PTh=1...
612 if (pb.que_suis_je().debute_par("Pb_Hydraulique_Melange_Binaire_"))
613 typ +="Gaz_Parfait";
614 else
615 typ += loi_etat_->type_fluide();
616
617 typ = Nom("EDO_Pression_th_") + typ;
618 Cerr << "Typing the pressure ODE: " << typ << finl;
619 EDO_Pth_.typer(typ);
620 EDO_Pth_->associer_domaines(pb.equation(0).domaine_dis(),pb.equation(0).domaine_Cl_dis());
621 EDO_Pth_->associer_fluide(*this);
622 EDO_Pth_->mettre_a_jour_CL(Pth_);
623
624 // Write in file
626 output_file_ += "_";
627 output_file_ += pb.le_nom();
628 output_file_ += ".evol_glob";
629
630 Cerr << "Warning! evol_glob file renamed " << output_file_ << finl;
632}
633
635{
636 if (traitement_PTh_ != 2) EDO_Pth_->completer();
637
638 eos_tools_->mettre_a_jour(le_probleme_->schema_temps().temps_courant());
639}
640
642{
643 if (je_suis_maitre())
644 {
646 fic << "# Time sum(T*dv)/sum(dv)[K] sum(rho*dv)/sum(dv)[kg/m3] Pth[Pa]" << finl;
647 }
648}
649
651{
652 const double Ch_m = eos_tools_->moyenne_vol(ch_inco_chaleur_->valeurs());
653 const double rhom = eos_tools_->moyenne_vol(ch_rho_->valeurs());
654
655 if (je_suis_maitre() && traitement_PTh_ != 2)
656 {
657 SFichier fic(output_file_, ios::app);
658 fic << temps << " " << Ch_m << " " << rhom << " " << Pth_ << finl;
659 }
660}
class Champ_Don_base base class of Given Fields (not calculated)
void mettre_a_jour(double temps) override
Time update.
void dimensionner(int, int)
Sets the number of components and the number of nodal values.
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
int nb_valeurs_nodales() const override
Returns the number of degrees of freedom per component: the number of nodes.
Class Champ_Fonc_Tabule Derived class of Champ_Fonc_base representing.
Champ_Uniforme Represents a field that is constant in space and time.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
virtual double changer_temps(const double t)
Sets the time at which the field is defined.
virtual void creer_champ(const Motcle &motlu)=0
virtual void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const =0
virtual bool has_champ(const Motcle &nom, OBS_PTR(Champ_base)&ref_champ) const =0
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
class Discretisation_base This class represents a spatial discretization scheme, which
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
class Domaine_VF
Definition Domaine_VF.h:44
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
Base class for a dilatable fluid, inheriting from Fluide_base.
const Champ_Don_base & ch_temperature() const
Returns the temperature field.
const Champ_base & get_champ(const Motcle &nom) const override
void creer_champ(const Motcle &motlu) override
int initialiser(const double temps) override
Initializes the fluid parameters.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
OBS_PTR(Champ_Inc_base) ch_inco_chaleur_
const DoubleTab & temperature() const
Returns the array of temperature values.
void mettre_a_jour(double) override
Performs a time update of the medium and therefore of its characteristic parameters.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
virtual void calculer_pression_tot()
Computes the total pressure: thermodynamic pressure + hydrodynamic pressure.
virtual void checkTraitementPth(const Domaine_Cl_dis_base &)
void completer_edo(const Probleme_base &)
virtual void remplir_champ_pression_tot(int n, const DoubleTab &PHydro, DoubleTab &PTot)=0
virtual void update_pressure_fields(double)
virtual void write_mean_edo(double)
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) override
void preparer_calcul() override
Prepares the fluid for computation.
void preparer_pas_temps()
Prepares the time step.
const OWN_PTR(Loi_Etat_base) &loi_etat() const
void update_rho_cp(double temps) override
void initialiser_radiatives(const double temps)
void set_Cp(double)
Completes the fluid with a constant Cp.
void verifier_coherence_champs(int &err, Nom &message) override
Verifies that the fields read have been correctly set.
void set_param(Param &param) const override
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
virtual void completer(const Probleme_base &)
Completes the fluid with the unknown fields associated with the problem.
Base class for an incompressible fluid and its properties:
Definition Fluide_base.h:36
void set_param(Param &param) const override
Champ_Don_base & kappa()
Definition Fluide_base.h:68
Champ_Don_base & longueur_rayo()
Definition Fluide_base.h:77
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) override
Base state law class for ideal gases, defining a dilatable fluid with the equation of state: Pth = rh...
State law class for a mixture of ideal gases in the quasi-compressible (QC) framework.
void ecrire(Sortie &) const
Writes a medium object to an output stream.
virtual void verifier_coherence_champs(int &err, Nom &message)
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Champs_compris champs_compris_
std::map< std::string, const Equation_base * > equation_
A character string (Nom) in uppercase.
Definition Motcle.h:26
An array of Motcle objects.
Definition Motcle.h:63
int search(const Motcle &t) const
Definition Motcle.cpp:319
Navier_Stokes_std This class carries the terms of the momentum equation.
Neumann_sortie_libre This class represents an open boundary without imposed velocity.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
virtual int debute_par(const char *const n) const
Definition Nom.cpp:314
const std::string & getString() const
Definition Nom.h:92
An array of character strings (VECT(Nom)).
Definition Noms.h:26
friend class Entree
Definition Objet_U.h:71
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
static const Nom & nom_du_cas()
Returns a constant reference to the case name. This method is static.
Definition Objet_U.cpp:145
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
@ REQUIRED
Definition Param.h:115
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
void supprimer(const char *keyword)
Remove a previously-registered keyword from this Param.
Definition Param.cpp:339
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Probleme_U.h:109
class Probleme_base It is a Probleme_U that is not a coupling.
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Definition Process.cpp:82
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Definition SFichier.h:29
double temps_courant() const
Returns the current time.
Base class for output streams.
Definition Sortie.h:52
void set_A(const double A)
const double & get_A() const
void set_C(const double C)
void set_Tref(const double Tref)
void set_prob(const Nom &prob)
void set_val_params(const Nom &prob, const double A, const double C, const double Tref)
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160