OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

kineticTheoryModel.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "kineticTheoryModel.H"
00028 #include "surfaceInterpolate.H"
00029 #include "mathematicalConstants.H"
00030 #include "fvCFD.H"
00031 
00032 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00033 
00034 Foam::kineticTheoryModel::kineticTheoryModel
00035 (
00036     const Foam::phaseModel& phasea,
00037     const Foam::volVectorField& Ub,
00038     const Foam::volScalarField& alpha,
00039     const Foam::dragModel& draga
00040 )
00041 :
00042     phasea_(phasea),
00043     Ua_(phasea.U()),
00044     Ub_(Ub),
00045     alpha_(alpha),
00046     phia_(phasea.phi()),
00047     draga_(draga),
00048 
00049     rhoa_(phasea.rho()),
00050     da_(phasea.d()),
00051     nua_(phasea.nu()),
00052 
00053     kineticTheoryProperties_
00054     (
00055         IOobject
00056         (
00057             "kineticTheoryProperties",
00058             Ua_.time().constant(),
00059             Ua_.mesh(),
00060             IOobject::MUST_READ,
00061             IOobject::NO_WRITE
00062         )
00063     ),
00064     kineticTheory_(kineticTheoryProperties_.lookup("kineticTheory")),
00065     equilibrium_(kineticTheoryProperties_.lookup("equilibrium")),
00066     viscosityModel_
00067     (
00068         kineticTheoryModels::viscosityModel::New
00069         (
00070             kineticTheoryProperties_
00071         )
00072     ),
00073     conductivityModel_
00074     (
00075         conductivityModel::New
00076         (
00077             kineticTheoryProperties_
00078         )
00079     ),
00080     radialModel_
00081     (
00082         radialModel::New
00083         (
00084             kineticTheoryProperties_
00085         )
00086     ),
00087     granularPressureModel_
00088     (
00089         granularPressureModel::New
00090         (
00091             kineticTheoryProperties_
00092         )
00093     ),
00094     frictionalStressModel_
00095     (
00096         frictionalStressModel::New
00097         (
00098             kineticTheoryProperties_
00099         )
00100     ),
00101     e_(kineticTheoryProperties_.lookup("e")),
00102     alphaMax_(kineticTheoryProperties_.lookup("alphaMax")),
00103     alphaMinFriction_(kineticTheoryProperties_.lookup("alphaMinFriction")),
00104     Fr_(kineticTheoryProperties_.lookup("Fr")),
00105     eta_(kineticTheoryProperties_.lookup("eta")),
00106     p_(kineticTheoryProperties_.lookup("p")),
00107     phi_(dimensionedScalar(kineticTheoryProperties_.lookup("phi"))*M_PI/180.0),
00108     Theta_
00109     (
00110         IOobject
00111         (
00112             "Theta",
00113             Ua_.time().timeName(),
00114             Ua_.mesh(),
00115             IOobject::MUST_READ,
00116             IOobject::AUTO_WRITE
00117         ),
00118         Ua_.mesh()
00119     ),
00120     mua_
00121     (
00122         IOobject
00123         (
00124             "mua",
00125             Ua_.time().timeName(),
00126             Ua_.mesh(),
00127             IOobject::NO_READ,
00128             IOobject::AUTO_WRITE
00129         ),
00130         Ua_.mesh(),
00131         dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0)
00132     ),
00133     lambda_
00134     (
00135         IOobject
00136         (
00137             "lambda",
00138             Ua_.time().timeName(),
00139             Ua_.mesh(),
00140             IOobject::NO_READ,
00141             IOobject::NO_WRITE
00142         ),
00143         Ua_.mesh(),
00144         dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0)
00145     ),
00146     pa_
00147     (
00148         IOobject
00149         (
00150             "pa",
00151             Ua_.time().timeName(),
00152             Ua_.mesh(),
00153             IOobject::NO_READ,
00154             IOobject::AUTO_WRITE
00155         ),
00156         Ua_.mesh(),
00157         dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0)
00158     ),
00159     kappa_
00160     (
00161         IOobject
00162         (
00163             "kappa",
00164             Ua_.time().timeName(),
00165             Ua_.mesh(),
00166             IOobject::NO_READ,
00167             IOobject::NO_WRITE
00168         ),
00169         Ua_.mesh(),
00170         dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0)
00171     ),
00172     gs0_
00173     (
00174         IOobject
00175         (
00176             "gs0",
00177             Ua_.time().timeName(),
00178             Ua_.mesh(),
00179             IOobject::NO_READ,
00180             IOobject::NO_WRITE
00181         ),
00182         Ua_.mesh(),
00183         dimensionedScalar("zero", dimensionSet(0, 0, 0, 0, 0), 1.0)
00184     )
00185 {}
00186 
00187 
00188 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00189 
00190 Foam::kineticTheoryModel::~kineticTheoryModel()
00191 {}
00192 
00193 
00194 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00195 
00196 void Foam::kineticTheoryModel::solve()
00197 {
00198     if (!kineticTheory_)
00199     {
00200         return;
00201     }
00202 
00203     word scheme("div(phi,Theta)");
00204 
00205     volScalarField alpha = alpha_;
00206     alpha.max(1.0e-6);
00207     const scalar sqrtPi = sqrt(mathematicalConstant::pi);
00208 
00209     surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_);
00210 
00211     volTensorField dU = fvc::grad(Ua_);
00212     volTensorField dUT = dU.T();
00213     volTensorField D = 0.5*(dU + dUT);
00214 
00215     // NB, drag = K*alpha*beta,
00216     // (the alpha and beta has been extracted from the drag function for
00217     // numerical reasons)
00218     volScalarField Ur = mag(Ua_ - Ub_);
00219     volScalarField betaPrim = alpha_*(1.0 - alpha_)*draga_.K(Ur);
00220 
00221     // Calculating the radial distribution function (solid volume fraction is
00222     //  limited close to the packing limit, but this needs improvements)
00223     //  The solution is higly unstable close to the packing limit.
00224     gs0_ = radialModel_->g0(min(alpha, alphaMax_-1.0e-2), alphaMax_);
00225 
00226     // particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45)
00227     volScalarField PsCoeff =
00228         granularPressureModel_->granularPressureCoeff(alpha_,gs0_,rhoa_,e_ );
00229 
00230     dimensionedScalar Tsmall
00231     (
00232         "small",
00233         dimensionSet(0,2,-2,0,0,0,0),
00234         1.0e-6
00235     );
00236 
00237     dimensionedScalar TsmallSqrt = sqrt(Tsmall);
00238     volScalarField ThetaSqrt = sqrt(Theta_);
00239 
00240     // 'thermal' conductivity (Table 3.3, p. 49)
00241     kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rhoa_, da_, e_);
00242 
00243     // particle viscosity (Table 3.2, p.47)
00244     mua_ = viscosityModel_->mua(alpha, Theta_, gs0_, rhoa_, da_, e_);
00245 
00246     // dissipation (Eq. 3.24, p.50)
00247     volScalarField gammaCoeff =
00248         12.0*(1.0 - e_*e_)*sqr(alpha)*rhoa_*gs0_*(1.0/da_)
00249        *ThetaSqrt/sqrtPi;
00250 
00251     // Eq. 3.25, p. 50 Js = J1 - J2
00252     volScalarField J1 = 3.0*betaPrim;
00253     volScalarField J2 =
00254         0.25*sqr(betaPrim)*da_*sqr(Ur)
00255        /(alpha*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt));
00256 
00257     // bulk viscosity  p. 45 (Lun et al. 1984).
00258     lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi;
00259 
00260 
00261     // stress tensor, Definitions, Table 3.1, p. 43
00262     volTensorField tau = 2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I;
00263 
00264     if (!equilibrium_)
00265     {
00266         // construct the granular temperature equation (Eq. 3.20, p. 44)
00267         // NB. note that there are two typos in Eq. 3.20
00268         // no grad infront of Ps
00269         // wrong sign infront of laplacian
00270         fvScalarMatrix ThetaEqn
00271         (
00272             fvm::ddt(1.5*alpha*rhoa_, Theta_)
00273           + fvm::div(phi, Theta_, scheme)
00274          ==
00275             fvm::SuSp(-((PsCoeff*I) && dU), Theta_)
00276           + (tau && dU)
00277           + fvm::laplacian(kappa_, Theta_, "laplacian(kappa,Theta)")
00278           + fvm::Sp(-gammaCoeff, Theta_)
00279           + fvm::Sp(-J1, Theta_)
00280           + fvm::Sp(J2/(Theta_ + Tsmall), Theta_)
00281         );
00282 
00283         ThetaEqn.relax();
00284         ThetaEqn.solve();
00285     }
00286     else
00287     {
00288         // equilibrium => dissipation == production
00289         // Eq. 4.14, p.82
00290         volScalarField K1 = 2.0*(1.0 + e_)*rhoa_*gs0_;
00291         volScalarField K3 = 0.5*da_*rhoa_*
00292             (
00293                 (sqrtPi/(3.0*(3.0-e_)))
00294                *(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha*gs0_)
00295               + 1.6*alpha*gs0_*(1.0 + e_)/sqrtPi
00296             );
00297 
00298         volScalarField K2 =
00299             4.0*da_*rhoa_*(1.0 + e_)*alpha*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0;
00300 
00301         volScalarField K4 = 12.0*(1.0 - e_*e_)*rhoa_*gs0_/(da_*sqrtPi);
00302 
00303         volScalarField trD = tr(D);
00304         volTensorField D2 = D & D;
00305         volScalarField tr2D = trD*trD;
00306         volScalarField trD2 = tr(D2);
00307 
00308         volScalarField t1 = K1*alpha + rhoa_;
00309         volScalarField l1 = -t1*trD;
00310         volScalarField l2 = sqr(t1)*tr2D;
00311         volScalarField l3 = 4.0*K4*alpha*(2.0*K3*trD2 + K2*tr2D);
00312 
00313         Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha + 1.0e-4)*K4));
00314     }
00315 
00316     Theta_.max(1.0e-15);
00317     Theta_.min(1.0e+3);
00318 
00319     volScalarField pf =
00320         frictionalStressModel_->frictionalPressure
00321     (
00322         alpha_,
00323         alphaMinFriction_,
00324         alphaMax_,
00325         Fr_,
00326         eta_,
00327         p_
00328     );
00329 
00330     PsCoeff += pf/(Theta_+Tsmall);
00331 
00332     PsCoeff.min(1.0e+10);
00333     PsCoeff.max(-1.0e+10);
00334 
00335     // update particle pressure
00336     pa_ = PsCoeff*Theta_;
00337 
00338     // frictional shear stress, Eq. 3.30, p. 52
00339     volScalarField muf = frictionalStressModel_->muf
00340     (
00341         alpha_,
00342         alphaMax_,
00343         pf,
00344         D,
00345         phi_
00346     );
00347 
00348     // add frictional stress for alpha > alphaMinFriction
00349     mua_ = viscosityModel_->mua(alpha, Theta_, gs0_, rhoa_, da_, e_) + muf;
00350     mua_.min(1.0e+2);
00351     mua_.max(0.0);
00352 
00353     lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0 + e_)*ThetaSqrt/sqrtPi;
00354 
00355     Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl;
00356 
00357     volScalarField ktn = mua_/rhoa_;
00358 
00359     Info<< "kinTheory: min(nua) = " << min(ktn).value()
00360         << ", max(nua) = " << max(ktn).value() << endl;
00361 
00362     Info<< "kinTheory: min(pa) = " << min(pa_).value()
00363         << ", max(pa) = " << max(pa_).value() << endl;
00364 }
00365 
00366 
00367 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd