ParticleErosion.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-2016 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::ParticleErosion
26 
27 Description
28  Creates particle erosion field, Q
29 
30 SourceFiles
31  ParticleErosion.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef ParticleErosion_H
36 #define ParticleErosion_H
37 
38 #include "CloudFunctionObject.H"
39 #include "volFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class ParticleErosion Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class CloudType>
51 class ParticleErosion
52 :
53  public CloudFunctionObject<CloudType>
54 {
55  // Private Data
56 
57  // Typedefs
58 
59  //- Convenience typedef for parcel type
60  typedef typename CloudType::parcelType parcelType;
61 
62 
63  //- Particle erosion field
65 
66  //- List of patch indices to post-process
67  labelList patchIDs_;
68 
69  //- Plastic flow stress - typical metal value = 2.7 GPa
70  scalar p_;
71 
72  //- Ratio between depth of contact and length of cut - default=2
73  scalar psi_;
74 
75  //- Ratio of normal and tangential forces - default=2
76  scalar K_;
77 
78 
79 protected:
80 
81  // Protected Member Functions
82 
83  //- Returns local patchi if patch is in patchIds_ list
84  label applyToPatch(const label globalPatchi) const;
85 
86  //- Write post-processing info
87  virtual void write();
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("particleErosion");
94 
95 
96  // Constructors
97 
98  //- Construct from dictionary
100  (
101  const dictionary& dict,
102  CloudType& owner,
103  const word& modelName
104  );
105 
106  //- Construct copy
108 
109  //- Construct and return a clone
111  {
113  (
114  new ParticleErosion<CloudType>(*this)
115  );
116  }
117 
118 
119  //- Destructor
120  virtual ~ParticleErosion();
121 
122 
123  // Member Functions
124 
125  // Evaluation
126 
127  //- Pre-evolve hook
128  virtual void preEvolve();
129 
130  //- Post-patch hook
131  virtual void postPatch
132  (
133  const parcelType& p,
134  const polyPatch& pp,
135  const scalar trackFraction,
136  const tetIndices& tetIs,
137  bool& keepParticle
138  );
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #ifdef NoRepository
149  #include "ParticleErosion.C"
150 #endif
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
ParticleErosion(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
Creates particle erosion field, Q.
virtual void preEvolve()
Pre-evolve hook.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
virtual ~ParticleErosion()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
virtual void write()
Write post-processing info.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
Definition: tetIndices.H:81
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
const CloudType & owner() const
Return const access to the owner cloud.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Templated cloud function object base class.
label applyToPatch(const label globalPatchi) const
Returns local patchi if patch is in patchIds_ list.
Namespace for OpenFOAM.
virtual void postPatch(const parcelType &p, const polyPatch &pp, const scalar trackFraction, const tetIndices &tetIs, bool &keepParticle)
Post-patch hook.
TypeName("particleErosion")
Runtime type information.