TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_parietal_base.h
1/****************************************************************************
2* Copyright (c) 2024, 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_parietal_base_included
17#define Flux_parietal_base_included
18
19#include <TRUSTTabs_forward.h>
20#include <Correlation_base.h>
21
22/*! @brief Base class for wall heat flux correlations of the form:
23 *
24 * sensible heat flux : q_{p}(k) = F(alpha_f, p, T_f, T_p, v_f, D_h, D_ch)
25 * latent heat flux : q_{pi}(k, l) = F(alpha_f, p, T_f, T_p, v_f, D_h, D_ch)
26 * (e.g. nucleate boiling: Gamma_{kl} = q_{pi}(k, l) / Lvap)
27 * This class defines two functions q_pk, q_pi.
28 */
29
31{
32 Declare_base(Flux_parietal_base);
33public:
34
35 /* input parameters */
36 struct input_t
37 {
38 int N; // number of phases
39 int f; // face number
40 double y; // distance between the face and the center of gravity of the cell
41 double D_h; // hydraulic diameter
42 double D_ch; // heated hydraulic diameter
43 double p; // pressure
44 double Tp; // wall temperature (single value)
45 const double *alpha; // alpha[n] -> void fraction of phase n
46 const double *T; // T[n] -> temperature of phase n
47 const double *v; // v[n] -> norm of the velocity of phase n
48 const double *lambda; // lambda[n] -> thermal conductivity of phase n
49 const double *mu; // mu[n] -> dynamic viscosity of phase n
50 const double *rho; // rho[n] -> density of phase n
51 const double *Cp; // Cp[n] -> heat capacity of phase n
52 const double *Lvap; //Lvap[(k*(N-1)-(k-1)*(k)/2) + (l-k-1)] : latent heat of phase change n <=> k
53 const double *Sigma; //Sigma[(k*(N-1)-(k-1)*(k)/2) + (l-k-1)] : surface tension between phases n <=> k
54 const double *Tsat; //Tsat[(k*(N-1)-(k-1)*(k)/2) + (l-k-1)] : saturation temperature for phase change n <=> k
55 };
56 /* output values */
57 struct output_t
58 {
59 DoubleTab *qpk = nullptr; // (*qpk)(n) -> heat flux toward phase n
60 DoubleTab *da_qpk = nullptr; // (*da_qpk)(n, m) -> derivative w.r.t. alpha_m
61 DoubleTab *dp_qpk = nullptr; // (*dp_qpk)(n) -> derivative w.r.t. p
62 DoubleTab *dv_qpk = nullptr; // (*dv_qpk)(n, m) -> derivative w.r.t. v[m]
63 DoubleTab *dTf_qpk = nullptr; // (*dTf_qpk)(n, m) -> derivative w.r.t. T[m]
64 DoubleTab *dTp_qpk = nullptr; // (*dTp_qpk)(n) -> derivative w.r.t. Tp
65 DoubleTab *qpi = nullptr; // (*qpi)(k, l) -> heat flux supplied to the phase change from k to l (to fill for k < l)
66 DoubleTab *da_qpi = nullptr; // (*da_qpi)(k, l, m) -> derivative w.r.t. alpha_m
67 DoubleTab *dp_qpi = nullptr; // (*dp_qpi)(k, l) -> derivative w.r.t. p
68 DoubleTab *dv_qpi = nullptr; // (*dv_qpi)(k, l,m) -> derivative w.r.t. v[m]
69 DoubleTab *dTf_qpi = nullptr; // (*dTf_qpi)(k, l, m) -> derivative w.r.t. T[m]
70 DoubleTab *dTp_qpi = nullptr; // (*dTp_qpi)(k, l) -> derivative w.r.t. Tp
71 DoubleTab *d_nuc = nullptr; // (*d_nucleation)(k) -> nucleation diameter of phase k
72 int *nonlinear = nullptr; // nonlinear -> set to 1 if q_pk / q_pi is nonlinear in Tp / Tf; do not modify otherwise
73 };
74 virtual void qp(const input_t& input, output_t& output) const = 0;
75 /* 1 if T[n] must be provided at the wall, 0 if it must be provided at the cell center */
76 virtual int T_at_wall() const = 0;
77 virtual int calculates_bubble_nucleation_diameter() const {return 0;};
78 virtual int needs_saturation() const {return 0;};
79};
80
81#endif
Base class for wall heat flux correlations of the form:
virtual int needs_saturation() const
virtual int T_at_wall() const =0
virtual int calculates_bubble_nucleation_diameter() const
virtual void qp(const input_t &input, output_t &output) const =0