ACU-T: 4002 Sloshing of Water in a Tank
This tutorial provides the instructions for setting up, solving and viewing results for a transient simulation of a two-phase flow in a rectangular tank using the level set model. In this simulation, AcuSolve is used to compute the time-varying water-level interface due to sloshing of the water against the tank walls. This tutorial is designed to introduce you to a number of modelling concept necessary to perform two-phase simulations.
- Two-phase flow simulation
- Transient simulation
- Use of a script for the water volume fraction initialization
- Use of user defined function for varying gravity
- Post-processing with AcuFieldView
Prerequisites
You should have already run through the introductory tutorial, ACU-T: 2000 Turbulent Flow in a Mixing Elbow. It is assumed that you have some familiarity with AcuConsole, AcuSolve, and AcuFieldView. You will also need access to a licensed version of AcuSolve.
Prior to running through this tutorial, copy AcuConsole_tutorial_inputs.zip from <Altair_installation_directory>\hwcfdsolvers\acusolve\win64\model_files\tutorials\AcuSolve to a local directory. Extract sloshing_tank.x_t and gravity.cfrom AcuConsole_tutorial_inputs.zip.
Analyze the Problem
An important step in any CFD simulation is to examine the engineering problem at hand and determine the important parameters that need to be provided to AcuSolve. Parameters can be based on geometrical elements (such as inlets, outlets, or walls) and on flow conditions (such as fluid properties, velocity).
In general, multiphase flows are mainly observed in real life environment, consisting of two or more fluids (gas, liquid, or solid). They have possible combinations of gas-liquid (dissolved gas), liquid-liquid (oil in water), liquid-solid (immersed particles), as well as gas-liquid-solid. The first two are examples of two-phase immiscible flows. The two-phase immiscible flows can be solved by tracking the interface between the two-phases. This tutorial will guide you through how to set up the two-phase flow problem using the level set method.
- Α = Amplitude of oscillation
- ω = Frequency of oscillation =
- T = Time period of oscillation
- φ = Phase difference
- t = Time
- Α = -0.06 m
- ω = 3.6 rad/sec
- T = 1.74 sec
- φ = 0
A UDF (gravity.c) written in C language is used for this purpose. For the details of the functions used in the gravity.c, refer to the AcuSolve User-Defined Functions Manual.
Define the Simulation Parameters
Start AcuConcolse and Create the Simulation Database
In this tutorial, you will begin by creating a database, populating the geometry-independent settings, loading the geometry, creating groups, setting group attributes, adding geometry components to groups, and assigning mesh controls and boundary conditions to the groups. Next you will generate a mesh and run AcuSolve to solve for the number of time steps specified. Finally, you will visualize some characteristics of the results using AcuFieldView.
Set General Simulation Parameters
In the next steps you will set attributes that apply globally to the simulation. To simplify this task, you will use the BAS filter in the Data Tree Manager. This filter reduces the number of items shown in the Data Tree to make navigation easier.
Set Solution Strategy Parameters
Set the Material Model Attributes
Import the Geometry and Define the Model
Import the Geometry
Set the Multiphase Parameters
When Multiphase is activated in the Problem Description, by selecting a Multiphase equation, AcuConsole automatically generates the necessary set of parameters required to complete the multiphase model definition. These include defining the fields in the model, and also specifying the interaction models between the fields.
In this section you will define the multiphase parameters for the simulation.
-
Define the Fields:
- Click on ALL in the Data Tree Manager to display all available simulation settings.
- Expand the Data Tree item.
- Under Multiphase Parameters, expand the Fields item.
- Double-click Air.
- Set Modify advanced settings to On and check that the Material model is set to Air.
- Double-click Water.
- Set Modify advanced settings to On and check that the Material model is set to Water.
-
Define the Field Interaction Model:
- Under Multiphase Parameters, expand the Field Interaction Model item.
- Double-click Air-Water to open the detail panel.
- Set Modify advanced settings to On.
- Click Open Refs next to Fields 1.
- Check that the entry in the Reference Editor is Air.
- Click Open Refs next to Fields 2.
- Check that the entry in the Reference Editor is Water.
- Set the Surface tension model to None.
- Set the Interface thickness option to Auto.
-
Define the Multiphase Model:
- Under Multiphase Parameters, expand the Multiphase Model item.
- Double-click Air-Water to open the detail panel.
- Set Modify advanced settings to On.
- Click Open Refs next to Field interaction models.
- Check that the entry in the Reference Editor is Air-Water.
Set the Body Force
The body force commands add volumetric source terms to the governing conservation equations. In this tutorial, gravitational body force will be applied to the fluid fields. The sinusoidal varying body force along x direction and constant gravity along y-direction will be defined as given by Equation 1.
Compile the UDF
A UDF in the form of C language (gravity.c) is provided with the tutorial. This program should be compiled using the following steps:
-
For Windows:
-
For Linux:
Define Nodal Outputs
The nodal output command specifies the nodal output parameters, for example, output frequency and number of saved states.
Set the Initial Conditions
Apply Volume Parameters
Volume groups are containers used for storing information about a volume region. This information includes solution and meshing parameters applied to the volume and the geometric regions that these settings are applied to.
When the geometry was imported into AcuConsole, all volumes were placed into the "default" volume container.
Since the model for this tutorial has only a single volume, it will be the only volume in the default volume group when the geometry is imported. Even when there is a single volume in the model, it is advisable to rename the volume for ease of identification in future. In the next steps you will rename the default volume group container, and set the material and other properties for it.
Create Surface Groups and Apply Surface Attributes
Surface groups are containers used for storing information about a surface, including solution and meshing parameters, and the corresponding surface in the geometry that the parameters will apply to.
In the next steps you will define surface groups, assign the appropriate settings for the different characteristics of the problem, and add surfaces to the group containers.
In the process of setting up a simulation, you need to move into different panels for setting up the boundary conditions, mesh parameters, and so on, which can sometimes be cumbersome (especially for models with too many surfaces). To make it easier, less error prone, and for saving time, two new dialogs are provided in AcuConsole which you can use to verify and provide the information for all surface or volume entities at once. They are the Volume Manager and Surface Manager. In this section some features of the Surface Manager are exploited.
Assign Mesh Controls
Set Global Mesh Attributes
Now that the flow characteristics have been set for the whole problem, a sufficiently refined mesh has to be generated.
Global mesh attributes are the meshing parameters applied to the model as a whole without reference to a specific geometric volume, surface, edge, or point. Local mesh attributes are used to create mesh generation controls for specific geometry components of the model.
In the next steps you will set the global mesh attributes.
Define Mesh Extrusion
The present simulation is equivalent to a representation of a 2D cross section of the model. In AcuSolve, 2D models are simulated by having just one element across the faces of the cross section. Thus, when these faces are set up with a similar boundary condition, it coerces the corresponding nodes across the faces to have same results. In this problem, these faces are the negative and positive z-surfaces. This kind of mesh is achieved in AcuSolve with mesh extrusion process. In the following steps you will define the process of extrusion of the mesh between these surfaces.
Generate the Mesh
In the next steps you will generate the mesh that will be used when computing a solution for the problem.
Assign Reference Pressure
The present case does not have any inlet or outlet surfaces to define a boundary condition which sets the pressure level inside the domain. To make the solution more robust, you will set a pressure reference point using a nodal boundary condition. The following steps will show how to set up the reference pressure inside the CFD domain.
Compute the Solution and Review the Results
Run AcuSolve
In the next steps, you will launch AcuSolve to compute the solution for this case.
Post-Process with AcuFieldView
- How to find the data readers in the File menu and open up the desired reader panel for data input.
- How to find the visualization panels either from the Side toolbar or the Visualization panel menu to create and modify surfaces in AcuFieldView
- How to move the data around the graphics window using mouse actions to translate, rotate and zoom in to the data.
Set Up AcuFieldView
Coordinate the Surface Showing Water-Air Interface on the Mid Coordinate Surface
Visualize the Animation of the Water Flow
If the Sweep Control in this dialog says Sweep instead of Build, the Flipbook Build Mode is not active. In Sweep mode, you will be able to create and visualize the animation but you will not be able to save it. To be able to save the animation, enable the Flipbook Build Mode.
Summary
In this AcuSolve tutorial, you successfully set up and solved a multiphase flow problem. The problem simulated sloshing of a rectangular water tank due to the gravity. As the water sloshed against the walls, the air-water interface in the tank was visualized. You started the tutorial by creating a database in AcuConsole, importing and meshing the geometry, and setting up the simulation parameters. Air and water were modelled as different fields occupying a single volume. Once the case was setup, the solution was generated with AcuSolve. Results were post-processed in AcuFieldView where you generated an animation of the water flow. New features that were introduced in this tutorial include: use of user defined function for simulating varying gravity.