This tutorial includes:
In this tutorial you will learn about:
Modeling a multiphase simulation in CFX-Pre.
Creating and editing a rigid body in CFX-Pre.
Creating and editing a subdomain in CFX-Pre.
Creating a keyframe animation in CFD-Post.
Component | Feature | Details |
---|---|---|
CFX-Pre | User Mode | General mode |
Analysis Type | Transient | |
Fluid Type | General Fluid | |
Domain Type | Single Domain | |
Turbulence Model | Shear Stress Transport | |
Heat Transfer | Isothermal | |
Buoyant Flow | ||
Multiphase | Homogeneous Model | |
Rigid Body | 3 degrees of freedom | |
Boundary Conditions | Symmetry Plane | |
Wall: No Slip | ||
Wall (Specified Displacement) | ||
Opening | ||
Mesh Motion option of Rigid Body Solution | ||
Subdomain | Mesh Motion option of Rigid Body Solution | |
Ansys CFX Command Language (CCL) | Importing Expressions | |
CFD-Post | Plots | Contour Plot |
Animations | Keyframe |
In this tutorial you will model the interaction between a rigid body (represented by a buoy) and two fluids (air and water) that make up the surrounding region, using a six degrees of freedom rigid-body solver. In this case, the fluid forces acting on the buoy cause motion that is constrained to three degrees of freedom: vertical and horizontal translation and rotation about an axis perpendicular to the translational directions. The motion of the floating buoy results from interactions between itself and the wave motion of the surrounding fluid created by an initial contraction of the domain in the X direction.
The rigid body is surrounded by a fluid volume that is part
air and part water (both at a static temperature of 25°C
). Because the rigid body has a density of 500 kg m^-3 – less
than that of water (997 kg m^-3) – it floats atop the water's
surface. The right-side wall, highlighted yellow in the image above,
is given an initial velocity in the negative X direction, thereby
causing the fluid domain to shrink. This in turn causes waves in the
water. An opening is required along the top face to enable air to
move in and out of the fluid region while the volume fraction of air
and water are in a state of flux. Because of this contraction of the
fluid region, you will also need to define the mesh motion of the
domain, subdomain, and several of the boundary conditions.
A homogeneous, multiphase model will be used for this simulation because the air and water will maintain a well-defined interface. When setting up the initial conditions for the simulation, CCL-defined step functions will be used to determine the volume fractions of water and air defined by a function of height.
The relevant fluid parameters of this problem are:
Density of water =
997 [kg m^-3]
Static temperature of water =
25 [C]
Density of air =
1.185 [kg m^-3]
Static temperature of air =
25 [C]
The relevant physical parameters of the rigid body are:
Mass =
39.39 [kg]
Density =
500 [kg m^-3]
Volume =
0.07878 [m^3]
Mass moment of inertia (XX, YY, ZZ, XY, XZ, YZ) =
(4.5, 2.1, 6.36, 0, 0, 0) [kg m^2]
Initial Center of Mass (X, Y, Z) =
(0, —0.1438, 0.05) [m]
The first step in solving this problem is to import a pre-existing mesh file into CFX-Pre. A CCL file containing several mathematical expressions for this simulation will also be imported into CFX-Pre. The transient analysis conditions will then be defined and the default domain edited. A number of boundary conditions will also be created within CFX-Pre. Mesh motion within the domain and several of the boundary conditions will be specified because the domain will contract at the beginning of the simulation, and because the buoy will move freely due to wave motion causing motion of the fluids and hence the rigid body within the domain. In the first simulation, the motion of the mesh surrounding the rigid body will be fully coupled to the motion of the buoy, including the rotation of the buoy; the mesh will both rotate and translate with the buoy. In the second simulation the rotational and translational motion will be decoupled, enabling the inner cylindrical subdomain to rotate at the same rate as the buoy while the outer domain will deform solely with the translational motion of the buoy. In both simulations in CFD-Post, a contour plot will be created to visualize the air/water makeup of the fluid region and the mesh will be visible to observe the mesh when it deforms. In addition, one animation for each simulation will be produced in order to show the complex motion of the rigid body and mesh deformation.
If this is the first tutorial you are working with, it is important to review the following topics before beginning:
Create a working directory.
Ansys CFX uses a working directory as the default location for loading and saving files for a particular session or project.
Download the
buoy.zip
file here .Unzip
buoy.zip
to your working directory.Ensure that the following tutorial input files are in your working directory:
Buoy.gtm
Buoy.ccl
Set the working directory and start CFX-Pre.
For details, see Setting the Working Directory and Starting Ansys CFX in Stand-alone Mode.
In this simulation, the motion of the mesh surrounding the rigid body will be fully coupled to the motion of the buoy, including the rotation of the buoy; the mesh will both rotate and translate with the buoy.
This section describes the step-by-step definition of the flow physics in CFX-Pre.
In CFX-Pre, select File > New Case.
Select General and click .
Select File > Save Case As.
Under File name, type
Buoy
.Click
.
Right-click
Mesh
and select Import Mesh > CFX Mesh.The Import Mesh dialog box appears.
Configure the following setting(s):
Setting
Value
File name
Buoy.gtm
Click Open.
The mathematical expressions for this simulation will be imported from a CFX Command Language (CCL) file. These expressions will be used to set a monitor point and the physical parameters of the simulation: the fluid properties and the displacement of the walls and opening.
Note: The expressions or physics for a simulation can be saved to a CCL file at any time by selecting File > Export > CCL.
Select File > Import > CCL.
The Import CCL dialog box appears.
Under Import Method, select Append. This will start with the existing CCL already generated by CFX-Pre and append the imported CCL.
Note: Replace is useful if you have defined physics and want to update or replace them with newly-imported physics.
Select
Buoy.ccl
.Click Open.
Double-click the
Expressions
section in the Outline tree to see a list of the expressions that have been imported.All expressions required for this simulation are displayed. Take a moment to look over each expression. A brief description of each expression will be provided wherever it is implemented within this tutorial.
Close the
Expressions
section by clicking Close located at the top of the left workspace.Note: Note that you could have entered these expressions manually into CFX-Pre by inserting new expressions and defining each with an appropriate formula.
In the Outline tree view, right-click
Analysis Type
and select Edit.Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Analysis Type
> Option
Transient
Analysis Type
> Time Duration
> Option
Total Time
Analysis Type
> Time Duration
> Total Time
7.0 [s]
Analysis Type
> Time Steps
> Option
Timesteps
Analysis Type
> Time Steps
> Timesteps
0.025 [s] [a]
Analysis Type
> Initial Time
> Option
Automatic with Value
Analysis Type
> Initial Time
> Time
0 [s]
Click
.
Note: You may ignore the physics validation messages regarding the lack of definition of transient results files and the lack of initial condition values. You will set up the transient results files and set the initial conditions later.
In this section you will create the fluid domain to reflect the multiphase, homogeneous region surrounding the buoy, define the fluids, and enable mesh motion.
Edit
Case Options
>General
in the Outline tree view, ensure that Automatic Default Domain and Automatic Default Interfaces are both selected, and click .In the tree view, right-click
Default Domain
, select Rename, and set the new name tobuoy
.In the tree view, right-click the newly renamed domain and select Edit.
Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Location and Type
> Location
Assembly
[a]Fluid and Particle Definitions
Delete
Fluid 1
[b]Fluid and Particle Definitions
Create a new fluid named
Air at 25 C
[c]Fluid and Particle Definitions
Create a new fluid named
Water at 25 C
[c]Fluid and Particle Definitions
> Air at 25 C
> Material
Air at 25 C
Fluid and Particle Definitions
> Water at 25 C
> Material
Water at 25 C [d]
Domain Models
> Buoyancy Model
> Option
Buoyant
Domain Models
> Buoyancy Model
> Gravity X Dirn.
0 [m s^-2]
Domain Models
> Buoyancy Model
> Gravity Y Dirn.
-g
[e]Domain Models
> Buoyancy Model
> Gravity Z Dirn.
0 [m s^-2]
Domain Models
> Buoyancy Model
> Buoy. Ref. Density
Domain Models
> Mesh Deformation
> Option
Regions of Motion Specified [g]
Domain Models
> Mesh Deformation
> Mesh Motion Model
> Option
Domain Models
> Mesh Deformation
> Mesh Motion Model
> Mesh Stiffness
> Option
Value
Domain Models
> Mesh Deformation
> Mesh Motion Model
> Mesh Stiffness
> Mesh Stiffness
Fluid Models
Multiphase
> Homogeneous Model
(Selected) [k]
Multiphase
> Free Surface Model
> Option
Standard
Multiphase
> Free Surface Model
> Interface Compression Level
(Selected)
Multiphase
> Free Surface Model
> Interface Compression Level
> Interface Compression
2
Heat Transfer
> Homogeneous Model
(Selected)
Turbulence
> Option
Shear Stress Transport
Fluid Pair Models
Fluid Pair
> Air at 25 C | Water at 25 C
> Interphase Transfer
> Option[l]
Mixture Model
Fluid Pair
> Air at 25 C | Water at 25 C
> Interphase Transfer
> Interface Len. Scale
1.0 [mm]
Click Multi-select from extended list to open the Selection Dialog box, then select
Assembly
from this list. Click .Ensure that you have
Fluid 1
selected and click Remove Selected Item .To create a new item, you must first click the Add new item icon, then enter the name as required and click .
Click Select from extended list and then on Import Library Data in the upper right corner of the resulting
Material
dialog box. When theSelect Library Data to Import
box appears, click Expand located beside Water Data. SelectWater at 25 C
from the list. Click .In order to enter an expression, you must first click Enter Expression .
The buoyancy reference density is set to 1.185 kg/m3, which is representative of air.
This mesh deformation option enables you to specify the motion of the boundary mesh nodes using user-defined expressions created in the CFX Expression Language (CEL). These expressions of mesh motion are included in the CCL file that was imported at the beginning of the tutorial.
To see the additional mesh motion settings, you may need to click Roll Down located beside Mesh Motion Model.
The Displacement Diffusion model for mesh motion preserves the relative mesh distribution of the initial mesh.
The variable
volcvol
(volume of finite volumes) is a predefined variable related to the local mesh element volume. It is used here in the calculation of the mesh stiffness value. In this example, the mesh stiffness is set to be inversely proportional tovolcvol
, which results in higher stiffness in regions of smaller element size; these are the regions that are most likely to experience mesh folding. This is similar to the default setting of Mesh Stiffness > Option set toIncrease Near Small Volumes
with Reference Volume > Option set toMean Control Volume
.In a homogeneous, multiphase model, all fluids share a flow field, turbulence field, and so on. This is valid for models where the fluids have completely stratified; this is the case in this simulation.
The interphase transfer model controls the calculation of interfacial area density, which is required by certain interfacial transfer processes. In this case, the homogeneous model is used and no other interfacial transfer processes are active so the actual setting does not matter.
Click
.
In this section you will specify the properties of a rigid body with three degrees of freedom: translation in the X and Y directions and rotation about the Z axis. The rigid body definition will be applied to the wall boundary of the buoy to define the motion characteristics of the buoy. Further, you will specify the direction of gravity that acts upon the buoy's mass. Aside from gravity, no external forces are specified to act continuously on the buoy, however the motion of the buoy will be driven by fluid forces (from both the air and water) acting on the surface of the rigid body.
It is very important to give the rigid body a coordinate frame that is centered on its center of mass. Create a coordinate frame centered on the rigid body in its initial position, and oriented with its axes aligned with the rigid body axes/global coordinate axes as follows:
Select Insert > Coordinate Frame.
In the dialog box that appears, set Name to
RigidBodyCoordFrame
and click . The Basic Settings tab for the coordinate frame appears.Set Option to
Axis Points
.Set Origin to
0, —0.1438, 0.05
.Set Z Axis Point to
0, —0.1438, 1
.Set X-Z Plane Pt to
1, —0.1438, 0.05
.Click
.
In the Outline tree view, right-click Flow Analysis 1 and select Insert > Rigid Body.
Accept the default name,
Rigid Body 1
, by clicking .Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Mass
39.39 [kg] [a]
Location
BUOY
Coordinate Frame
RigidBodyCoordFrame
Mass Moment of Inertia
> XX Component
4.5 [kg m^2]
Mass Moment of Inertia
> YY Component
2.1 [kg m^2]
Mass Moment of Inertia
> ZZ Component
6.36 [kg m^2]
Mass Moment of Inertia
> XY Component
0 [kg m^2]
Mass Moment of Inertia
> XZ Component
0 [kg m^2]
Mass Moment of Inertia
> YZ Component
0 [kg m^2]
Dynamics
Degrees of Freedom
> Translational Degrees of Freedom
> Option
X and Y axes
Degrees of Freedom
> Rotational Degrees of Freedom
> Option
Z axis
Gravity
(Selected)
Gravity
> Option
Cartesian Components
Gravity
> Gravity X Dirn.
0 [m s^-2]
Gravity
> Gravity Y Dirn.
-g
[b]Gravity
> Gravity Z Dirn.
0 [m s^-2]
Initial Conditions
Center of Mass
(Selected)
Center of Mass
> Option
Automatic[c]
Linear Velocity
(Selected)
Linear Velocity
> Option
Automatic with Value
Linear Velocity
> X Component
0 [m s^-1]
Linear Velocity
> Y Component
0 [m s^-1]
Linear Velocity
> Z Component
0 [m s^-1]
Angular Velocity
(Selected)
Angular Velocity
> Option
Automatic with Value
Angular Velocity
> X Component
0 [radians s^-1]
Angular Velocity
> Y Component
0 [radians s^-1]
Angular Velocity
> Z Component
0 [radians s^-1]
The values in this table are taken directly from the problem description found in the Overview of the Problem to Solve section.
In order to enter an expression, you must first click Enter Expression .
Setting this option to Automatic defaults the center of mass of the rigid body to the origin of the
RigidBodyCoordFrame
. In most cases, this will be the correct setting.
Click
.
In this section symmetry boundaries will be created for the front and back planes of the given geometry; this is required because a 2D representation of the flow field is being modeled. Wall boundaries will also be created for the bottom, stationary side, moving side, and buoy body sections of the fluid region. Because the right-side wall will be provided with an initial velocity in the negative X direction, you will define mesh motion along this direction for the moving wall boundaries. An opening boundary will also be created along the top of the fluid region to enable air to flow freely in and out of this region because of the interactions between the air and water (as a result of the moving wall).
The front and back planes each require a symmetry boundary.
Create a new boundary named
back
.Configure the following setting(s):
Click
.Create a second boundary named
front
.Configure the following setting(s):
Click
.
The top, bottom, and sides of the fluid region all require wall
boundaries. In addition, the surface between the fluid region and
the rigid body, Rigid Body 1
, requires a wall
boundary; this wall boundary will move according to the rigid body
solution.
Create a new boundary named
Buoy Surface
.Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Boundary Type
Wall
Location
BUOY
Boundary Details
Mesh Motion
> Option
Rigid Body Solution
Mesh Motion
> Rigid Body
Rigid Body 1
Mass and Momentum
> Option
No Slip Wall
Wall Roughness
> Option
Smooth Wall
Click
.Create a new boundary named
wall
.Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Boundary Type
Wall
Location
BOTTOM, S1, S2 [a]
Boundary Details
Mesh Motion
> Option
Specified Displacement
Mesh Motion
> Displacement
> Option
Cartesian Components
Mesh Motion
> Displacement
> X Component
Mesh Motion
> Displacement
> Y Component
0.0 [m] [d]
Mesh Motion
> Displacement
> Z Component
0.0 [m]
Mass and Momentum
> Option
No Slip Wall
Hold the Ctrl key while selecting
BOTTOM
,S1
, andS2
from the list.In order to enter an expression, you must first click Enter Expression .
This displacement expression, defined in the CCL, will enable the mesh nodes to shift in the X direction because the fluid domain is compressed in this direction during the simulation. The X-coordinate runs from -4.0 m to 4.0 m, but this mesh motion along the bottom of the fluid region only occurs when the X-coordinate is between 0 m and 4.0 m. Thus,
wallMeshMot
uses a simple logical expression to apply the mesh motion only when the X-coordinate is greater than or equal to 0 m.The second displacement expression that is present in the CCL,
wxdisp
, allows the mesh nodes to shift in the X direction, because the right-side wall will be moving and compressing the fluid region during the simulation. It is defined in the CCL as a logical expression that remains steady at0.0 [m]
until it is turned "on" at timetOn
, at which point a time-dependent, sinusoidally increasing displacement is applied. This displacement increases until 1.0 seconds into the simulation, when it plateaus at this final value. The expressionwallMeshMot
is dependent onwxdisp
, as can be seen in the CCL, and will therefore take the motion of the moving side wall into account. This expression will have no effect on the stationary wall because this wall has an X-coordinate that is outside the part of the expression that specifies a displacement. Thus,wallMeshMot
can be applied to all three of these walls; it is equally applicable to each.The left-side of the fluid region maintains its position throughout the simulation and it is necessary to define mesh deformation of the bottom in the X direction only. Therefore, set the mesh displacement in the Y and Z directions to
0.0 [m]
.
Click
.
Create a new boundary named
top
.Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Boundary Type
Opening
Location
TOP
Boundary Details
Mesh Motion
> Option
Specified Displacement
Mesh Motion
> Displacement
> Option
Cartesian Components
Mesh Motion
> Displacement
> X Component
wallMeshMot [a]
Mesh Motion
> Displacement
> Y Component
0.0 [m]
Mesh Motion
> Displacement
> Z Component
0.0 [m]
Mass and Momentum
> Option
Opening Pres. and Dirn
Mass and Momentum
> Relative Pressure
0 [Pa]
Fluid Values
Boundary Conditions
> Air at 25 C
> Volume Fraction
> Volume Fraction
1.0
Boundary Conditions
> Water at 25 C
> Volume Fraction
> Volume Fraction
0.0 [b]
The same mesh motion is provided for the
top
boundary and thebottom
boundary. They will move in unison.The
top
boundary comes into contact only with air, and not with water. The volume fraction of the opening for air is set to 1.0 and that of water to 0.0, therefore enabling only air to pass through the opening.
Click
.
Note: Opening boundary types are used to enable the flow to leave and re-enter the domain. This behavior is expected due to the motion of the water and the interaction between the air and water in the fluid region.
Because a transient simulation is being modeled, initial values are required for all variables.
Click Global Initialization .
Configure the following setting(s):
Tab
Setting
Value
Global Settings
Initial Conditions
> Cartesian Velocity Components
> U
0 [m s^-1]
Initial Conditions
> Cartesian Velocity Components
> V
0 [m s^-1]
Initial Conditions
> Cartesian Velocity Components
> W
0 [m s^-1]
Initial Conditions
> Static Pressure
> Option
Automatic with Value
Initial Conditions
> Static Pressure
> Relative Pressure
Initial Conditions
> Turbulence
> Option
Intensity and Eddy Viscosity Ratio
Fluid Settings
Fluid Specific Initialization
> Air at 25 C
> Initial Conditions
> Volume Fraction
> Volume Fraction
airvol [a]
Fluid Specific Initialization
> Water at 25 C
> Initial Conditions
> Volume Fraction
> Volume Fraction
In order to enter an expression, you must first click Enter Expression .
The expression
hypres
is defined in the CCL file and gives the relative pressure as a function of the volume of water in the fluid region and the vertical distance (Y direction value). The expression results in an initial pressure gradient that linearly decreases when the value of the Y-coordinate increases (or the water depth decreases). When the Y-coordinate reaches the interface between the air and water, the initial pressure plateaus at a value of zero (due to the reliance of the expressionhypres
onwatvol
). The initial pressure gradient produced by this expression can be observed in the image below.To create this plot in CFX-Pre:
Double-click Expressions in the Outline tree view.
Double-click the
hypres
expression.Select the Plot tab under
Details of
hypres.Select
Expression Variables: Y
.Set the
Start of Range
to-2.0 [m]
andEnd of Range
to2.0 [m]
.Click
.
The
airvol
andwatvol
expressions were provided in the CCL file. The expressionwatvol
is a step function that returns a value of1.0
for all Y-coordinate values less than the initial water height (0.05 [m]),0.0
for all Y-coordinate values greater than the initial water height, and0.5
when the Y-coordinate value is equal to the initial water height.
Click
.
In this section, you will adjust the solver control settings to promote a quicker solution time and to enable the frequency of when the rigid body solver is run.
Click Solver Control .
Configure the following setting(s):
Tab
Setting
Value
Equation Class Settings
Equation Class
> Mesh Displacement
(Selected)
Equation Class
> Mesh Displacement
> Convergence Control
(Selected)
Equation Class
> Mesh Displacement
> Convergence Control
> Max. Coeff. Loops
4 [a]
Equation Class
> Mesh Displacement
> Convergence Control
> Min. Coeff. Loops
2
Rigid Body Control Rigid Body Control
(Selected)
Rigid Body Control
> Rigid Body Solver Coupling Control
> Update Frequency
Every Coefficient Loop [b]
Rigid Body Control
> Angular Momentum Equation Control
(Selected) [c]
Advanced Options
Multiphase Control
(Selected)
Multiphase Control
> Initial Volume Fraction Smoothing
(Selected)
Multiphase Control
> Initial Volume Fraction Smoothing
> Option
Volume-Weighted [d]
The maximum number of coefficient loops is set to 4 and the minimum number of coefficient loops to 2 to ensure that the solver completes at least 2 loops per time step, and no more than 4. In this simulation it will ensure a relatively resolved and accurate solution within a short period of time.
By setting the update frequency to every coefficient loop you are specifying that CFX-Solver will call the rigid body solver during every coefficient loop within each time step. This may increase total solution time, however the motion of the rigid body will be better resolved.
This sets the integration scheme for the angular momentum equations to the second-order Simo Wong scheme, which is robust and energy-conserving.
If the initial conditions for volume fraction have a discontinuity, startup robustness problems may occur. Choosing volume-weighted smoothing of these volume fractions may improve startup robustness.
Click
.
In this section, you will set transient results for selected variables to be captured every three time steps. You will also create two monitor points so that you can track the progress in CFX-Solver Manager.
Click Output Control .
Click the Trn Results tab.
In the Transient Results editor, click Add new item , set Name to
Transient Results 1
, and click OK.Configure the following setting(s) of
Transient Results 1
:Click the Monitor tab and configure the following setting(s):
Monitor Objects
(Selected)
Monitor Objects
> Monitor Points and Expressions
Create a new Monitor Point and enter the name
Buoy Force
[a][b].Monitor Objects
> Monitor Points and Expressions
> Buoy Force
> Option
Expression
Monitor Objects
> Monitor Points and Expressions
> Buoy Force
> Expression Value
force_y()@Buoy Surface
Monitor Objects
> Monitor Points and Expressions
Create a new Monitor Point and enter the name
Buoy Torq
[a][c].Monitor Objects
> Monitor Points and Expressions
> Buoy Torq
> Option
Expression
Monitor Objects
> Monitor Points and Expressions
> Buoy Torq
> Expression Value
torque_z()@Buoy Surface
Click
.
When CFX-Pre has shut down and the CFX-Solver Manager has started, obtain a solution to the CFD problem by following the instructions below.
Ensure that the Define Run dialog box is displayed.
Solver Input File should be set to
Buoy.def
.Click Start Run.
CFX-Solver runs and attempts to obtain a solution. At the end of the run, a dialog box is displayed stating that the simulation has ended.
Note: After the CFX-Solver Manager has run for a short time, you can track the monitor points you created in CFX-Pre by clicking the
User Points
tab that appears at the top of the graphical interface of CFX-Solver Manager. The two monitor points — Buoy Force and Buoy Torq — are monitored in the global coordinate frame and not the coordinate frame attached to the buoy. You can also view the level of convergence of the rigid body solution through theRigid Body Convergence
tab. Finally, the rigid body position and Euler angles can be displayed by going to the main menu and selecting Monitors > Rigid Body > Rigid Body Position and Monitors > Rigid Body > Rigid Body Euler Angles, respectively.Note: New monitor points can be toggled within the current plot by right-clicking the plot and selecting Monitor Properties. A window will display available plot line variables. Select the box to the left of the property to display it — the plot will adjust the scale so that all properties appear.
Select Post-Process Results.
If using stand-alone mode, select Shut down CFX-Solver Manager.
Click
.
In this section, you will create a contour plot for this case. An animation will then be created to show the movement of the rigid body in the fluid domain. Furthermore, the minimum face angle of the mesh will be calculated for comparison purposes between the simulations.
Right-click a blank area in the viewer and select Predefined Camera > View From +Z.
Create a new Plane and accept the default name.
Configure the following setting(s):
Tab
Setting
Value
Geometry
Definition
> Method
XY Plane
Definition
> Z
0.05 [m]
Click
.Create new contour and accept the default name.
Configure the following setting(s):
Tab
Setting
Value
Geometry
Locations
Plane 1
Variable
Water at 25 C.Volume Fraction
Color Map
White to Blue
# of Contours
10
Click
.Select File > Save State and choose the name
Buoy.cst
.Click
.
A short animation of the rigid body and surrounding fluid region, starting from rest and given an initial velocity, will be created to show the complex motion of the rigid body and deformation of the mesh because of the waves created in the fluid region. You will record a short animation that can be played in an MPEG player.
Ensure that
Contour 1
is visible in the 3D Viewer (make sure there is a check mark besideContour 1
in the Outline tree view).Turn off the visibility of
Plane 1
andDefault Legend View 1
to better see the movement of the buoy.Edit
Wireframe
and configure the following setting(s):Tab
Setting
Value
Definition
Show surface mesh
(Selected)
Click
.Click the Timestep Selector in the toolbar. Select the 1st time step and click .
Click Animation in the Timestep Selector dialog box.
The Animation dialog box appears.
Set Type to Keyframe Animation.
Click New to create
KeyframeNo1
.Select
KeyframeNo1
, then set # of Frames to93
, then press Enter while the cursor is in the # of Frames box.Tip: Be sure to press Enter and confirm that the new number appears in the list before continuing.
In the Timestep Selector, select time step 280 and click .
In the Animation dialog box, click New to create
KeyframeNo2
.Ensure that More Animation Options is pushed down to show more animation settings.
Select Loop.
Ensure that Repeat forever (next to Repeat) is not selected (not pushed down).
Select Save Movie.
Set Format to
MPEG1
.Prepare to save the movie file:
If you want to save the file in your working directory, set File name to
Buoy.mpg
in the field beside Save Movie.If you want to save the file somewhere other than your working directory, click Browse (next to Save Movie) set the new path and movie filename. Click .
The movie filename (including the path) has been set, but the animation has not yet been produced.
Click To Beginning .
This ensures that the animation will begin at the first keyframe.
After the first keyframe has been loaded, click Play the animation .
The MPEG will be created as the animation proceeds.
This will be slow, since results will be loaded and objects will be created for each time step.
To view the movie file, you need to use a viewer that supports the MPEG format.
Note: To explore additional animation options, click the Options button. On the Advanced tab of the Animation Options dialog box, there is a Save Frames As Image Files check box. By selecting this check box, the JPEG or PPM files used to encode each frame of the movie will persist after movie creation; otherwise, they will be deleted.
Close the Animation dialog box when the animation is complete.
In this step, you will calculate the Minimum Face Angle of the mesh which is an indicator of the overall mesh quality during the deformation of the mesh. A Minimum Face Angle of greater than 15° is one indicator of a good quality mesh. However an angle of between 10° and 15° is also acceptable but may produce inaccuracies in that region of the mesh during the simulation.
Click the Timestep Selector , select the 162nd time step and click .
Select Tools > Mesh Calculator or click the Calculators tab and select Mesh Calculator.
Configure the following setting(s):
Tab
Setting
Value
Mesh Calculator
Function
Minimum Face Angle
Click Calculate.
When you have finished, close the Timestep Selector dialog box and exit from CFD-Post.
The 162nd time step was chosen arbitrarily to contrast the mesh quality between this simulation and the following one. In this simulation the Minimum Face Angle during the 162nd time step is approximately 13°.
In this section you will use a subdomain to decouple rotation (that is, to enable independent rotation of the mesh in each part of the domain). Furthermore, you will edit the domain interface boundaries to restrict mesh deformation on the outer part of the domain to translational only; the inner cylindrical part of the domain will rotate and translate at the same rate as the buoy.
Ensure that the following tutorial input file is in your working directory:
Buoy.cfx
Set the working directory and start CFX-Pre if it is not already running.
For details, see Setting the Working Directory and Starting Ansys CFX in Stand-alone Mode.
Select File > Open Case.
From your working directory, select
Buoy.cfx
and click Open.Select File > Save Case As.
Set File name to
Buoy_decoupled.cfx
.Click
.
The subdomain, domain interfaces, and buoy must share common rigid body characteristics. This is necessary because the inner cylinder and the rigid body must translate and rotate at the same rate to properly isolate the motions. All relative movement between the inner cylinder and the buoy will be eliminated, causing zero mesh deformation within the inner cylinder. A subdomain is not strictly necessary to decouple rotational motions. However, the subdomain increases the robustness of the simulation by ensuring that the entire mesh within the inner cylinder has the same physical properties as the rigid body, not just at the buoy boundary and inner cylinder domain interface (this will be set up in the next step).
Select Insert > Subdomain from the main menu or click Subdomain .
Set the subdomain name to
rot_trans
and click .Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Location
B86
Mesh Motion
Mesh Motion
> Option
Rigid Body Solution
Mesh Motion
> Rigid Body
Rigid Body 1
Mesh Motion
> Motion Constraints
(Selected)
Mesh Motion
> Motion Constraints
> Motion Constraints
None
Click
.
You will edit the domain interfaces to restrict the rotational movement of the mesh surrounding the subdomain. The mesh that is located on the inner cylindrical domain interface will be assigned the same physical properties as that of the rigid body.
Edit
Simulation
>Flow Analysis 1
>buoy
>Default Fluid Fluid Interface Side 1
.Configure the following setting(s):
Click
.Edit
Simulation
>Flow Analysis 1
>buoy
>Default Fluid Fluid Interface Side 2
.Configure the following setting(s):
Tab
Setting
Value
Basic Settings
Location
F89.86[a]
Boundary Details
Mesh Motion
> Option
Rigid Body Solution
Mesh Motion
> Rigid Body
Rigid Body 1
Mesh Motion
> Motion Constraints
(Selected)
Mesh Motion
> Motion Constraints
> Motion Constraints
None
Click
.
When CFX-Pre has shut down and the CFX-Solver Manager has started, obtain a solution to the CFD problem by following the instructions below.
Ensure that the Define Run dialog box is displayed.
Solver Input File should be set to
Buoy_decoupled.def
.Click Start Run.
CFX-Solver runs and attempts to obtain a solution. At the end of the run, a dialog box is displayed stating that the simulation has ended.
Select Post-Process Results.
If using stand-alone mode, select Shut down CFX-Solver Manager.
Click
.
In this section, you will create a contour plot of Water at 25 C.Volume Fraction
to show the water content
of the fluid region, and to illustrate the interface between the air
and water. An animation will then be created to show the movement
of the rigid body in the fluid domain. Furthermore, the minimum face
angle of the mesh will be calculated for comparison purposes between
the simulations.
In the first part of the tutorial, you created a plane and a
contour plot, then saved a state file named Buoy.cst
. You will load the resulting state file so that you do not have
to create a new plane and contour plot:
Select File > Load State and choose the name
Buoy.cst
.Click
.
A short animation of the rigid body and surrounding fluid region, starting from rest and given an initial velocity, will be created to show the complex motion of the rigid body and deformation of the mesh because of the waves created in the fluid region. You will record a short animation that can be played in a MPEG player.
Ensure that
Contour 1
is visible in the 3D Viewer (make sure there is a check mark besideContour 1
in the Outline tree view).Turn off the visibility of
Plane 1
andDefault Legend View 1
to better see the movement of the buoy.Edit
Wireframe
and configure the following setting(s):Tab
Setting
Value
Definition
Show surface mesh
(Selected)
Click the Timestep Selector . Select the 1st time step and click .
Click Animation in the Timestep Selector dialog box.
The Animation dialog box appears.
Set Type to Keyframe Animation.
Click New to create
KeyframeNo1
.Select
KeyframeNo1
, then set # of Frames to93
, then press Enter while the cursor is in the # of Frames box.Tip: Be sure to press Enter and confirm that the new number appears in the list before continuing.
Use the Timestep Selector to load the 280th time step.
In the Animation dialog box, click New to create
KeyframeNo2
.Ensure that More Animation Options is pushed down to show more animation settings.
Select Loop.
Ensure that Repeat forever (next to Repeat) is not selected (not pushed down).
Select Save Movie.
Set Format to
MPEG1
.Set File name to
Buoy_decoupled.mpg
.If you want to save the animation to a location other than your working directory, click Browse (next to Save Movie) to set the path to a different directory and click .
The movie filename (including the path) has been set, but the animation has not yet been produced.
Click To Beginning .
This ensures that the animation will begin at the first keyframe.
After the first keyframe has been loaded, click Play the animation .
The MPEG will be created as the animation proceeds.
Close the Animation dialog box when the animation is complete.
In this section you will calculate the Minimum Face Angle of the mesh, which is an indicator of the overall mesh quality during the deformation of the mesh. A Minimum Face Angle of greater than 15° is one indicator of a good quality mesh. However an angle of between 10° and 15° is also acceptable but may produce inaccuracies in that region of the mesh during the simulation.
Click the Timestep Selector and load the 162nd time step.
Select Tools > Mesh Calculator or click the Calculators tab and select Mesh Calculator.
Configure the following setting(s):
Tab
Setting
Value
Mesh Calculator
Function
Minimum Face Angle
Click Calculate.
You can also check other time steps to calculate the mesh quality throughout the simulation.
When you have finished, close the Timestep Selector dialog box.
In this section you will compare two cases. First, compare the animations:
With
Buoy_decoupled_001.res
already loaded in CFD-Post, select File > Load Results.In the Load Results File dialog box, select Keep current cases loaded, then select the file Buoy_001.res. Click .
Click the viewport icon and select .
Click the synchronize active view icon .
Right-click within the 3D view and select Predefined Camera > View from +Z to orient the view. Click Fit View to scale the buoy appropriately within the 3D Viewer.
In the Outline tree, double-click Case Comparison.
In the Case Comparison editor, select Case Comparison Active, then ensure that both cases are set to
Current Step: 0
. Click .Ensure that in each of the views:
Contour 1
is visibleThe plane and default legend are hidden
Wireframe
has Show surface mesh selected
Note: To show/hide plots, toggle the check box next to the plot name in the Outline tree view. This toggles the visibility of the plot in the currently selected view. Because the synchronization of active views has been enabled, this also modifies the visibility of all other views to match the currently selected view.
Click the Timestep Selector .
Click Animation in the Timestep Selector dialog box.
The Animation dialog box appears.
Set Type to Keyframe Animation.
Delete the two existing Keyframes using the delete icon , because they display the results from only one results file. Then set up the Keyframe Animation in the same way as for the animations you created previously in this tutorial.
Beside Save Movie, set the movie filename to
Buoy_comparison.mpg
.Click Stop , then click To Beginning .
This ensures that the animation will begin at the first keyframe.
After the first keyframe has been loaded, click Play the animation .
The MPEG will be created as the animation proceeds.
Close the Animation dialog box when the animation is complete.
Now compare the mesh deformations:
Click the Timestep Selector and load the 162nd time step.
The top two views show the differences in the mesh deformation.
Select Tools > Mesh Calculator or click the Calculators tab and select Mesh Calculator.
Configure the following setting(s):
Tab
Setting
Value
Mesh Calculator
Function
Minimum Face Angle
Click Calculate. Results from both cases appear.
You can also check other time steps to calculate the mesh quality throughout the simulation.
When you have finished, close the Timestep Selector dialog box and exit from CFD-Post.