6. Moving reference frame

The computational domain can be placed in a moving reference frame. This may for example be useful for simulation liquid sloshing inside moving tanks or for simulations ships at forward speed.

Regular constant, linear and/or oscillatory motion can be described using an internal model. For more complex motions a time trace can be imported from file.

6.1. Virtual body force

The relation between the inertial velocity \(\mathbf{v}\) and the body-fixed velocity \(\mathbf{u}\) is defined as follows:

\[\frac{D\mathbf{v}}{Dt} = \ddot{\mathbf{x}} + \dot{\mathbf{\omega}}\times \mathbf{r} + \mathbf{\omega}\times\left(\mathbf{\omega}\times\mathbf{r} \right) + 2\mathbf{\omega}\times\mathbf{u} + \frac{D\mathbf{u}}{Dt}\]

Here the first term, \(\ddot{\mathbf{x}}\), is the linear acceleration of the origin of the body-fixed frame with respect to the origin of the inertial frame. The relation between the external linear acceleration and the linear acceleration as measured inside the moving frame, say \(\ddot{\mathbf{x}}^\prime\), is as follows:

\[\ddot{\mathbf{x}} = \ddot{\mathbf{x}}^\prime + \mathbf{\omega} \times \mathbf{\dot{\mathbf{x}}}\]

The properties of the moving reference frame can be specified in the inertial system or in the body-fixed system. If the motion is specified in the body-fixed system, the acceleration term is adjusted automatically, hence the correction involving the cross product \(\mathbf{\omega} \times \mathbf{\dot{\mathbf{x}}}\) should not be included in the input.

Besides the linear acceleration term we recognize the following contributions:

  • centrifugal acceleration: \(\mathbf{\omega}\times\left(\mathbf{\omega}\times\mathbf{r} \right)\)
  • Coriolis acceleration: \(2\mathbf{\omega}\times\mathbf{u}\)
  • Euler acceleration: \(\dot{\mathbf{\omega}}\times \mathbf{r}\)

6.2. Regular motions

Regular motions involving constant(ly accelerated) and/or oscillatory translations and/or rotations can be specified directly in the XML input file.

Let the linear and angular motion of the reference frame be denoted by

\[\mathbf{x}(t) = [x(t)\; y(t)\; z(t)\;R(t)\; P(t)\; Y(t)].\]

The linear motion is measured in meters and the angular motion is measured in degrees. The motion equations for the built-in model are then defined as follows:

\[\begin{split}\mathbf{x} &= \mathbf{x}_0 + \mathbf{u}_0 t + \frac{1}{2}\mathbf{a}_0 t^2 + \mathbf{r} \cos\mathbf{\theta} \\ \dot{\mathbf{x}} &= \mathbf{u}_0 + \mathbf{a}_0 t - \mathbf{r} \dot{\mathbf{\theta}} \sin\mathbf{\theta} \\ \ddot{\mathbf{x}} &= \mathbf{a}_0 - \mathbf{r} \dot{\mathbf{\theta}}^2 \cos\mathbf{\theta} \\ \mathbf{\theta} &= 2\pi\;\mathbf{f}\;t + \pi \mathbf{\phi}/180\end{split}\]

where \(\mathbf{x}_0\) is the initial position, \(\mathbf{u}_0\) is the constant velocity, \(\mathbf{a}_0\) is the constant acceleration, \(\mathbf{r}\) is the amplitude of the oscillatory motion, \(\mathbf{f}\) is the frequency (Hz) of oscillation and \(\mathbf{\phi}\) is the phase offset expressed in degrees.

6.3. Irregular motions

Irregular motions can be imported from file. The file contains basic ASCII tabular data, consisting of 19 columns:

  • column 01: time [s]
  • columns 02 to 07: linear and angular position [ m (x3), deg (x3) ]
  • columns 08 to 13: linear and angular velocity [ m s^-1 (x3), deg s^-1 (x3)]
  • columns 14 to 19: linear and angular acceleration [ m s^-2 (x3), deg s^-2 (x3)]

Note that the simulation time interval as defined in comflow.cfi should be fully contained in the specified time trace. An error message will be displayed if this is not the case.

Hint

The old input format based on the input files dis_geo.in, vel_geo.in and acc_geo.in can be converted to the new input format using the following MATLAB script:

dis = load('dis_geo.in','-ascii');
vel = load('vel_geo.in','-ascii');
acc = load('acc_geo.in','-ascii');

all = [ dis, vel(:,2:end), acc(:,2:end) ];

all(:, 5:7 ) = all(:, 5:7 )*180/pi;
all(:,11:13) = all(:,11:13)*180/pi;
all(:,17:19) = all(:,17:19)*180/pi;

save('moving_frame.in','all','-ascii');

6.4. Interactively moving objects

Warning

Although it is possible to include (interactively) moving objects inside a moving reference frame, this functionality has not been sufficiently tested yet. Force calculations may still be incorrect, in particular in case of complex motions, and therewith may affect the motion of the object or the post-processing of forces.

6.5. Getting started

The following XML snippets summarize the available options for the moving reference frame.

<domain>
     <extents> -0.15 0.15  0.0 3.8  0.0 2.7 </extents>

     <moving_frame type="regular" gravity_frame="inertial" definition_frame="inertial">
          <position>      0. 0.  0. 0. 0. 0. </position>      <!-- initial position: m (3x), deg (3x) -->
          <velocity>      0. 0.  0. 0. 0. 0. </velocity>      <!-- constant velocity: m s^-1 (3x), deg s^-1 (3x) -->
          <acceleration>  0. 0.  0. 0. 0. 0. </acceleration>  <!-- constant acceleration: m s^-2 (3x), deg s^-2 (3x) -->
          <amplitude>     0. 0.1 0. 0. 0. 0. </amplitude>     <!-- oscillation amplitude: m (3x), deg (3x) -->
          <frequency>     1. 0.  0. 0. 0. 0. </frequency>     <!-- oscillation frequency: Hz (6x) -->
          <phase>         0. 0.  0. 0. 0. 0. </phase>         <!-- oscillation phase offset: deg (6x) -->

          <origin>        0. 1.9 0.          </origin>        <!-- origin on computational grid: m (3x) -->
     </moving_frame>
</domain>

In this example an oscillatory sway motion is specified. Typically both the motion and gravitational acceleration are defined in the inertial (earth-fixed) frame. The option moving_frame/origin may be used to specify the origin of motion on the computational grid.

In order to import a motion time trace from file, the following XML settings may be used:

<domain>
     <extents> -0.15 0.15  0.0 3.8  0.0 2.7 </extents>

     <moving_frame type="time_trace" gravity_frame="inertial" definition_frame="inertial">
          <origin> 0. 1.9  0. </origin>   <!-- origin on computational grid: m (3x) -->
     </moving_frame>
</domain>

Typically the properties of the moving reference frame are defined in the inertial frame. This is realized by using XML option moving_frame/@definition_frame="inertial". If the measurement equipmant was located on board of the moving object it may be more practical to define the motion in the body-fixed frame by using XML option moving_frame/@definition_frame="body_fixed".