prescribedRotation.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) 2018 OpenCFD Ltd.
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::RBD::restraints::prescribedRotation
28 
29 Group
30  grpRigidBodyDynamicsRestraints
31 
32 Description
33  Restraint setting angular velocity of the rigid body.
34  Developed from the linear axial angular spring restraint.
35 
36  Adds a rotation along given axis to the body.
37  Used for a combination of 6DOF bodies where one is driven by 6DOF and
38  the other attached to it using specified rotation
39  in the local reference frame.
40 
41 Usage
42  \table
43  Property | Description | Required | Default value
44  referenceOrientation | Orientation | no | I
45  axis | Rotation axis (in reference) | yes |
46  omega | Angular velocity (rad/s) | yes |
47  \endtable
48 
49 SourceFiles
50  prescribedRotation.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef prescribedRotation_H
55 #define prescribedRotation_H
56 
57 #include "rigidBodyRestraint.H"
58 #include "TimeFunction1.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace RBD
65 {
66 namespace restraints
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class prescribedRotation Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class prescribedRotation
74 :
75  public restraint
76 {
77  // Private data
78 
79  //- Reference orientation where there is no moment
80  tensor refQ_;
81 
82  //- Global unit axis around which the motion is sprung
83  vector axis_;
84 
85  //- Rotational velocity [rad/sec]
86  TimeFunction1<vector> omegaSet_;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("prescribedRotation");
93 
94 
95  // Constructors
96 
97  //- Construct from components
99  (
100  const word& name,
101  const dictionary& dict,
102  const rigidBodyModel& model
103  );
104 
105  //- Construct and return a clone
106  virtual autoPtr<restraint> clone() const
107  {
108  return autoPtr<restraint>
109  (
110  new prescribedRotation(*this)
111  );
112  }
113 
114 
115  //- Destructor
116  virtual ~prescribedRotation();
117 
118 
119  // Member Functions
120 
121  //- Accumulate the retraint internal joint forces into the tau field and
122  // external forces into the fx field
123  virtual void restrain
124  (
127  const rigidBodyModelState& state
128  ) const;
129 
130  //- Update properties from given dictionary
131  virtual bool read(const dictionary& dict);
132 
133  //- Write
134  virtual void write(Ostream&) const;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace RBD
141 } // End namespace RBD
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Foam::RBD::restraint::name
const word & name() const
Return the name.
Definition: rigidBodyRestraint.H:152
Foam::Tensor< scalar >
Foam::RBD::rigidBodyModelState
Holds the motion state of rigid-body model.
Definition: rigidBodyModelState.H:67
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::TimeFunction1
Light wrapper around Function1 to provide a mechanism to update time-based entries.
Definition: ConeNozzleInjection.H:80
Foam::RBD::restraints::prescribedRotation::~prescribedRotation
virtual ~prescribedRotation()
Destructor.
Definition: prescribedRotation.C:72
Foam::RBD::restraints::prescribedRotation::TypeName
TypeName("prescribedRotation")
Runtime type information.
Foam::Field< scalar >
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::RBD::rigidBodyModel
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
Definition: rigidBodyModel.H:83
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::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::RBD::restraints::prescribedRotation::write
virtual void write(Ostream &) const
Write.
Definition: prescribedRotation.C:202
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::RBD::restraints::prescribedRotation::read
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
Definition: prescribedRotation.C:162
Foam::Vector< scalar >
Foam::RBD::restraints::prescribedRotation::prescribedRotation
prescribedRotation(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from components.
Definition: prescribedRotation.C:57
Foam::RBD::restraints::prescribedRotation::restrain
virtual void restrain(scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
Accumulate the retraint internal joint forces into the tau field and.
Definition: prescribedRotation.C:79
Foam::RBD::restraint
Base class for defining restraints for rigid-body dynamics.
Definition: rigidBodyRestraint.H:68
Foam::RBD::restraints::prescribedRotation::clone
virtual autoPtr< restraint > clone() const
Construct and return a clone.
Definition: prescribedRotation.H:125
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
TimeFunction1.H
Foam::RBD::restraints::prescribedRotation
Restraint setting angular velocity of the rigid body. Developed from the linear axial angular spring ...
Definition: prescribedRotation.H:92
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61
rigidBodyRestraint.H