Files
OpenFOAM-12/applications/test/rigidBodyDynamics/pendulumAndSpring

110 lines
2.2 KiB
Plaintext

solver
{
type Newmark;
}
bodies
{
M
{
type sphere;
parent root;
mass 6e4;
radius 0.01;
centreOfMass (0 0 0);
transform (1 0 0 0 1 0 0 0 1) (0 0 0);
joint
{
type composite;
joints
(
{
type Px;
}
{
type Rz;
}
);
}
outline
(
(0 0.1 0)
(0.05 0.0866025 0)
(0.0866025 0.05 0)
(0.1 0 0)
(0.0866025 -0.05 0)
(0.05 -0.0866025 0)
(0 -0.1 0)
(0 -2.5 0)
(0 -0.1 0)
(-0.05 -0.0866025 0)
(-0.0866025 -0.05 0)
(-0.1 0 0)
(-0.0866025 0.05 0)
(-0.05 0.0866025 0)
(0 0.1 0)
);
}
m
{
type sphere;
parent M;
mass 6e3;
radius 0.01;
centreOfMass (0 0 0);
transform (1 0 0 0 1 0 0 0 1) (0 -5 0);
joint
{
type rigid;
}
outline
(
(0 2.5 0)
(0 0.1 0)
(0.05 0.0866025 0)
(0.0866025 0.05 0)
(0.1 0 0)
(0.0866025 -0.05 0)
(0.05 -0.0866025 0)
(0 -0.1 0)
(-0.05 -0.0866025 0)
(-0.0866025 -0.05 0)
(-0.1 0 0)
(-0.0866025 0.05 0)
(-0.05 0.0866025 0)
(0 0.1 0)
(0 2.5 0)
);
}
}
restraints
{
spring
{
type linearSpring;
body M;
anchor (0 0 0);
refAttachmentPt (0 0 0);
stiffness 1e5;
damping 0;
restLength 0;
}
}
// Set the gravitational acceleration
g (0 -9.81 0);
// Set the initial offset of the pendulum to 1.5m
// and the angle of the pendulum to 30deg
q (1.5 0.5235987);
deltaT 0.01;
// It is necessary to iterate for the Newmark solver
nIter 2;
endTime 20;