基于集中质量法的锚链力算法
20200501 更新
- 本项目已弃用
本文代码来自“系泊载液浮体水动力特性的数值及试验研究”于含
本文记录编译过程以及字典文件的编写
1.在/opt/OpenFOAM/OpenFOAM-v1712/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints
(本文OpenFOAM
安装位置为/opt
)中创建文件夹LumpedMassMethodMooring
,在该文件夹中建立两个文件LumpedMassMethodMooring.C
与LumpedMassMethodMooring.H
以下为LumpedMassMethodMooring.C
具体内容
/*---------------------------LumpedMassMethodMooring.C--------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
----------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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 2 of the License, or (at your
option) any later version.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
于含 系泊载液浮体水动力特性的数值及试验研究
提供的基于集中质量法的锚链力算法
\*------------------------------------------------------------------------------*/
#include "LumpedMassMethodMooring.H"
#include "addToRunTimeSelectionTable.H"
#include "sixDoFRigidBodyMotion.H"
#include "DynamicList.H"
// * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace sixDoFRigidBodyMotionRestraints
{
defineTypeNameAndDebug (LumpedMassMethodMooring, 0);
addToRunTimeSelectionTable
(
sixDoFRigidBodyMotionRestraint,
LumpedMassMethodMooring,
dictionary
);
}
}
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::LumpedMassMethodMooring
(
const word& name,
const dictionary& sDoFRBMRDict
)
:
sixDoFRigidBodyMotionRestraint(name, sDoFRBMRDict),
anchor_(),
refAttachmentPt_(),
cableLength_(),
totalMass_(),
EA_(),
n_(),
g_()
{
read(sDoFRBMRDict);
catenaryCableLength = cableLength_;
catenaryTotalMass = totalMass_ ;
supportForcePercent= 0;
firstPieceSeita = 0.0001;
Ttotal = 0;
Th =0;
Tv =0;
calculatedZ=0;
calculatedX=0;
mooringstate=-1;
}
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * * * //
Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::~LumpedMassMethodMooring()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * * //
void Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::restrain
(
const sixDoFRigidBodyMotion& motion,
vector& restraintPosition,
vector& restraintForce,
vector& restraintMoment
) const
{
restraintPosition = motion.transform(refAttachmentPt_);
restraintMoment = vector::zero;
restraintForce = vector::zero;
scalar direct1=(restraintPosition[0]==anchor_[0]?0:(restraintPosition[0]-anchor_[0]>0?-1:1));
scalar direct2=(restraintPosition[1]==anchor_[1]?0:(restraintPosition[1]-anchor_[1]>0?-1:1));
scalar x = mag(anchor_[0] - restraintPosition[0]);
scalar h = mag(anchor_[1] - restraintPosition[1]);
scalar a1=999999;
scalar a2=0.0001;
scalar toleranceA=0.001;
while (Foam::mag(((a1+a2)/2)*(Foam::cosh(x/((a1+a2)/2))-1)-h) > toleranceA)
{
scalar y3 = ((a1+a2)/2)*(Foam::cosh(x/((a1+a2)/2))-1);
if(y3<h)
{
a1= (a1+a2)/2;
}
if(y3>h)
{
a2 = (a1+a2)/2;
}
}
scalar a=(a1+a2)/2;
scalar maxCatenarycableLength = a * Foam::sinh (x/a);
vector r = restraintPosition - anchor_;
scalar strightLineLength = mag(r);
if (cableLength_ >= maxCatenarycableLength)
{
mooringstate=1;//The first state of the mooring chain, which is mentioned in section 4.1
mooringstate1loopingZ:
calculatingZX();
while (calculatedZ < h)
{
addSeita();
calculatingZX();
}
while (calculatedX > x)
{
calculatingFromNextPiece();
goto mooringstate1loopingZ;
}
restraintForce[0]=direct1*Th;
restraintForce[1]=direct2*Tv;
restraintForce[2]=0;
}
else if (maxCatenarycableLength > cableLength_ && cableLength_ >= strightLineLength)
{
mooringstate=2; //The second state of the mooring chain, which is mentioned in section 4.1
mooringstate2loopingZ:
calculatingZX();
while (calculatedZ < h)
{
addSeita();
calculatingZX();
}
while (calculatedX < x)
{
changeSupportForcePercent();
goto mooringstate2loopingZ;
}
restraintForce[0]=direct1*Th;
restraintForce[1]=direct2*Tv;
restraintForce[2]=0;
}
else if(strightLineLength > cableLength_)
{
mooringstate=3; //The third state of the mooring chain, which is mentioned in section 4.1
r/= (strightLineLength + VSMALL);
scalar elongation = strightLineLength - cableLength_;
scalar stiffness = EA_ / cableLength_;
restraintForce = -stiffness * elongation * r;
restraintForce[2]=0;
}
if (motion.report())
{
Info<< " magForce : "<<mag(restraintForce)
//<< " mooringstate: " << mooringstate
//<< " restraintPosition: " <<restraintPosition
//<< " anchor: " <<anchor_
//<< " seita " <<firstPieceSeita
//<< " calculatedZ " <<calculatedZ
//<< " calculatedX " <<calculatedX
<< endl;
}
catenaryCableLength = cableLength_;
catenaryTotalMass = totalMass_ ;
supportForcePercent= 0;
firstPieceSeita = 0.0001;
Ttotal = 0;
Th =0;
Tv =0;
calculatedZ=0;
calculatedX=0;
mooringstate=-1;
}
void Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::calculatingZX()const
{
scalar l = catenaryCableLength / n_;
scalar verticalForce = (catenaryTotalMass/n_/2 * g_)*(1-supportForcePercent) ;
//the horizontalforce in the first piece which also in every piece
scalar horizontalForce = verticalForce/Foam::tan(firstPieceSeita);
scalar seita = firstPieceSeita;
scalar totalForce = verticalForce/Foam::sin(seita);
scalar finalZ=0;
scalar finalX=cableLength_ - catenaryCableLength;
finalZ = finalZ + l*(1+totalForce/EA_)*Foam::sin(seita);
finalX = finalX + l*(1+totalForce/EA_)*Foam::cos(seita);
for (int i=1;i<=n_ - 1; i++)
{
//calculate the vertical force in each piece
verticalForce = verticalForce + catenaryTotalMass * g_ / n_ ;
//calculate the angle between each cable piece and horizontal
seita = Foam::atan(verticalForce/horizontalForce) ;
//calculate total force in each piece
totalForce = verticalForce/Foam::sin(seita);
finalZ = finalZ + l*(1+totalForce/EA_)*Foam::sin(seita);
finalX = finalX + l*(1+totalForce/EA_)*Foam::cos(seita);
}
calculatedZ=finalZ;
calculatedX=finalX;
Ttotal=totalForce;
Tv=verticalForce;
Th=horizontalForce;
}
void Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::addSeita()const
{
firstPieceSeita += 0.0001;
}
void Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::calculatingFromNextPiece()const
{
catenaryCableLength = catenaryCableLength - catenaryCableLength/n_ ;
catenaryTotalMass = catenaryTotalMass - catenaryTotalMass/n_ ;
}
void Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::changeSupportForcePercent()const
{
supportForcePercent = supportForcePercent - 1;
}
bool Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::read
(
const dictionary& sDoFRBMRDict
)
{
sixDoFRigidBodyMotionRestraint::read(sDoFRBMRDict);
sDoFRBMRCoeffs_.lookup("anchor") >> anchor_;
sDoFRBMRCoeffs_.lookup("refAttachmentPt") >> refAttachmentPt_;
sDoFRBMRCoeffs_.lookup("cableLength") >> cableLength_;
sDoFRBMRCoeffs_.lookup("totalMass") >> totalMass_;
sDoFRBMRCoeffs_.lookup("EA") >> EA_;
sDoFRBMRCoeffs_.lookup("n") >> n_;
sDoFRBMRCoeffs_.lookup("g") >> g_;
return true;
}
void Foam::sixDoFRigidBodyMotionRestraints::LumpedMassMethodMooring::write
(
Ostream& os
) const
{
os.writeKeyword("anchor")
<< anchor_ << token::END_STATEMENT << nl;
os.writeKeyword("refAttachmentPt")
<< refAttachmentPt_ << token::END_STATEMENT << nl;
os.writeKeyword("cableLength")
<< cableLength_ << token::END_STATEMENT << nl;
os.writeKeyword("totalMass")
<< totalMass_ << token::END_STATEMENT << nl;
os.writeKeyword("EA")
<< EA_ << token::END_STATEMENT << nl;
os.writeKeyword("n")
<< n_ << token::END_STATEMENT << nl;
os.writeKeyword("g")
<< g_ << token::END_STATEMENT << nl;
}
// **************************************************************************** //
以下为LumpedMassMethodMooring.H
具体内容
/*------------------------LumpedMassMethodMooring.H-----------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
----------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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 2 of the License, or (at your
option) any later version.
OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
于含 系泊载液浮体水动力特性的数值及试验研究
提供的基于集中质量法的锚链力算法
\*------------------------------------------------------------------------------*/
#ifndef LumpedMassMethodMooring_H
#define LumpedMassMethodMooring_H
#include "sixDoFRigidBodyMotionRestraint.H"
#include "point.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace sixDoFRigidBodyMotionRestraints
{
/*------------------------------------------------------------------------------*\
Class LumpedMassMethodMooring Declaration
\*------------------------------------------------------------------------------*/
class LumpedMassMethodMooring
:
public sixDoFRigidBodyMotionRestraint
{
// Private data
//Anchor point, where the spring is attached to an immovable
// object
point anchor_;
//- Reference point of attachment to the solid body
point refAttachmentPt_;
//- Total length of the mooring chain or cable
scalar cableLength_;
//- Total mass of the mooring chain or cable
scalar totalMass_;
//- The tensile stiffness of the mooring chain or cable
scalar EA_;
//- The number of segments
scalar n_;
//- The acceleration of gravity
scalar g_;
//- The cable length without lying on the sea bed, AKA the pendulous length
mutable scalar catenaryCableLength;
//- The cable mass without lying on the sea bed, AKA the pendulous mass
mutable scalar catenaryTotalMass;
//- The vertical mooring force of the sea bed acting on the mooring cable
mutable scalar supportForcePercent;
//- The intersection angle between the sea bed and mooring cable
mutable scalar firstPieceSeita;
//- The calculated value of the vertical position of the top side of the mooring cable
mutable scalar calculatedZ;
//- The calculated value of the horizontal position of the top side of the mooring cable
mutable scalar calculatedX;
//- The horizontal component of the mooring force
mutable scalar Th;
//- The vertical component of the mooring force
mutable scalar Tv;
//- The mooring force
mutable scalar Ttotal;
//- The state of the mooring cable
mutable scalar mooringstate;
public:
//- Runtime type information
TypeName("LumpedMassMethodMooring");
// Constructors
//- Construct from components
LumpedMassMethodMooring
(
const word& name,
const dictionary& sDoFRBMRDict
);
//- Construct and return a clone
virtual autoPtr<sixDoFRigidBodyMotionRestraint> clone() const
{
return autoPtr<sixDoFRigidBodyMotionRestraint>
(
new LumpedMassMethodMooring(*this)
);
}
//- Destructor
virtual ~LumpedMassMethodMooring();
// Member Functions
//- Calculate the restraint position, force and moment.
// Global reference frame vectors.
virtual void restrain
(
const sixDoFRigidBodyMotion& motion,
vector& restraintPosition,
vector& restraintForce,
vector& restraintMoment
) const;
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMRCoeff);
//- Write
virtual void write(Ostream&) const;
void calculatingZX()const;
void addSeita()const;
void calculatingFromNextPiece()const;
void changeSupportForcePercent()const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace solidBodyMotionFunctions
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
2.修改/opt/OpenFOAM/OpenFOAM-v1712/src/sixDoFRigidBodyMotion/Make/
文件夹中files
文件
在restraints
列中添加$(restraints)/LumpedMassMethodMooring/LumpedMassMethodMooring.C
3.终端进入/opt/OpenFOAM/OpenFOAM-v1712/src/sixDoFRigidBodyMotion/
目录,先进入OpenFOAM1712环境,再输入wmake
开始编译。
注意输出结果,观察是否有错误发生。下文为此次编译成功的输出结果。
[email protected]:/opt/OpenFOAM/OpenFOAM-v1712/src/sixDoFRigidBodyMotion$ of17
[email protected]:/opt/OpenFOAM/OpenFOAM-v1712/src/sixDoFRigidBodyMotion$ wmake
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file LumpedMassMethodMooring.C
g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1712 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-v1712/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/fileFormats/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/meshTools/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/functionObjects/forces/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/dynamicMesh/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-v1712/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/OSspecific/POSIX/lnInclude -fPIC -c sixDoFRigidBodyMotion/restraints/LumpedMassMethodMooring/LumpedMassMethodMooring.C -o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/LumpedMassMethodMooring/LumpedMassMethodMooring.o
g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1712 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-v1712/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/fileFormats/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/meshTools/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/functionObjects/forces/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/dynamicMesh/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-v1712/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1712/src/OSspecific/POSIX/lnInclude -fPIC -shared -Xlinker --add-needed -Xlinker --no-as-needed /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionStateIO.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring/linearSpring.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularSpring/sphericalAngularSpring.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearDamper/linearDamper.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularDamper/sphericalAngularDamper.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/LumpedMassMethodMooring/LumpedMassMethodMooring.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/axis/sixDoFRigidBodyMotionAxisConstraint.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/line/sixDoFRigidBodyMotionLineConstraint.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/orientation/sixDoFRigidBodyMotionOrientationConstraint.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/plane/sixDoFRigidBodyMotionPlaneConstraint.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/point/sixDoFRigidBodyMotionPointConstraint.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/sixDoFSolver.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFSolvers/sixDoFSolver/newSixDoFSolver.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFSolvers/symplectic/symplectic.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFSolvers/CrankNicolson/CrankNicolson.o /opt/OpenFOAM/OpenFOAM-v1712/build/linux64GccDPInt32Opt/src/sixDoFRigidBodyMotion/sixDoFSolvers/Newmark/Newmark.o -L/opt/OpenFOAM/OpenFOAM-v1712/platforms/linux64GccDPInt32Opt/lib \
-lmeshTools -lforces -ldynamicMesh -o /opt/OpenFOAM/OpenFOAM-v1712/platforms/linux64GccDPInt32Opt/lib/libsixDoFRigidBodyMotion.so
该悬链算法的使用方法见下。
1.在dynamicMeshDict
字典文件里sixDoFRigidBodyMotionCoeffs
子字典里restraints
项添加参数,以下为一个例子(注释仅为源文件注释的简单翻译)
restraints
{
mooringCable // 名称任意
{
sixDoFRigidBodyMotionRestraint LumpedMassMethodMooring; //使用该算法
anchor (4.5 -0.2 0.05);//该点在固定的某边界上
refAttachmentPt (5.8 -0.5 0.05);//该店在浮动的边界上
cableLength 1.4;//缆绳长度
totalMass 0.063541;//缆绳总质量
EA 1596;//弹性模量EA
n 500;//分段数
g 9.81;
}
}
Comments | NOTHING