DynamicMeshDict
Contents
1 Description
This controls deformation and morphing of the mesh during a simulation. This dictionary is only necessary on solvers that invoke mesh motion. Generally, all these solvers will have the term DyM included in the base solver name. For example, a standard base solver might be pimpleFoam. With mesh motion, the solver will be pimpleDyMFoam and require a dynamicMeshDict.
Also note that the exact behavior of dynamicMeshDict is one of the less standardized features of OpenFOAM. The exact details and solver capabilities may vary depending on your specific version of OpenFOAM. This guide was created using OpenFOAM version 2.2 from Engys.
2 Example Dictionary File (6DOF Body Motion)
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | OpenFOAM (Engys Edition): | | o O o | Version: 2.2_engysEdition-beta | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class dictionary; location "../constant"; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; staticFvMeshCoeffs { } motionSolverLibs ( "libsixDoFRigidBodyMotionDev.so" ); solver sixDoFRigidBodyMotion; diffusivity quadratic inverseDistance 1 ( Body ); sixDoFRigidBodyMotionCoeffs { patches ( Body ); innerDistance 25; outerDistance 275; centreOfMass ( 16.81 -1087.4 -1063.3 ); mass 4.1453e+06; g ( 0 0 -9.8065 ); momentOfInertia ( 2.7874e+08 5.8901e+08 6.6762e+08 ); velocity ( 0 -0.5 -0.25 ); rhoName rhoInf; rhoInf 1024.81; accelerationRelaxation 0.9; accelerationDamping 0.95; report on; reportToFile on; solver { type CrankNicolson; } constraints { } restraints { Bouyancy { sixDoFRigidBodyMotionRestraint constantForce; refAttachmentPt ( 16.8 -1087.4 -1062 ); constantForce ( 0 0 4.0994e+07 ); } } } // ************************************************************************* //
3 Motion Types
The dictionary allows specification of four types of mesh motion.
- staticFvMesh: provides no mesh motion. The mesh is static. Useful for debugging a simulation that involves mesh motion.
- solidBodyMotionFvMesh: Prescribed mesh motion. No topology change in mesh.
- dynamicRefineFvMesh: refines the simulation mesh and provides topology changes based on simulation fields.
- dynamicMotionSolverFvMesh: Mesh motion based on solved mesh motion for rigid body motion.
The following code blocks show the template of commands required for each motion type. Additional parameters are also required to specify the details of each motion type.
3.1 Command Template: No Mesh Motion
dynamicFvMesh staticFvMesh; staticFvMeshCoeffs { }
3.2 Command Template: Prescribed Rigid Body Motion
dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { //Parameter definitions }
3.3 Command Template: Dynamic Mesh Refinement Template
dynamicFvMesh dynamicRefineFvMesh; dynamicRefineFvMeshCoeffs { //Parameter definitions }
3.4 Command Template: 6DOF Motion Solver
dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ("libsixDoFRigidBodyMotion.so"); solver sixDoFRigidBodyMotion; sixDoFRigidBodyMotionCoeffs { //Parameter definitions }
4 Parameter Definitions - staticFvMesh
There are no parameters required for a staticFVMesh. In fact, this dictionary is not really required. The only possible reasons to use this are cases where you may need to employ an openFOAM solver with dynamic mesh motion, but you don't actually want to have mesh motion. If anyone knows a useful example of this, please add here.
5 Parameter Definitions - solidBodyMotionFvMesh
This is a case where the mesh motion is a defined and specified motion, known before the simulation begins. The user specifies the type of motion, and the mesh moves according to this specified motion.
This type of motion is useful for cases where the mesh topology does not change but the mesh still incorporates some type of motion. Examples of this may include rotating subdomains to model fans, propellers, etc. This may also include some type of oscillatory motion for modeling linear piston motions.
6 Parameter Definitions - dynamicRefineFvMesh
dynamicRefineFvMesh does not morph the mesh shape. Instead, it performs topological refinements to the mesh, based on the values of specified fields. This is useful for cases like sonic shockwaves. Situations where you have a large region with relatively little change in field variables, and a small section with rapid and extreme change in field variables.
7 Parameter Definitions - dynamicMotionSolverFvMesh
This starts to get into the realm of fluid structure interaction (FSI). This solver morphs the mesh around a specified set of boundaries. The meshing motion is calculated based on the pressures on those boundaries. In turn, the dynamicMotionSolverFvMesh provides feedback to the fluid simulation. It alters the velocity boundary conditions (U field) on the included boundaries to specify the local velocity of the defined body. This local velocity includes coupled translation and rotational motions, if permitted. This mesh control is almost exclusively used to solve problems involving rigid body motion. There are many options and controls built into this one dictions. This section of the dynamicMeshDict is where you define the following items.
- Mesh morphing control
- Physical parameters of the rigid body
- Parameters to control how the 6DoF solver will actually solve the body motions
- Forces and motion constraints on the body, in addition to fluid forces.
8 User Notes
Consider mesh motion when defining any boundary conditions that are directionally dependent. The vectors are defined relative to the mesh definition. So as the mesh rotates, the direction of any vectors defined in your boundary conditions will also rotate.