TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Echange_contact_Correlation_VDF.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 Echange_contact_Correlation_VDF_included
17#define Echange_contact_Correlation_VDF_included
18
19#include <Echange_global_impose.h>
20#include <Domaine_forward.h>
21#include <Parser_U.h>
22
23class Milieu_base;
24class Front_VF;
25class Domaine_VDF;
26class Param;
27
29{
30
31 Declare_instanciable(Echange_contact_Correlation_VDF);
32
33public:
34
35 void mettre_a_jour(double) override;
36 void completer() override;
37 virtual void imprimer(double) const;
38 virtual int limpr(double, double) const;
39
40 /*
41 * Method that can be overridden in derived classes to define a particular Nusselt number.
42 * Otherwise, a Nusselt function of local Reynolds and local Prandtl can be entered directly in the data file.
43 * It returns the value of the heat exchange coefficient on cell i.
44 */
45 virtual double calculer_coefficient_echange(int i);
46
47 /*
48 * Method that can be overridden in derived classes to define a particular shape.
49 * Otherwise, a function of the lateral surface area S and the hydraulic diameter Dh can be entered in the data file.
50 * It computes the volume of a fluid slice with lateral surface area s and hydraulic diameter d.
51 * This function depends on the geometry for which the correlation is written
52 * (parallel plates, cylinders, etc.)
53 */
54 virtual double volume(double s, double d);
55
56 /*
57 * Returns U and T and the physical properties on 1D cell i.
58 */
59 inline double getU(int i) const { return U(i); }
60 inline double getT(int i) const { return T(i); }
61 inline double getMu(int i) const { return mu(i); }
62 inline double getLambda(int i) const { return lambda(i); }
63 inline double getRho(int i) const { return rho(i); }
64 inline double getCp() const { return Cp; }
65 inline double getDh() const { return diam; }
66 inline double getQh() const { return debit; }
67
68protected:
69 void set_param(Param& param) const override;
70 int lire_motcle_non_standard(const Motcle&, Entree&) override;
71
72 void calculer_CL();
73 void calculer_Q();
75 void trier_coord();
76 void calculer_Vitesse();
77 void calculer_Tfluide();
78 void calculer_h_mon_pb(DoubleTab&);
79 void calculer_h_solide(DoubleTab&, const Equation_base&, const Domaine_VDF&, const Front_VF&, const Milieu_base&);
80 void init_tab_echange();
81
83 DoubleTab autre_h;
84 bool Reprise_temperature = false;
85
86 DoubleTab tab_ech;
87
88 double Tinf = -100., Tsup = -100.; // Inlet and outlet temperatures
89 double T_CL0 = -100., T_CL1 = -100.; // BCs on the domain. Sequential: = Tinf and Tsup; Parallel: = Tvoisin
90 int dir = -1; // Direction of the cylinder
96 double dt_impr = -100.;
97 double Cp = -100.;
98 double debit = -100.;
99
100 double diam = -100.; // hydraulic diameter
101 DoubleVect vol; // slice volumes Sdz along the flow direction
102 DoubleVect coord; // coordinates of the 1D discretization points
103
104 int N = -1; // number of 1D mesh points for velocity and temperature
105 DoubleVect U, T; // fluid unknowns: velocity and temperature
106 DoubleVect Qvol; // volumetric power in the 1D fluid
107 DoubleVect rho, mu, lambda; // array of fluid physical properties at a given instant
108 DoubleVect h_correlation; // heat transfer coefficient from correlation
109
110};
111
112#endif
class Domaine_VDF
Definition Domaine_VDF.h:61
void calculer_Q()
Computes the volumetric power source term in the 1D fluid energy equation.
void calculer_CL()
Computes the boundary conditions to apply to the energy equation.
void set_param(Param &param) const override
void calculer_h_mon_pb(DoubleTab &)
Computes the local heat exchange coefficient in the solid cell.
virtual double volume(double s, double d)
Computes the volume of a slice with lateral surface area s and hydraulic diameter d.
void init_tab_echange()
Initializes the tab_ech array for parallel execution.
virtual double calculer_coefficient_echange(int i)
Computes the heat exchange coefficient using the correlation entered in the data file.
void calculer_prop_physique()
Computes rho, mu and lambda of the fluid at the current temperature.
void calculer_Vitesse()
Computes the velocity from mass conservation.
void mettre_a_jour(double) override
Updates the velocity, fluid temperature and heat exchange coefficient.
void completer() override
Completes and initializes the class attributes.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
void calculer_h_solide(DoubleTab &, const Equation_base &, const Domaine_VDF &, const Front_VF &, const Milieu_base &)
virtual void imprimer(double) const
Prints the results.
virtual int limpr(double, double) const
Tests whether printing is requested.
void calculer_Tfluide()
Computes the 1D temperature in the fluid by solving energy conservation.
Classe Echange_global_impose This class represents the special case of the class.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
class Front_VF
Definition Front_VF.h:36
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
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
class Parser_U Version of the Parser class, deriving from Objet_U.
Definition Parser_U.h:32