From d0b5bef948b78adf6d714d565b8bb29137d5a83e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 18 Apr 2016 15:41:10 +0100 Subject: [PATCH] tutorials/multiphase/interDyMFoam/ras/floatingObject: Updated to use rigidBodyDynamics --- .../floatingObject/constant/dynamicMeshDict | 96 ++++++++----------- .../constant/dynamicMeshDict.sixDoF | 94 ++++++++++++++++++ 2 files changed, 134 insertions(+), 56 deletions(-) create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict.sixDoF diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict index 090aa63d16..d04014451f 100644 --- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict @@ -16,75 +16,59 @@ FoamFile 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; - accelerationRelaxation 0.7; solver { type Newmark; } - constraints + accelerationRelaxation 0.7; + + bodies { - // fixedPoint - // { - // sixDoFRigidBodyMotionConstraint point; - // centreOfRotation (0.5 0.45 0.1); - // } - - fixedLine + floatingObject { - sixDoFRigidBodyMotionConstraint line; - centreOfRotation (0.5 0.45 0.1); - direction (0 1 0); - } + type cuboid; + parent root; - fixedAxis - { - sixDoFRigidBodyMotionConstraint axis; - axis (0 1 0); + // 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; + } + ); + } + + patches (floatingObject); + innerDistance 0.05; + outerDistance 0.35; } } } diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict.sixDoF b/tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict.sixDoF new file mode 100644 index 0000000000..aa43b2aeb4 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/constant/dynamicMeshDict.sixDoF @@ -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); + } + } +} + + +// ************************************************************************* //