linearDamper.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) 2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::RBD::restraints::linearDamper
28
29Group
30 grpRigidBodyDynamicsRestraints
31
32Description
33 Linear damper restraint. Operates in the local frame of the body.
34
35SourceFiles
36 linearDamper.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef RBD_restraints_linearDamper_H
41#define RBD_restraints_linearDamper_H
42
43#include "rigidBodyRestraint.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49namespace RBD
50{
51namespace restraints
52{
53
54/*---------------------------------------------------------------------------*\
55 Class linearDamper Declaration
56\*---------------------------------------------------------------------------*/
58class linearDamper
59:
60 public restraint
61{
62 // Private data
63
64 //- Damping coefficient [Ns/m]
65 scalar coeff_;
66
67
68public:
69
70 //- Runtime type information
71 TypeName("linearDamper");
72
73
74 // Constructors
75
76 //- Construct from components
78 (
79 const word& name,
80 const dictionary& dict,
81 const rigidBodyModel& model
82 );
83
84 //- Construct and return a clone
85 virtual autoPtr<restraint> clone() const
86 {
88 (
89 new linearDamper(*this)
90 );
91 }
92
93
94 //- Destructor
95 virtual ~linearDamper();
96
97
98 // Member Functions
99
100 //- Accumulate the restraint internal joint forces into the tau field and
101 // external forces into the fx field
102 virtual void restrain
103 (
104 scalarField& tau,
106 const rigidBodyModelState& state
107 ) const;
108
109 //- Update properties from given dictionary
110 virtual bool read(const dictionary& dict);
111
112 //- Write
113 virtual void write(Ostream&) const;
114};
115
116
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119} // End namespace restraints
120} // End namespace RBD
121} // End namespace Foam
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125#endif
126
127// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Base class for defining restraints for rigid-body dynamics.
const word & name() const
Return the name.
Linear damper restraint. Operates in the local frame of the body.
Definition: linearDamper.H:60
virtual ~linearDamper()
Destructor.
Definition: linearDamper.C:70
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
Definition: linearDamper.C:96
virtual void restrain(scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
Accumulate the restraint internal joint forces into the tau field and.
Definition: linearDamper.C:77
virtual autoPtr< restraint > clone() const
Construct and return a clone.
Definition: linearDamper.H:84
TypeName("linearDamper")
Runtime type information.
Holds the motion state of rigid-body model.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73