TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_parietal_Nusselt.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 <Flux_parietal_Nusselt.h>
17#include <Milieu_composite.h>
18#include <Pb_Multiphase.h>
19#include <cmath>
20
21Implemente_instanciable(Flux_parietal_Nusselt, "Flux_parietal_Nusselt", Flux_parietal_base);
22// XD flux_parietal_nusselt flux_parietal_base nusselt INHERITS_BRACE not_set
23
25{
26 return os;
27}
28
30{
31 Param param(que_suis_je());
32 param.ajouter_non_std("formula", this, Param::REQUIRED); // XD_ADD_P chaine
33 // XD_CONT Nusselt formula as a function of Re and Pr
34 param.lire_avec_accolades_depuis(is);
35 return is;
36}
37
39{
40 if (mot == "formula")
41 {
42 Nom tmp;
43 is >> tmp;
44 Cerr << "Reading and interpreting the function " << tmp << " ... ";
45 nusselt_.setNbVar(2);
46 nusselt_.setString(tmp);
47 nusselt_.addVar("Re");
48 nusselt_.addVar("Pr");
49 nusselt_.parseString();
50 return 1;
51 }
52 else
54}
55
56void Flux_parietal_Nusselt::qp(const input_t& in, output_t& out) const
57{
58 const double Re = in.rho[0] * in.v[0] * in.D_h / in.mu[0], Pr = in.mu[0] * in.Cp[0] / in.lambda[0];
59 nusselt_.setVar("Re", Re);
60 nusselt_.setVar("Pr", Pr);
61 const double Nu = nusselt_.eval();
62
63 double DT = in.Tp - in.T[0], dTf_DT = -1.0, dTp_DT = 1.0, dp_DT = 0.0;
64 if (out.qpk) (*out.qpk)(0) = in.lambda[0] / in.D_ch * Nu * DT;
65 if (out.dTf_qpk) (*out.dTf_qpk)(0, 0) = in.lambda[0] / in.D_ch * Nu * dTf_DT;
66 if (out.dTp_qpk) (*out.dTp_qpk)(0) = in.lambda[0] / in.D_ch * Nu * dTp_DT;
67 if (out.dp_qpk) (*out.dp_qpk)(0) = in.lambda[0] / in.D_ch * Nu * dp_DT;
68}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Class Flux_parietal_Nusselt Correlation of parietal heat flux using the Nusselt number (with Nusselt ...
void qp(const input_t &input, output_t &output) const override
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
classe Flux_parietal_base correlations de flux parietal de la forme
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
virtual int lire_motcle_non_standard(const Motcle &motlu, Entree &is)
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
Definition Objet_U.cpp:115
friend class Entree
Definition Objet_U.h:76
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
@ REQUIRED
Definition Param.h:115
Classe de base des flux de sortie.
Definition Sortie.h:52