# 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 dict ions. 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.

## Contents

- 1 Example Dictionary File
- 2 Main Controls
- 3 sixDoFRigidBodyMotionCoeffs
- 4 Parameters - Morphing Control
- 5 Parameters - 6DoF Solver Control
- 6 Parameters - Body Definition
- 7 Parameters - Force Definitions
- 8 Parameters - Motion Definitions
- 9 Parameters - Output Control
- 10 Physics - Boundary Condition Setup
- 11 User Notes

# 1 Example Dictionary File

dynamicFvMesh dynamicMotionSolverFvMesh; 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 ); } } }

# 2 Main Controls

There are two main entries to specify outside of the coefficients subdictionary. These are required entries. You specify the motion solver and import the library for the motion solver. This must be included in any code definition for the dynamicMotionSolverFvMesh dictionary.

motionSolverLibs ( "libsixDoFRigidBodyMotionDev.so" ); solver sixDoFRigidBodyMotion;

## 2.1 Diffusivity Parameter

In addition to the required parameters, you also have the option of specifying a diffusivity parameter. This is optional. OpenFOAM will supply default values if you do not include this.

diffusivity quadratic inverseDistance 5.0 ( Body );

The diffusivity parameter controls how the mesh motion is distributed through the mesh. The basic scenario assumes that you have a moving boundary and another set of static boundaries. The mesh motion solver must find some way to diffuse the motion of your boundary into the domain. There are several approaches available. If you are unsure of what to do, remove this entry completely. OpenFOAM will supply default values. The list of possible diffusivity options include:

- inverseDistance
- inverseFaceDistance
- inversePointDistance
- inverseVolume
- uniform

### 2.1.1 inverseDistance

diffusivity quadratic inverseDistance 5.0 ( Body );

Specify the inverseDistance to reduce mesh morphing inverse to distance from a series of patches. The farther away from the specified patches, the less mesh morphing. This applies in all directions from the Body. This command can be divided into several parts.

#### 2.1.1.1 Diffusivity Model

inverseDistance

The keyword inverseDistance specifies the diffusivity model.

#### 2.1.1.2 Distance Type

You can specify how quickly the mesh morphing reduces with distance.

diffusivity quadratic inverseDistance

The quadratic parameter drops off with quadratic of the inverse distance. This is more aggressive than the linear parameter. You do not need to specify this parameter. Do not include this modifier, and OpenFOAM will supply a default value.

diffusivity linear inverseDistance

The linear parameter drops off with linear variation of the inverse distance. You do not need to specify this parameter. Do not include this modifier, and OpenFOAM will supply a default value.

#### 2.1.1.3 Distance Specification

5.0

This specifies the physical distance from your specified patch. The distance parameter applies to all directions when used in the inverseDistance diffusivity model.

#### 2.1.1.4 Patch Specification

( Body Patch1 Patch2);

Finally, you specify the patches that the diffusivity should apply to. This is a list of named mesh patches. The list is specified by mesh patch name, not boundary name.

# 3 sixDoFRigidBodyMotionCoeffs

Everything else can be found int he sixDoFRigidBodyMotionCoeffs. These parameters can be somewhat confusing because they combine to define several items relating to the body motion. The parameters can be applied in any order. To clarify the application of each parameter, they were divided into the following main categories.

- Mesh Morphing Control
- 6DoF Solver Control
- Body Definition
- Forces Definitions
- Motion Definitions
- Output Control

All documentation from this point on assumes that any information is applied within the sixDoFRigidBodyMotionCoeffs subdictionary.

