1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::sixDoFRigidBodyMotionRestraints::linearSpring
29 sixDoFRigidBodyMotionRestraints model. Linear spring.
34 \*---------------------------------------------------------------------------*/
36 #ifndef linearSpring_H
37 #define linearSpring_H
39 #include "sixDoFRigidBodyMotionRestraint.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace sixDoFRigidBodyMotionRestraints
50 /*---------------------------------------------------------------------------*\
51 Class linearSpring Declaration
52 \*---------------------------------------------------------------------------*/
56 public sixDoFRigidBodyMotionRestraint
60 //- Anchor point, where the spring is attached to an immovable
64 //- Reference point of attachment to the solid body
65 point refAttachmentPt_;
67 //- Spring stiffness coefficient (N/m)
70 //- Damping coefficient (Ns/m)
73 //- Rest length - length of spring when no forces are applied to it
79 //- Runtime type information
80 TypeName("linearSpring");
85 //- Construct from components
88 const dictionary& sDoFRBMRDict
91 //- Construct and return a clone
92 virtual autoPtr<sixDoFRigidBodyMotionRestraint> clone() const
94 return autoPtr<sixDoFRigidBodyMotionRestraint>
96 new linearSpring(*this)
103 virtual ~linearSpring();
108 //- Calculate the restraint position, force and moment.
109 // Global reference frame vectors.
110 virtual void restrain
112 const sixDoFRigidBodyMotion& motion,
113 vector& restraintPosition,
114 vector& restraintForce,
115 vector& restraintMoment
118 //- Update properties from given dictionary
119 virtual bool read(const dictionary& sDoFRBMRCoeff);
122 virtual void write(Ostream&) const;
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace solidBodyMotionFunctions
129 } // End namespace Foam
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 // ************************************************************************* //