TrioCFD 1.9.9_beta
TrioCFD documentation
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 the base equation, associate the pressure to the equation,
44 *
45 * complete the divergence, gradient, and pressure solver.
46 * Adds 2 source terms: one representing the centrifugal force
47 * in the axisymmetric case, the other arising in the
48 * 2D axisymmetric resolution.
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
Returns the discretization associated with the equation.
Sources les_sources
Base class carrying the terms of the momentum equation for a fluid without turbulence modelling under...
void completer() override
Completes the base equation: associates the pressure, completes the divergence, gradient and pressure...
int impr(Sortie &os) const override
Prints the equation operators to an output stream, unconditionally.
Carries the terms of the momentum equation for a weakly compressible fluid without turbulence modelli...
void completer() override
Complete the base equation, associate the pressure to the equation,.
int impr(Sortie &os) const override
Prints the equation operators to an output stream, unconditionally.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
Source Generic class of the source term hierarchy. A Source object can.
Definition Source.h:33
void typer_direct(const Nom &)
Definition Source.cpp:41