# ACU-T: 4000 Dam Break Simulation: Two Phase Problem

This tutorial provides the instructions for setting up, solving and viewing results for a transient dam break simulation using the level set method. In this simulation, a square column of water is initially held at rest by walls in one end of a reservoir. The simulation begins when the walls holding the water column are removed and the water is free to flow out. The simulation can be used to visualize and study the surge patterns as the column of water rushes out, as in a dam wall break.

The basic steps in any CFD simulation are shown in ACU-T: 2000 Turbulent Flow in a Mixing Elbow. The following additional capabilities of AcuSolve are introduced in this tutorial:
• Two-phase flow simulation using the level set method
• Transient simulation
• Use of a script for the water volume fraction initialization
• 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 damBreak2D.x_t from AcuConsole_tutorial_inputs.zip.

The color of objects shown in the modeling window in this tutorial and those displayed on your screen may differ. The default color scheme in AcuConsole is "random," in which colors are randomly assigned to groups as they are created. In addition, this tutorial was developed on Windows. If you are running this tutorial on a different operating system, you may notice a slight difference between the images displayed on your screen and the images shown in the tutorial.

## 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, or whether the flow should be modeled as turbulent or as laminar).

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.

The system being simulated contains a reservoir, along one corner of which stands a square water column, held in place by walls. At time t = 0 the walls are removed. As the walls are removed, the water column is now free to flow out and flow surges towards the other end of the reservoir. The simulation can be used to visualize and study the surge patterns as the column of water rushes out, as in a dam wall break.

The schematics of the problem which will be addressed in this tutorial is shown in Figure 1. The system will be modeled as a two-dimensional problem by including only a single layer of extruded elements in the spanwise direction.

## Define the Simulation Parameters

### Start AcuConsole and Create the Simulation Database

In this tutorial, you will begin by creating a database, populating the geometry-independent settings, loading the geometry, creating volume and surface groups, setting group parameters, 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 using AcuFieldView.

In the next steps you will start AcuConsole, and create the database for storage of the simulation settings.

1. Start AcuConsole from the Windows Start menu by clicking Start > Altair <version> > AcuConsole.
2. Click the File menu, then click New to open the New data base dialog.
3. Browse to the location that you would like to use as your working directory.
This directory is where all files related to the simulation will be stored. The AcuConsole database file (.acs) is stored in this directory. Once the mesh and solution are created, additional files and directories will be created within this directory.
4. Create a new directory in this location. Name it Dam_break and open it.
5. Enter damBreak_2D as the file name for the database.
Note: In order for other applications to be able to read the files written by AcuConsole, the database path and name should not include spaces.
6. Click Save to create the database.

### Set General Simulation Parameters

In next steps you will set parameters that apply globally to the simulation. To make this simple, the basic settings applicable for any simulation can be filtered using the BAS filter in the Data Tree Manager. This filter enables display of only a small subset of the available items in the Data Tree and makes navigation of the entries easier.

1. Click BAS in the Data Tree Manager to switch to basic view in the Data Tree.
2. Double-click the Global Data Tree item to expand it.
Tip: You can also expand a tree item by clicking next to the item name.
3. Double-click Problem Description to open the Problem Description detail panel.
Tip: You can also open a panel by right-clicking a tree item and clicking Open on the context menu.
4. Enter AcuSolve Multiphase Tutorial as the Title.
5. Enter Dam Break 2D as the Sub title.
6. Change the Analysis type to Transient.
7. Ensure Multiphase equation is set to Level Set.

### Set Solution Strategy Attributes