sixDoFRigidBodyMotionCoeffs { //Parameters - Mesh Morphing Control //Parameters - 6DoF Solver Control //Parameters - Body Definition //Parameters - Force Definitions //Parameters - Motion Definitions //Parameters - Output Control }

# 4 Parameters - Morphing Control

## 4.1 Inner and Outer Distance

innerDistance 25; outerDistance 275;

The solver also allows you to specify an innerDistance and outerDistance parameter. These control how the sixDof solver morphs the mesh.

- Anything within the innerDistance directly moves the mesh nodes as a rigid body.
- Between the innerDistance and outerDistance, the mesh nodes are morphed.
- Outside the outerDistance, no morphing occurs.

But be careful. The outerDistance parameter must always be larger than the innerDistance parameter. If you try to specify outerDistance as smaller than innerDistance, the solver will override your inputs with default values.

# 5 Parameters - 6DoF Solver Control

## 5.1 Solver Type

solver { type CrankNicolson; //options: Newmark, CrankNicolson, symplectic }

This specifies the solver for the 6DoF body motions. There are three solvers you can select.

- Newmark solver is a second order implicit solver. You can find a general wiki entry on it here. More information is available on the OpenFOAM source documents.
- CrankNicolson is a second order implicit solver. You can find a general wiki entry on it here. More information is available on the OpenFOAM source documents. If you use the default values for solver coefficients, the CrankNicolson scheme is equivalent to the Newmark scheme.
- symplectic is a second order explicit solver. You can find a general wiki entry on it here. More information is available on the OpenFOAM source documents.

### 5.1.1 Newmark Solver

Example specification in dynamicMeshDict:

solver { type Newmark; gamma 0.5; // Velocity integration coefficient beta 0.25; // Position integration coefficient }

### 5.1.2 Crank Nicolson Solver

Example specification in dynamicMeshDict:

solver { type CrankNicolson; aoc 0.5; // Acceleration off-centering coefficient voc 0.5; // Velocity off-centering coefficient }

### 5.1.3 Symplectic Solver

Example specification in dynamicMeshDict:

solver { type symplectic; }

## 5.2 Acceleration Relaxation and Damping

accelerationRelaxation 0.9; accelerationDamping 0.95;

These two parameters help maintain stability of the 6DoF solver. Under certain conditions, the 6DoF solver can become unstable. This mainly occurs in situations of high acceleration. The high acceleration feeds into the fluid domain as high velocities on the boundary conditions. This in turn creates high fluid forces from the reaction, resulting in rapid deceleration. This type of scenario will lead to the 6DoF solver diverging. Instead, OpenFOAM provides two parameters to avoid this scenario.

AccelerationDamping is the main tool to eliminate divergence from sudden acceleration. The accelerationDamping reduces the calculated acceleration on the body, but it does this in proportion to the magnitude of the acceleration, similar to a damping coefficient. Thus, sudden accelerations recieve large amounts of relaxation. Whereas normal accelerations that are typical for the result of the time history receive relatively little acceleration. The parameter can range from 0.0 to 1.0. Recommended values are in the range of 0.90 - 1.0.

AccelerationRelaxation is a direct reduction on the acceleration. If the 6DoF solver calculates an acceleration of 10 m/s^2 for a given timestep, with an acclerationRelaxation of 0.90, the actual applied acceleration will be 0.90 * 10 = 9 m/s^2. This will then apply to the newly derived boundary conditions and Body velocity. Be careful with this accelerationRelaxation. Too low of a value will mean that the Body does not respond to the fluid forces correctly. Too much of a discrepancy between calculated fluid forces and resulting motion will also lead to divergence The parameter can range from 0.0 to 1.0. Recommended values are in the range of 0.90 - 1.0.

# 6 Parameters - Body Definition

## 6.1 Mass Properties

mass 4.1453e+06; centreOfMass ( 16.81 -1087.4 -1063.3 ); momentOfInertia ( 2.7874e+08 5.8901e+08 6.6762e+08 );

This defines the mass properties of the 6DoF Body. The mass applies to the entire Body. The centreOfMass defines the centroid of the Body, in the world coordinate system. This is the centroid at initial position. The momentOfInertia defines the moment of the inertia of the Body. This is not the radius of gyration. It is the direct moment of inertia in the three principal axes (XX, YY, ZZ). The cross products of inertia are not defined. CentreOfMass and momentOfInertia are both entered as vector lists.

## 6.2 Initial Conditions

velocity ( 0 -0.5 -0.25 );

This defines the initial velocity for the Body. The initial velocity affects Body initial momentum. Velocity is entered as a vector list. A zero velocity is also possible.

# 7 Parameters - Force Definitions

## 7.1 Patches

patches ( Body );

This specifies the mesh patches that are considered part of the 6DoF rigid body. This has several implications.

- Mesh morphing is centered around this patch
- The 6DoF Body velocities can be used as boundary conditions for the main fluid solver
- Specifying a patch automatically tells OpenFOAM to integrate pressures along this patch and calculate fluids forces.

The patch is specified as a list of patch names. These are patche names from the mesh definition, not the boundary conditions.

## 7.2 Restraints

restraints { //Restraint Forces //Typical Restriant Force Definition NameofForce-AnyNameYouWantNoSpaces { sixDoFRigidBodyMotionRestraint ForceType; //More Parameters depending on ForceType } }

The restraints provide reactionary forces other than the fluid interaction. Fluid interaction is automatically included whenever a patch is specified as part of the body. The restraint forces allow you to model other forces through simple reaction force terms. These are typically reaction forces. The exact force magnitude will change depending on body behavior.

You can create multiple force definitions of multiple types. THe restraints parameter is a set of all the restraint forces defined.

List of Force Type keywords

- constantForce
- linearDamper
- sphericalAngularDamper
- linearSpring
- linearAxialAngularSpring
- tabluatedAxialAngularSpring

### 7.2.1 constantForce

Example Definition

BuoyantForce { sixDoFRigidBodyMotionRestraint constantForce; refAttachmentPt (16.8 -1087.4 -1062.0); //Center of buoyancy. constantForce (0 0 4.0994E7); //Force vector in N. }

The constantForce may not be available in all versions of OpenFOAM. This term was found in the edition published by Engys.

The constant force is a simple constant force. Unlike the other restraints, this force term does not react or change with body motions. The constant force is specified with a force vector. This specifies the magnitude and direction of the force. The direction of the force does not rotate with body motions. The force direction remains fixed. The definition also requires an attachment point. The sixDoF solver will include moment coupling if the constantForce is not attached at the same coordinates as the center of gravity. The reference attachment point will move with body motions. It will mantain the same relative position from the body center of gravity.

The constantForce term is especially useful to account for any unmodeled force elements and balance out your model forces. An example would be a submarine with internal ballast tanks. The CFD simulation would only model the external skin of the submarine. But without the internal ballast tanks, the body has too much buoyancy force in the 6DoF model. To correct this, one can use the constantForce to apply a downward force and account for the added weight of those ballast tanks.

### 7.2.2 linearDamper

Example Definition

NameOfDamperForce { sixDoFRigidBodyMotionRestraint linearDamper; coeff 12345; //Linear damping coefficient in Ns/m }

The linearDamper force provides a reactionary force that is proportional to the body velocity. A simple damping coefficient is defined. The linear damping force only reacts to linear motions. All damper forces are applied at the body center of gravity. The damping force is always applied in a direction exactly opposite to the body linear velocity vector.

### 7.2.3 sphericalAngularDamper

Example Definition

NameOfDamperForce { sixDoFRigidBodyMotionRestraint sphericalAngularDamper; coeff 12345; //angular damping coefficient in Nms/rad }

The sphericalAngularDamper provides a reactionary force that is proportional to the body angular velocity. A simple damping coefficient is define. The angular damping force only reacts to angular motions. All damper forces are applied at the body center of gravity. The damping force is always applied in the direction exactly opposite to the body angular velocity vector.

### 7.2.4 linearSpring

Example Definition

NameOfTranslationLinearSpring { sixDoFRigidBodyMotionRestraint linearSpring; anchor (0 0.1 2.0); refAttachmentPt (1.0 2.0 3.0); stiffness 1.6E6; //units of N/m damping 5678; //units of Ns/m restLength 1.41; //units of m }

The linearSpring provides a more comprehensive model for restraint forces. This model includes the following major features.

- stiffness, force proportional to body displacement.
- damping, force proportional to body velocity.
- attachmentPoint, provides coupling between body forces and moments on the body. Coupling is based on the distance from refAttachmentPt to the body center of gravity.
- restLength, allows you to provide initial conditions of tension or compression on the spring

#### 7.2.4.1 Anchor Position

anchor (0 0.1 2.0);

The spring is defined by two end points. The anchor defines the fixed end point. This will remain fixed in position throughout your simulation.

#### 7.2.4.2 Body Attachment Position

refAttachmentPt (1.0 2.0 3.0);

This specifies the second endpoint of the spring. This is the attachment point on the body. The spring will generate forces and coupled moments. The moment is generated from the moment arm between the body center of gravity and the refAttachmentPt.

#### 7.2.4.3 Stiffness

stiffness 1.6E6; //units of N/m

This stiffness is the spring component of the linearSpring forces. Force varies linearly proportional to linear deflection. This specifies the component of the force that responds to body displacements. The forces are based on the displacement at the refAttachmentPt. This includes motions from translation and rotation of the body. Stiffness is specified in units of N/m. You can also define this reactionary force with a zero stiffness. That will create an object that behaves purely as a damper.

#### 7.2.4.4 Damping

damping 5678; //units of Ns/m

This damping is the damper component of the linearSpring forces. Force varies linearly proportional to linear velocity. This specifies the component of the force that responds to body velocity. The forces are based on the velocity at the refAttachmentPt. This includes motions from translation and rotation of the body. Damping is specified in units of Ns/m. You can also define this reactionary force with a zero damping value. That will create an object that behaves purely as a spring.

#### 7.2.4.5 Resting Length

restLength 1.41; //units of m

The resting length is used to specify the initial condition of the spring. The resting length defines the linear distance where the spring produces zero force.

### 7.2.5 linearAxialAngularSpring

Example Definition

NameOfAxialLinearSpring { sixDoFRigidBodyMotionRestraint linearAxialAngularSpring; axis (1.0 2.0 3.0); stiffness 1.6E6; //units of Nm/rad damping 5678; //units of Nms/rad referenceOrientation (0 0.1 2.0); //Neutral orientation. Specified as a vector }

The linearAxialAngularSpring provides a more comprehensive model for restraint forces specifically focused on body rotational motion. The force model creates moments that are about the defined axis. The moments are always reactionary and in the oppoosite direction of body rotation. This model's force only depends on rotation about the specified axis. This model includes the following major features.

- stiffness, force proportional to body rotation.
- damping, force proportional to body angular velocity.
- axis, specifies the axis of rotation.
- referenceOrientation, allows you to provide initial conditions of rotational moment for the spring.

#### 7.2.5.1 Rotation Axis

axis (1.0 2.0 3.0);

The rotation axis defines the reference axis for rotation. All forces within this model are based on rotation about the defined axis. The axis is defined as a vector. OpenFOAM will automatically extract the unit vector from whatever vector you define. Any moments act at the body center of gravity.

#### 7.2.5.2 Stiffness

stiffness 1.6E6; //units of N/m

This stiffness is the spring component of the linearAxialAngularSpring moments. This specifies the component of the moment that responds to body rotation angle. The moments are based on the rotation angle relative to the referenceOrientation. Stiffness is specified in units of Nm/rad. You can also define this reactionary moment with a zero stiffness. That will create an object that behaves purely as a damper.

#### 7.2.5.3 Damping

damping 5678; //units of Ns/m

This damping is the damper component of the linearAxialAngularSpring moments. This specifies the component of the moment that responds to body angular velocity. The moments are based on the angular velocity at the body centroid. Damping is specified in units of Nms/rad. You can also define this reactionary force moment with a zero damping value. That will create an object that behaves purely as a spring.

#### 7.2.5.4 Reference Orientation

referenceOrientation (0 0.1 2.0); //Neutral orientation. as a vector

The reference orientation specifies the orientation for neutral moment from the force model. Orientation is specified as a vector. The force model will calculate the rotation in radians of the body orientation from your defined reference orientation. The model only considers any rotation that is about the axis of rotation that you defined.

### 7.2.6 tabluatedAxialAngularSpring

I am not sure about the input definition for this. More information can be found in the openFOAM source code documentation (Doxygen).

# 8 Parameters - Motion Definitions

constraints { //Motion Constraints //Typical Motion Constraint Definition NameofConstraint-AnyNameYouWantNoSpaces { sixDoFRigidBodyMotionConstraint MotionType; //More Parameters depending on MotionType } }

Constraints are a list of constrained motions. Constraints directly control the permitted motions of the body. These are different from restraints, which apply reactive forces. Constraints do not generate any force. They simply restrict the body motions. The constraints parameters is a list of defined constraints. You can define combinations of multiple constraint types to restrict body motions in different ways.

List of MotionType keywords

- axis
- line
- plane
- point
- orientation

## 8.1 axis

NameofAxisConstraint { sixDoFRigidBodyMotionConstraint axis; axis (1 0 0.25); }

The axis constraint only constrains rotational motion. Linear motion is unconstrained. The axis constraint only permits rotation about the defined axis of rotation. This limits body motions to only one degree of freedom in rotation plus 3 degrees of freedom in linear motion. The axis is defined based on a vector orientation. OpenFOAM will automatically rescale the axis definition to interpret it as a unit vector definition.

## 8.2 line

NameofLineConstraint { sixDoFRigidBodyMotionConstraint line; direction (1 0 0.25); }

The line constraint is similar to the axis constraint, but the line constraint focuses on linear motion. Rotational motion is unconstrained. The line constraint only permits linear motion along the vector defined by the direction keyword. This limits body motions to only one degree of freedom in linear motion plus 3 degrees of freedom in rotational motion. The direction is defined based on a vector line. OpenFOAM automatically rescales the direction definition to interpret it as a unit vector definition.

## 8.3 plane

NameofPlaneConstraint { sixDoFRigidBodyMotionConstraint plane; normal (1 0 0.25); }

The plane constraint allows 2D linear motion, but restricts the body from moving in the third dimension. The direction of motion is defined by the orientation of the plane. The body is permitted linear motion anywhere within the defined plane. The plane is defined by the normal vector, specified through the "normal" keyword. OpenFOAM automatically rescales the normal vector definition to interpret it as a unit vector definition. When defining this plane constraint, the origin of the vector is taken as the body initial center of gravity.

## 8.4 point

NameofPointConstraint { sixDoFRigidBodyMotionConstraint point; centreOfRotation (1 0 0.25); }

The point constraint eliminates are linear motion, but the body is allowed unconstrained rotational motion about the defined center of rotation. This allows rotation in any direction. The center of rotation is defined through the "centreOfRotation" keyword. This does not need to be the body center of gravity. You can use this to define a spherical joint, where the body rotates about the joint.

Remember that you can add multiple constraint definitions. The combination of a point constraint and an axis constraint would simulate a pinned connection.

## 8.5 orientation

NameofOrientationConstraint { sixDoFRigidBodyMotionConstraint orientation; centreOfRotation (1 0 0.25); }

The orientation constraint eliminates any rotational motion, but the body is allowed unconstrained linear motion. If the "centreOfRotation" is not defined, the body center of mass is used.

# 9 Parameters - Output Control

report on; reportToFile on;

These two parameters control the output from the 6DoF Solver.

The "report" parameter writes the 6DoF body state to the time files. If you look under a time folder (not the 0 time folder), you will see an additional folder named uniform. In this is a file named sixDoFRigidBodyMotionState. This reports the state of the 6DoF body. The file format looks like this:

/*--------------------------------*- 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 "1.92/uniform"; object sixDoFRigidBodyMotionState; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // centreOfRotation ( 16.7975 -1088.76 -1063.78 ); orientation ( 1 0 0 0 1 0 0 0 1 ); velocity ( -0.00260292 -0.713923 -0.245859 ); acceleration ( -0.00135749 0.00674935 -0.01104 ); angularMomentum ( 0 0 0 ); torque ( 116594 281950 -91413 ); // ************************************************************************* //

The other parameter also writes output on the 6DoF state. The reportToFile writes the 6DoF body state for all timesteps into a single file. That output file looks like this:

Time centreOfRotation_x centreOfRotation_y centreOfRotation_z centreOfMass_x centreOfMass_y centreOfMass_z orientation_xx orientation_xy orientation_xz orientation_yx orientation_yy orientation_yz orientation_zx orientation_zy orientation_zz Ux Uy Uz omega_x omega_y omega_z 0.48 16.7998 -1087.73 -1063.42 16.7998 -1087.73 -1063.42 1 0 0 0 1 0 0 0 1 -0.000679523 -0.73788 -0.253318 0 0 0 0.96 16.7994 -1088.08 -1063.54 16.7994 -1088.08 -1063.54 1 0 0 0 1 0 0 0 1 -0.00135747 -0.719188 -0.25145 0 0 0 ... 1.44 16.7986 -1088.42 -1063.66 16.7986 -1088.42 -1063.66 1 0 0 0 1 0 0 0 1 -0.00198185 -0.716625 -0.248611 0 0 0

This file format is very useful to import into spreadsheet programs or tables. Note that the orientation of the body is written as a tensor. You will need to create your own utility to convert this to Euler Angles. Or check the internet. There are several useful utilities for this.

This report file is constantly updated as OpenFOAM runs. An incomplete run will still generate this report file for all the currently completed timesteps. You can also grab the file while OpenFOAM runs to monitor the motions of your 6DoF body for an active run.

# 10 Physics - Boundary Condition Setup

The boundary conditions must be set with specific keywords to use the information from the 6DoF solver. This provides the feedback. The surface velocities from the 6DoF Body are supplied as boundary conditions to the fluid solver. The example below shows a single boundary named "Body" that represents the 6DoF Body.

Body { U { type movingWallVelocity; value uniform (0 0 0); } pointDisplacement { type calculated; value uniform (0 0 0); } p { type zeroGradient; } }

The velocity condition is specified as a movingWallVelocity. The uniform value of zero only applies to the initialization. The boundary will be overwritten with calculated velocity values from the 6DoF solver on the next timestep and going forward.

The pointDisplacement is necessary for the mesh morphing. This must be set to type of "calculated". This will tell the mesh morpher to look at the 6DoF solver results to perform the morphing. Specifically, the library writes a field file called pointDisplacement and another field called pointMotionU. These are used to perform the mesh morphing. They can also be viewed as an output.

The pressure field is specified as a zeroGradient. This is typical for normal wall boundaries.

# 11 User Notes

If you are using the sixDoFRigidBodyMotion, you must import the additional motion solver library.

```
motionSolverLibs ( "libsixDoFRigidBodyMotionDev.so" );
```

The solver also allows you to specify an innerDistance and outerDistance parameter. These control how the sixDof solver morphs the mesh.

- Anything within the innerDistance directly moves the mesh nodes as a rigid body.
- Between the innerDistance and outerDistance, the mesh nodes are morphed.
- Outside the outerDistance, no morphing occurs.

But be careful. The outerDistance parameter must always be larger than the innerDistance parameter. If you try to specify outerDistance as smaller than innerDistance, the solver will override your inputs with default values.