﻿ Sloshing of water in a tank (3D, 6 degree of freedom) - XSim

Sloshing of water in a tank (3D, 6 degree of freedom)

Update: July 28, 2017
OpenFOAM 4.x

Case directory

\$FOAM_TUTORIALS/multiphase/interDyMFoam/ras/sloshingTank3D6DoF

Summary

Model geometry

We calculate the water flow in a shaking tank using the mesh movement function for 40 seconds. The volume of water is assumed to be about 20% of the tank, and the rest is air.

The properties of the water and air are specified in the file "constant/transportProperties".

The movement of the mesh is specified in the file "constant/dynamicMeshDict" as follows.

```dynamicFvMesh   solidBodyMotionFvMesh;
solidBodyMotionFvMeshCoeffs
{
solidBodyMotionFunction tabulated6DoFMotion;
tabulated6DoFMotionCoeffs
{
CofG            (0 0 0);
timeDataFileName "\$FOAM_CASE/constant/6DoF.dat";
}
}
```

The specified file "constant/6DoF.dat" contains the following values for 3 directions of translation and 3 directions of rotation up to 40 seconds, which define the motion.

```100
(
(0 ((0 0 0) (0 0 0)))
(0.40404 ((0.401298 0.952899 0.321827) (4.82741 2.79073 2.00649)))
(0.808081 ((0.786273 1.8071 0.635266) (9.52899 5.3597 3.93137)))

…………

(39.596 ((1.625 0.77368 -0.260102) (-3.90153 5.2878 8.12498)))
(40 ((1.82589 1.65428 -0.575807) (-8.6371 2.70906 9.12945)))
)
```

In addition, the following settings are made in the file "system/controlDict" to output the pressure "p" at the specified point and surface. The output data will be saved in the folder "postProcessing".

```functions
{
probes
{
type            probes;
libs ("libsampling.so");
writeControl   timeStep;
writeInterval  1;
probeLocations
(
(0 9.95 19.77)
(0 -9.95 19.77)
);
fixedLocations  false;
fields
(
p
);
}
}
```

The meshes are as follows, and the number of mesh is 25840.

Meshes

The calculation result is as follows.

Surface boundary of water
Surface boundary of water at initial time
Surface boundary of water at final time
Pressure "p" at the specified coordinates. Solid line: coordinates (0, 9.95, 19.77), dashed line: coordinates (0, -9.95, 19.77).

Commands

cp -r \$FOAM_TUTORIALS/multiphase/interDyMFoam/ras/sloshingTank3D6DoF sloshingTank3D6DoF
cd sloshingTank3D6DoF

m4 system/blockMeshDict.m4 > system/blockMeshDict
blockMesh
cp 0/alpha.water.orig 0/alpha.water
setFields
interDyMFoam

# Display in 3D
paraFoam

# Draw the pressures at the specified coordinates as a graph
gnuplot
gnuplot>plot "postProcessing/probes/0/p" using 1:2 title 'point 1' with lines lc rgb "black", "postProcessing/probes/0/p" using 1:3 title 'point 2' with lines dt (5,5) lc rgb "black"

Calculation time

40 minutes 55.38 seconds *Single, Inter(R) Core(TM) i7-2600 CPU @ 3.40GHz 3.40GHz