TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_Diff_base.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 <Operateur_Diff_base.h>
17#include <Milieu_base.h>
18#include <Champ_base.h>
19
20Implemente_base(Operateur_Diff_base,"Operateur_Diff_base",Operateur_base);
21
23{
24 return os;
25}
26
28{
29 return is;
30}
31
32/*! @brief Associates the true diffusivity in m^2/s (in QC for example, the operator is applied to rho*u, and the dynamic viscosity is then associated to
33 *
34 * the operator instead of the kinematic viscosity. In that case, it
35 * is necessary to associate the true diffusivity here for the computation
36 * of the stability time step.
37 *
38 */
40 const Champ_base& diffu)
41{
42 if (je_suis_maitre())
43 {
44 Cerr << "Operateur_Diff_base::associer_diffusivite_pour_pas_de_temps\n";
45 Cerr << " field name : " << diffu.le_nom();
46 Cerr << " unit : " << diffu.unite() << finl;
47 }
48 diffusivite_pour_pas_de_temps_ = diffu;
49}
50
51/*! @brief Returns the field corresponding to the true diffusivity of the medium used for the time step computation.
52 *
53 * If the operator is applied to rho*v
54 * for example (QC case for instance), the associated diffusivity is the
55 * dynamic viscosity and not the kinematic viscosity. The kinematic
56 * viscosity must be used for the time step computation...
57 * The true diffusivity (in m^2/s) is determined as follows:
58 * * if diffusivite_pour_pas_de_temps_ has been initialised => it is used
59 * (mechanism set up for front-tracking, because the medium
60 * is invalid)
61 * * otherwise diffusivite() is used
62 *
63 */
65{
66 assert( diffusivite_pour_pas_de_temps_ );
67 return diffusivite_pour_pas_de_temps_.valeur();
68}
69
71{
72 Cerr << que_suis_je() << " does not support volumic diffusivity (received field " << champ.le_nom() << ")." << finl;
74}
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
const Nom & le_nom() const override
Returns the name of the field.
const Nom & unite() const
Returns the unit of a scalar field whose all components have the same unit.
const Nom & le_nom() const override
Returns *this.
Definition Nom.cpp:555
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
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
virtual void associer_diffusivite_volumique(const Champ_base &)
virtual void associer_diffusivite_pour_pas_de_temps(const Champ_base &)
Associates the true diffusivity in m^2/s (in QC for example, the operator is applied to rho*u,...
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Returns the field corresponding to the true diffusivity of the medium used for the time step computat...
class Operateur_base This class is the base of the hierarchy of objects representing an
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Definition Process.cpp:82
Base class for output streams.
Definition Sortie.h:52