TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Navier_Stokes_Fluide_Dilatable_base.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 Navier_Stokes_Fluide_Dilatable_base_included
17#define Navier_Stokes_Fluide_Dilatable_base_included
18
19#include <Navier_Stokes_Fluide_Dilatable_Proto.h>
20#include <Source_Masse_Fluide_Dilatable_base.h>
21#include <TRUSTTabs_forward.h>
22#include <Navier_Stokes_std.h>
23
24
25
26class Matrice_Morse;
27
28/*! @brief @brief Base class carrying the terms of the momentum equation for a fluid without turbulence modelling under the dilatable fluid assumption.
29 *
30 * The following form of the Navier-Stokes equations is used:
31 * DU/dt = div(viscous term) - gradP/rho + sources/rho
32 * div U = W
33 * where DU/dt is the material derivative of velocity and rho is the density.
34 * The implementation allows individual terms (viscous, convective, source) to be neglected.
35 * The unknown is the velocity field.
36 *
37 * @sa Navier_Stokes_std
38 */
39
41{
43
44public :
45 int lire_motcle_non_standard(const Motcle& mot, Entree& is) override;
46 int preparer_calcul() override;
47 void set_param(Param& param) const override;
48 void discretiser() override;
49 const Champ_Don_base& diffusivite_pour_transport() const override;
50 const Champ_base& diffusivite_pour_pas_de_temps() const override;
51 const Champ_base& vitesse_pour_transport() const override;
52
53 // Virtual methods
54 DoubleTab& derivee_en_temps_inco(DoubleTab& ) override;
55 const Champ_base& get_champ(const Motcle& nom) const override;
56 bool has_champ(const Motcle& nom, OBS_PTR(Champ_base) &ref_champ) const override;
57 bool has_champ(const Motcle& nom) const override;
58 void completer() override;
59 void assembler( Matrice_Morse& mat_morse, const DoubleTab& present, DoubleTab& secmem) override ;
60 void assembler_avec_inertie( Matrice_Morse& mat_morse, const DoubleTab& present, DoubleTab& secmem) override ;
61 void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl) override;
62 int impr(Sortie& os) const override;
63 bool initTimeStep(double dt) override;
64
65 // Inline methods
66 inline void mettre_a_jour(double temps) override
67 {
69 if (source_masse_)
70 source_masse_->mettre_a_jour(temps);
71 }
72
73 inline const Champ_Inc_base& rho_la_vitesse() const override { return rho_la_vitesse_; }
74
75 inline bool has_source_masse() const { return bool(source_masse_); }
77 {
78 assert(source_masse_);
79 return source_masse_.valeur();
80 }
81
82protected:
84};
85
86#endif /* Navier_Stokes_Fluide_Dilatable_base_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
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
A character string (Nom) in uppercase.
Definition Motcle.h:26
Base class carrying the terms of the momentum equation for a fluid without turbulence modelling under...
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
void assembler_avec_inertie(Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem) override
const Champ_Inc_base & rho_la_vitesse() const override
DoubleTab & derivee_en_temps_inco(DoubleTab &) override
Returns the time derivative of the unknown I of the equation: dI/dt = M-1*(sum(operators(I) + sources...
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Reads non-simple-type parameters of an Objet_U from an input stream.
const Champ_base & diffusivite_pour_pas_de_temps() const override
void completer() override
Completes the base equation: associates the pressure, completes the divergence, gradient and pressure...
void discretiser() override
Discretizes the equation.
const Champ_Don_base & diffusivite_pour_transport() const override
const Source_Masse_Fluide_Dilatable_base & source_masse() const
const Champ_base & vitesse_pour_transport() const override
void assembler(Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem) override
void mettre_a_jour(double temps) override
The value of the unknown at the time step has been calculated.
int preparer_calcul() override
Calls Equation_base::preparer_calcul(), assembles the pressure solver and initialises the pressure.
const Champ_base & get_champ(const Motcle &nom) const override
int impr(Sortie &os) const override
Prints the equation operators to an output stream, unconditionally.
OWN_PTR(Source_Masse_Fluide_Dilatable_base) source_masse_
void assembler_blocs_avec_inertie(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl) override
bool initTimeStep(double dt) override
Allocation and initialization of the unknown and boundary conditions until present+dt.
void mettre_a_jour(double temps) override
Performs a time update of the equation.
OBS_PTR(Fluide_base) le_fluide
friend class Entree
Definition Objet_U.h:71
friend class Sortie
Definition Objet_U.h:70
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Special mass source term for the mass equation (used only during the projection/correction step).