TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Navier_Stokes_WC.cpp
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#include <Navier_Stokes_WC.h>
17#include <Fluide_Weakly_Compressible.h>
18#include <Discretisation_base.h>
19
20Implemente_instanciable(Navier_Stokes_WC,"Navier_Stokes_WC",Navier_Stokes_Fluide_Dilatable_base);
21// XD navier_stokes_WC navier_stokes_standard navier_stokes_WC INHERITS_BRACE Navier-Stokes equation for a
22// XD_CONT weakly-compressible fluid.
23// XD attr mass_source mass_source mass_source OPT Mass source used in a dilatable simulation to add/reduce a mass at
24// XD_CONT the boundary (volumetric source in the first cell of a given boundary).
25
27{
29}
30
32{
34 assert(le_fluide);
35 if (!sub_type(Fluide_Weakly_Compressible,le_fluide.valeur()))
36 {
37 Cerr<<"ERROR : the Navier_Stokes_WC equation can be associated only to a weakly compressible fluid."<<finl;
39 }
40 return is;
41}
42
43/*! @brief Complete l'equation base, associe la pression a l'equation,
44 *
45 * complete la divergence, le gradient et le solveur pression.
46 * Ajout de 2 termes sources: l'un representant la force centrifuge
47 * dans le cas axi-symetrique,l'autre intervenant dans la resolution
48 * en 2D axisymetrique
49 *
50 */
52{
53 Cerr<<"Navier_Stokes_WC::completer"<<finl;
54 if (le_fluide->a_gravite())
55 {
56 Cerr << "Gravity = " << le_fluide->gravite() << finl;
57 Cerr << "Creation of the buoyancy source term for the Navier_Stokes_WC equation : " << finl;
58 Source t;
59 Source& so=les_sources.add(t);
60 Nom type_so = "Source_WC_Gravite_";
62 if (disc=="VEFPreP1B") disc = "VEF";
63 type_so += disc;
64 so.typer_direct(type_so);
65 so->associer_eqn(*this);
66 Cerr << so->que_suis_je() << finl;
67 }
69}
70
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Discretisation_base & discretisation() const
Renvoie la discretisation associee a l'equation.
Sources les_sources
classe Navier_Stokes_Fluide_Dilatable_base Cette classe basse porte les termes de l'equation de la dy...
void completer() override
Complete l'equation base, associe la pression a l'equation,.
int impr(Sortie &os) const override
Imprime les operateurs de l'equation sur un flot de sortie, de facon inconditionnelle.
classe Navier_Stokes_WC Cette classe porte les termes de l'equation de la dynamique
void completer() override
Complete l'equation base, associe la pression a l'equation,.
int impr(Sortie &os) const override
Imprime les operateurs de l'equation sur un flot de sortie, de facon inconditionnelle.
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
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
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
classe Source Classe generique de la hierarchie des sources, un objet Source peut
Definition Source.h:33
void typer_direct(const Nom &)
Definition Source.cpp:41