sixDoFRigidBodyMotion/restraints: rationalise reporting

This commit is contained in:
Henry
2013-12-17 17:40:45 +00:00
parent 2e50e33d72
commit d9c06910bc
6 changed files with 8 additions and 24 deletions

View File

@ -11,6 +11,8 @@ $(restraints)/linearAxialAngularSpring/linearAxialAngularSpring.C
$(restraints)/linearSpring/linearSpring.C
$(restraints)/sphericalAngularSpring/sphericalAngularSpring.C
$(restraints)/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
$(restraints)/linearDamper/linearDamper.C
$(restraints)/sphericalAngularDamper/sphericalAngularDamper.C
constraints = sixDoFRigidBodyMotion/constraints

View File

@ -135,7 +135,6 @@ Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::restrain
if (motion.report())
{
Info<< " angle " << theta*sign(a & axis_)
<< " force " << restraintForce
<< " moment " << restraintMoment
<< endl;
}
@ -190,7 +189,6 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::read
}
sDoFRBMRCoeffs_.lookup("stiffness") >> stiffness_;
sDoFRBMRCoeffs_.lookup("damping") >> damping_;
return true;

View File

@ -85,8 +85,6 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::restrain
vector r = restraintPosition - anchor_;
scalar magR = mag(r);
// r is now the r unit vector
r /= (magR + VSMALL);
vector v = motion.currentVelocity(restraintPosition);
@ -100,7 +98,6 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::restrain
Info<< " attachmentPt - anchor " << r*magR
<< " spring length " << magR
<< " force " << restraintForce
<< " moment " << restraintMoment
<< endl;
}
}
@ -114,13 +111,9 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearSpring::read
sixDoFRigidBodyMotionRestraint::read(sDoFRBMRDict);
sDoFRBMRCoeffs_.lookup("anchor") >> anchor_;
sDoFRBMRCoeffs_.lookup("refAttachmentPt") >> refAttachmentPt_;
sDoFRBMRCoeffs_.lookup("stiffness") >> stiffness_;
sDoFRBMRCoeffs_.lookup("damping") >> damping_;
sDoFRBMRCoeffs_.lookup("restLength") >> restLength_;
return true;

View File

@ -72,8 +72,7 @@ Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void
Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::restrain
void Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::restrain
(
const sixDoFRigidBodyMotion& motion,
vector& restraintPosition,
@ -86,19 +85,15 @@ Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::restrain
for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
{
vector axis = vector::zero;
axis[cmpt] = 1;
vector refDir = vector::zero;
refDir[(cmpt + 1) % 3] = 1;
vector newDir = motion.orientation() & refDir;
axis = (refQ_ & axis);
refDir = (refQ_ & refDir);
newDir -= (axis & newDir)*axis;
restraintMoment += -stiffness_*(refDir ^ newDir);
@ -114,8 +109,7 @@ Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::restrain
if (motion.report())
{
Info<< " force " << restraintForce
<< " moment " << restraintMoment
Info<< " moment " << restraintMoment
<< endl;
}
}
@ -147,7 +141,6 @@ bool Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::read
}
sDoFRBMRCoeffs_.lookup("stiffness") >> stiffness_;
sDoFRBMRCoeffs_.lookup("damping") >> damping_;
return true;

View File

@ -136,7 +136,6 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
if (motion.report())
{
Info<< " angle " << theta
<< " force " << restraintForce
<< " moment " << restraintMoment
<< endl;
}

View File

@ -174,9 +174,6 @@ class sixDoFRigidBodyMotion
//- Return access to the orientation
inline const tensor& Q() const;
//- Return access to velocity
inline const vector& v() const;
//- Return access to acceleration
inline const vector& a() const;
@ -356,8 +353,7 @@ public:
//- Return the angular velocity in the global frame
inline vector omega() const;
//- Return the velocity of a position given by the current
// motion state
//- Return the velocity of a position
inline point currentVelocity(const point& pt) const;
//- Report the status of the motion
@ -384,6 +380,9 @@ public:
//- Return the report Switch
inline bool report() const;
//- Return access to velocity
inline const vector& v() const;
// Edit