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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::ParticleErosion
29 
30 Group
31  grpLagrangianIntermediateFunctionObjects
32 
33 Description
34  Creates particle erosion field, Q
35 
36 SourceFiles
37  ParticleErosion.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef ParticleErosion_H
42 #define ParticleErosion_H
43 
44 #include "CloudFunctionObject.H"
45 #include "volFields.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class ParticleErosion Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class CloudType>
57 class ParticleErosion
58 :
59  public CloudFunctionObject<CloudType>
60 {
61  // Private Data
62 
63  // Typedefs
64 
65  //- Convenience typedef for parcel type
66  typedef typename CloudType::parcelType parcelType;
67 
68 
69  //- Particle erosion field
71 
72  //- List of patch indices to post-process
73  labelList patchIDs_;
74 
75  //- Plastic flow stress - typical metal value = 2.7 GPa
76  scalar p_;
77 
78  //- Ratio between depth of contact and length of cut - default=2
79  scalar psi_;
80 
81  //- Ratio of normal and tangential forces - default=2
82  scalar K_;
83 
84 
85 protected:
86 
87  // Protected Member Functions
88 
89  //- Create|read|reset the Q field
90  void resetQ();
91 
92  //- Returns local patchi if patch is in patchIds_ list
93  label applyToPatch(const label globalPatchi) const;
94 
95  //- Write post-processing info
96  virtual void write();
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("particleErosion");
103 
104 
105  // Constructors
106 
107  //- Construct from dictionary
109  (
110  const dictionary& dict,
111  CloudType& owner,
112  const word& modelName
113  );
114 
115  //- Construct copy
117 
118  //- Construct and return a clone
120  {
122  (
123  new ParticleErosion<CloudType>(*this)
124  );
125  }
126 
127 
128  //- Destructor
129  virtual ~ParticleErosion() = default;
130 
131 
132  // Member Functions
133 
134  // Evaluation
135 
136  //- Pre-evolve hook
137  virtual void preEvolve
138  (
139  const typename parcelType::trackingData& td
140  );
141 
142  //- Post-patch hook
143  virtual void postPatch
144  (
145  const parcelType& p,
146  const polyPatch& pp,
147  bool& keepParticle
148  );
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
159  #include "ParticleErosion.C"
160 #endif
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
volFields.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::ParticleErosion::applyToPatch
label applyToPatch(const label globalPatchi) const
Returns local patchi if patch is in patchIds_ list.
Definition: ParticleErosion.C:66
Foam::ParticleErosion::clone
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: ParticleErosion.H:118
Foam::ParticleErosion::TypeName
TypeName("particleErosion")
Runtime type information.
Foam::ParticleErosion::write
virtual void write()
Write post-processing info.
Definition: ParticleErosion.C:75
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
CloudFunctionObject.H
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:68
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:123
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:163
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::ParticleErosion::preEvolve
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
Definition: ParticleErosion.C:153
Foam::List< label >
Foam::CloudFunctionObject
Templated cloud function object base class.
Definition: CloudFunctionObject.H:62
Foam::ParticleErosion::resetQ
void resetQ()
Create|read|reset the Q field.
Definition: ParticleErosion.C:34
Foam::ParticleErosion::~ParticleErosion
virtual ~ParticleErosion()=default
Destructor.
Foam::ParticleErosion
Creates particle erosion field, Q.
Definition: ParticleErosion.H:56
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:93
ParticleErosion.C