TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_interfacial_base.h
1/****************************************************************************
2* Copyright (c) 2025, 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 Flux_interfacial_base_included
17#define Flux_interfacial_base_included
18
19#include <Correlation_base.h>
20#include <TRUSTTabs.h>
21
22/*! @brief Base class for interfacial heat flux correlations of the form:
23 *
24 * Phi_{kl} = h_{kl}(T_k - T_l)
25 * This class defines a flux function with:
26 * inputs:
27 * D_h -> hydraulic diameter
28 * alpha[n] -> void fraction of phase n
29 * T[n] -> temperature of phase n
30 * p -> pressure
31 * nv[N * n + k] -> norm of the velocity of phase n if k == n, norm of v_k-v_n otherwise
32 * lambda[n], mu[n], rho[n], Cp[n] -> various physical properties of phase n
33 *
34 * outputs:
35 * hi(k, l) -> heat transfer coefficient between phase k and the interface with phase l (hi(l, k) != hi(k, l) !)
36 * dT_hi(k, l, n) -> derivative of hi(k, l) w.r.t. T[n]
37 * da_hi(k, l, n) -> derivative of hi(k, l) w.r.t. a[n]
38 * dp_hi(k, l) -> derivative of hi(k, l) w.r.t. p
39 *
40 *
41 */
43{
44 Declare_base(Flux_interfacial_base);
45public:
46 /* input parameters */
47 struct input_t
48 {
49 double dh; // hydraulic diameter
50 const double *alpha; // alpha[n] : void fraction of phase n
51 const double *T; // T[n] : temperature of phase n
52 const double *T_passe;// T_passe[n]: temperature of phase n at the previous iteration
53 double p; // pressure
54 const double *nv; // nv[N * k + l] : norm of ||v_k - v_l||
55 const double *lambda; // lambda[n] : thermal conductivity of phase n
56 const double *mu; // mu[n] : dynamic viscosity of phase n
57 const double *rho; // rho[n] : density of phase n
58 const double *Cp; // CP[n] : heat capacity of phase n
59 const double *Lvap; // Lvap[ind_trav] : latent heat of phase change n=>k, ind_trav = (k*(N-1)-(k-1)*(k)/2) + (l-k-1)
60 const double *dP_Lvap;//dP_Lvap[ind_trav]: pressure derivative of latent heat, ind_trav = (k*(N-1)-(k-1)*(k)/2) + (l-k-1)
61 const double *h; // h[n] : enthalpy of phase n
62 const double *dP_h; // dP_h[n] : pressure derivative of enthalpy of phase n
63 const double *dT_h; // dT_h[n] : temperature derivative of enthalpy of phase n
64 const double *d_bulles;//d_bulles[n] : bubble diameter of phase n
65 const double *k_turb; // k_turb[n] : turbulent kinetic energy of phase n
66 const double *nut; // nut[n] : turbulent viscosity of phase n
67 const double *sigma; //sigma[ind_trav]: surface tension sigma(ind_trav), ind_trav = (n*(N-1)-(n-1)*(n)/2) + (m-n-1)
68 const double *Tsat; // Tsat[ind_trav]: saturation temperature for phase change n <=> k
69 const double *dP_Tsat;//dP_Tsat[ind_trav]: pressure derivative of saturation temperature, ind_trav = (k*(N-1)-(k-1)*(k)/2) + (l-k-1)
70 DoubleTab v; // v(n, d) : velocity of phase n in direction d
71 int e; // element index
72 };
73 /* output values */
74 struct output_t
75 {
76 DoubleTab hi; //hi(k, l) : heat transfer coefficient between phase k and the interface with phase l (hi(l, k) != hi(k, l) !)
77 DoubleTab dT_hi; //dT_hi(k, l, n) : derivative of hi(k, l) w.r.t. T[n]
78 DoubleTab da_hi; //da_hi(k, l, n) : derivative of hi(k, l) w.r.t. a[n]
79 DoubleTab dp_hi; //dp_hi(k, l) : derivative of hi(k, l) w.r.t. p
80 };
81 virtual void coeffs(const input_t& input, output_t& output) const = 0;
82 double dv_min() const {return dv_min_;};
83 double dv_min_ = 0.01;
84};
85
86#endif
Base class for interfacial heat flux correlations of the form:
virtual void coeffs(const input_t &input, output_t &output) const =0