1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
30 #include "dragModel.H"
31 #include "evaporationModel.H"
32 #include "heatTransferModel.H"
33 #include "basicMultiComponentMixture.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
42 void parcel::setRelaxationTimes
46 scalarField& tauEvaporation,
47 scalar& tauHeatTransfer,
48 scalarField& tauBoiling,
52 const scalar temperature,
53 const scalar pressure,
54 const scalarField& Yfg,
55 const scalarField& m0,
60 const liquidMixture& fuels = sDB.fuels();
62 scalar mCell = rho*sDB.mesh().V()[cell()];
63 scalarField mfg(Yfg*mCell);
65 label Ns = sDB.composition().Y().size();
66 label Nf = fuels.components().size();
68 // Tf is based on the 1/3 rule
69 scalar Tf = T() + (temperature - T())/3.0;
71 // calculate mixture properties
73 scalar kMixture = 0.0;
74 scalar cpMixture = 0.0;
77 for(label i=0; i<Ns; i++)
79 scalar Y = sDB.composition().Y()[i][celli];
80 W += Y/sDB.gasProperties()[i].W();
81 // Using mass-fractions to average...
82 kMixture += Y*sDB.gasProperties()[i].kappa(Tf);
83 cpMixture += Y*sDB.gasProperties()[i].Cp(Tf);
84 muf += Y*sDB.gasProperties()[i].mu(Tf);
88 scalarField Xf(Nf, 0.0);
89 scalarField Yf(Nf, 0.0);
90 scalarField psat(Nf, 0.0);
91 scalarField msat(Nf, 0.0);
93 for(label i=0; i<Nf; i++)
95 label j = sDB.liquidToGasIndex()[i];
96 scalar Y = sDB.composition().Y()[j][celli];
97 scalar Wi = sDB.gasProperties()[j].W();
100 psat[i] = fuels.properties()[i].pv(pressure, temperature);
101 msat[i] = min(1.0, psat[i]/pressure)*Wi/W;
104 scalar nuf = muf/rho;
106 scalar liquidDensity = fuels.rho(pressure, T(), X());
107 scalar liquidcL = fuels.cp(pressure, T(), X());
108 scalar heatOfVapour = fuels.hl(pressure, T(), X());
110 // calculate the partial rho of the fuel vapour
111 // alternative is to use the mass fraction
112 // however, if rhoFuelVap is small (zero)
113 // d(mass)/dt = 0 => no evaporation... hmmm... is that good? NO!
115 // Assume equilibrium at drop-surface => pressure @ surface
116 // = vapour pressure to calculate fuel-vapour density @ surface
117 scalar pressureAtSurface = fuels.pv(pressure, T(), X());
118 scalar rhoFuelVap = pressureAtSurface*fuels.W(X())/(specie::RR*Tf);
120 scalarField Xs(sDB.fuels().Xs(pressure, temperature, T(), Xf, X()));
121 scalarField Ys(Nf, 0.0);
124 for(label i=0; i<Nf; i++)
126 label j = sDB.liquidToGasIndex()[i];
127 scalar Wi = sDB.gasProperties()[j].W();
131 for(label i=0; i<Nf; i++)
133 label j = sDB.liquidToGasIndex()[i];
134 scalar Wi = sDB.gasProperties()[j].W();
135 Ys[i] = Xs[i]*Wi/Wliq;
138 scalar Reynolds = Re(Up, nuf);
139 scalar Prandtl = Pr(cpMixture, muf, kMixture);
141 // calculate the characteritic times
145 // no drag for parcels in the liquid core..
150 tauMomentum = sDB.drag().relaxationTime
161 // store the relaxationTime since it is needed in some breakup models.
164 tauHeatTransfer = sDB.heatTransfer().relaxationTime
174 // evaporation-properties are evaluated at averaged temperature
175 // set the boiling conditions true if pressure @ surface is 99.9%
177 // this is mainly to put a limit on the evaporation time,
178 // since tauEvaporation is very very small close to the boiling point.
180 for(label i=0; i<Nf; i++)
182 scalar Td = min(T(), 0.999*fuels.properties()[i].Tc());
183 bool boiling = fuels.properties()[i].pv(pressure, Td)
186 scalar Di = fuels.properties()[i].D(pressure, Td);
187 scalar Schmidt = Sc(nuf, Di);
189 scalar partialPressure = Xf[i]*pressure;
192 if(partialPressure > psat[i])
194 tauEvaporation[i] = GREAT;
196 // not saturated vapour
201 // For saturation evaporation, only use 99.99% for
202 // numerical robustness
203 scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]);
205 tauEvaporation[i] = sDB.evaporation().relaxationTime
208 fuels.properties()[i].rho(pressure, Td),
223 sDB.heatTransfer().Nu(Reynolds, Prandtl);
225 // calculating the boiling temperature of the liquid at ambient pressure
226 scalar tBoilingSurface = Td;
229 scalar deltaT = 10.0;
230 scalar dp0 = fuels.properties()[i].pv(pressure, tBoilingSurface) - pressure;
231 while ((Niter < 200) && (mag(deltaT) > 1.0e-3))
234 scalar pBoil = fuels.properties()[i].pv(pressure, tBoilingSurface);
235 scalar dp = pBoil - pressure;
236 if ( (dp > 0.0) && (dp0 > 0.0) )
238 tBoilingSurface -= deltaT;
242 if ( (dp < 0.0) && (dp0 < 0.0) )
244 tBoilingSurface += deltaT;
249 if ( (dp > 0.0) && (dp0 < 0.0) )
251 tBoilingSurface -= deltaT;
255 tBoilingSurface += deltaT;
262 scalar vapourSurfaceEnthalpy = 0.0;
263 scalar vapourFarEnthalpy = 0.0;
265 for(label k = 0; k < sDB.gasProperties().size(); k++)
267 vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface);
268 vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature);
271 scalar kLiquid = fuels.properties()[i].K(pressure, 0.5*(tBoilingSurface+T()));
273 tauBoiling[i] = sDB.evaporation().boilingTime
275 fuels.properties()[i].rho(pressure, Td),
276 fuels.properties()[i].cp(pressure, Td),
283 sDB.runTime().value() - ct(),
286 vapourSurfaceEnthalpy,
299 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
301 } // End namespace Foam
303 // ************************************************************************* //