sixDoFRigidBodyMotion::axialAngularSpring: Function1 based replacement for tabulatedAxialAngularSpring
axialAngularSpring uses a Function1 for the angular spring moment and linear damping. Tabulated data is supported using the 'table' Function1.
This commit is contained in:
@ -10,7 +10,7 @@ $(restraints)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C
|
|||||||
$(restraints)/linearAxialAngularSpring/linearAxialAngularSpring.C
|
$(restraints)/linearAxialAngularSpring/linearAxialAngularSpring.C
|
||||||
$(restraints)/linearSpring/linearSpring.C
|
$(restraints)/linearSpring/linearSpring.C
|
||||||
$(restraints)/sphericalAngularSpring/sphericalAngularSpring.C
|
$(restraints)/sphericalAngularSpring/sphericalAngularSpring.C
|
||||||
$(restraints)/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
|
$(restraints)/axialAngularSpring/axialAngularSpring.C
|
||||||
$(restraints)/linearDamper/linearDamper.C
|
$(restraints)/linearDamper/linearDamper.C
|
||||||
$(restraints)/sphericalAngularDamper/sphericalAngularDamper.C
|
$(restraints)/sphericalAngularDamper/sphericalAngularDamper.C
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "tabulatedAxialAngularSpring.H"
|
#include "axialAngularSpring.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "sixDoFRigidBodyMotion.H"
|
#include "sixDoFRigidBodyMotion.H"
|
||||||
#include "transform.H"
|
#include "transform.H"
|
||||||
@ -35,12 +35,12 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace sixDoFRigidBodyMotionRestraints
|
namespace sixDoFRigidBodyMotionRestraints
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(tabulatedAxialAngularSpring, 0);
|
defineTypeNameAndDebug(axialAngularSpring, 0);
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
addToRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
sixDoFRigidBodyMotionRestraint,
|
sixDoFRigidBodyMotionRestraint,
|
||||||
tabulatedAxialAngularSpring,
|
axialAngularSpring,
|
||||||
dictionary
|
dictionary
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -49,8 +49,8 @@ namespace sixDoFRigidBodyMotionRestraints
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::
|
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::
|
||||||
tabulatedAxialAngularSpring
|
axialAngularSpring
|
||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const dictionary& sDoFRBMRDict
|
const dictionary& sDoFRBMRDict
|
||||||
@ -69,15 +69,15 @@ tabulatedAxialAngularSpring
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::
|
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::
|
||||||
~tabulatedAxialAngularSpring()
|
~axialAngularSpring()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void
|
void
|
||||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
|
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::restrain
|
||||||
(
|
(
|
||||||
const sixDoFRigidBodyMotion& motion,
|
const sixDoFRigidBodyMotion& motion,
|
||||||
vector& restraintPosition,
|
vector& restraintPosition,
|
||||||
@ -142,7 +142,7 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
|
bool Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::read
|
||||||
(
|
(
|
||||||
const dictionary& sDoFRBMRDict
|
const dictionary& sDoFRBMRDict
|
||||||
)
|
)
|
||||||
@ -175,10 +175,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
moment_.reset
|
moment_ = Function1<scalar>::New("moment", sDoFRBMRCoeffs_);
|
||||||
(
|
|
||||||
new Function1s::Table<scalar>("moment", sDoFRBMRCoeffs_)
|
|
||||||
);
|
|
||||||
|
|
||||||
const word angleFormat = sDoFRBMRCoeffs_.lookup("angleFormat");
|
const word angleFormat = sDoFRBMRCoeffs_.lookup("angleFormat");
|
||||||
|
|
||||||
@ -203,7 +200,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::write
|
void Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::write
|
||||||
(
|
(
|
||||||
Ostream& os
|
Ostream& os
|
||||||
) const
|
) const
|
||||||
@ -22,19 +22,19 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring
|
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring
|
||||||
|
|
||||||
Description
|
Description
|
||||||
sixDoFRigidBodyMotionRestraints model. Axial angular spring with moment
|
Axial angular spring with moment values obtained from a Function1 and
|
||||||
values drawn from an interpolation table. Linear damping.
|
linear damping.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
tabulatedAxialAngularSpring.C
|
axialAngularSpring.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef tabulatedAxialAngularSpring_H
|
#ifndef axialAngularSpring_H
|
||||||
#define tabulatedAxialAngularSpring_H
|
#define axialAngularSpring_H
|
||||||
|
|
||||||
#include "sixDoFRigidBodyMotionRestraint.H"
|
#include "sixDoFRigidBodyMotionRestraint.H"
|
||||||
#include "point.H"
|
#include "point.H"
|
||||||
@ -50,10 +50,10 @@ namespace sixDoFRigidBodyMotionRestraints
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class tabulatedAxialAngularSpring Declaration
|
Class axialAngularSpring Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class tabulatedAxialAngularSpring
|
class axialAngularSpring
|
||||||
:
|
:
|
||||||
public sixDoFRigidBodyMotionRestraint
|
public sixDoFRigidBodyMotionRestraint
|
||||||
{
|
{
|
||||||
@ -66,7 +66,7 @@ class tabulatedAxialAngularSpring
|
|||||||
vector axis_;
|
vector axis_;
|
||||||
|
|
||||||
//- Spring moment as a function of angle
|
//- Spring moment as a function of angle
|
||||||
autoPtr<Function1s::Table<scalar>> moment_;
|
autoPtr<Function1<scalar>> moment_;
|
||||||
|
|
||||||
//- Boolean stating whether the angle around the axis needs to
|
//- Boolean stating whether the angle around the axis needs to
|
||||||
// be converted to degrees before evaluating the moment function
|
// be converted to degrees before evaluating the moment function
|
||||||
@ -79,13 +79,13 @@ class tabulatedAxialAngularSpring
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("tabulatedAxialAngularSpring");
|
TypeName("axialAngularSpring");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
tabulatedAxialAngularSpring
|
axialAngularSpring
|
||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const dictionary& sDoFRBMRDict
|
const dictionary& sDoFRBMRDict
|
||||||
@ -96,13 +96,13 @@ public:
|
|||||||
{
|
{
|
||||||
return autoPtr<sixDoFRigidBodyMotionRestraint>
|
return autoPtr<sixDoFRigidBodyMotionRestraint>
|
||||||
(
|
(
|
||||||
new tabulatedAxialAngularSpring(*this)
|
new axialAngularSpring(*this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~tabulatedAxialAngularSpring();
|
virtual ~axialAngularSpring();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
Reference in New Issue
Block a user