PDRDragModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
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 Class
25  Foam::PDRDragModel
26 
27 Description
28  Base-class for sub-grid obstacle drag models. The available drag model is at
29  \link basic.H \endlink.
30 
31 SourceFiles
32  PDRDragModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef PDRDragModel_H
37 #define PDRDragModel_H
38 
39 #include "IOdictionary.H"
40 #include "psiuReactionThermo.H"
43 #include "runTimeSelectionTables.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class PDRDragModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class PDRDragModel
55 :
56  public regIOobject
57 {
58 
59 protected:
60 
61  // Protected data
62 
64 
68  const surfaceScalarField& phi_;
69 
70  Switch on_;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("PDRDragModel");
77 
78 
79  // Declare run-time constructor selection table
80 
82  (
83  autoPtr,
85  dictionary,
86  (
87  const dictionary& PDRProperties,
89  const volScalarField& rho,
90  const volVectorField& U,
91  const surfaceScalarField& phi
92  ),
93  (
94  PDRProperties,
95  turbulence,
96  rho,
97  U,
98  phi
99  )
100  );
101 
102 
103  // Constructors
104 
105  //- Construct from components
107  (
108  const dictionary& PDRProperties,
109  const compressible::RASModel& turbulence,
110  const volScalarField& rho,
111  const volVectorField& U,
112  const surfaceScalarField& phi
113  );
114 
115  //- Disallow default bitwise copy construction
116  PDRDragModel(const PDRDragModel&);
117 
118 
119  // Selectors
120 
121  //- Return a reference to the selected Xi model
123  (
124  const dictionary& PDRProperties,
125  const compressible::RASModel& turbulence,
126  const volScalarField& rho,
127  const volVectorField& U,
128  const surfaceScalarField& phi
129  );
130 
131 
132  //- Destructor
133  virtual ~PDRDragModel();
134 
135 
136  // Member Functions
137 
138  //- Return true if the drag model is switched on
139  bool on() const
140  {
141  return on_;
142  }
143 
144  //- Return the momentum drag coefficient
145  virtual tmp<volSymmTensorField> Dcu() const = 0;
146 
147  //- Return the momentum drag turbulence generation rate
148  virtual tmp<volScalarField> Gk() const = 0;
149 
150  //- Inherit read from regIOobject
151  using regIOobject::read;
152 
153  //- Update properties from given dictionary
154  virtual bool read(const dictionary& PDRProperties) = 0;
156  virtual bool writeData(Ostream&) const
157  {
158  return true;
159  }
161  virtual void writeFields() const
162  {
164  }
165 
166 
167  // Member Operators
168 
169  //- Disallow default bitwise assignment
170  void operator=(const PDRDragModel&) = delete;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
virtual ~PDRDragModel()
Destructor.
TypeName("PDRDragModel")
Runtime type information.
dictionary PDRDragModelCoeffs_
Definition: PDRDragModel.H:62
U
Definition: pEqn.H:72
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Base-class for sub-grid obstacle drag models. The available drag model is at basic.H.
Definition: PDRDragModel.H:53
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
const compressible::RASModel & turbulence_
Definition: PDRDragModel.H:64
const volScalarField & rho_
Definition: PDRDragModel.H:65
const volVectorField & U_
Definition: PDRDragModel.H:66
phi
Definition: correctPhi.H:3
const surfaceScalarField & phi_
Definition: PDRDragModel.H:67
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Info<< "Reading field U\"<< 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(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
void operator=(const PDRDragModel &)=delete
Disallow default bitwise assignment.
PDRDragModel(const dictionary &PDRProperties, const compressible::RASModel &turbulence, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
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.
virtual void writeFields() const
Definition: PDRDragModel.H:160
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:52
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))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual tmp< volScalarField > Gk() const =0
Return the momentum drag turbulence generation rate.
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:53
bool on() const
Return true if the drag model is switched on.
Definition: PDRDragModel.H:138
virtual bool writeData(Ostream &) const
Pure virtual writaData function.
Definition: PDRDragModel.H:155
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353
RASModel< momentumTransportModel > RASModel
Typedefs for turbulence, RAS and LES models for compressible flow based on the standard laminar trans...
Namespace for OpenFOAM.
virtual tmp< volSymmTensorField > Dcu() const =0
Return the momentum drag coefficient.