1. Double-click Auto Solution Strategy to open the Auto Solution Strategy detail panel.
2. Check that the Analysis type is set to Transient.
3. Set the Max time steps to 0.
4. Set the Final time to 1.0 secs.
5. Set the Initial time increment to 0.002498.
When setting up a transient analysis, if the Max time steps option is set to zero, this option is ignored. In such a case, the final time must be specified. AcuSolve will then run until this final time is reached, incrementing with the specified initial time increment at each time step.
6. Check that the Convergence tolerance is set to 0.001 seconds.
7. Set the Max stagger iterations to 5.
8. Set the Relaxation factor to 0.0.
When solving transient solutions, the relaxation factor should be set to zero. A non-zero relaxation factor causes incremental updates of the solution, which will impact the time accuracy of the solution for transient cases.
9. Check that Flow and Multifluid flags are turned On.
10. Check that Fluid 1 is set to Air.
11. Check that Fluid 2 is set to Water.
The options available to specify the fluids for Fluid 1 and Fluid 2 are taken from the material models already defined in the open AcuConsole database. When a new AcuConsole database is created, the available pre-defined fluid material models are Air and Water. If your model requires a fluid other than these two, you must create and define a new material model to match the specification of this fluid, before you can set it as one of the fluids in the Multifluid model definition.

### Set Material Model Parameters

AcuConsole has three pre-defined materials, Air, Aluminum, and Water, with standard parameters defined. In the next steps you will verify that the pre-defined material properties of air and water match the desired properties for this problem.
1. Double-click Material Model in the Data Tree to expand it.
2. Double-click Air in the Data Tree to open the Air detail panel.

The material type for air is Fluid. Fluid is the default material type for any new material created in AcuConsole.

3. In the Density tab, check the following:
1. The Type is set to Constant.
2. The Density value is 1.225 kg/m3.
4. Click the Viscosity tab. The viscosity of air is 1.781 x 10-5kg/m – sec.
5. Double-click Water in the Data Tree to open the detail panel.
The Material type for water is Fluid.
6. In the Density tab, check the following:
1. The Type is set to Constant.
2. The Density value is 1000 kg/m3.
7. Click the Viscosity tab. The viscosity of water is 0.001 kg/m – sec.

The remaining thermal and other material properties are not critical to this simulation. However, you may browse through the tabs to check the complete material specification

1. Save the database to create a backup of your settings. This can be achieved with any of the following methods.
• Click the File menu, then click Save.
• Click on the toolbar.
• Click Ctrl+S.
Note: Changes made in AcuConsole are saved into the database file (.acs) as they are made. A save operation copies the database to a backup file, which can be used to reload the database from that saved state in the event that you do not want to commit future changes.

### 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 go through and observe the multiphase parameters for the simulation as generated by AcuConsole.

1. Define the fields:
1. Click on ALL in the Data Tree Manager to display all available simulation settings.
2. Expand the Advanced Solution Strategy > Multiphase Parameters Data Tree item.
3. Under Multiphase Parameters, expand the Fields item.
4. Double-click Air.
5. Set Modify advanced settings to On and check that the Material model is set to Air.
6. Double-click on Water.
7. Set Modify advanced settings to On and check that the Material model is set to Water.
2. Define the Field Interaction Model:
1. Under Multiphase Parameters, expand the Field Interaction Model item.
2. Double-click Air-Water to open the detail panel.
3. Set Modify advanced settings to On.
4. Click Open Refs next to Fields 1.
5. Check that the entry in the Reference Editor is Air.
6. Click Open Refs next to Fields 2.
7. Check that the entry in the Reference Editor is Water.
8. Set the Surface tension model to None.
9. Set the Interface thickness option to Auto.
3. Define the Multiphase Model:
1. Under Multiphase Parameters, expand the Multiphase Model item.
2. Double-click Air-Water to open the detail panel.
3. Set Modify advanced settings to On.
4. Click Open Refs next to Field interaction models.
5. Check that the entry in the Reference Editor is Air-Water.

## Import the Geometry and Define the Model

### Import the Geometry

You will import the geometry in the next part of this tutorial. You will need to know the location of damBreak2D.x_t in order to complete these steps. This file contains information about the geometry in Parasolid ASCII format.
1. Click File > Import.
2. Browse to the directory containing damBreak2D.x_t.
3. Change the file name filter to Parasolid File (*.x_t *.xmt *X_T …).
4. Select damBreak2D.x_t and click Open to open the Import Geometry dialog.

