TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
QDM_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 QDM_Multiphase_included
17#define QDM_Multiphase_included
18
19#include <Operateur_Evanescence.h>
20#include <Navier_Stokes_std.h>
21#include <vector>
22
23/*! @brief Carries the terms of the momentum equation for multiphase flow without turbulence modelling.
24 *
25 * The quasi-compressible fluid assumption is used.
26 * Under these assumptions, the following form of the Navier-Stokes equations is used:
27 * DU/dt = div(viscous term) - gradP/rho + sources/rho
28 * div U = W
29 * where DU/dt : material derivative of velocity
30 * rho : density
31 * Note: the implementation allows individual terms (viscous, convective, source) to be neglected.
32 * The unknown is the velocity field.
33 *
34 * @sa Equation_base Pb_Thermohydraulique_QC Navier_Stokes_std
35 */
37{
38 Declare_instanciable(QDM_Multiphase);
39
40public :
41
42 void set_param(Param& param) const override;
43 int lire_motcle_non_standard(const Motcle&, Entree&) override;
44 void completer() override;
45 void discretiser_vitesse() override;
46 void discretiser_grad_p() override;
47 void mettre_a_jour(double temps) override;
48 int impr(Sortie& os) const override
49 {
50 return Equation_base::impr(os); //idem
51 }
52 bool initTimeStep(double dt) override;
53 void abortTimeStep() override;
54
55 void dimensionner_matrice_sans_mem(Matrice_Morse& matrice) override;
56
57 /*
58 interface {dimensionner,assembler}_blocs
59 specifics: evanescence is taken into account (last)
60 */
61 int has_interface_blocs() const override;
62 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const override;
63 const Champ_Don_base& diffusivite_pour_transport() const override;
64 const Champ_base& diffusivite_pour_pas_de_temps() const override;
65 const Champ_base& vitesse_pour_transport() const override;
66 void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = {}) override;
67 void creer_champ(const Motcle& motlu) override;
68 void get_noms_champs_postraitables(Noms& nom,Option opt=NONE) const override;
69
70 double alpha_res() const ;
71
72protected:
73 Entree& lire_cond_init(Entree&) override; // to read the pressure
74 int preparer_calcul() override; // calls Equation_base method
75
76 std::vector<OWN_PTR(Champ_Inc_base)> vit_phases_; // velocity fields for each phase
77 Motcles noms_vit_phases_; // their names
78
79 std::vector<OWN_PTR(Champ_Fonc_base)> grad_vit_phases_; // velocity gradients for each phase
81
83};
84
85#endif /* QDM_Multiphase_included */
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Class Champ_Inc_base.
virtual int impr(Sortie &os) const
Prints the equation operators to an output stream, unconditionally.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
A character string (Nom) in uppercase.
Definition Motcle.h:26
An array of Motcle objects.
Definition Motcle.h:63
OWN_PTR(Assembleur_base) &assembleur_pression()
friend class Entree
Definition Objet_U.h:71
friend class Sortie
Definition Objet_U.h:70
Operateur_Evanescence class: generic class in the operator hierarchy representing a term.
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Carries the terms of the momentum equation for multiphase flow without turbulence modelling.
void completer() override
Completes the base equation, associates the pressure to the equation,.
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
Operateur_Evanescence evanescence_
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
const Champ_Don_base & diffusivite_pour_transport() const override
void creer_champ(const Motcle &motlu) override
Motcles noms_grad_vit_phases_
void discretiser_vitesse() override
std::vector< OWN_PTR(Champ_Inc_base)> vit_phases_
const Champ_base & vitesse_pour_transport() const override
void discretiser_grad_p() override
void abortTimeStep() override
Reinitialize what must be.
int preparer_calcul() override
cf Equation_base::preparer_calcul() Assembly of the pressure solver and
void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) override
double alpha_res() const
Entree & lire_cond_init(Entree &) override
Reading of initial conditions in an input stream.
void set_param(Param &param) const override
void mettre_a_jour(double temps) override
Performs a time update of the equation.
std::vector< OWN_PTR(Champ_Fonc_base)> grad_vit_phases_
int impr(Sortie &os) const override
Prints some information to an output stream: - maximum of div U.
int has_interface_blocs() const override
Motcles noms_vit_phases_
const Champ_base & diffusivite_pour_pas_de_temps() const override
void dimensionner_matrice_sans_mem(Matrice_Morse &matrice) override
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.