FreeFOAM The Cross-Platform CFD Toolkit
basic.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 "basic.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace PDRDragModels
34 {
35  defineTypeNameAndDebug(basic, 0);
36  addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
37 };
38 };
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
43 Foam::PDRDragModels::basic::basic
44 (
45  const dictionary& PDRProperties,
47  const volScalarField& rho,
48  const volVectorField& U,
49  const surfaceScalarField& phi
50 )
51 :
52  PDRDragModel(PDRProperties, turbulence, rho, U, phi),
53  Csu("Csu", dimless, PDRDragModelCoeffs_.lookup("Csu")),
54  Csk("Csk", dimless, PDRDragModelCoeffs_.lookup("Csk")),
55 
56  Aw2_
57  (
58  "Aw2",
59  sqr
60  (
62  (
63  IOobject
64  (
65  "Aw",
66  U_.mesh().time().findInstance(polyMesh::meshSubDir, "Aw"),
67  polyMesh::meshSubDir,
68  U_.mesh(),
69  IOobject::MUST_READ,
70  IOobject::NO_WRITE
71  ),
72  U_.mesh()
73  )
74  )
75  ),
76 
77  CR_
78  (
79  IOobject
80  (
81  "CR",
82  U_.mesh().time().findInstance(polyMesh::meshSubDir, "CR"),
83  polyMesh::meshSubDir,
84  U_.mesh(),
85  IOobject::MUST_READ,
86  IOobject::NO_WRITE
87  ),
88  U_.mesh()
89  ),
90 
91  CT_
92  (
93  IOobject
94  (
95  "CT",
96  U_.mesh().time().findInstance(polyMesh::meshSubDir, "CT"),
97  polyMesh::meshSubDir,
98  U_.mesh(),
99  IOobject::MUST_READ,
100  IOobject::NO_WRITE
101  ),
102  U_.mesh()
103  )
104 {}
105 
106 
107 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
108 
110 {}
111 
112 
113 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
114 
116 {
117  const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
118 
119  return (0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*Aw2_;
120 }
121 
122 
124 {
125  const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
126 
127  return
128  (0.5*rho_)*mag(U_)*(U_ & CT_ & U_)
129  + Csk*betav*turbulence_.muEff()*Aw2_*magSqr(U_);
130 }
131 
132 
133 bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
134 {
135  PDRDragModel::read(PDRProperties);
136 
137  PDRDragModelCoeffs_.lookup("Csu") >> Csu.value();
138  PDRDragModelCoeffs_.lookup("Csk") >> Csk.value();
139 
140  return true;
141 }
142 
143 
144 // ************************ vim: set sw=4 sts=4 et: ************************ //