FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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