DispersionRASModel.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-2016 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::DispersionRASModel
28 
29 Description
30  Base class for particle dispersion models based on RAS turbulence.
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef DispersionRASModel_H
35 #define DispersionRASModel_H
36 
37 #include "DispersionModel.H"
38 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class DispersionRASModel Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class CloudType>
51 :
52  public DispersionModel<CloudType>
53 {
54 protected:
55 
56  // Protected data
57 
58  // Locally cached turbulence fields
59 
60  //- Turbulence k
61  const volScalarField* kPtr_;
62 
63  //- Take ownership of the k field
64  mutable bool ownK_;
65 
66  //- Turbulence epsilon
68 
69  //- Take ownership of the epsilon field
70  mutable bool ownEpsilon_;
71 
72 
73  // Protected Functions
74 
75  //- Return the k field from the turbulence model
77 
78  //- Return the epsilon field from the turbulence model
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("dispersionRASModel");
86 
87 
88  // Constructors
89 
90  //- Construct from components
92 
93  //- Construct copy
95 
96  //- Construct and return a clone
97  virtual autoPtr<DispersionModel<CloudType>> clone() const = 0;
98 
99 
100  //- Destructor
101  virtual ~DispersionRASModel();
102 
103 
104  // Member Functions
105 
106  //- Update (disperse particles)
107  virtual vector update
108  (
109  const scalar dt,
110  const label celli,
111  const vector& U,
112  const vector& Uc,
113  vector& UTurb,
114  scalar& tTurb
115  ) = 0;
116 
117  //- Cache carrier fields
118  virtual void cacheFields(const bool store);
119 
120 
121  // I-O
122 
123  //- Write
124  virtual void write(Ostream& os) const;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #ifdef NoRepository
135  #include "DispersionRASModel.C"
136 #endif
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::DispersionModel
Base class for dispersion modelling.
Definition: KinematicCloud.H:86
Foam::DispersionRASModel::epsilonPtr_
const volScalarField * epsilonPtr_
Turbulence epsilon.
Definition: DispersionRASModel.H:66
Foam::DispersionRASModel::write
virtual void write(Ostream &os) const
Write.
Definition: DispersionRASModel.C:181
Foam::DispersionRASModel::DispersionRASModel
DispersionRASModel(const dictionary &dict, CloudType &owner)
Construct from components.
Definition: DispersionRASModel.C:94
Foam::DispersionRASModel::kPtr_
const volScalarField * kPtr_
Turbulence k.
Definition: DispersionRASModel.H:60
Foam::DispersionRASModel::cacheFields
virtual void cacheFields(const bool store)
Cache carrier fields.
Definition: DispersionRASModel.C:136
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::DispersionRASModel::kModel
tmp< volScalarField > kModel() const
Return the k field from the turbulence model.
Definition: DispersionRASModel.C:36
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::DispersionRASModel::ownEpsilon_
bool ownEpsilon_
Take ownership of the epsilon field.
Definition: DispersionRASModel.H:69
DispersionModel.H
Foam::DispersionRASModel::clone
virtual autoPtr< DispersionModel< CloudType > > clone() const =0
Construct and return a clone.
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::DispersionRASModel::~DispersionRASModel
virtual ~DispersionRASModel()
Destructor.
Definition: DispersionRASModel.C:127
DispersionRASModel.C
Foam::Vector< scalar >
Foam::DispersionRASModel::ownK_
bool ownK_
Take ownership of the k field.
Definition: DispersionRASModel.H:63
Foam::DispersionRASModel::TypeName
TypeName("dispersionRASModel")
Runtime type information.
Foam::DispersionRASModel::update
virtual vector update(const scalar dt, const label celli, const vector &U, const vector &Uc, vector &UTurb, scalar &tTurb)=0
Update (disperse particles)
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 >
Foam::DispersionRASModel
Base class for particle dispersion models based on RAS turbulence.
Definition: DispersionRASModel.H:49
Foam::DispersionRASModel::epsilonModel
tmp< volScalarField > epsilonModel() const
Return the epsilon field from the turbulence model.
Definition: DispersionRASModel.C:64