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

basic.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 "basic.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 namespace PDRDragModels
00035 {
00036     defineTypeNameAndDebug(basic, 0);
00037     addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
00038 };
00039 };
00040 
00041 
00042 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00043 
00044 Foam::PDRDragModels::basic::basic
00045 (
00046     const dictionary& PDRProperties,
00047     const compressible::RASModel& turbulence,
00048     const volScalarField& rho,
00049     const volVectorField& U,
00050     const surfaceScalarField& phi
00051 )
00052 :
00053     PDRDragModel(PDRProperties, turbulence, rho, U, phi),
00054     Csu("Csu", dimless, PDRDragModelCoeffs_.lookup("Csu")),
00055     Csk("Csk", dimless, PDRDragModelCoeffs_.lookup("Csk")),
00056 
00057     Aw2_
00058     (
00059         "Aw2",
00060         sqr
00061         (
00062             volScalarField
00063             (
00064                 IOobject
00065                 (
00066                     "Aw",
00067                     U_.mesh().time().findInstance(polyMesh::meshSubDir, "Aw"),
00068                     polyMesh::meshSubDir,
00069                     U_.mesh(),
00070                     IOobject::MUST_READ,
00071                     IOobject::NO_WRITE
00072                 ),
00073                 U_.mesh()
00074             )
00075         )
00076     ),
00077 
00078     CR_
00079     (
00080         IOobject
00081         (
00082             "CR",
00083             U_.mesh().time().findInstance(polyMesh::meshSubDir, "CR"),
00084             polyMesh::meshSubDir,
00085             U_.mesh(),
00086             IOobject::MUST_READ,
00087             IOobject::NO_WRITE
00088         ),
00089         U_.mesh()
00090     ),
00091 
00092     CT_
00093     (
00094         IOobject
00095         (
00096             "CT",
00097             U_.mesh().time().findInstance(polyMesh::meshSubDir, "CT"),
00098             polyMesh::meshSubDir,
00099             U_.mesh(),
00100             IOobject::MUST_READ,
00101             IOobject::NO_WRITE
00102         ),
00103         U_.mesh()
00104     )
00105 {}
00106 
00107 
00108 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
00109 
00110 Foam::PDRDragModels::basic::~basic()
00111 {}
00112 
00113 
00114 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
00115 
00116 Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
00117 {
00118     const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
00119 
00120     return (0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*Aw2_;
00121 }
00122 
00123 
00124 Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
00125 {
00126     const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
00127 
00128     return
00129         (0.5*rho_)*mag(U_)*(U_ & CT_ & U_)
00130       + Csk*betav*turbulence_.muEff()*Aw2_*magSqr(U_);
00131 }
00132 
00133 
00134 bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
00135 {
00136     PDRDragModel::read(PDRProperties);
00137 
00138     PDRDragModelCoeffs_.lookup("Csu") >> Csu.value();
00139     PDRDragModelCoeffs_.lookup("Csk") >> Csk.value();
00140 
00141     return true;
00142 }
00143 
00144 
00145 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd