CollidingParcelI.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-2025 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 \*---------------------------------------------------------------------------*/
25 
26 #include "CollidingParcel.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ParcelType>
33 :
34  ParcelType::constantProperties(),
35  youngsModulus_(this->dict_, 0.0),
36  poissonsRatio_(this->dict_, 0.0)
37 {}
38 
39 
40 template<class ParcelType>
42 (
43  const constantProperties& cp
44 )
45 :
46  ParcelType::constantProperties(cp),
47  youngsModulus_(cp.youngsModulus_),
48  poissonsRatio_(cp.poissonsRatio_)
49 {}
50 
51 
52 template<class ParcelType>
54 (
55  const dictionary& parentDict
56 )
57 :
58  ParcelType::constantProperties(parentDict),
59  youngsModulus_(this->dict_, "youngsModulus"),
60  poissonsRatio_(this->dict_, "poissonsRatio")
61 {}
62 
63 
64 template<class ParcelType>
66 (
67  const polyMesh& mesh,
68  const barycentric& coordinates,
69  const label celli,
70  const label tetFacei,
71  const label tetPti,
72  const label facei
73 )
74 :
75  ParcelType(mesh, coordinates, celli, tetFacei, tetPti, facei),
76  f_(Zero),
78  torque_(Zero),
80 {}
81 
82 
83 template<class ParcelType>
85 (
86  const meshSearch& searchEngine,
87  const vector& position,
88  const label celli,
89  label& nLocateBoundaryHits
90 )
91 :
92  ParcelType(searchEngine, position, celli, nLocateBoundaryHits),
93  f_(Zero),
94  angularMomentum_(Zero),
95  torque_(Zero),
96  collisionRecords_()
97 {}
98 
99 
100 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
101 
102 template<class ParcelType>
103 inline Foam::scalar
105 {
106  return youngsModulus_.value();
107 }
108 
109 
110 template<class ParcelType>
111 inline Foam::scalar
113 {
114  return poissonsRatio_.value();
115 }
116 
117 
118 // * * * * * * * * * * CollidingParcel Member Functions * * * * * * * * * * //
119 
120 template<class ParcelType>
122 {
123  return f_;
124 }
125 
126 
127 template<class ParcelType>
128 inline const Foam::vector&
130 {
131  return angularMomentum_;
132 }
133 
134 
135 template<class ParcelType>
137 {
138  return torque_;
139 }
140 
141 
142 template<class ParcelType>
143 inline const Foam::collisionRecordList&
145 {
146  return collisionRecords_;
147 }
148 
149 
150 template<class ParcelType>
152 {
153  return f_;
154 }
155 
156 
157 template<class ParcelType>
159 {
160  return angularMomentum_;
161 }
162 
163 
164 template<class ParcelType>
166 {
167  return torque_;
168 }
169 
170 
171 template<class ParcelType>
174 {
175  return collisionRecords_;
176 }
177 
178 
179 template<class ParcelType>
181 {
182  return angularMomentum_/this->momentOfInertia();
183 }
184 
185 
186 // ************************************************************************* //
Class to hold thermo particle constant properties.
scalar youngsModulus() const
Return const access to Young's Modulus.
scalar poissonsRatio() const
Return const access to Poisson's ratio.
const vector & angularMomentum() const
Return const access to angular momentum.
vector f_
Force on particle due to collisions [N].
CollidingParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti, const label facei)
Construct from mesh, coordinates and topology.
vector omega() const
Particle angular velocity.
const vector & f() const
Return const access to force.
collisionRecordList collisionRecords_
Particle collision records.
const vector & torque() const
Return const access to torque.
vector angularMomentum_
Angular momentum of Parcel in global reference frame [kg m2/s].
const collisionRecordList & collisionRecords() const
Return const access to the collision records.
vector torque_
Torque on particle due to collisions in global.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh object that implements searches within the local cells and faces.
Definition: meshSearch.H:59
Calculates the inertia tensor and principal axes and moments of a polyhedra/cells/triSurfaces....
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
barycentric coordinates(const polyMesh &mesh, const point &position, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the coordinates given the position and tet topology.
Definition: tracking.C:1258
point position(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the position given the coordinates and tet topology.
Definition: trackingI.H:224
static const zero Zero
Definition: zero.H:97
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
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
Definition: POSIX.C:753