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 | 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::PressureGradientForce
28 
29 Group
30  grpLagrangianIntermediateForceSubModels
31 
32 Description
33  Calculates particle pressure gradient force
34 
35 SourceFiles
36  PressureGradientForceI.H
37  PressureGradientForce.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef PressureGradientForce_H
42 #define PressureGradientForce_H
43 
44 #include "ParticleForce.H"
45 #include "volFields.H"
46 #include "interpolation.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class PressureGradientForce Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class CloudType>
59 :
60  public ParticleForce<CloudType>
61 {
62 protected:
63 
64  // Protected data
65 
66  //- Name of velocity field
67  const word UName_;
68 
69  //- Rate of change of carrier phase velocity interpolator
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("pressureGradient");
77 
78 
79  // Constructors
80 
81  //- Construct from mesh
83  (
85  const fvMesh& mesh,
86  const dictionary& dict,
87  const word& forceType = typeName
88  );
89 
90  //- Construct copy
92 
93  //- Construct and return a clone
95  {
97  (
99  );
100  }
101 
102 
103  //- Destructor
104  virtual ~PressureGradientForce();
105 
106 
107  // Member Functions
108 
109  // Access
110 
111  //- Return the rate of change of carrier phase velocity interpolator
112  inline const interpolation<vector>& DUcDtInterp() const;
113 
114 
115  // Evaluation
116 
117  //- Cache fields
118  virtual void cacheFields(const bool store);
119 
120  //- Calculate the non-coupled force
121  virtual forceSuSp calcCoupled
122  (
123  const typename CloudType::parcelType& p,
124  const typename CloudType::parcelType::trackingData& td,
125  const scalar dt,
126  const scalar mass,
127  const scalar Re,
128  const scalar muc
129  ) const;
130 
131  //- Return the added mass
132  virtual scalar massAdd
133  (
134  const typename CloudType::parcelType& p,
135  const typename CloudType::parcelType::trackingData& td,
136  const scalar mass
137  ) const;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #include "PressureGradientForceI.H"
148 
149 #ifdef NoRepository
150  #include "PressureGradientForce.C"
151 #endif
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
volFields.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::ParticleForce::owner
const CloudType & owner() const
Return const access to the cloud owner.
Definition: ParticleForceI.H:31
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::PressureGradientForce::PressureGradientForce
PressureGradientForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict, const word &forceType=typeName)
Construct from mesh.
Definition: PressureGradientForce.C:37
Foam::PressureGradientForce::~PressureGradientForce
virtual ~PressureGradientForce()
Destructor.
Definition: PressureGradientForce.C:65
Foam::PressureGradientForce::DUcDtInterpPtr_
autoPtr< interpolation< vector > > DUcDtInterpPtr_
Rate of change of carrier phase velocity interpolator.
Definition: PressureGradientForce.H:69
interpolation.H
Foam::PressureGradientForce::cacheFields
virtual void cacheFields(const bool store)
Cache fields.
Definition: PressureGradientForce.C:72
Foam::PressureGradientForce
Calculates particle pressure gradient force.
Definition: PressureGradientForce.H:57
Foam::PressureGradientForce::calcCoupled
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.
Definition: PressureGradientForce.C:123
Foam::PressureGradientForce::TypeName
TypeName("pressureGradient")
Runtime type information.
Foam::forceSuSp
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:64
Foam::ParticleForce
Abstract base class for particle forces.
Definition: ParticleForce.H:59
ParticleForce.H
Foam::PressureGradientForce::UName_
const word UName_
Name of velocity field.
Definition: PressureGradientForce.H:66
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::interpolation
Abstract base class for interpolation.
Definition: mappedPatchFieldBase.H:96
PressureGradientForce.C
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
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PressureGradientForce::clone
virtual autoPtr< ParticleForce< CloudType > > clone() const
Construct and return a clone.
Definition: PressureGradientForce.H:93
Foam::PressureGradientForce::DUcDtInterp
const interpolation< vector > & DUcDtInterp() const
Return the rate of change of carrier phase velocity interpolator.
Definition: PressureGradientForceI.H:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
PressureGradientForceI.H
Foam::ParticleForce::mesh
const fvMesh & mesh() const
Return the mesh database.
Definition: ParticleForceI.H:45
Foam::PressureGradientForce::massAdd
virtual scalar massAdd(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar mass) const
Return the added mass.
Definition: PressureGradientForce.C:145