For this tutorial, the default values for the Import Geometry dialog are used to load the geometry. If you have previously used AcuConsole, be sure that any settings that you might have altered are manually changed to match the default values shown in the figure. With the default settings, volumes from the CAD model are added to a default volume group. Surfaces from the CAD model are added to a default surface group. You will work with groups later in this tutorial to create new groups, set flow parameters, add geometric components, and set meshing parameters.

5. Click Ok to complete the geometry import.

### 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. Gravity will be defined as equal to standard gravity (g = 9.81 m/s­2) along the negative Y-axis, which is the downward direction in the model.

1. Double-click Body Force in the Data Tree to expand it.
2. Double-click on Gravity to open the Gravity detail panel.

The medium for gravity is Fluid. This means that the gravity defined here is applicable only on material models whose material type is fluid.

3. Click Open Array.
4. In the Array Editor dialog, enter:
• X-component: 0.0
• Y-component: -9.81 m/s2
• Z-component: 0.0
5. Click OK to complete the definition of gravity.
Note: The definition of gravity here will have no effect on the simulation unless it is assigned to some volume set in the model.

### Define Nodal Outputs

The nodal output command specifies the nodal output parameters, for example, output frequency and number of saved states.

1. Expand the Output tree, then double-click Nodal Output to open the Nodal Output detail panel.
2. Set Time step frequency to 1.
This will save the nodal outputs at every time step.
3. Set Output initial condition to On.
This will instruct the solver to write the initial state of the problem as the first output file.
4. Make sure that the Number of saved states is set to 0.
Setting this option to zero will instruct the solver to save all of the solution state files.

### Set the Initial Conditions

1. Double-click on Nodal Initial Condition in the Data Tree to open the detail panel.
2. Set the Pressure initial condition type to Script.
3. Click Open text next to Pressure script to open the text editor.
4. Enter the following script in the text editor:
value = 0.0
if (x<0.05715 and y<0.05715): value=9.81*1000.0*(0.05715-y)


This script will set the pressure initial condition in the domain. The region where x < 0.05715 and y < 0.05715 represents the region where the water column is initially held, bound by the dam walls. Within this region, the pressure is defined by the hydrostatic pressure level within the water column. For all other nodes in the domain, the pressure is set to zero. At these nodes, the pressure value represents the atmospheric pressure.

5. Click Ok to close the text editor.
6. Set the Multiphase field to Water.
7. Set Water initial condition type to Script.
8. Click Open Text next to Water volume fraction script to open the text editor.
9. Enter the following script in the text editor:
value = 0.0
if (x<0.05715 and y<0.05715): value=1.0


This script will set the initial volume fraction of the field water in the domain. For the nodes where x < 0.05715 and y < 0.05715 (the region occupied by the water column), the volume fraction of water will be set to 1. For all other nodes, the volume fraction of water will be set to zero. At these nodes, the volume fraction of air will be 1, as the sum of volume fractions of the field should always be unity.

10. Click Ok to close the text editor.

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

1. Expand the Model Data Tree item.
2. Right-click on Surfaces and click Display off to turn off the display of surfaces.
3. Expand Volumes. Toggle the display of the default volume container by clicking and next to the volume name.
Note: You may not see any change when toggling the display if Surfaces are being displayed, as surfaces and volumes may overlap.
4. Rename the default volume group.
1. Right-click on default.
2. Click Rename.
3. Enter Fluid as the new name and press Enter.
5. Set up the Fluid volume element set.
1. Expand Fluid in the Data Tree.
2. Double-click Element Set under Fluid to open it in the detail panel.
3. For Medium, select Multiphase.
4. For Multiphase model, select Air-Water.
5. For Body force, select Gravity.

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

