mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
sixDoFRigidBodyMotion: support acceleration relaxation and damping
This commit is contained in:
@ -175,6 +175,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion()
|
|||||||
momentOfInertia_(diagTensor::one*VSMALL),
|
momentOfInertia_(diagTensor::one*VSMALL),
|
||||||
mass_(VSMALL),
|
mass_(VSMALL),
|
||||||
aRelax_(1.0),
|
aRelax_(1.0),
|
||||||
|
aDamp_(1.0),
|
||||||
report_(false)
|
report_(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -192,6 +193,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
|
|||||||
const tensor& initialQ,
|
const tensor& initialQ,
|
||||||
const diagTensor& momentOfInertia,
|
const diagTensor& momentOfInertia,
|
||||||
scalar aRelax,
|
scalar aRelax,
|
||||||
|
scalar aDamp,
|
||||||
bool report
|
bool report
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
@ -215,6 +217,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
|
|||||||
momentOfInertia_(momentOfInertia),
|
momentOfInertia_(momentOfInertia),
|
||||||
mass_(mass),
|
mass_(mass),
|
||||||
aRelax_(aRelax),
|
aRelax_(aRelax),
|
||||||
|
aDamp_(aDamp),
|
||||||
report_(report)
|
report_(report)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -239,6 +242,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion(const dictionary& dict)
|
|||||||
momentOfInertia_(dict.lookup("momentOfInertia")),
|
momentOfInertia_(dict.lookup("momentOfInertia")),
|
||||||
mass_(readScalar(dict.lookup("mass"))),
|
mass_(readScalar(dict.lookup("mass"))),
|
||||||
aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)),
|
aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)),
|
||||||
|
aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)),
|
||||||
report_(dict.lookupOrDefault<Switch>("report", false))
|
report_(dict.lookupOrDefault<Switch>("report", false))
|
||||||
{
|
{
|
||||||
addRestraints(dict);
|
addRestraints(dict);
|
||||||
@ -264,6 +268,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
|
|||||||
momentOfInertia_(sDoFRBM.momentOfInertia_),
|
momentOfInertia_(sDoFRBM.momentOfInertia_),
|
||||||
mass_(sDoFRBM.mass_),
|
mass_(sDoFRBM.mass_),
|
||||||
aRelax_(sDoFRBM.aRelax_),
|
aRelax_(sDoFRBM.aRelax_),
|
||||||
|
aDamp_(sDoFRBM.aDamp_),
|
||||||
report_(sDoFRBM.report_)
|
report_(sDoFRBM.report_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -375,8 +380,8 @@ void Foam::sixDoFRigidBodyMotion::updatePosition
|
|||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
v() = v0() + 0.5*deltaT0*a();
|
v() = v0() + aDamp_*0.5*deltaT0*a();
|
||||||
pi() = pi0() + 0.5*deltaT0*tau();
|
pi() = pi0() + aDamp_*0.5*deltaT0*tau();
|
||||||
|
|
||||||
// Leapfrog move part
|
// Leapfrog move part
|
||||||
centreOfMass() = centreOfMass0() + deltaT*v();
|
centreOfMass() = centreOfMass0() + deltaT*v();
|
||||||
@ -426,8 +431,8 @@ void Foam::sixDoFRigidBodyMotion::updateAcceleration
|
|||||||
applyConstraints(deltaT);
|
applyConstraints(deltaT);
|
||||||
|
|
||||||
// Correct velocities
|
// Correct velocities
|
||||||
v() += 0.5*deltaT*a();
|
v() += aDamp_*0.5*deltaT*a();
|
||||||
pi() += 0.5*deltaT*tau();
|
pi() += aDamp_*0.5*deltaT*tau();
|
||||||
|
|
||||||
if (report_)
|
if (report_)
|
||||||
{
|
{
|
||||||
@ -446,8 +451,8 @@ void Foam::sixDoFRigidBodyMotion::updateVelocity(scalar deltaT)
|
|||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
v() += 0.5*deltaT*a();
|
v() += aDamp_*0.5*deltaT*a();
|
||||||
pi() += 0.5*deltaT*tau();
|
pi() += aDamp_*0.5*deltaT*tau();
|
||||||
|
|
||||||
if (report_)
|
if (report_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -122,6 +122,9 @@ class sixDoFRigidBodyMotion
|
|||||||
//- Acceleration relaxation coefficient
|
//- Acceleration relaxation coefficient
|
||||||
scalar aRelax_;
|
scalar aRelax_;
|
||||||
|
|
||||||
|
//- Acceleration damping coefficient (for steady-state simulations)
|
||||||
|
scalar aDamp_;
|
||||||
|
|
||||||
//- Switch to turn reporting of motion data on and off
|
//- Switch to turn reporting of motion data on and off
|
||||||
Switch report_;
|
Switch report_;
|
||||||
|
|
||||||
@ -264,6 +267,7 @@ public:
|
|||||||
const tensor& initialQ,
|
const tensor& initialQ,
|
||||||
const diagTensor& momentOfInertia,
|
const diagTensor& momentOfInertia,
|
||||||
scalar aRelax = 1.0,
|
scalar aRelax = 1.0,
|
||||||
|
scalar aDamp = 1.0,
|
||||||
bool report = false
|
bool report = false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user