TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Momentum_Euler.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 Momentum_Euler_included
17#define Momentum_Euler_included
18
19#include <Operateur_NConserv.h>
20#include <Navier_Stokes_std.h>
21
23{
24 Declare_instanciable(Momentum_Euler);
25public :
26
27 // overload to do nothing
28 void discretiser_grad_p() override { }
29 void discretiser_vitesse() override { }
30
31 // overload to skip mother class
32 void mettre_a_jour(double temps) override { Equation_base::mettre_a_jour(temps); }
34 int impr(Sortie& os) const override { return Equation_base::impr(os); }
35 int preparer_calcul() override;
36
37 // overload to change behavior
38 Entree& lire_cond_init(Entree&) override; //to read the pressure
39 void discretiser() override;
40 void set_param(Param& param) const override;
41 void completer() override;
42 void abortTimeStep() override;
43 void creer_champ(const Motcle& motlu) override;
44 void get_noms_champs_postraitables(Noms& nom,Option opt=NONE) const override;
45 void mettre_a_jour_champs_conserves(double temps, int reset) override;
46 void verifie_ch_init_nb_comp(const Champ_Inc_base& ch_ref, const int nb_comp) const override;
47
48 int lire_motcle_non_standard(const Motcle&, Entree&) override;
49 int sauvegarder(Sortie& os) const override;
50 double calculer_pas_de_temps() const override ;
51
52 bool initTimeStep(double dt) override;
53 DoubleTab& corriger_derivee_expl(DoubleTab& derivee) override { return derivee; }
54 DoubleTab& corriger_derivee_impl(DoubleTab& derivee) override { return derivee; }
55 const Champ_Don_base& diffusivite_pour_transport() const override;
56 const Champ_base& diffusivite_pour_pas_de_temps() const override;
57
58 const Operateur& operateur(int) const override;
59 Operateur& operateur(int) override;
60
61 // new methods
62 void mettre_a_jour_p_c();
64 void calculer_vitesse();
65 void init_alpha_rho_u();
66
67 double alpha_res() const ;
68 const Champ_Inc_base& vitesse_phase(const int i) const;
69 Champ_Inc_base& vitesse_phase(const int i) ;
70
71 // inline methods
72 inline int nombre_d_operateurs() const override { return 2; }
73 inline const DoubleTab& vitesse_son() const { return vitesse_son_; }
74 inline DoubleTab& vitesse_son() { return vitesse_son_; }
75 inline const DoubleTab& vitesse_normale() const { return vitesse_normale_; } ;
76 inline DoubleTab& vitesse_normale() { return vitesse_normale_; } ;
77 inline const Champ_Inc_base& inconnue() const override { return l_inco_ch_.valeur(); }
78 inline Champ_Inc_base& inconnue() override { return l_inco_ch_.valeur(); }
79 inline const Champ_Inc_base& vitesse() const override { return la_vitesse.valeur(); }
80 inline Champ_Inc_base& vitesse() override { return la_vitesse.valeur(); }
81
82protected:
85
86 std::vector<OWN_PTR(Champ_Inc_base)> vit_phases_; //vitesses de chaque phase
88
90};
91
92#endif /* Momentum_Euler_included */
class Champ_Don_base base class of Given Fields (not calculated)
Class Champ_Inc_base.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void mettre_a_jour(double temps)
The value of the unknown at the time step has been calculated.
virtual int impr(Sortie &os) const
Prints the equation operators to an output stream, unconditionally.
virtual int has_interface_blocs() const
DoubleTab vitesse_normale_
const DoubleTab & vitesse_normale() const
DoubleTab vitesse_son_
Champ_Inc_base & inconnue() override
void verifie_ch_init_nb_comp(const Champ_Inc_base &ch_ref, const int nb_comp) const override
Verification of the number of components read for the specification of a field.
void mettre_a_jour(double temps) override
The value of the unknown at the time step has been calculated.
const Champ_Inc_base & vitesse() const override
const Champ_base & diffusivite_pour_pas_de_temps() const override
void discretiser() override
Discretizes the equation.
void discretiser_vitesse() override
void set_param(Param &param) const override
int preparer_calcul() override
Everything that does not depend on other possible problems.
DoubleTab & vitesse_normale()
Operateur_NConserv terme_nconserv_
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
const DoubleTab & vitesse_son() const
const Champ_Inc_base & vitesse_phase(const int i) const
void completer() override
Completes the construction (initialization) of objects associated with the equation.
OWN_PTR(Champ_Inc_base) l_inco_ch_
double alpha_res() const
int impr(Sortie &os) const override
Prints the equation operators to an output stream, unconditionally.
Motcles noms_vit_phases_
void discretiser_grad_p() override
void mettre_a_jour_champs_conserves(double temps, int reset) override
void calculer_vitesse_normale()
Champ_Inc_base & vitesse() override
DoubleTab & vitesse_son()
void creer_champ(const Motcle &motlu) override
int sauvegarder(Sortie &os) const override
We save the unknown, then the source terms to an output stream.
int has_interface_blocs() const override
DoubleTab & corriger_derivee_expl(DoubleTab &derivee) override
const Champ_Don_base & diffusivite_pour_transport() const override
void abortTimeStep() override
Reinitialize what must be.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
const Champ_Inc_base & inconnue() const override
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
double calculer_pas_de_temps() const override
Calculation of the next time step.
Entree & lire_cond_init(Entree &) override
Reading of initial conditions in an input stream.
int nombre_d_operateurs() const override
DoubleTab & corriger_derivee_impl(DoubleTab &derivee) override
std::vector< OWN_PTR(Champ_Inc_base)> vit_phases_
const Operateur & operateur(int) const override
A character string (Nom) in uppercase.
Definition Motcle.h:26
An array of Motcle objects.
Definition Motcle.h:63
An array of character strings (VECT(Nom)).
Definition Noms.h:26
friend class Sortie
Definition Objet_U.h:70
class Operateur Generic class of the operator hierarchy.
Definition Operateur.h:39
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Base class for output streams.
Definition Sortie.h:52