1. In the Data Tree, right-click on Volumes and select Display off to turn off the display of volumes.
2. Right-click on Surfaces and select Surface Manager.
3. In the Surface Manager dialog, click New 2 times to create 2 new surface groups.
Note: If you cannot see the Simple BC Active and Simple BC Type columns, click Columns, select these two columns from the list, and click Ok.
4. Turn the display off for all surfaces except for default surface.
5. Rename Surface Names (column 1) for Surface 1 to Surface 2, and set the Simple BC Active and Simple BC Type columns as per the table shown below.
6. Assign the surfaces to the z_pos and z_neg surface groups.
1. In the z-pos row, click Add to.
2. Select the planar surface with the maximum z-coordinate as shown in figure below and click Done.
3. Similarly assign the surface with the minimum z-coordinate to the z_neg surface group.

When the geometry was loaded into AcuConsole, all geometry surfaces were placed in the default surface group container. This default surface group was renamed to sides. In the previous steps, you assigned some surfaces to various other surface groups that you created. At this point, all that is left in the sides surface group are the surfaces which make up the sides of the reservoir.

7. Close the Surface Manager dialog.

### Assign the Surface Parameters

1. Set up the z_pos and z_neg surface parameters:
1. In the Data Tree, under Surfaces, expand the z_pos surface group.
2. Double-click Simple Boundary Condition to open the detail panel.
3. Ensure the Type is set to Symmetry.
4. Similarly, check that the Simple Boundary Condition type for z_neg is also set to Symmetry.
2. Set up the sides surface parameters:
1. In the Data Tree, under Surfaces, expand the sides surface group.
2. Double-click Simple Boundary Condition to open the detail panel.
3. Ensure the Type is set to Wall.

## Assign Mesh Controls

### Set Global Meshing 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.

1. Click MSH in the Data Tree Manager to filter the settings in the Data Tree to show only the controls related to meshing.
2. Double-click the Global Data Tree item to expand it.
3. Double-click Global Mesh Attributes to open the Global Mesh Attributes detail panel.
4. Change the Mesh size type to Absolute.
1. Click the drop-down control next to Mesh size type.
2. Click Absolute.
5. Set Absolute mesh size to 0.002748 m.

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

1. Right-click Mesh Extrusions and select New.
2. Right-click Mesh Extrusion 1, select Rename and enter Z extrusion.
3. Double-click Z extrusion to open the settings dialog.
4. Verify that Geometry type is set to surface.
5. For Side 1, from the drop down, select z_neg.
6. For Side 2, from the drop down, select z_pos.
7. Check that the Extrusion type is set to Number of layers.
8. Set Number of layers to 1.
9. Under Extrusion options, select All tets.
10. Click OK to accept these settings.

### Generate the Mesh

In the next steps you will generate the mesh that will be used when computing a solution for the problem.

1. Click on the toolbar to open the Launch AcuMeshSim dialog.
2. Leave the default settings and select OK.

During meshing an AcuTail window opens. Meshing progress is reported in this window. A summary of the meshing process indicates that the mesh has been generated.

Note: The actual number of nodes and elements, and memory usage may vary slightly from machine to machine.
3. Visualize the mesh in the modeling window. Turn on the display of surfaces and set the display type to solid and wire.
4. You can rotate and zoom in the model to analyse the various mesh regions.

### Assign Reference Pressure

The present case does not have any inlet or outlet surfaces to define any boundary condition that 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 setup the reference pressure inside the CFD domain.

1. Expand the Model Data Tree item.
2. Right-click on Nodes and select New to create a new entity, Node 1.
3. Rename Node 1 to Fixed Pressure Node.
4. Right-click Fixed Pressure Node and select Define.
5. In the Node Define Dialog Box, set Selection Type to Pressure Point and Volumes to fluid.
6. Click OK.
7. Expand Fixed Pressure Node and enable Pressure.
The single node will now act as the pressure reference point for the simulation. The default Type of Zero sets the nodes in this set to pressure = 0.0.
8. Examine the location of the reference pressure node and check that it is inside the domain.
1. Right-click on Fixed Pressure Node and select Display on.
2. Right-click on Surfaces and set Display type to outline.
You should be able to see the fixed pressure node as a point, as shown in the figure below.

## Compute the Solution and Review the Results

### Run AcuSolve

In the next steps, you will launch AcuSolve to compute the solution for this case.

1. Click on the toolbar to open the Launch AcuSolve dialog.

