tutorials/multiphase/interDyMFoam/ras/floatingObject: Updated to use rigidBodyDynamics
This commit is contained in:
@ -16,75 +16,59 @@ FoamFile
|
|||||||
|
|
||||||
dynamicFvMesh dynamicMotionSolverFvMesh;
|
dynamicFvMesh dynamicMotionSolverFvMesh;
|
||||||
|
|
||||||
motionSolverLibs ("libsixDoFRigidBodyMotion.so");
|
motionSolverLibs ("librigidBodyMeshMotion.so");
|
||||||
|
|
||||||
solver sixDoFRigidBodyMotion;
|
solver rigidBodyMotion;
|
||||||
|
|
||||||
sixDoFRigidBodyMotionCoeffs
|
rigidBodyMotionCoeffs
|
||||||
{
|
{
|
||||||
patches (floatingObject);
|
|
||||||
innerDistance 0.05;
|
|
||||||
outerDistance 0.35;
|
|
||||||
|
|
||||||
centreOfMass (0.5 0.45 0.35);
|
|
||||||
|
|
||||||
// Cuboid dimensions
|
|
||||||
Lx 0.3;
|
|
||||||
Ly 0.2;
|
|
||||||
Lz 0.5;
|
|
||||||
|
|
||||||
// Density of the solid
|
|
||||||
rho 500;
|
|
||||||
|
|
||||||
// Cuboid mass
|
|
||||||
mass #calc "$rho*$Lx*$Ly*$Lz";
|
|
||||||
|
|
||||||
// Cuboid moment of inertia about the centre of mass
|
|
||||||
momentOfInertia #codeStream
|
|
||||||
{
|
|
||||||
codeInclude
|
|
||||||
#{
|
|
||||||
#include "diagTensor.H"
|
|
||||||
#};
|
|
||||||
|
|
||||||
code
|
|
||||||
#{
|
|
||||||
scalar sqrLx = sqr($Lx);
|
|
||||||
scalar sqrLy = sqr($Ly);
|
|
||||||
scalar sqrLz = sqr($Lz);
|
|
||||||
os <<
|
|
||||||
$mass
|
|
||||||
*diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0;
|
|
||||||
#};
|
|
||||||
};
|
|
||||||
|
|
||||||
report on;
|
report on;
|
||||||
accelerationRelaxation 0.7;
|
|
||||||
|
|
||||||
solver
|
solver
|
||||||
{
|
{
|
||||||
type Newmark;
|
type Newmark;
|
||||||
}
|
}
|
||||||
|
|
||||||
constraints
|
accelerationRelaxation 0.7;
|
||||||
{
|
|
||||||
// fixedPoint
|
|
||||||
// {
|
|
||||||
// sixDoFRigidBodyMotionConstraint point;
|
|
||||||
// centreOfRotation (0.5 0.45 0.1);
|
|
||||||
// }
|
|
||||||
|
|
||||||
fixedLine
|
bodies
|
||||||
{
|
{
|
||||||
sixDoFRigidBodyMotionConstraint line;
|
floatingObject
|
||||||
centreOfRotation (0.5 0.45 0.1);
|
{
|
||||||
direction (0 1 0);
|
type cuboid;
|
||||||
|
parent root;
|
||||||
|
|
||||||
|
// Cuboid dimensions
|
||||||
|
Lx 0.3;
|
||||||
|
Ly 0.2;
|
||||||
|
Lz 0.5;
|
||||||
|
|
||||||
|
// Density of the cuboid
|
||||||
|
rho 500;
|
||||||
|
|
||||||
|
// Cuboid mass
|
||||||
|
mass #calc "$rho*$Lx*$Ly*$Lz";
|
||||||
|
L ($Lx $Ly $Lz);
|
||||||
|
centreOfMass (0 0 0.25);
|
||||||
|
transform (1 0 0 0 1 0 0 0 1) (0.5 0.45 0.1);
|
||||||
|
|
||||||
|
joint
|
||||||
|
{
|
||||||
|
type composite;
|
||||||
|
joints
|
||||||
|
(
|
||||||
|
{
|
||||||
|
type Py;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type Ry;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedAxis
|
patches (floatingObject);
|
||||||
{
|
innerDistance 0.05;
|
||||||
sixDoFRigidBodyMotionConstraint axis;
|
outerDistance 0.35;
|
||||||
axis (0 1 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,94 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object motionProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dynamicFvMesh dynamicMotionSolverFvMesh;
|
||||||
|
|
||||||
|
motionSolverLibs ("libsixDoFRigidBodyMotion.so");
|
||||||
|
|
||||||
|
solver sixDoFRigidBodyMotion;
|
||||||
|
|
||||||
|
sixDoFRigidBodyMotionCoeffs
|
||||||
|
{
|
||||||
|
patches (floatingObject);
|
||||||
|
innerDistance 0.05;
|
||||||
|
outerDistance 0.35;
|
||||||
|
|
||||||
|
centreOfMass (0.5 0.45 0.35);
|
||||||
|
|
||||||
|
// Cuboid dimensions
|
||||||
|
Lx 0.3;
|
||||||
|
Ly 0.2;
|
||||||
|
Lz 0.5;
|
||||||
|
|
||||||
|
// Density of the solid
|
||||||
|
rho 500;
|
||||||
|
|
||||||
|
// Cuboid mass
|
||||||
|
mass #calc "$rho*$Lx*$Ly*$Lz";
|
||||||
|
|
||||||
|
// Cuboid moment of inertia about the centre of mass
|
||||||
|
momentOfInertia #codeStream
|
||||||
|
{
|
||||||
|
codeInclude
|
||||||
|
#{
|
||||||
|
#include "diagTensor.H"
|
||||||
|
#};
|
||||||
|
|
||||||
|
code
|
||||||
|
#{
|
||||||
|
scalar sqrLx = sqr($Lx);
|
||||||
|
scalar sqrLy = sqr($Ly);
|
||||||
|
scalar sqrLz = sqr($Lz);
|
||||||
|
os <<
|
||||||
|
$mass
|
||||||
|
*diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0;
|
||||||
|
#};
|
||||||
|
};
|
||||||
|
|
||||||
|
report on;
|
||||||
|
accelerationRelaxation 0.7;
|
||||||
|
//accelerationDamping 0;
|
||||||
|
|
||||||
|
solver
|
||||||
|
{
|
||||||
|
type Newmark;
|
||||||
|
}
|
||||||
|
|
||||||
|
constraints
|
||||||
|
{
|
||||||
|
// fixedPoint
|
||||||
|
// {
|
||||||
|
// sixDoFRigidBodyMotionConstraint point;
|
||||||
|
// centreOfRotation (0.5 0.45 0.1);
|
||||||
|
// }
|
||||||
|
|
||||||
|
fixedLine
|
||||||
|
{
|
||||||
|
sixDoFRigidBodyMotionConstraint line;
|
||||||
|
centreOfRotation (0.5 0.45 0.1);
|
||||||
|
direction (0 1 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedAxis
|
||||||
|
{
|
||||||
|
sixDoFRigidBodyMotionConstraint axis;
|
||||||
|
axis (0 1 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user