PressureGradientForce.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-2018 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
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 typename CloudType::parcelType::trackingData& td,
120  const scalar dt,
121  const scalar mass,
122  const scalar Re,
123  const scalar muc
124  ) const;
125 
126  //- Return the added mass
127  virtual scalar massAdd
128  (
129  const typename CloudType::parcelType& p,
130  const typename CloudType::parcelType::trackingData& td,
131  const scalar mass
132  ) const;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #include "PressureGradientForceI.H"
143 
144 #ifdef NoRepository
145  #include "PressureGradientForce.C"
146 #endif
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
dictionary dict
virtual forceSuSp calcCoupled(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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
TypeName("pressureGradient")
Runtime type information.
const fvMesh & mesh() const
Return the mesh database.
Abstract base class for particle forces.
Definition: ParticleForce.H:53
const CloudType & owner() const
Return const access to the cloud owner.
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:61
Calculates particle pressure gradient force.
virtual void cacheFields(const bool store)
Cache fields.
A class for handling words, derived from string.
Definition: word.H:59
virtual ~PressureGradientForce()
Destructor.
const interpolation< vector > & DUcDtInterp() const
Return the rate of change of carrier phase velocity interpolator.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:215
const word UName_
Name of velocity field.
virtual scalar massAdd(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar mass) const
Return the added mass.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Abstract base class for interpolation.
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 autoPtr< ParticleForce< CloudType > > clone() const
Construct and return a clone.
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
PressureGradientForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict, const word &forceType=typeName)
Construct from mesh.
Namespace for OpenFOAM.
autoPtr< interpolation< vector > > DUcDtInterpPtr_
Rate of change of carrier phase velocity interpolator.