initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / combustion / PDRFoam / PDRModels / dragModels / basic / basic.C
blob1fabe1360d296845cac37f3eea5792f816c69ca4
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "basic.H"
28 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 namespace Foam
34 namespace PDRDragModels
36     defineTypeNameAndDebug(basic, 0);
37     addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
42 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
44 Foam::PDRDragModels::basic::basic
46     const dictionary& PDRProperties,
47     const compressible::RASModel& turbulence,
48     const volScalarField& rho,
49     const volVectorField& U,
50     const surfaceScalarField& phi
53     PDRDragModel(PDRProperties, turbulence, rho, U, phi),
54     Csu("Csu", dimless, PDRDragModelCoeffs_.lookup("Csu")),
55     Csk("Csk", dimless, PDRDragModelCoeffs_.lookup("Csk")),
57     Aw2_
58     (
59         "Aw2",
60         sqr
61         (
62             volScalarField
63             (
64                 IOobject
65                 (
66                     "Aw",
67                     U_.mesh().time().findInstance(polyMesh::meshSubDir, "Aw"),
68                     polyMesh::meshSubDir,
69                     U_.mesh(),
70                     IOobject::MUST_READ,
71                     IOobject::NO_WRITE
72                 ),
73                 U_.mesh()
74             )
75         )
76     ),
78     CR_
79     (
80         IOobject
81         (
82             "CR",
83             U_.mesh().time().findInstance(polyMesh::meshSubDir, "CR"),
84             polyMesh::meshSubDir,
85             U_.mesh(),
86             IOobject::MUST_READ,
87             IOobject::NO_WRITE
88         ),
89         U_.mesh()
90     ),
92     CT_
93     (
94         IOobject
95         (
96             "CT",
97             U_.mesh().time().findInstance(polyMesh::meshSubDir, "CT"),
98             polyMesh::meshSubDir,
99             U_.mesh(),
100             IOobject::MUST_READ,
101             IOobject::NO_WRITE
102         ),
103         U_.mesh()
104     )
108 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
110 Foam::PDRDragModels::basic::~basic()
114 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
116 Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
118     const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
120     return (0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*Aw2_;
124 Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
126     const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
128     return
129         (0.5*rho_)*mag(U_)*(U_ & CT_ & U_)
130       + Csk*betav*turbulence_.muEff()*Aw2_*magSqr(U_);
134 bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
136     PDRDragModel::read(PDRProperties);
138     PDRDragModelCoeffs_.lookup("Csu") >> Csu.value();
139     PDRDragModelCoeffs_.lookup("Csk") >> Csk.value();
141     return true;
145 // ************************************************************************* //