PDRDragModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::PDRDragModel
28 
29 Description
30  Base-class for sub-grid obstacle drag models. The available drag model is at
31  \link basic.H \endlink.
32 
33 SourceFiles
34  PDRDragModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef PDRDragModel_H
39 #define PDRDragModel_H
40 
41 #include "IOdictionary.H"
42 #include "psiuReactionThermo.H"
45 #include "runTimeSelectionTables.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class PDRDragModel Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class PDRDragModel
57 :
58  public regIOobject
59 {
60 
61 protected:
62 
63  // Protected data
64 
66 
70  const surfaceScalarField& phi_;
71 
72  bool on_;
73 
74 
75 private:
76 
77  // Private Member Functions
78 
79  //- No copy construct
80  PDRDragModel(const PDRDragModel&) = delete;
81 
82  //- No copy assignment
83  void operator=(const PDRDragModel&) = delete;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("PDRDragModel");
90 
91 
92  // Declare run-time constructor selection table
93 
95  (
96  autoPtr,
98  dictionary,
99  (
100  const dictionary& PDRProperties,
102  const volScalarField& rho,
103  const volVectorField& U,
104  const surfaceScalarField& phi
105  ),
106  (
107  PDRProperties,
108  turbulence,
109  rho,
110  U,
111  phi
112  )
113  );
114 
115 
116  // Selectors
117 
118  //- Return a reference to the selected Xi model
120  (
121  const dictionary& PDRProperties,
123  const volScalarField& rho,
124  const volVectorField& U,
125  const surfaceScalarField& phi
126  );
127 
128 
129  // Constructors
130 
131  //- Construct from components
133  (
134  const dictionary& PDRProperties,
136  const volScalarField& rho,
137  const volVectorField& U,
138  const surfaceScalarField& phi
139  );
140 
141 
142  //- Destructor
143  virtual ~PDRDragModel();
144 
145 
146  // Member Functions
147 
148  //- Return true if the drag model is switched on
149  bool on() const
150  {
151  return on_;
152  }
153 
154  //- Return the momentum drag coefficient
155  virtual tmp<volSymmTensorField> Dcu() const = 0;
156 
157  //- Return the momentum drag turbulence generation rate
158  virtual tmp<volScalarField> Gk() const = 0;
159 
160  //- Inherit read from regIOobject
161  using regIOobject::read;
162 
163  //- Update properties from given dictionary
164  virtual bool read(const dictionary& PDRProperties) = 0;
165 
166  virtual bool writeData(Ostream&) const
167  {
168  return true;
169  }
170 
171  virtual void writeFields() const
172  {
174  }
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
psiuReactionThermo.H
Foam::PDRDragModel::U_
const volVectorField & U_
Definition: PDRDragModel.H:68
turbulence
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Foam::PDRDragModel::Gk
virtual tmp< volScalarField > Gk() const =0
Return the momentum drag turbulence generation rate.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::PDRDragModel::on
bool on() const
Return true if the drag model is switched on.
Definition: PDRDragModel.H:148
Foam::PDRDragModel::turbulence_
const compressible::RASModel & turbulence_
Definition: PDRDragModel.H:66
Foam::PDRDragModel::on_
bool on_
Definition: PDRDragModel.H:71
Foam::regIOobject::read
virtual bool read()
Read object.
Definition: regIOobjectRead.C:191
rho
rho
Definition: readInitialConditions.H:88
Foam::PDRDragModel::TypeName
TypeName("PDRDragModel")
Runtime type information.
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::PDRDragModel::New
static autoPtr< PDRDragModel > New(const dictionary &PDRProperties, const compressible::RASModel &turbulence, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi)
Return a reference to the selected Xi model.
Foam::PDRDragModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, PDRDragModel, dictionary,(const dictionary &PDRProperties, const compressible::RASModel &turbulence, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi),(PDRProperties, turbulence, rho, U, phi))
Foam::PDRDragModel::writeFields
virtual void writeFields() const
Definition: PDRDragModel.H:170
Foam::PDRDragModel::writeData
virtual bool writeData(Ostream &) const
Pure virtual writeData function.
Definition: PDRDragModel.H:165
Foam::PDRDragModel::rho_
const volScalarField & rho_
Definition: PDRDragModel.H:67
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:73
Foam::PDRDragModel::~PDRDragModel
virtual ~PDRDragModel()
Destructor.
Foam::compressible::RASModel
RASModel< EddyDiffusivity< turbulenceModel > > RASModel
Definition: turbulentFluidThermoModel.H:66
Foam::PDRDragModel::Dcu
virtual tmp< volSymmTensorField > Dcu() const =0
Return the momentum drag coefficient.
multivariateSurfaceInterpolationScheme.H
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::PDRDragModel::PDRDragModelCoeffs_
dictionary PDRDragModelCoeffs_
Definition: PDRDragModel.H:64
Foam::PDRDragModel
Base-class for sub-grid obstacle drag models. The available drag model is at basic....
Definition: PDRDragModel.H:55
Foam::PDRDragModel::phi_
const surfaceScalarField & phi_
Definition: PDRDragModel.H:69
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::GeometricField< scalar, fvPatchField, volMesh >
turbulentFluidThermoModel.H