mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -39,6 +39,11 @@ void Foam::sixDoFRigidBodyMotion::applyRestraints()
|
|||||||
{
|
{
|
||||||
forAll(restraints_, rI)
|
forAll(restraints_, rI)
|
||||||
{
|
{
|
||||||
|
if (report_)
|
||||||
|
{
|
||||||
|
Info<< "Restraint " << restraintNames_[rI];
|
||||||
|
}
|
||||||
|
|
||||||
// restraint position
|
// restraint position
|
||||||
point rP = vector::zero;
|
point rP = vector::zero;
|
||||||
|
|
||||||
@ -85,6 +90,11 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
|
|||||||
|
|
||||||
forAll(constraints_, cI)
|
forAll(constraints_, cI)
|
||||||
{
|
{
|
||||||
|
if (report_)
|
||||||
|
{
|
||||||
|
Info<< "Constraint " << constraintNames_[cI];
|
||||||
|
}
|
||||||
|
|
||||||
// constraint position
|
// constraint position
|
||||||
point cP = vector::zero;
|
point cP = vector::zero;
|
||||||
|
|
||||||
|
|||||||
@ -123,8 +123,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::constrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Constraint " << this->name()
|
Info<< " angle " << theta
|
||||||
<< " angle " << theta
|
|
||||||
<< " force " << constraintForceIncrement
|
<< " force " << constraintForceIncrement
|
||||||
<< " moment " << constraintMomentIncrement;
|
<< " moment " << constraintMomentIncrement;
|
||||||
|
|
||||||
@ -175,4 +174,14 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("axis")
|
||||||
|
<< fixedAxis_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -111,6 +111,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -109,8 +109,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::constrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Constraint " << this->name()
|
Info<< " error " << error
|
||||||
<< " error << " << error
|
|
||||||
<< " force " << constraintForceIncrement
|
<< " force " << constraintForceIncrement
|
||||||
<< " moment " << constraintMomentIncrement;
|
<< " moment " << constraintMomentIncrement;
|
||||||
|
|
||||||
@ -163,4 +162,17 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionConstraints::fixedLine::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("refPoint")
|
||||||
|
<< refPt_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("direction")
|
||||||
|
<< dir_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -112,6 +112,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -150,8 +150,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::constrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Constraint " << this->name()
|
Info<< " max angle " << maxTheta
|
||||||
<< " max angle " << maxTheta
|
|
||||||
<< " force " << constraintForceIncrement
|
<< " force " << constraintForceIncrement
|
||||||
<< " moment " << constraintMomentIncrement;
|
<< " moment " << constraintMomentIncrement;
|
||||||
|
|
||||||
@ -198,4 +197,14 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("fixedOrientation")
|
||||||
|
<< fixedOrientation_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -112,6 +112,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -109,8 +109,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::constrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Constraint " << this->name()
|
Info<< " error " << error
|
||||||
<< " error " << error
|
|
||||||
<< " force " << constraintForceIncrement
|
<< " force " << constraintForceIncrement
|
||||||
<< " moment " << constraintMomentIncrement;
|
<< " moment " << constraintMomentIncrement;
|
||||||
|
|
||||||
@ -146,4 +145,17 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("refPoint")
|
||||||
|
<< fixedPlane_.refPoint() << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("normal")
|
||||||
|
<< fixedPlane_.normal() << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -110,6 +110,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -118,8 +118,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::constrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Constraint " << this->name()
|
Info<< " error " << error
|
||||||
<< " error " << error
|
|
||||||
<< " force " << constraintForceIncrement
|
<< " force " << constraintForceIncrement
|
||||||
<< " moment " << constraintMomentIncrement;
|
<< " moment " << constraintMomentIncrement;
|
||||||
|
|
||||||
@ -151,4 +150,14 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("fixedPoint")
|
||||||
|
<< fixedPoint_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -111,6 +111,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
virtual bool read(const dictionary& sDoFRBMCCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,6 @@ Foam::sixDoFRigidBodyMotionConstraint::sixDoFRigidBodyMotionConstraint
|
|||||||
const dictionary& sDoFRBMCDict
|
const dictionary& sDoFRBMCDict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
name_(fileName(sDoFRBMCDict.name().name()).components(token::COLON).last()),
|
|
||||||
sDoFRBMCCoeffs_
|
sDoFRBMCCoeffs_
|
||||||
(
|
(
|
||||||
sDoFRBMCDict.subDict
|
sDoFRBMCDict.subDict
|
||||||
@ -69,9 +68,6 @@ bool Foam::sixDoFRigidBodyMotionConstraint::read
|
|||||||
const dictionary& sDoFRBMCDict
|
const dictionary& sDoFRBMCDict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
name_ =
|
|
||||||
fileName(sDoFRBMCDict.name().name()).components(token::COLON).last();
|
|
||||||
|
|
||||||
tolerance_ = (readScalar(sDoFRBMCDict.lookup("tolerance")));
|
tolerance_ = (readScalar(sDoFRBMCDict.lookup("tolerance")));
|
||||||
|
|
||||||
relaxationFactor_ = sDoFRBMCDict.lookupOrDefault<scalar>
|
relaxationFactor_ = sDoFRBMCDict.lookupOrDefault<scalar>
|
||||||
@ -86,4 +82,13 @@ bool Foam::sixDoFRigidBodyMotionConstraint::read
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionConstraint::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("tolerance")
|
||||||
|
<< tolerance_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("relaxationFactor")
|
||||||
|
<< relaxationFactor_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -70,9 +70,6 @@ protected:
|
|||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Name of the constraint in dictionary
|
|
||||||
word name_;
|
|
||||||
|
|
||||||
//- Constraint model specific coefficient dictionary
|
//- Constraint model specific coefficient dictionary
|
||||||
dictionary sDoFRBMCCoeffs_;
|
dictionary sDoFRBMCCoeffs_;
|
||||||
|
|
||||||
@ -145,16 +142,10 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMCDict) = 0;
|
virtual bool read(const dictionary& sDoFRBMCDict);
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return access to the name of the restraint
|
|
||||||
inline const word& name() const
|
|
||||||
{
|
|
||||||
return name_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return access to sDoFRBMCCoeffs
|
// Return access to sDoFRBMCCoeffs
|
||||||
inline const dictionary& coeffDict() const
|
inline const dictionary& coeffDict() const
|
||||||
{
|
{
|
||||||
@ -172,6 +163,9 @@ public:
|
|||||||
{
|
{
|
||||||
return relaxationFactor_;
|
return relaxationFactor_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -42,68 +42,67 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const
|
|||||||
os.writeKeyword("report")
|
os.writeKeyword("report")
|
||||||
<< report_ << token::END_STATEMENT << nl;
|
<< report_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
if (restraints_.size())
|
if (!restraints_.empty())
|
||||||
{
|
{
|
||||||
dictionary restraintsDict;
|
os << indent << "restraints" << nl
|
||||||
|
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||||
|
|
||||||
forAll(restraints_, rI)
|
forAll(restraints_, rI)
|
||||||
{
|
{
|
||||||
word restraintType = restraints_[rI].type();
|
word restraintType = restraints_[rI].type();
|
||||||
|
|
||||||
dictionary restraintDict;
|
os << indent << restraintNames_[rI] << nl
|
||||||
|
<< indent << token::BEGIN_BLOCK << incrIndent << endl;
|
||||||
|
|
||||||
restraintDict.add("sixDoFRigidBodyMotionRestraint", restraintType);
|
os.writeKeyword("sixDoFRigidBodyMotionRestraint")
|
||||||
|
<< restraintType << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
restraintDict.add
|
os.writeKeyword(word(restraintType + "Coeffs")) << nl;
|
||||||
(
|
|
||||||
word(restraintType + "Coeffs"), restraints_[rI].coeffDict()
|
|
||||||
);
|
|
||||||
|
|
||||||
restraintsDict.add(restraints_[rI].name(), restraintDict);
|
os << indent << token::BEGIN_BLOCK << nl << incrIndent;
|
||||||
|
|
||||||
|
restraints_[rI].write(os);
|
||||||
|
|
||||||
|
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||||
|
|
||||||
|
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.writeKeyword("restraints") << restraintsDict;
|
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (constraints_.size())
|
if (!constraints_.empty())
|
||||||
{
|
{
|
||||||
dictionary constraintsDict;
|
os << indent << "constraints" << nl
|
||||||
|
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||||
|
|
||||||
constraintsDict.add("maxIterations", maxConstraintIterations_);
|
os.writeKeyword("maxIterations")
|
||||||
|
<< maxConstraintIterations_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
forAll(constraints_, rI)
|
forAll(constraints_, rI)
|
||||||
{
|
{
|
||||||
word constraintType = constraints_[rI].type();
|
word constraintType = constraints_[rI].type();
|
||||||
|
|
||||||
dictionary constraintDict;
|
os << indent << constraintNames_[rI] << nl
|
||||||
|
<< indent << token::BEGIN_BLOCK << incrIndent << endl;
|
||||||
|
|
||||||
constraintDict.add
|
os.writeKeyword("sixDoFRigidBodyMotionConstraint")
|
||||||
(
|
<< constraintType << token::END_STATEMENT << nl;
|
||||||
"sixDoFRigidBodyMotionConstraint",
|
|
||||||
constraintType
|
|
||||||
);
|
|
||||||
|
|
||||||
constraintDict.add
|
constraints_[rI].sixDoFRigidBodyMotionConstraint::write(os);
|
||||||
(
|
|
||||||
"tolerance",
|
|
||||||
constraints_[rI].tolerance()
|
|
||||||
);
|
|
||||||
|
|
||||||
constraintDict.add
|
os.writeKeyword(word(constraintType + "Coeffs")) << nl;
|
||||||
(
|
|
||||||
"relaxationFactor",
|
|
||||||
constraints_[rI].relaxationFactor()
|
|
||||||
);
|
|
||||||
|
|
||||||
constraintDict.add
|
os << indent << token::BEGIN_BLOCK << nl << incrIndent;
|
||||||
(
|
|
||||||
word(constraintType + "Coeffs"), constraints_[rI].coeffDict()
|
|
||||||
);
|
|
||||||
|
|
||||||
constraintsDict.add(constraints_[rI].name(), constraintDict);
|
constraints_[rI].write(os);
|
||||||
|
|
||||||
|
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||||
|
|
||||||
|
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.writeKeyword("constraints") << constraintsDict;
|
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -136,8 +136,7 @@ Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::restrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Restraint " << this->name()
|
Info<< " angle " << theta
|
||||||
<< " angle " << theta
|
|
||||||
<< " force " << restraintForce
|
<< " force " << restraintForce
|
||||||
<< " moment " << restraintMoment
|
<< " moment " << restraintMoment
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -199,4 +198,23 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("referenceOrientation")
|
||||||
|
<< refQ_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("axis")
|
||||||
|
<< axis_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("stiffness")
|
||||||
|
<< stiffness_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("damping")
|
||||||
|
<< damping_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -114,6 +114,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -96,8 +96,7 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::restrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Restraint " << this->name()
|
Info<< " spring length " << magR
|
||||||
<< " spring length " << magR
|
|
||||||
<< " force " << restraintForce
|
<< " force " << restraintForce
|
||||||
<< " moment " << restraintMoment
|
<< " moment " << restraintMoment
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -125,4 +124,26 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearSpring::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("anchor")
|
||||||
|
<< anchor_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("refAttachmentPt")
|
||||||
|
<< refAttachmentPt_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("stiffness")
|
||||||
|
<< stiffness_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("damping")
|
||||||
|
<< damping_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("restLength")
|
||||||
|
<< restLength_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -117,6 +117,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------* \
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
@ -39,7 +39,6 @@ Foam::sixDoFRigidBodyMotionRestraint::sixDoFRigidBodyMotionRestraint
|
|||||||
const dictionary& sDoFRBMRDict
|
const dictionary& sDoFRBMRDict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
name_(fileName(sDoFRBMRDict.name().name()).components(token::COLON).last()),
|
|
||||||
sDoFRBMRCoeffs_
|
sDoFRBMRCoeffs_
|
||||||
(
|
(
|
||||||
sDoFRBMRDict.subDict
|
sDoFRBMRDict.subDict
|
||||||
@ -64,9 +63,6 @@ bool Foam::sixDoFRigidBodyMotionRestraint::read
|
|||||||
const dictionary& sDoFRBMRDict
|
const dictionary& sDoFRBMRDict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
name_ =
|
|
||||||
fileName(sDoFRBMRDict.name().name()).components(token::COLON).last();
|
|
||||||
|
|
||||||
sDoFRBMRCoeffs_ = sDoFRBMRDict.subDict(type() + "Coeffs");
|
sDoFRBMRCoeffs_ = sDoFRBMRDict.subDict(type() + "Coeffs");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -70,9 +70,6 @@ protected:
|
|||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Name of the constraint in dictionary
|
|
||||||
word name_;
|
|
||||||
|
|
||||||
//- Restraint model specific coefficient dictionary
|
//- Restraint model specific coefficient dictionary
|
||||||
dictionary sDoFRBMRCoeffs_;
|
dictionary sDoFRBMRCoeffs_;
|
||||||
|
|
||||||
@ -134,21 +131,18 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMRDict) = 0;
|
virtual bool read(const dictionary& sDoFRBMRDict);
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return access to the name of the restraint
|
|
||||||
inline const word& name() const
|
|
||||||
{
|
|
||||||
return name_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return access to sDoFRBMRCoeffs
|
// Return access to sDoFRBMRCoeffs
|
||||||
inline const dictionary& coeffDict() const
|
inline const dictionary& coeffDict() const
|
||||||
{
|
{
|
||||||
return sDoFRBMRCoeffs_;
|
return sDoFRBMRCoeffs_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -113,8 +113,7 @@ Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::restrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Restraint " << this->name()
|
Info<< " force " << restraintForce
|
||||||
<< " force " << restraintForce
|
|
||||||
<< " moment " << restraintMoment
|
<< " moment " << restraintMoment
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -153,4 +152,19 @@ bool Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("referenceOrientation")
|
||||||
|
<< refQ_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("stiffness") << stiffness_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("damping") << damping_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -111,6 +111,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -136,8 +136,7 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< "Restraint " << this->name()
|
Info<< " angle " << theta
|
||||||
<< " angle " << theta
|
|
||||||
<< " force " << restraintForce
|
<< " force " << restraintForce
|
||||||
<< " moment " << restraintMoment
|
<< " moment " << restraintMoment
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -223,4 +222,34 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("referenceOrientation")
|
||||||
|
<< refQ_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
os.writeKeyword("axis")
|
||||||
|
<< axis_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
moment_.write(os);
|
||||||
|
|
||||||
|
os.writeKeyword("angleFormat");
|
||||||
|
|
||||||
|
if (convertToDegrees_)
|
||||||
|
{
|
||||||
|
os << "degrees" << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
os << "radians" << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
os.writeKeyword("damping")
|
||||||
|
<< damping_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -121,6 +121,9 @@ public:
|
|||||||
|
|
||||||
//- Update properties from given dictionary
|
//- Update properties from given dictionary
|
||||||
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
virtual bool read(const dictionary& sDoFRBMRCoeff);
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user