关于dynamicMeshDict里rigidBodyMotion和sixDoFRigidBodyMotion的问题请教
-
各位大佬好,目前我在用OpenFOAM做多浮体在波浪作用下的数值模拟。有些问题想要请教:
1、在constant文件夹中有dynamicMeshDict文件,在之前的学习过程中我主要接触到的是sixDoFRigidBodyMotion和rigidBodyMotion这两类求解器。据我目前了解,前者只可以用来模拟单物体,后者可以模拟多物体。不知我理解的是否正确?
2、在学习过程中,我对一些算例进行sixDoFRigidBodyMotion和rigidBodyMotion这两类求解器的计算结果比较,目前是找到了两个算例,分别是OpenFOAM中tutorials/multiphase/interFoam/RAS/floatingObject以及foamMooring中关于overset的算例,连接如下:https://gitlab.com/hfchen20/foamMooring/-/tree/master/tutorial/rgb_overset?ref_type=heads
我对这两个算例都分别使用采用sixDoFRigidBodyMotion和rigidBodyMotion的dynamicMeshDict进行了试算比较。然后发现计算得到的结果,如物体的位移、旋转的角度时程曲线基本一致。但是当我在此基础上新设算例,就是在dynamicMeshDict中加入一个linearAxialAngularSpring后,再计算出来的结果就会出现较大不同,这可能是哪些原因导致的呢?
以下是我整理后画出来的时程图:floatingObject算例
上面是没有加linearAxialAngularSpring,下面是加了之后的:
这是dynamicMeshDict代码对比:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs (rigidBodyMeshMotion); motionSolver rigidBodyMotion; rigidBodyMotionCoeffs { report on; solver { type Newmark; } accelerationRelaxation 0.7; bodies { floatingObject { type cuboid; parent root; // Cuboid dimensions Lx 0.3; Ly 0.2; Lz 0.5; // Density of the cuboid rho 500; // Cuboid mass mass #eval{ $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; } } restraints { /*axialSpring { type linearAxialAngularSpring; body floatingObject; axis (0 1 0); stiffness 10; damping 0; referenceOrientation (1 0 0 0 1 0 0 0 1); }*/ } } // ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs (sixDoFRigidBodyMotion); motionSolver 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 rhoSolid 500; // Cuboid mass mass #eval{ $rhoSolid*$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); } } /*restraints { axialSpring { sixDoFRigidBodyMotionRestraint linearAxialAngularSpring; axis (0 1 0); stiffness 10; damping 0; referenceOrientation (1 0 0 0 1 0 0 0 1); } }*/ } // ************************************************************************* //
3.为了搞清楚linearAxialAngularSpring,我还试着对tutorials/incompressible/pimpleFoam/RAS/wingMotion进行改写。因为这个算例中的dynamicMeshDict文件里使用了linearAxialAngularSpring。但是在原版的算例中,其使用的是sixDoFRigidBodyMotion,我想要将他改成rigidBodyMotion,但是我改后的算例只能算0.20s左右就会发散。在此我想请教一下有没有人做过类似的工作,能不能请教一下经验。
下面是我改的dynamicMeshDict文件:/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ("librigidBodyMeshMotion.so"); motionSolver rigidBodyMotion; //accelerationRelaxation 0.4; updateControl timeStep; updateInterval 1; rho rhoInf; rhoInf 1; rigidBodyMotionCoeffs { report on; solver { type symplectic; } rho rhoInf; rhoInf 1; bodies { wing { type rigidBody; parent root; mass 22.9; centreOfMass (0.2474612746 -0.02371895744 0); inertia (1.958864357 0 0 3.920839234 0 2.057121362); // Transformation tensor and centre of rotation transform (0.9953705935 0.09611129781 0 -0.09611129781 0.9953705935 0 0 0 1) (0.25 0.007 0.125); angularMomentum (0 0 -2); joint { type composite; joints ( { type Py; } { type Rz; } ); } patches (wing); innerDistance 0.3; outerDistance 1; } } restraints { verticalSpring { type linearSpring; body wing; anchor (0.25 0.007 0.125); refAttachmentPt (0 0 0); stiffness 4000; damping 2; restLength 0; } axialSpring { type linearAxialAngularSpring; body wing; axis (0 0 1); stiffness 700; damping 0.5; referenceOrientation (0.9953705935 0.09611129781 0 -0.09611129781 0.9953705935 0 0 0 1); } } } // ************************************************************************* //