FreeFOAM The Cross-Platform CFD Toolkit
RanzMarshall.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include <OpenFOAM/error.H>
27 
28 #include "RanzMarshall.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 
38 defineTypeNameAndDebug(RanzMarshall, 0);
39 
41 (
42  heatTransferModel,
43  RanzMarshall,
44  dictionary
45 );
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
49 // Construct from components
51 (
52  const dictionary& dict
53 )
54 :
55  heatTransferModel(dict),
56  heatDict_(dict.subDict(typeName + "Coeffs")),
57  preRePrFactor_(readScalar(heatDict_.lookup("preRePrFactor"))),
58  ReExponent_(readScalar(heatDict_.lookup("ReExponent"))),
59  PrExponent_(readScalar(heatDict_.lookup("PrExponent")))
60 {}
61 
62 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
63 
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 
71 {
72  return true;
73 }
74 
75 scalar RanzMarshall::Nu
76 (
77  const scalar ReynoldsNumber,
78  const scalar PrandtlNumber
79 ) const
80 {
81  return 2.0 + preRePrFactor_ * pow(ReynoldsNumber, ReExponent_) * pow(PrandtlNumber, PrExponent_);
82 }
83 
85 (
86  const scalar liquidDensity,
87  const scalar diameter,
88  const scalar liquidcL,
89  const scalar kappa,
90  const scalar ReynoldsNumber,
91  const scalar PrandtlNumber
92 ) const
93 {
94  scalar time = liquidDensity*pow(diameter, 2.0)*liquidcL/(6.0*kappa*Nu(ReynoldsNumber, PrandtlNumber));
95 
96  time = max(SMALL, time);
97 
98  return time;
99 }
100 
101 scalar RanzMarshall::fCorrection(const scalar z) const
102 {
103  scalar correct;
104  if (z > 0.01)
105  {
106  if (z < 1.0e+5)
107  {
108  correct = z/(exp(z) - 1.0);
109  }
110  else
111  {
112  correct = SMALL;
113  }
114 
115  }
116  else
117  {
118  // taylor-expansion of exp(z)...
119  correct = 1.0/(1+0.5*z);
120  }
121 
122  return correct;
123 }
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // ************************ vim: set sw=4 sts=4 et: ************************ //