TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Constituant.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 Constituant_included
17#define Constituant_included
18
19#include <Milieu_base.h>
20
21/*! @brief Represents the constituent(s) of a fluid.
22 *
23 * @brief Contains a field alpha representing the diffusion coefficient of the constituent.
24 * When a Constituant object represents multiple constituents, the field alpha is vectorial
25 * with as many components as there are constituents.
26 *
27 * @sa Milieu_base
28 */
30{
31 Declare_instanciable(Constituant);
32public :
33
34 void set_param(Param& param) const override;
35
37 {
38 assert(D_);
39 return D_.valeur();
40 }
41
42 inline void mettre_a_jour(double temps) override
43 {
44 if (D_) D_->mettre_a_jour(temps);
45 }
46
47 void discretiser(const Probleme_base& pb, const Discretisation_base& dis) override;
48
49 void discretiser_multi_concentration(const Nom& , const Probleme_base& pb, const Discretisation_base& dis);
50
51 int initialiser(const double temps) override
52 {
53 if (D_) D_->initialiser(temps);
54 return 1;
55 }
56
57 inline int nb_constituants() const
58 {
59 return diffusion_multi_scalaire_ ? static_cast<int>(std::sqrt(D_->nb_comp())) /* TODO FIXME */ : D_->nb_comp();
60 }
61 int lire_motcle_non_standard(const Motcle& mot, Entree& is) override;
62
63protected :
64 OWN_PTR(Champ_Don_base) D_; // Diffusion coefficient of the constituent in a medium
66};
67
68#endif /* Constituant_included */
class Champ_Don_base base class of Given Fields (not calculated)
Represents the constituent(s) of a fluid.
Definition Constituant.h:30
int nb_constituants() const
Definition Constituant.h:57
const Champ_Don_base & diffusivite_constituant() const
Definition Constituant.h:36
void discretiser(const Probleme_base &pb, const Discretisation_base &dis) override
void discretiser_multi_concentration(const Nom &, const Probleme_base &pb, const Discretisation_base &dis)
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Reads non-simple-type parameters of an Objet_U from an input stream.
bool diffusion_multi_scalaire_
Definition Constituant.h:65
void set_param(Param &param) const override
void mettre_a_jour(double temps) override
Definition Constituant.h:42
OWN_PTR(Champ_Don_base) D_
int initialiser(const double temps) override
Definition Constituant.h:51
class Discretisation_base This class represents a spatial discretization scheme, which
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Milieu_base This class is the base of the (physical) medium hierarchy.
Definition Milieu_base.h:50
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
class Probleme_base It is a Probleme_U that is not a coupling.