TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Pb_Multiphase.h
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#ifndef Pb_Multiphase_included
17#define Pb_Multiphase_included
18
19#include <Energie_Multiphase.h>
20#include <Masse_Multiphase.h>
21#include <Correlation_base.h>
22#include <Pb_Fluide_base.h>
23#include <QDM_Multiphase.h>
24#include <TRUST_Deriv.h>
25#include <TRUST_List.h>
26#include <Interprete.h>
27#include <Verif_Cl.h>
28
29/*! @brief Multiphase thermohydraulics problem of type "3*N equations":
30 *
31 * - QDM_Multiphase : Navier-Stokes and continuity equations for each phase
32 * unknowns : v_k (per-phase velocities)
33 * auxiliary fields : pressure p, void fractions a_k (sum a_k = 1)
34 * - Energie_Multiphase : energy conservation equations for each phase
35 * unknowns : T_k (temperatures)
36 * Typical resolution scheme:
37 * 1) QDM_Multiphase -> velocity prediction
38 * mass conservation -> Newton (semi-implicit step)
39 * 2) Energie_Multiphase -> implicit advection/diffusion of energy
40 *
41 * @sa Pb_Fluide_base QDM_Multiphase Masse_Multiphase Energie_Multiphase
42 */
43
45{
46 Declare_instanciable(Pb_Multiphase);
47public:
48 void typer_lire_milieu(Entree& is) override;
49 int nombre_d_equations() const override;
50 const Equation_base& equation(int) const override ;
51 Equation_base& equation(int) override;
52 void associer_milieu_base(const Milieu_base& ) override;
53 Entree& lire_equations(Entree& is, Motcle& dernier_mot) override;
54 int verifier() override;
55 void preparer_calcul() override;
56
57 /* number of phases in the problem */
58 int nb_phases() const { return noms_phases_.size(); }
59 const Nom& nom_phase(int i) const { return noms_phases_[i]; }
60 const Noms& noms_phases() const { return noms_phases_; }
61
62 double calculer_pas_de_temps() const override;
63
64 virtual void typer_lire_correlation_hem() { /* Do nothing */}
65
66 virtual Equation_base& equation_qdm() { return eq_qdm_; }
67 virtual const Equation_base& equation_qdm() const { return eq_qdm_; }
68 virtual Equation_base& equation_masse() { return eq_masse_; }
69 virtual const Equation_base& equation_masse() const { return eq_masse_; }
71 virtual const Equation_base& equation_energie() const { return eq_energie_; }
72
73 inline virtual bool resolution_en_T() const { return true; }
74
75 double alpha_inf_phase(int i) const { return alpha_inf_phases_[i]; }
76 void set_alpha_inf_phase(int i, double value) { alpha_inf_phases_[i] = value; }
77
78protected:
80 // equations
84 // minimum void fractions for evanescence management (zero by default)
86};
87
88#endif /* Pb_Multiphase_included */
Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar is tempe...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
Specialisation of Convection_Diffusion_std for multiphase flows where the transported scalar is the v...
Milieu_base This class is the base of the (physical) medium hierarchy.
Definition Milieu_base.h:50
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
Pb_Fluide_base This class provides a base class for.
Multiphase thermohydraulics problem of type "3*N equations":
double alpha_inf_phase(int i) const
void preparer_calcul() override
Prepares the computation: initializes the medium parameters and prepares the computation of each equa...
virtual const Equation_base & equation_qdm() const
virtual bool resolution_en_T() const
double calculer_pas_de_temps() const override
Computes the value of the next time step for the problem.
QDM_Multiphase eq_qdm_
Masse_Multiphase eq_masse_
virtual Equation_base & equation_qdm()
virtual const Equation_base & equation_energie() const
DoubleVect alpha_inf_phases_
virtual void typer_lire_correlation_hem()
Energie_Multiphase eq_energie_
virtual Equation_base & equation_energie()
Entree & lire_equations(Entree &is, Motcle &dernier_mot) override
Reading of the equations of the problem.
const Nom & nom_phase(int i) const
void set_alpha_inf_phase(int i, double value)
const Noms & noms_phases() const
int nombre_d_equations() const override
Returns the number of equations.
const Equation_base & equation(int) const override
Returns the equation at index i (const version).
virtual const Equation_base & equation_masse() const
void typer_lire_milieu(Entree &is) override
int nb_phases() const
int verifier() override
Checks the compatibility of the thermal and hydraulic equations.
void associer_milieu_base(const Milieu_base &) override
Associates the medium with the problem.
virtual Equation_base & equation_masse()
Carries the terms of the momentum equation for multiphase flow without turbulence modelling.