For this case, the default settings will be used. You may choose to change the number of processors to allow AcuSolve to run using more processors (4 or 8), if available. HyperMesh will generate the required solver input files and launch AcuSolve. AcuSolve will calculate the steady state solution for this problem.

2. Select Ok to start the solution process.

While computing the solution, an AcuTail window opens. Solution progress is reported in this window. A summary of the solution process indicates that the run has been completed.

The information provided in the summary is based on the number of processors used by AcuSolve. If you use a different number of processors than indicated in this tutorial, the summary for your run may be slightly different than the summary shown.

3. Close the AcuTail window and save the database to create a backup of your settings.

### Post-Process with AcuFieldView

The tutorial has been written with the assumption that you have become familiar with the AcuFieldView interface and basic operations. In general, it will be helpful to understand the following basics:
• 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.
This tutorial shows you how to work with steady state analysis data.
1. Click on the AcuConsole toolbar to open the Launch AcuFieldView dialog.
2. Click OK to start AcuConsole.
You will see that the pressure contours have already been displayed on all the boundary surfaces with mesh.

#### Set Up AcuFieldView

1. Close the Boundary Surface dialog.
2. Click Viewer Options.
3. In the Viewer Options dialog:
1. Deselect Perspective to turn off the perspective view.
2. Click Axis Markers to disable the axis markers.
3. Click Close.
4. On the toolbar, click the Colormap icon .
5. In the Scalar Colormap Specification dialog, click Background and select White.
6. Close the Scalar Colormap Specification dialog.
7. Click the Toggle Outline icon on the toolbar to turn off the outline display.
Your display should look similar to figure below.

#### Coordinate the Surface Showing Water-Air Interface on the Mid Coordinate Surface

1. From the Surface tab in the Boundary Surface dialog, turn off the Visibility for the active boundary surfaces.
2. Click Create to create a new Boundary Surface set.
3. For the new set:
1. Turn on the visibility.
2. Set the Display Type to Outlines.
3. For Boundary Types, select All.
4. Click Ok.
5. Click to open the Coordinate Surface dialog.
6. Click Create to create a new coordinate surface.
7. Select Z as the Coordinate Plane.
This will create a coordinate surface at the mid – Z coordinate plane. The coordinate surface created is the mid plane between the two side surfaces in the model.
8. Change the Coloring to Scalar.
9. Change the Display Type to Smooth.
10. For Scalar Function, select volume_fraction-Water.
11. In the Colormap tab, set the maximum and minimum threshold values to 0.501 and 0.499 respectively.
12. From the Defined Views list, select +Z as the viewing direction.
Your view should be similar to Figure 22.

#### Visualize the Animation of the Water Flow

1. Close the Coordinate Surface dialog.
2. From the Tools menu, select Flipbook Build Mode.
3. In the Flipbook Size Warning window, click OK to close it.
4. Click Tools > Transient Data.
The Transient Data Controls dialog opens.

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.

1. Drag the time step slider to its leftmost position. Alternatively, enter zero in the Time Step or Solution Time box.
2. Click Apply.
The displayed state now corresponds to the initial state of the domain.
3. Click Build.
AcuFieldView will now build the frame-by-frame animation of the solution progressing through all the available time steps. You will be able to see the progress in the Building Flipbook dialog.

Once the Build process is complete, a Flipbook Controls dialog will appear.

4. In the Flipbook Controls dialog, click Frame Rate.
5. For Minimum time, enter 0.1 seconds and click Close.
6. Click Play to play the animation.
7. To save the animation, click Pause , and then click Save.
8. Provide a file name in the Flipbook File Save dialog, and click Save.

## Summary

In this AcuSolve tutorial, you successfully set up and solved a multiphase flow problem. The problem simulated a dam break scenario. A column of water initially held in place by walls in one end of the reservoir was let free to flow at the start of the simulation. 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 as it surges once the walls restricting the water column are removed. New features that were introduced in this tutorial include: setting up a multiphase flow simulation in AcuSolve with two fluids.