initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / dieselSpray / spraySubModels / evaporationModel / standardEvaporationModel / standardEvaporationModel.C
blobe1d39fceb6a3005ee8dcb19064bc6781efd9da7f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 \*---------------------------------------------------------------------------*/
27 #include "error.H"
29 #include "standardEvaporationModel.H"
30 #include "addToRunTimeSelectionTable.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 namespace Foam
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 defineTypeNameAndDebug(standardEvaporationModel, 0);
41 addToRunTimeSelectionTable
43     evaporationModel,
44     standardEvaporationModel,
45     dictionary
49 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
51 // Construct from dictionary
52 standardEvaporationModel::standardEvaporationModel
54     const dictionary& dict
57     evaporationModel(dict),
58     evapDict_(dict.subDict(typeName + "Coeffs")),
59     preReScFactor_(readScalar(evapDict_.lookup("preReScFactor"))),
60     ReExponent_(readScalar(evapDict_.lookup("ReExponent"))),
61     ScExponent_(readScalar(evapDict_.lookup("ScExponent"))),
62     evaporationScheme_(evapDict_.lookup("evaporationScheme")),
63     nEvapIter_(0)
65     if (evaporationScheme_ == "implicit") 
66     {
67         nEvapIter_ = 2;
68     }
69     else if (evaporationScheme_ == "explicit") 
70     {
71         nEvapIter_ = 1;
72     }
73     else 
74     {
75         FatalError
76             << "evaporationScheme type " << evaporationScheme_
77             << " unknown.\n"
78             << "Use implicit or explicit."
79             << abort(FatalError);
80     }
84 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
86 standardEvaporationModel::~standardEvaporationModel()
90 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
92 bool standardEvaporationModel::evaporation() const
94     return true;
97 // Correlation for the Sherwood Number
98 scalar standardEvaporationModel::Sh
100     const scalar ReynoldsNumber,
101     const scalar SchmidtNumber
102 ) const
104     return 2.0 + preReScFactor_*pow(ReynoldsNumber,ReExponent_)*pow(SchmidtNumber,ScExponent_);
107 scalar standardEvaporationModel::relaxationTime
109     const scalar diameter,
110     const scalar liquidDensity,
111     const scalar rhoFuelVapor,
112     const scalar massDiffusionCoefficient,
113     const scalar ReynoldsNumber,
114     const scalar SchmidtNumber,
115     const scalar Xs,
116     const scalar Xf,
117     const scalar m0,
118     const scalar dm,
119     const scalar dt
120 ) const
122     scalar time = GREAT;
123     scalar lgExpr = 0.0;
125     /*
126         (pressure - partialFuelVaporPressure)/
127         (pressure - pressureAtSurface)
128       = 1 + Xratio
130         if the pressure @ Surface > pressure
131         this lead to boiling
132         and Xratio -> infinity (as it should)
133         ... this is numerically nasty
135     NB! by N. Nordin
136         X_v,s = (p_v,s/p) X_v,d
137         where X_v,d = 1 for single component fuel
138         according to eq (3.136)
139         in D. Clerides Thesis
140     */
142     scalar Xratio = (Xs - Xf)/max(SMALL, 1.0 - Xs);
144     if (Xratio > 0.0)
145     {
146         lgExpr = log(1.0 + Xratio);
147     }
149     // From Equation (3.79) in C. Kralj's Thesis:
150     // Note that the 2.0 (instead of 6.0) below is correct, since evaporation
151     // is d(diameter)/dt and not d(mass)/dt
153     scalar denominator =
154         6.0 * massDiffusionCoefficient
155       * Sh(ReynoldsNumber, SchmidtNumber)
156       * rhoFuelVapor * lgExpr;
158     if (denominator > SMALL)
159     {
160         time = max(VSMALL, liquidDensity * pow(diameter, 2.0)/denominator);
161     }
163     return time;
167 scalar standardEvaporationModel::boilingTime
169     const scalar liquidDensity,
170     const scalar cpFuel,
171     const scalar heatOfVapour,
172     const scalar kappa,
173     const scalar Nusselt,
174     const scalar deltaTemp,
175     const scalar diameter,
176     const scalar, 
177     const scalar, 
178     const scalar, 
179     const scalar, 
180     const scalar, 
181     const scalar, 
182     const scalar, 
183     const scalar, 
184     const scalar, 
185     const scalar, 
186     const scalar 
187 ) const
189     scalar time = GREAT;
191     // the deltaTemperature is limited to not go below .5 deg K
192     // for numerical reasons.
193     // This is probably not important, since it results in an upper
194     // limit for the boiling time... which we have anyway.
195     scalar deltaT = max(0.5, deltaTemp);
197     time = liquidDensity*cpFuel*sqr(diameter)/
198     (
199         6.0 * kappa * Nusselt * log(1.0 + cpFuel * deltaT/max(SMALL, heatOfVapour))
200     );
202     time = max(VSMALL, time);
204     return time;
207 inline label standardEvaporationModel::nEvapIter() const
209     return nEvapIter_;
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 } // End namespace Foam
215 // ************************************************************************* //