TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Pb_Multiphase_HEM.cpp
1/****************************************************************************
2* Copyright (c) 2024, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#include <Pb_Multiphase_HEM.h>
17#include <EChaine.h>
18
19Implemente_instanciable(Pb_Multiphase_HEM, "Pb_HEM|Pb_Multiphase_HEM", Pb_Multiphase);
20// XD Pb_Multiphase_HEM Pb_Multiphase Pb_HEM INHERITS_BRACE A problem that allows the resolution of 2-phases mechanicaly
21// XD_CONT and thermally coupled with 3 equations
22
25
27{
28 // Particular treatment in cas of Homogeneous Equilibrium Mechanical calculation using the Pb_HEM class
29 // We enforce a interfacial flux correlation with constant coefficient
30 if (has_correlation("flux_interfacial"))
31 {
32 for (auto &&corr : correlations_)
33 {
34 if (corr.second->que_suis_je() == "Flux_interfacial_Coef_Constant")
35 {
36 Cout << "Flux_interfacial_Coef_Constant is already defined." << finl;
37 }
38 else
39 {
40 Cerr << "An interfacial flux correlation is already defined in the data file, but from a different kind that coef_constant." << finl;
41 Cerr << "For a Pb_HEM, the interfacial flux correlation must be of the kind coef_constant. Please either remove the line as it will be automatically added or modify the expression." << finl;
43 }
44 }
45 }
46 else
47 {
48 // The coefficient 1e10 is enforced. If the user wants to modify it, we invite her to add the line in the data file.
49 Cout << "Pb_HEM: we add a interfacial flux correlation with constant coefficient." << finl;
50 Nom corr_FICC("{ flux_interfacial coef_constant { ");
51 for (int ii = 0; ii < nb_phases(); ii++)
52 {
53 corr_FICC += nom_phase(ii);
54 corr_FICC += " 1e10 ";
55 }
56 corr_FICC += "} }";
57 Cout << "Expression added: " << corr_FICC << finl;
58 Cout << "Please add this line to the data file directly if you want to modify the enforced coefficient 1e10." << finl;
59
60 EChaine corr_flux_inter_coef_const(corr_FICC);
61 lire_correlations(corr_flux_inter_coef_const);
62 }
63}
Une entree dont la source est une chaine de caracteres.
Definition EChaine.h:31
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
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
void typer_lire_correlation_hem() override
classe Pb_Multiphase Cette classe represente un probleme de thermohydraulique multiphase de type "3*N...
const Nom & nom_phase(int i) const
int nb_phases() const
virtual Entree & lire_correlations(Entree &is)
int has_correlation(std::string nom_correlation) const
std::map< std::string, OWN_PTR(Correlation_base)> correlations_
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52