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

## Contents

# 1 Example Interface

dynamicMeshDict { dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { //Parameter Definitions } motionSolverLibs ( "libfvMotionSolvers.so" ); }

## 1.1 Variation for Multi-body Motion

You can also specify different motions for multiple bodies. This is a case where you have multiple subdomains defined, and each subdomain is a body. You may then specify different prescribed motions for each body. The motions must also be prescribed motion. You can not specify different motion solvers for each body.

dynamicMeshDict { dynamicFvMesh multiSolidBodyMotionFvMesh; multiSolidBodyMotionFvMeshCoeffs { motionBody1 { solidBodyMotionFunction oscillatingRotatingMotion; oscillatingRotatingMotionCoeffs { //Motion Coefficients } } motionBody2 { solidBodyMotionFunction rotatingMotion; rotatingMotionCoeffs { //Motion Coefficients } } } motionSolverLibs ( "libfvMotionSolvers.so" ); }

The motions within each body are defined the same as a single body motion is defined. The rest of this page focuses on motion definitions assuming a single body. But all motions can be adapted to be used in multi-body motions as well.

# 2 Motion Functions

There are several motion functions supported. These define the characteristic of the presecribed motion. Each motion function has a series of parameters associated to characterize the motion.

- axisRotationMotion: constant velocity rotating motion.
- linearMotion: constant velocity linear displacement.
- oscillatingLinearMotion: oscillating linear displacement that follows a sinusoidal pattern.
- oscillatingRotatingMotion: oscilating rotating motion that follow a sinusoidal pattern.
- rotatingMotion: constant rotational displacement.
- SDA: Motion specific to marine ship motion. Three degree of freedom ship motion.
- tabulated6DoFMotion: A set of tabluated values that specify the six degree of freedom motion for the body.
- multiMotion: a combination of other defined motions.

Several of these motions can be used in semi-steady flow cases. These may apply to cases like a frozen rotor where the rotor is solved for several representative rotated positions. The remainder of the motions are intended for true time dependent motion.

## 2.1 axisRotationMotion

Axis rotation motion is similar to rotating motion. Only instead of specifying an axis and rotation velocity, the two are combined into a single 3D vector definition. One very important difference: the axisRotationMotion function expects a rotation speed in *deg/s*, where the rotatingMotion function expects rotation speed in *rad/s*. When running using these two functions, always check that your rotation speed matches what you expected.

dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { cellZone rotating; solidBodyMotionFunction axisRotationMotion; axisRotationMotionCoeffs { origin ( 0 0.5 5.0 ); radialVelocity ( 0 0 360); //Vector rotation direction, in deg/s } }

### 2.1.1 cellZone

cellZone rotating;

The cellZone ID. This is the name of a cellZone designated during the meshing operation. Use this to specify a subdomain for rotating turbomachinery or propellers. If you do not have a cellZone, you can rotate the entire domain instead. To rotate the entire domain, either specify "none" for the cellZone, or do not include this entry.

### 2.1.2 origin

origin ( 0 0.5 5.0 );

The origin of rotation. This will be the rotation point. Specified as a vector from the simulation origin. Vector units are in the units of your simulation, usually in meters.

### 2.1.3 radialVelocity

radialVelocity ( 0 0 360); //Vector rotation direction, in deg/s

This is the rotation speed of you domain/subdomain, specified as a 3D vector. This is not a unit vector. The magnitude of the vector is the speed of rotation. The component directions of the vector specify the direction of your rotation axis. The domain/subdomain will rotate about this axis.

The units of input are not entirely clear. Some examples and source code suggest that input units for this motion are deg/s. But in general, OpenFOAM expects rotational motion to be specified in units of radians. Please carefully check your simulations if using this motion.

## 2.2 linearMotion

Linear motion specifies a constant velocity linear displacement. It can be applied to the entire domain or just a subdomain.

dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { cellZone Motion; solidBodyMotionFunction linearMotion; linearMotionCoeffs { velocity (1.0 0.0 0.25); } }

### 2.2.1 cellZone

cellZone Motion;

The cellZone ID. This is the name of a cellZone designated during the meshing operation. Use this to specify a subdomain if you have linear motion of just a single portion of the domain. Or if you wish to move the entire domain, then specify "none" or do not include this parameter.

### 2.2.2 velocity

velocity (1.0 0.0 0.25);

This is the vector of linear velocity for the motion of your domain/subdomain. Specified as a vector. The magnitude of the vector is your total velocity. The individual component directions specify the direction of velocity. Units are in the unit system of your simulation, typically in meters/s.

## 2.3 oscillatingLinearMotion

The oscillatingLinearMotion provides an oscillating motion that varies with a defined frequency. This is useful to model scenarios like oscillating pistons. This creates a non-uniform velocity for mesh displacement that varies sinusoidally.

dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { cellZone moving; solidBodyMotionFunction oscillatingLinearMotion; oscillatingLinearMotionCoeffs { amplitude (3.0 0.5 2.0); omega 5.25; } }

### 2.3.1 cellZone

cellZone moving;

The cellZone ID. This is the name of a cellZone designated during the meshing operation. Use this to specify a subdomain for motion. If you do not have a cellZone, you can move the entire domain instead. To move the entire domain, either specify "none" for the cellZone, or do not include this entry.

### 2.3.2 amplitude

amplitude (3.0 0.5 2.0);

This is the amplitude of the linear motion. The linear motion amplitude is provided as a 3D vector definition. The total magnitude of the vector provides the amplitude of the motion. The individual component directions specify the direction of oscillation. All components oscillate at the same frequency. Motion is provided in the units defined for the simulation, typically meters.

### 2.3.3 omega

omega 5.25; //rad/s

This is the frequency of oscillation. The linear motion will oscillate at this frequency. The frequency is defined in units of rad/s.

## 2.4 oscillatingRotatingMotion

The oscillatingRotatingMotion creates a non-uniform rotational motion. The motion varies sinusoidally, creating an oscillating pattern. This is useful to model oscillating wheels, pendulums, or other rotating objects that follow a periodic motion.

dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { cellZone rotating; solidBodyMotionFunction oscillatingRotatingMotion; oscillatingRotatingMotionCoeffs { origin (0 0.5 1.5); amplitude (3.0 0.5 2.0); //units of rad omega 5.25; //units of rad/s } }

### 2.4.1 cellZone

cellZone rotating;

The cellZone ID. This is the name of a cellZone designated during the meshing operation. Use this to specify a subdomain for rotating turbomachinery or propellers. If you do not have a cellZone, you can rotate the entire domain instead. To rotate the entire domain, either specify "none" for the cellZone, or do not include this entry.

### 2.4.2 origin

origin (0 0.5 1.5);

The origin of rotation. This will be the rotation point. Specified as a vector from the simulation origin. Vector units are in the units of your simulation, usually in meters.

### 2.4.3 amplitude

amplitude (3.0 0.5 2.0); //units of rad

This is the amplitude of the rotating motion. The rotating motion amplitude is provided as a 3D vector definition. The total magnitude of the vector provides the amplitude of the motion. The individual component directions specify the axis of rotating oscillation. Rotation will oscillate about this axis. All component directions oscillate at the same frequency. Motion is defined in units of rad.

### 2.4.4 omega

omega 5.25; //rad/s

This is the frequency of oscillation. The linear motion will oscillate at this frequency. The frequency is defined in units of rad/s.

## 2.5 rotatingMotion

This provides a simple definition for constant rotation of the mesh. You can rotate the entire domain, or only a single cell zone within the domain. This is very useful for time simulation of turbomachinery.

dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { cellZone rotating; solidBodyMotionFunction rotatingMotion; rotatingMotionCoeffs { origin ( 0 0.5 5.0 ); axis ( 0 0 1); omega 5.52 //5.52 rad/s } }

### 2.5.1 cellZone

cellZone rotating;

The cellZone ID. This is the name of a cellZone designated during the meshing operation. Use this to specify a subdomain for rotating turbomachinery or propellers. If you do not have a cellZone, you can rotate the entire domain instead. To rotate the entire domain, either specify "none" for the cellZone, or do not include this entry.

### 2.5.2 origin

origin ( 0 0.5 5.0 );

The origin of rotation. This will be the rotation point. Specified as a vector from the simulation origin. Vector units are in the units of your simulation, usually in meters.

### 2.5.3 axis

axis ( 0 0 1);

The axis or rotation. This specifies the directionality for rotation. The domain/subdomain will rotate about this axis. Axis is specified as a 3D vector. Units of the vector are in units of your simulation, typically meters. OpenFOAM will automatically convert your vector definition into a unit vector.

### 2.5.4 omega

omega 5.52 //5.52 rad/s

The rate of rotate for your domain/subdomain. This is specified in a rate of radians/s. Positive and negative rotation rates can be specified. The direction of rotation follows the right-hand rule around the rotation axis you defined.

## 2.6 SDA

SDA is a motion specific to modeling in marine applications. SDA creates a prescibed motion in three directions: roll, heave, and sway. This was intended to simulate the motion of a vessel in a seaway. The intended application was tank sloshing of a large liquid storage tank in the vessel. In this scenario, the tank would be modeled as the CFD domain, and the SDA motion would be applied to simulate the motions of the ship and drive the tank sloshing. The SDA description is a fairly large entry and has its own page.

## 2.7 tabulated6DoFMotion

The tabulated6DoFMotion allows the user to specify a set of complex interconnected motions, through the use of an external table that gives the motion at several points in time.

dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { solidBodyMotionFunction tabulated6DoFMotion; tabulated6DoFMotionCoeffs { CofG ( 1.0 3.0 2.5 ); timeDataFileName "Absolute Path to data file/datafile.dat"; } }

### 2.7.1 CofG

CofG ( 1.0 3.0 2.5 );

This is the body center of gravity. Rotation motions use the CofG as the reference point. The CofG will move with the linear motion vector defined.

### 2.7.2 timeDataFileName

The path to the data file can also include environment variables. So if you have an evironment variable defined to specify your current case, the file path can be simplified.

timeDataFileName "$FOAM_CASE_PATH/Relative Path to data file/datafile.dat";

The data file specifies the exact magnitude and direction of motion for a series of time points. It is given as a vector of linear displacement and a vector of rotation about the center of gravity (CofG) defined in the input. The data file is linearly interpolated, so your time points do not need to match the timesteps of the simulation.

The format of the data file is shown below

4 //number of data points in the file //Position formatting is not important. File is based on the character sequence only. //Vectors are not relative. Each vector is total displacement and total rotation. ( //(time_point ( (linear displacement vector) (rotation vector) ) ) //(seconds ( (following unit system, usually meters) (radians) ) ) (0 ( (0.25 0.50 1.0) (0.220 0.30 0.40) ) ) (0.25 ( (0.50 1.0 2.0) (0.60 0.60 0.60) ) ) (0.75 ( (0.75 5.0 1.0) (1.2 2.4 5.0) ) ) (10.0 ( (0.1 6.0 1.0) (5.0 3.0 5.5) ) ) )

Each time point first specifies the reference time. Then the motion is contained within a group. The linear displacement and angular rotation are both contained in their own vector lists.

## 2.8 multiMotion

Multimotion combines multiple motion functions. An example would be a domain moving with oscillating linear motion, but with a different frequency of oscillation in each direction. This would not be possible with a single definition of "oscillatingLinearMotion". However, you could use multiMotion to provide three different definitions of "oscillatingLinearMotion", where each motion had a different frequency of oscillation. This allows you to create complex motions by combining multiple simple motion functions.

dynamicFvMesh solidBodyMotionFvMesh; solidBodyMotionFvMeshCoeffs { solidBodyMotionFunction multiMotion; multiMotionCoeffs { NameofMotion1 //Specify any name you want. Names must be unique. No repeats of previous definitions. { solidBodyMotionFunction typeOfMotionFunction; //Specify the type of motion function using the previous keywords. typeOfMotionFunctionCoeffs { //Parameters for the individual motion function. //The function definition happens just as a case where you only have a single motion function. } } NameofMotion2 //Specify any name you want. Names must be unique. No repeats of previous definitions. { solidBodyMotionFunction typeOfMotionFunction; //Specify the type of motion function using the previous keywords. typeOfMotionFunctionCoeffs { //Parameters for the individual motion function. //The function definition happens just as a case where you only have a single motion function. } } } }

The individual parameters for each sub motion are the same as previously defined. You can use the same type of motion function multiple times, simply varying the parameter values. Or each motion function can be entirely different. The only criteria is that each defined motion function must have a unique name. No repeating names of motion functions.

# 3 User Notes

- When using oscillating motion functions, be sure to examine the results if the function initializes with zero motion, or initializes with motion equal to the defined amplitude. This is the equivalent of initializing with a sine function or cosine function.