PressureGradientForce.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 | Copyright (C) 2011-2013 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::PressureGradientForce
26 
27 Description
28  Calculates particle pressure gradient force
29 
30 SourceFiles
31  PressureGradientForceI.H
32  PressureGradientForce.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef PressureGradientForce_H
37 #define PressureGradientForce_H
38 
39 #include "ParticleForce.H"
40 #include "volFields.H"
41 #include "interpolation.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class PressureGradientForce Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class CloudType>
54 :
55  public ParticleForce<CloudType>
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Name of velocity field
62  const word UName_;
63 
64  //- Rate of change of carrier phase velocity interpolator
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("pressureGradient");
72 
73 
74  // Constructors
75 
76  //- Construct from mesh
78  (
80  const fvMesh& mesh,
81  const dictionary& dict,
82  const word& forceType = typeName
83  );
84 
85  //- Construct copy
87 
88  //- Construct and return a clone
89  virtual autoPtr<ParticleForce<CloudType> > clone() const
90  {
92  (
94  );
95  }
96 
97 
98  //- Destructor
99  virtual ~PressureGradientForce();
100 
101 
102  // Member Functions
103 
104  // Access
105 
106  //- Return the rate of change of carrier phase velocity interpolator
107  inline const interpolation<vector>& DUcDtInterp() const;
108 
109 
110  // Evaluation
111 
112  //- Cache fields
113  virtual void cacheFields(const bool store);
114 
115  //- Calculate the non-coupled force
116  virtual forceSuSp calcCoupled
117  (
118  const typename CloudType::parcelType& p,
119  const scalar dt,
120  const scalar mass,
121  const scalar Re,
122  const scalar muc
123  ) const;
124 
125  //- Return the added mass
126  virtual scalar massAdd
127  (
128  const typename CloudType::parcelType& p,
129  const scalar mass
130  ) const;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #include "PressureGradientForceI.H"
141 
142 #ifdef NoRepository
143  #include "PressureGradientForce.C"
144 #endif
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
const word UName_
Name of velocity field.
TypeName("pressureGradient")
Runtime type information.
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:58
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
autoPtr< interpolation< vector > > DUcDtInterpPtr_
Rate of change of carrier phase velocity interpolator.
Calculates particle pressure gradient force.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
virtual scalar massAdd(const typename CloudType::parcelType &p, const scalar mass) const
Return the added mass.
dictionary dict
A class for handling words, derived from string.
Definition: word.H:59
Abstract base class for interpolation.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
const interpolation< vector > & DUcDtInterp() const
Return the rate of change of carrier phase velocity interpolator.
virtual forceSuSp calcCoupled(const typename CloudType::parcelType &p, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the non-coupled force.
PressureGradientForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict, const word &forceType=typeName)
Construct from mesh.
virtual ~PressureGradientForce()
Destructor.
const CloudType & owner() const
Return const access to the cloud owner.
virtual void cacheFields(const bool store)
Cache fields.
virtual autoPtr< ParticleForce< CloudType > > clone() const
Construct and return a clone.
const fvMesh & mesh() const
Return the mesh database.
Abstract base class for particle forces.
Definition: ParticleForce.H:53
volScalarField & p
Definition: createFields.H:51