mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENC: sixDoFRigidBodyMotion. Moving reporting of constraint and
restraint data to the classes themselves to allow class specific data to be reported.
This commit is contained in:
@ -45,13 +45,6 @@ void Foam::sixDoFRigidBodyMotion::applyRestraints()
|
||||
|
||||
restraints_[rI].restrain(*this, rP, rF, rM);
|
||||
|
||||
if (report_)
|
||||
{
|
||||
Info<< "Restraint " << restraints_[rI].name() << ": "
|
||||
<< "force " << rF << " moment " << rM
|
||||
<< endl;
|
||||
}
|
||||
|
||||
a() += rF/mass_;
|
||||
|
||||
// Moments are returned in global axes, transforming to
|
||||
@ -104,23 +97,6 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
|
||||
|
||||
allConverged = allConverged && constraintConverged;
|
||||
|
||||
if (report_)
|
||||
{
|
||||
Info<< "Constraint " << constraints_[cI].name()
|
||||
<< ": force " << cF << " moment " << cM;
|
||||
|
||||
if (constraintConverged)
|
||||
{
|
||||
Info<< " - converged";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " - not converged";
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
// Accumulate constraint force
|
||||
cFA += cF;
|
||||
|
||||
|
||||
@ -119,7 +119,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::constrain
|
||||
|
||||
constraintForceIncrement = vector::zero;
|
||||
|
||||
return (mag(theta) < tolerance_);
|
||||
bool converged(mag(theta) < tolerance_);
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Constraint " << this->name()
|
||||
<< " angle " << theta
|
||||
<< " force " << constraintForceIncrement
|
||||
<< " moment " << constraintMomentIncrement;
|
||||
|
||||
if (converged)
|
||||
{
|
||||
Info<< " converged";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " not converged";
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return converged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -105,7 +105,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::constrain
|
||||
|
||||
constraintMomentIncrement = vector::zero;
|
||||
|
||||
return (mag(error) < tolerance_);
|
||||
bool converged(mag(error) < tolerance_);
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Constraint " << this->name()
|
||||
<< " error << " << error
|
||||
<< " force " << constraintForceIncrement
|
||||
<< " moment " << constraintMomentIncrement;
|
||||
|
||||
if (converged)
|
||||
{
|
||||
Info<< " converged";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " not converged";
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return converged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -146,7 +146,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::constrain
|
||||
|
||||
constraintForceIncrement = vector::zero;
|
||||
|
||||
return (mag(maxTheta) < tolerance_);
|
||||
bool converged(mag(maxTheta) < tolerance_);
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Constraint " << this->name()
|
||||
<< " max angle " << maxTheta
|
||||
<< " force " << constraintForceIncrement
|
||||
<< " moment " << constraintMomentIncrement;
|
||||
|
||||
if (converged)
|
||||
{
|
||||
Info<< " converged";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " not converged";
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return converged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -105,7 +105,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::constrain
|
||||
|
||||
constraintMomentIncrement = vector::zero;
|
||||
|
||||
return (mag(error) < tolerance_);
|
||||
bool converged(mag(error) < tolerance_);
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Constraint " << this->name()
|
||||
<< " error " << error
|
||||
<< " force " << constraintForceIncrement
|
||||
<< " moment " << constraintMomentIncrement;
|
||||
|
||||
if (converged)
|
||||
{
|
||||
Info<< " converged";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " not converged";
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return converged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -114,7 +114,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::constrain
|
||||
|
||||
constraintMomentIncrement = vector::zero;
|
||||
|
||||
return (mag(error) < tolerance_);
|
||||
bool converged(mag(error) < tolerance_);
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Constraint " << this->name()
|
||||
<< " error " << error
|
||||
<< " force " << constraintForceIncrement
|
||||
<< " moment " << constraintMomentIncrement;
|
||||
|
||||
if (converged)
|
||||
{
|
||||
Info<< " converged";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " not converged";
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return converged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -133,6 +133,15 @@ Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::restrain
|
||||
// Not needed to be altered as restraintForce is zero, but set to
|
||||
// centreOfMass to be sure of no spurious moment
|
||||
restraintPosition = motion.centreOfMass();
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Restraint " << this->name()
|
||||
<< " angle " << theta
|
||||
<< " force " << restraintForce
|
||||
<< " moment " << restraintMoment
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -93,6 +93,15 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::restrain
|
||||
restraintForce = -stiffness_*(magR - restLength_)*r - damping_*(r & v)*r;
|
||||
|
||||
restraintMoment = vector::zero;
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Restraint " << this->name()
|
||||
<< " spring length " << magR
|
||||
<< " force " << restraintForce
|
||||
<< " moment " << restraintMoment
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -110,6 +110,14 @@ Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::restrain
|
||||
// Not needed to be altered as restraintForce is zero, but set to
|
||||
// centreOfMass to be sure of no spurious moment
|
||||
restraintPosition = motion.centreOfMass();
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Restraint " << this->name()
|
||||
<< " force " << restraintForce
|
||||
<< " moment " << restraintMoment
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -133,6 +133,15 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
|
||||
// Not needed to be altered as restraintForce is zero, but set to
|
||||
// centreOfMass to be sure of no spurious moment
|
||||
restraintPosition = motion.centreOfMass();
|
||||
|
||||
if (motion.report())
|
||||
{
|
||||
Info<< "Restraint " << this->name()
|
||||
<< " angle " << theta
|
||||
<< " force " << restraintForce
|
||||
<< " moment " << restraintMoment
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user