TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Modele_turbulence_hyd_null.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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 <Modele_turbulence_hyd_null.h>
17#include <EcritureLectureSpecial.h>
18#include <Discretisation_base.h>
19#include <Schema_Temps_base.h>
20#include <Probleme_base.h>
21#include <Equation_base.h>
22#include <Domaine.h>
23#include <Param.h>
24
25Implemente_instanciable_sans_constructeur(Modele_turbulence_hyd_null, "Modele_turbulence_hyd_null", Modele_turbulence_hyd_base);
26// XD modele_turbulence_hyd_null modele_turbulence_hyd_deriv null INHERITS_BRACE Null turbulence model (turbulent
27// XD_CONT viscosity = 0) which can be used with a turbulent problem.
28
29Modele_turbulence_hyd_null::Modele_turbulence_hyd_null()
30{
32}
33
35{
36 // Creation of a null wall law:
37 const Equation_base& eqn = equation();
38 const Nom& discr = eqn.discretisation().que_suis_je();
39
40 if (discr == "VEF" || discr == "VEFPreP1B") loipar_.typer("negligeable_VEF");
41 else if (discr == "VDF") loipar_.typer("negligeable_VDF");
42 else if (discr == "EF") loipar_.typer("negligeable_EF");
43 else
44 {
45 Cerr << "Error in Modele_turbulence_hyd_null::readOn\n";
46 Cerr << " the discretization " << discr << " is not supported";
47 Cerr << finl;
48 exit();
49 }
50 loipar_->associer_modele(*this);
51 loipar_->associer(eqn.domaine_dis(), eqn.domaine_Cl_dis());
52
53 // Not willing to debug XDATA ... penalizing everyone instead
54 Param param(que_suis_je());
55 param.lire_avec_accolades_depuis(is);
56 return is;
57}
58
60{
61 return os << que_suis_je() << " " << le_nom();
62}
63
65{
66 // in special write mode only the master writes the header
67 int write, special;
69 if (write)
70 {
71 Nom mon_ident(que_suis_je());
72 mon_ident += equation().probleme().domaine().le_nom();
73 double temps = equation().schema_temps().temps_courant();
74 mon_ident += Nom(temps, "%e");
75 os << mon_ident << finl;
76 os << que_suis_je() << finl;
77 os.flush();
78 }
79 return 0;
80}
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
static int is_ecriture_special(int &special, int &a_faire)
Indicates whether the special format was requested in active writing by xyz save.
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.
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Probleme_base & probleme()
Returns the problem associated with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
Base class for the turbulence model hierarchy for Navier-Stokes equations.
Equation_base & equation()
Returns the equation associated with the turbulence model.
int sauvegarder(Sortie &) const override
Saves the turbulence model to an output stream.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Sortie
Definition Objet_U.h:70
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 const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Objet_U.cpp:317
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
const Domaine & domaine() const
Returns the domain associated with the problem.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
double temps_courant() const
Returns the current time.
Base class for output streams.
Definition Sortie.h:52
virtual Sortie & flush()
Definition Sortie.cpp:138
virtual void declare_support_masse_volumique(int ok)
The constructor of a derived class that uses the density field must call this function with the value...