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