ACU-T: 4002 Sloshing of Water in a Tank
Prerequisites
This tutorial provides instructions for running a transient simulation of a two-phase flow in a rectangular tank using the level set model. Prior to starting this tutorial, you should have already run through the introductory tutorial, ACU-T: 1000 UI Introduction, and have a basic understanding of HyperMesh CFD and AcuSolve. To run this simulation, you will need access to a licensed version of HyperMesh CFD and AcuSolve.
Since the HyperMesh CFD database (.hm file) contains meshed geometry, this tutorial does not include steps related to geometry import and mesh generation.
Problem Description
The problem to be solved is shown schematically in the figure below. It consists of a partially filled water tank and from time t=0, water inside the tank is subjected to a sinusoidal varying body force along x-direction and constant gravity along y-direction.
The body force in the x-direction is given by the expression:
- Α = Amplitude of oscillation = -0.06 m
- ω = Frequency of oscillation = = 3.6 rad/sec
- T = Time period of oscillation = 1.74 sec
- φ = Phase difference = 0
Start HyperMesh CFD and Open the HyperMesh Database
- Start HyperMesh CFD from the Windows Start menu by clicking .
-
From the Home tools, Files tool group, click the Open Model tool.
The Open File dialog opens.
- Browse to the directory where you saved the model file. Select the HyperMesh file ACU-T4002_TankSloshing.hm and click Open.
- Click .
-
Create a new directory named Tank_Sloshing and navigate into this directory.
This will be the working directory and all the files related to the simulation will be stored in this location.
- Enter tank_sloshing as the file name for the database, or choose any name of your preference.
- Click Save to create the database.
Validate the Geometry
The Validate tool scans through the entire model, performs checks on the surfaces and solids, and flags any defects in the geometry, such as free edges, closed shells, intersections, duplicates, and slivers.
Set Up the Problem
Set Up the Simulation Parameters and Solver Settings
-
From the Flow ribbon, click the Physics tool.
The Setup dialog opens.
-
Under the Physics models setting:
- Activate the Multiphase flow radio button.
- Set the Multifluid type to Immiscible and the Immiscible material to Air-Water
- Set the Time step size to 0.006 and the Final time to 4.0
- Select Laminar as the Turbulence model.
- Set the gravity to -9.81 m/sec2 in the y direction.
- Select Absolute for the Pressure scale.
-
Click the Solver Controls setting.
- Set the Minimum stagger iterations to 2.
- Set the Maximum stagger iterations to 6.
- Close the dialog and save the model.
Assign Material Properties
-
From the Flow ribbon, click the Material tool.
- In the Materials legend, verify that Air-Water is assigned.
- Click on the guide bar.
Set the Body Force
-
From the Flow ribbon, click the tool.
- Select the solid body.
- In the microdialog, set the Type to User Function.
-
Click and enter the following
values.
These values are for the amplitude of oscillation = -0.06 m; time period of oscillation = 1.74 sec; Phase difference = 0
-
In Momentum Source legend, double-click on Momentum,
rename it to bodyForce, then press Enter.
Note: The values provided above are the ones described in the problem description. The user values should be provided in the same order as shown above because these values will be passed on to the UDF script, which refers to these values in specific order.
- On the guide bar, click to execute the command and exit the tool.
Compile the Body Force UDF
-
For Windows:
-
For Linux:
Define Flow Boundary Conditions
-
From the Flow ribbon, click the No Slip tool.
-
Select all four surfaces shown in the figure below.
- Click on the guide bar.
-
Click the Slip tool.
-
Select the right most face on the positive z-axis, as shown in the figure
below.
- In the Boundaries legend, double-click on Slip, rename it to z_pos, then press Enter.
- On the guide bar, click to execute the command and remain in the tool.
- Rotate the model and select the opposite face.
- In the Boundaries legend, rename Slip to z_neg.
- Click on the guide bar.
- Save the database.
Define Nodal Initial Conditions
-
From the Solution ribbon, click the
Plane tool.
- Select the solid body.
- Click Plane on the guide bar.
- Click any point on the model to initially position the plane.
-
Click in the microdialog and
manually set the plane axis to Y.
-
Click and set the coordinates to (0.60, 0.12,
0.10).
- Press Esc two times.
- Click to add a variable then select Fluid from the list.
-
Make sure that the Value is set to Water then press
Esc again.
- Click on the guide bar.
- Save the database.
Define Nodal Outputs
-
From the Solution ribbon, click the Field tool.
The Field Output dialog opens.
-
Set the parameters for Solution variables as shown in the figure below.
Run AcuSolve
-
From the Solution ribbon, click the Run tool.
The Launch AcuSolve dialog opens.
- Set the Parallel processing option to Intel MPI.
- Optional: Set the number of processors to 4 or 8 based on availability.
- Expand the Default initial conditions tab and deactivate the Pre-compute flow and Pre-compute turbulence options.
- Set the x-velocity to 0.
-
Leave the remaining options as default and click
Run to launch AcuSolve.
The Run Status dialog opens. Once the run is complete, the status is updated and you can close the dialog.Tip: While AcuSolve is running, right-click on the AcuSolve job in the Run Status dialog and select View Log File to monitor the solution process.
Post-Process the Results with HM-CFD Post
- Once the solution is completed, navigate to the Post ribbon.
- From the menu bar, click .
-
Select the AcuSolve log file in your problem
directory to load the results for post-processing.
The solid and all the surfaces are loaded in the Post Browser.
-
Click the Top face on the View Cube to align the
model.
- Right-click on the z_pos boundary in the Post Browser and select Edit.
- In the display properties microdialog, set the display to volume fraction water.
- Activate the Legend toggle and click to refresh the range.
-
Click , and set the Colormap Name to Rainbow
Uniform.
- Click on the guide bar.
-
Click at the bottom of the modeling window to view a live animation of the flow.
-
Save the animation.
- Go to .
- Click on the toolbar.
- Uncheck Include mouse cursor.
- Set the frame rate to 24.
- Click on the toolbar then drag over the area you want to record.
- Click to start recording and the same button to stop recording.
- Name the file and save it.
Summary
In this tutorial, you successfully learned how to set up and solve a transient multiphase flow problem involving water sloshing in a tank using HyperMesh CFD and AcuSolve. You also learned how to create a multiphase model using the Level Set method and specify the body force using a user-defined function and then compile the UDF. Once the solution was computed, you post-processed the results using the Post ribbon where you generated an animation of the water sloshing in the tank.