linearAxialAngularSpring.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-2013 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::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring
28 
29 Description
30  sixDoFRigidBodyMotionRestraints model. Linear axial angular spring.
31 
32 SourceFiles
33  linearAxialAngularSpring.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef linearAxialAngularSpring_H
38 #define linearAxialAngularSpring_H
39 
41 #include "point.H"
42 #include "tensor.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 namespace sixDoFRigidBodyMotionRestraints
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class linearAxialAngularSpring Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
59 {
60  // Private data
61 
62  //- Reference orientation where there is no moment
63  tensor refQ_;
64 
65  //- Global unit axis around which the motion is sprung
66  vector axis_;
67 
68  //- Spring stiffness coefficient (Nm/rad)
69  scalar stiffness_;
70 
71  //- Damping coefficient (Nms/rad)
72  scalar damping_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("linearAxialAngularSpring");
79 
80 
81  // Constructors
82 
83  //- Construct from components
85  (
86  const word& name,
87  const dictionary& sDoFRBMRDict
88  );
89 
90  //- Construct and return a clone
92  {
94  (
95  new linearAxialAngularSpring(*this)
96  );
97  }
98 
99 
100  //- Destructor
101  virtual ~linearAxialAngularSpring();
102 
103 
104  // Member Functions
105 
106  //- Calculate the restraint position, force and moment.
107  // Global reference frame vectors.
108  virtual void restrain
109  (
110  const sixDoFRigidBodyMotion& motion,
111  vector& restraintPosition,
112  vector& restraintForce,
113  vector& restraintMoment
114  ) const;
115 
116  //- Update properties from given dictionary
117  virtual bool read(const dictionary& sDoFRBMRCoeff);
118 
119  //- Write
120  virtual void write(Ostream&) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace solidBodyMotionFunctions
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::sixDoFRigidBodyMotionRestraint::name
const word & name() const
Return the name.
Definition: sixDoFRigidBodyMotionRestraint.H:128
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
point.H
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::linearAxialAngularSpring
linearAxialAngularSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
Definition: linearAxialAngularSpring.C:56
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::restrain
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
Definition: linearAxialAngularSpring.C:82
tensor.H
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::clone
virtual autoPtr< sixDoFRigidBodyMotionRestraint > clone() const
Construct and return a clone.
Definition: linearAxialAngularSpring.H:90
Foam::sixDoFRigidBodyMotionRestraint
Base class for defining restraints for sixDoF motions.
Definition: sixDoFRigidBodyMotionRestraint.H:66
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::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::sixDoFRigidBodyMotion
Six degree of freedom motion for a rigid body.
Definition: sixDoFRigidBodyMotion.H:69
Foam::Vector< scalar >
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::read
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
Definition: linearAxialAngularSpring.C:148
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring
sixDoFRigidBodyMotionRestraints model. Linear axial angular spring.
Definition: linearAxialAngularSpring.H:55
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::TypeName
TypeName("linearAxialAngularSpring")
Runtime type information.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::~linearAxialAngularSpring
virtual ~linearAxialAngularSpring()
Destructor.
Definition: linearAxialAngularSpring.C:74
sixDoFRigidBodyMotionRestraint.H
Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::write
virtual void write(Ostream &) const
Write.
Definition: linearAxialAngularSpring.C:188