NonInertialFrameForce.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-2017 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::NonInertialFrameForce
28 
29 Group
30  grpLagrangianIntermediateForceSubModels
31 
32 Description
33  Calculates particle non-inertial reference frame force. Variable names as
34  from Landau and Lifshitz, Mechanics, 3rd Ed, p126-129.
35 
36 SourceFiles
37  NonInertialFrameForce.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef Foam_NonInertialFrameForce_H
42 #define Foam_NonInertialFrameForce_H
43 
44 #include "ParticleForce.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class NonInertialFrameForce Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class CloudType>
57 :
58  public ParticleForce<CloudType>
59 {
60  // Private Data
61 
62  //- Name of the linear acceleration field
63  word WName_;
64 
65  //- The linear acceleration of the reference frame
66  vector W_;
67 
68  //- Name of the angular velocity field
69  word omegaName_;
70 
71  //- The angular velocity of the reference frame
72  vector omega_;
73 
74  //- Name of the angular acceleration field
75  word omegaDotName_;
76 
77  //- The angular acceleration of the reference frame
78  vector omegaDot_;
79 
80  //- Name of the centre of rotation field
81  word centreOfRotationName_;
82 
83  //- The centre of rotation of the reference frame
84  vector centreOfRotation_;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("nonInertialFrame");
91 
92 
93  // Constructors
94 
95  //- Construct from mesh
97  (
99  const fvMesh& mesh,
100  const dictionary& dict
101  );
102 
103  //- Construct copy
105 
106  //- Construct and return a clone
107  virtual autoPtr<ParticleForce<CloudType>> clone() const
108  {
110  (
111  new ParticleForce<CloudType>(*this)
112  );
113  }
114 
115 
116  //- Destructor
117  virtual ~NonInertialFrameForce();
118 
119 
120  // Member Functions
121 
122  // Access
123 
124  //- Return the linear acceleration of the reference frame
125  const vector& W() const noexcept { return W_; }
127  //- Return the angular velocity of the reference frame
128  const vector& omega() const noexcept { return omega_; }
129 
130  //- Return the angular acceleration of the reference frame
131  const vector& omegaDot() const noexcept { return omegaDot_; }
132 
133  //- Return the centre of rotation of the reference frame
134  const vector& centreOfRotation() const noexcept
135  {
136  return centreOfRotation_;
137  }
138 
139 
140  // Evaluation
141 
142  //- Cache fields
143  virtual void cacheFields(const bool store);
144 
145  //- Calculate the non-coupled force
146  virtual forceSuSp calcNonCoupled
147  (
148  const typename CloudType::parcelType& p,
149  const typename CloudType::parcelType::trackingData& td,
150  const scalar dt,
151  const scalar mass,
152  const scalar Re,
153  const scalar muc
154  ) const;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #ifdef NoRepository
165  #include "NonInertialFrameForce.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void cacheFields(const bool store)
Cache fields.
virtual autoPtr< ParticleForce< CloudType > > clone() const
Construct and return a clone.
Abstract base class for particle forces.
Definition: ParticleForce.H:54
const vector & omega() const noexcept
Return the angular velocity of the reference frame.
virtual ~NonInertialFrameForce()
Destructor.
const fvMesh & mesh() const noexcept
Return the mesh database.
TypeName("nonInertialFrame")
Runtime type information.
const vector & centreOfRotation() const noexcept
Return the centre of rotation of the reference frame.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Calculates particle non-inertial reference frame force. Variable names as from Landau and Lifshitz...
NonInertialFrameForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict)
Construct from mesh.
Vector< scalar > vector
Definition: vector.H:57
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
const direction noexcept
Definition: Scalar.H:258
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Definition: complexField.C:207
const CloudType & owner() const noexcept
Return const access to the cloud owner.
virtual forceSuSp calcNonCoupled(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the non-coupled force.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
const vector & omegaDot() const noexcept
Return the angular acceleration of the reference frame.
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
const vector & W() const noexcept
Return the linear acceleration of the reference frame.
Namespace for OpenFOAM.