Angular damper rotational restraint

This commit is contained in:
Vuko Vukcevic 2017-03-10 12:58:14 +01:00 committed by Hrvoje Jasak
parent 704829a15e
commit e7fd51dc97
3 changed files with 230 additions and 0 deletions

View file

@ -25,6 +25,7 @@ $(sixDOF)/sixDOFODE/constraints/translationalConstraints/periodicOscillation/per
$(sixDOF)/sixDOFODE/restraints/translationalRestraints/translationalRestraint/translationalRestraint.C $(sixDOF)/sixDOFODE/restraints/translationalRestraints/translationalRestraint/translationalRestraint.C
$(sixDOF)/sixDOFODE/restraints/translationalRestraints/linearSpringDamper/linearSpringDamper.C $(sixDOF)/sixDOFODE/restraints/translationalRestraints/linearSpringDamper/linearSpringDamper.C
$(sixDOF)/sixDOFODE/restraints/rotationalRestraints/rotationalRestraint/rotationalRestraint.C $(sixDOF)/sixDOFODE/restraints/rotationalRestraints/rotationalRestraint/rotationalRestraint.C
$(sixDOF)/sixDOFODE/restraints/rotationalRestraints/angularDamper/angularDamper.C
$(sixDOF)/sixDOFODE/sixDOFODE.C $(sixDOF)/sixDOFODE/sixDOFODE.C
$(sixDOF)/sixDOFODE/newSixDOFODE.C $(sixDOF)/sixDOFODE/newSixDOFODE.C

View file

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "angularDamper.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(angularDamper, 0);
addToRunTimeSelectionTable
(
rotationalRestraint,
angularDamper,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::angularDamper::angularDamper
(
const word& name,
const dictionary& dict
)
:
rotationalRestraint(name, dict),
angDampingCoeffs_(dict.lookup("angularDamping")),
inGlobal_(dict.lookup("inGlobalCoordinateSystem"))
{}
Foam::autoPtr<Foam::rotationalRestraint>
Foam::angularDamper::clone() const
{
return autoPtr<rotationalRestraint>
(
new angularDamper(*this)
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::angularDamper::~angularDamper()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::vector Foam::angularDamper::restrainingMoment
(
const scalar,
const tensor& toRelative,
const vector& omega
) const
{
vector rm;
if (inGlobal_)
{
// Restraint given in global (inertial) coordinate system, transform it
// to local
rm = (toRelative & angDampingCoeffs_) & omega;
}
else
{
// Restraint already in local (body) coordinate system
rm = angDampingCoeffs_ & omega;
}
return -rm;
}
void Foam::angularDamper::write(Ostream& os) const
{
os.writeKeyword("type") << tab << type()
<< token::END_STATEMENT << nl << nl;
os.writeKeyword("angularDamping") << tab << angDampingCoeffs_
<< token::END_STATEMENT << nl;
os.writeKeyword("inGlobalCoordinateSystem") << tab << inGlobal_
<< token::END_STATEMENT << endl;
}
// ************************************************************************* //

View file

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::angularDamper
Description
Rotational restraint corresponding to angular damper defined by angular
damping coefficients.
Author
Vuko Vukcevic, FSB Zagreb. All rights reserved.
SourceFiles
angularDamper.C
\*---------------------------------------------------------------------------*/
#ifndef angularDamper_H
#define angularDamper_H
#include "rotationalRestraint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class angularDamper Declaration
\*---------------------------------------------------------------------------*/
class angularDamper
:
public rotationalRestraint
{
// Private Data
//- Angular damping coefficients
diagTensor angDampingCoeffs_;
//- Whether the damper is applied in global or local c. s.
Switch inGlobal_;
public:
//- Runtime type information
TypeName("angularDamper");
// Constructors
//- Construct from dictionary
angularDamper
(
const word& name,
const dictionary& dict
);
//- Construct and return a clone
virtual autoPtr<rotationalRestraint> clone() const;
// Destructor
virtual ~angularDamper();
// Member Functions
// Restraint specific functions
//- Return restraining moment (in the global coordinate system)
virtual vector restrainingMoment
(
const scalar t,
const tensor& toRelative,
const vector& omega
) const;
// I-O Functions and Operators
//- Virtual write function
virtual void write(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //