Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / lagrangian / dieselSpray / spraySubModels / heatTransferModel / RanzMarshall / RanzMarshall.C
blob89438efa684f028357dc3681464ab9ddb8664b72
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "error.H"
28 #include "RanzMarshall.H"
29 #include "addToRunTimeSelectionTable.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 namespace Foam
35     defineTypeNameAndDebug(RanzMarshall, 0);
37     addToRunTimeSelectionTable
38     (
39         heatTransferModel,
40         RanzMarshall,
41         dictionary
42     );
46 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
48 Foam::RanzMarshall::RanzMarshall(const dictionary& dict)
50     heatTransferModel(dict),
51     heatDict_(dict.subDict(typeName + "Coeffs")),
52     preRePrFactor_(readScalar(heatDict_.lookup("preRePrFactor"))),
53     ReExponent_(readScalar(heatDict_.lookup("ReExponent"))),
54     PrExponent_(readScalar(heatDict_.lookup("PrExponent")))
58 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
60 Foam::RanzMarshall::~RanzMarshall()
64 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
66 bool Foam::RanzMarshall::heatTransfer() const
68     return true;
72 Foam::scalar Foam::RanzMarshall::Nu
74     const scalar ReynoldsNumber,
75     const scalar PrandtlNumber
76 ) const
78     return
79         2.0
80       + preRePrFactor_
81        *pow(ReynoldsNumber, ReExponent_)
82        *pow(PrandtlNumber, PrExponent_);
86 Foam::scalar Foam::RanzMarshall::relaxationTime
88     const scalar liquidDensity,
89     const scalar diameter,
90     const scalar liquidcL,
91     const scalar kappa,
92     const scalar ReynoldsNumber,
93     const scalar PrandtlNumber
94 ) const
96     scalar time =
97         liquidDensity
98        *sqr(diameter)
99        *liquidcL
100        /(6.0*kappa*Nu(ReynoldsNumber, PrandtlNumber));
102     time = max(SMALL, time);
104     return time;
108 Foam::scalar Foam::RanzMarshall::fCorrection(const scalar z) const
110     scalar correct;
111     if (z > 0.01)
112     {
113         if (z < 1.0e+5)
114         {
115             correct = z/(exp(z) - 1.0);
116         }
117         else
118         {
119             correct = SMALL;
120         }
121     }
122     else
123     {
124         // taylor-expansion of exp(z)...
125         correct = 1.0/(1+0.5*z);
126     }
128     return correct;
132 // ************************************************************************* //