TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Flux_parietal_Kurul_Podowski.cpp
1/****************************************************************************
2* Copyright (c) 2021, 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_Kurul_Podowski.h>
17#include <Flux_parietal_adaptatif.h>
18#include <Loi_paroi_adaptative.h>
19#include <Pb_Multiphase.h>
20
21#include <TRUSTTrav.h>
22#include <Milieu_composite.h>
23#include <Saturation_base.h>
24#include <math.h>
25
26Implemente_instanciable(Flux_parietal_Kurul_Podowski, "Flux_parietal_Kurul_Podowski", Flux_parietal_base);
27
29{
31}
32
34{
35 const Pb_Multiphase& pbm = ref_cast(Pb_Multiphase, pb_.valeur());
36 Correlation_base::typer_lire_correlation(correlation_monophasique_, pbm, "Flux_parietal", is);
37 Cout << que_suis_je() << " : single-phase wall heat flux is " << correlation_monophasique_->que_suis_je() << finl;
38
39 Param param(que_suis_je());
40
41 param.ajouter("departure_diameter", &dd_ );
42
43
44 param.lire_avec_accolades(is);
45
46 if (!sub_type(Milieu_composite, pb_->milieu()))
47 Process::exit("Flux_parietal_Kurul_Podowski::readOn : the medium must be composite !");
48
49 if (!pbm.nom_phase(0).debute_par("liquide"))
50 Process::exit("Flux_parietal_Kurul_Podowski::readOn : the first phase must be liquid !");
51
52 const Milieu_composite& milc = ref_cast(Milieu_composite, pb_->milieu());
53 for (int n = 0; n < pbm.nb_phases(); n++) //recherche de n_l, n_g : phase {liquide,gaz}_continu en priorite
54 {
55 if (pbm.nom_phase(n).debute_par("liquide") && (n_l < 0 || pbm.nom_phase(n).finit_par("continu"))) n_l = n;
56 if (( pbm.nom_phase(n).finit_par("group1"))) n_g1 = n;
57 if (( pbm.nom_phase(n).finit_par("group2"))) n_g2 = n;
58 }
59 int n_g = -1;
60 for (int k = 1; k < pbm.nb_phases(); k++)
61 if (n_g1 != k && milc.has_saturation(0, k))
62 n_g += 1;
63
64 if (n_g > 0)
65 Process::exit("Flux_parietal_Kurul_Podowski::readOn : there can only be one evaporating phase for the carrying liquid for now ! Please feel free to update the code if you need.");
66
67 return is;
68}
69
71{
72 correlation_monophasique_->completer();
73}
74
76{
77 // Set everything to zero
78 if (out.qpk) (*out.qpk) = 0.;
79 if (out.da_qpk) (*out.da_qpk) = 0.;
80 if (out.dp_qpk) (*out.dp_qpk) = 0.;
81 if (out.dv_qpk) (*out.dv_qpk) = 0.;
82 if (out.dTf_qpk) (*out.dTf_qpk) = 0.;
83 if (out.dTp_qpk) (*out.dTp_qpk) = 0.;
84 if (out.qpi) (*out.qpi) = 0.;
85 if (out.da_qpi) (*out.da_qpi) = 0.;
86 if (out.dp_qpi) (*out.dp_qpi) = 0.;
87 if (out.dv_qpi) (*out.dv_qpi) = 0.;
88 if (out.dTf_qpi) (*out.dTf_qpi) = 0.;
89 if (out.dTp_qpi) (*out.dTp_qpi) = 0.;
90 if (out.nonlinear) (*out.nonlinear) = 1;
91
92 // On remplit le monophasique ; pas besoin du flux interfacial normalement
93 ref_cast(Flux_parietal_base, correlation_monophasique_.valeur()).qp(in, out);
94
95 // Ici la phase liquide est forcement la phase 0 car la correlation monophasique ne remplit que la phase 0
96
97 const Milieu_composite& milc = ref_cast(Milieu_composite, pb_->milieu());
98
99 for (int k = 0 ; k < in.N ; k++)
100 if (n_l != k)
101 {
102 if (n_g2 != k)
103 {
104 if (milc.has_saturation(n_l, k))
105 {
106 // on part de ind_sat = (k*(in.N-1)-(k-1)*(k)/2) + (l-k-1) // avec k<l
107
108 int ind_sat = k<n_l ? ( k *(in.N-1)-( k -1)*( k )/2) + (n_l- k -1) :
109 (n_l*(in.N-1)-(n_l-1)*(n_l)/2) + ( k -n_l-1);
110
111 if (in.Tp - in.Tsat[ind_sat] > 0) // Else : no wall superheat => no nucleation => single phase heat transfer only
112 {
113
114 const double dd = 1.e-4*(in.Tp - in.Tsat[ind_sat])+dd_;
115
116 const double dTp_dd = 1.e-4;
117
118 const double N_sites = std::pow(210.*(in.Tp - in.Tsat[ind_sat]), 1.8);
119 const double dTp_N_sites = 210.*1.8*std::pow(210.*(in.Tp - in.Tsat[ind_sat]), .8);
120
121 const double A_bubbles = std::min(1., 3.1415/4.*N_sites*dd*dd);
122 const double dTp_A_bubbles = (3.1415/4.*N_sites*dd*dd>1) ? 0. : 3.1415/4.*dTp_N_sites*dd*dd+3.1415/4.*N_sites*2.*dTp_dd*dd ;
123
124 const double f_dep = std::sqrt(4./3*9.81*(in.rho[n_l]-in.rho[k])/(in.rho[n_l])) * std::pow(dd, -0.5);
125 const double dTp_f_dep = std::sqrt(4./3*9.81*(in.rho[n_l]-in.rho[k])/(in.rho[n_l])) *-0.5*dTp_dd*std::pow(dd, -1.5);
126
127 const double q_evap = f_dep * 3.1415/6. * dd*dd*dd * in.rho[k] * in.Lvap[ind_sat] * N_sites ;
128 const double dTp_q_evap= dTp_f_dep * 3.1415/6. * dd*dd*dd * in.rho[k] * in.Lvap[ind_sat] * N_sites
129 +f_dep * 3.1415/6. *3.*dTp_dd*dd*dd * in.rho[k] * in.Lvap[ind_sat] * N_sites
130 +f_dep * 3.1415/6. * dd*dd*dd * in.rho[k] * in.Lvap[ind_sat] * dTp_N_sites ;
131
132
133 const double q_quench= A_bubbles *2. * in.lambda[n_l] * (in.Tp - in.T[n_l]) / std::sqrt(3.1415*in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::sqrt(f_dep);
134 const double dTl_q_quench= A_bubbles *2. * in.lambda[n_l] * (-1.) / std::sqrt(3.1415*in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::sqrt(f_dep);
135 const double dTp_q_quench= dTp_A_bubbles *2. * in.lambda[n_l] * (in.Tp - in.T[n_l]) / std::sqrt(3.1415*in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::sqrt(f_dep)
136 +A_bubbles *2. * in.lambda[n_l] * (1.) / std::sqrt(3.1415*in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * std::sqrt(f_dep)
137 +A_bubbles *2. * in.lambda[n_l] * (in.Tp - in.T[n_l]) / std::sqrt(3.1415*in.lambda[n_l]/(in.rho[n_l]*in.Cp[n_l])) * .5*dTp_f_dep/std::sqrt(f_dep);
138
139 // We correct the single phase heat flux
140 double qpk_nl_loc = -1;
141 if (out.qpk) qpk_nl_loc = (*out.qpk)(n_l);
142 if (out.qpk) (*out.qpk) *= (1-A_bubbles);
143 if (out.da_qpk) (*out.da_qpk) *= (1-A_bubbles);
144 if (out.dp_qpk) (*out.dp_qpk) *= (1-A_bubbles);
145 if (out.dv_qpk) (*out.dv_qpk) *= (1-A_bubbles);
146 if (out.dTf_qpk) (*out.dTf_qpk) *= (1-A_bubbles);
147 if (out.dTp_qpk)
148 {
149 (*out.dTp_qpk) *= (1-A_bubbles);
150 (*out.dTp_qpk)(n_l) += -dTp_A_bubbles*qpk_nl_loc;
151 }
152
153 // Quenching
154 if (out.qpk) (*out.qpk)(n_l) += q_quench;
155 if (out.dTp_qpk) (*out.dTp_qpk)(n_l) += dTp_q_quench;
156 if (out.dTf_qpk) (*out.dTf_qpk)(n_l,n_l) += dTl_q_quench;
157
158 // Evaporation
159 if (out.qpi) (*out.qpi)(n_l, k) += q_evap;
160 if (out.dTp_qpi) (*out.dTp_qpi)(n_l, k) += dTp_q_evap;
161 }
162 }
163 }
164 }
165}
static void typer_lire_correlation(OWN_PTR(Correlation_base)&, const Probleme_base &, const Nom &, Entree &)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Flux_parietal_Kurul_Podowski classe qui implemente une correlation de flux parietal diphasique
virtual void qp(const input_t &input, output_t &output) const override
classe Flux_parietal_base correlations de flux parietal de la forme
Classe Milieu_composite Cette classe represente un fluide reel ainsi que.
bool has_saturation(int k, int l) const
virtual int finit_par(const char *const n) const
Definition Nom.cpp:324
virtual int debute_par(const char *const n) const
Definition Nom.cpp:319
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
const Nom & nom_phase(int i) const
int nb_phases() const
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52