Professional Documents
Culture Documents
Tutorial: Horizontal Film Boiling: 26.3, Setting Up The VOF Model
Tutorial: Horizontal Film Boiling: 26.3, Setting Up The VOF Model
Introduction
This tutorial provides guidelines and recommendations for setting up and solving film boiling
problems and suggests mesh resolution and solver settings. In such problems, the wall
temperature is much higher than the saturation temperature of the liquid in contact with
the wall, and the entire wall surface is immersed in vapor. Due to the boiling mass exchange
occurring at the vapor-liquid interface, bubbles of gas are periodically produced and emitted
upward. Such a regime is known as film boiling.
This tutorial demonstrates how to do the following:
Use user-defined functions (UDFs) to specify a model which is not available with
ANSYS FLUENT.
Solve the case using appropriate solver settings and solution monitors.
Prerequisites
This tutorial is written with the assumption that you have completed Tutorial 1 from ANSYS
FLUENT13.0 Tutorial Guide, and that you are familiar with the ANSYS FLUENTnavigation
pane and menu structure. Some steps in the setup and solution procedure will not be shown
explicitly.
In this tutorial, you will use VOF multiphase model. If you have not used this model before,
refer to Section 26.3, Setting Up the VOF Model in ANSYS FLUENT13.0 Users Guide.
For more information about UDFs, see ANSYS FLUENT13.0 UDF Manual.
Problem Description
The problem to be solved in this tutorial is shown in Figure 1.
The wall has a temperature 10 K above saturation. Initially, the linear temperature profile
(from Twall to Tsat in the positive Y direction) is patched on the liquid domain.
c ANSYS, Inc. March 1, 2011 1
Horizontal Film Boiling
Preparation
4. Click the UDF Compiler tab and ensure that the Setup Compilation Environment for
UDF is enabled.
The path to the .bat file which is required to compile the UDF will be displayed as soon
as you enable Setup Compilation Environment for UDF.
If the UDF Compiler tab does not appear in the FLUENT Launcher dialog box by default,
click the Show Additional Options >> button to view the additional settings.
The Display Options are enabled by default. Therefore, after you read in the mesh, it
will be displayed in the embedded graphics window.
Step 1: Mesh
2
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
Step 3: Models
c ANSYS, Inc. March 1, 2011 3
Horizontal Film Boiling
Step 4: Materials
4
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
Parameter Value
Density 5
Cp (Specific Heat) 200
Thermal Conductivity 1
Viscosity 0.005
(b) Click Change/Create and close the Create/Edit Materials dialog box.
A Question dialog box will appear asking whether to overwrite liquid, click NO.
Step 5: Phases
c ANSYS, Inc. March 1, 2011 5
Horizontal Film Boiling
Ensure that the UDF source file (boiling.c) is in the same folder that contains your
case and data files.
(a) Click Add... and select the source file, boiling.c.
(b) Click Build and then click Load to load the library.
2. Define function hooks.
Define User-Defined Function Hooks...
6
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
(a) Click Edit... for the Initialization to open Initialization Functions dialog box.
i. Select my init function::libudf from the Available Initializations Functions list.
ii. Click Add and OK to close the Initialization Functions dialog box.
(b) Click Edit... for the Adjust to open Adjust Functions dialog box.
i. Select area density::libudf from the Available Adjust Functions list.
ii. Click Add and OK to close the Adjust Functions dialog box.
(c) Click OK to close the User-Defined Function Hooks dialog box.
1. Retain the selection of mixture from the Phase drop-down list and click Edit....
(a) Enable Source Terms and click the Source Terms tab.
(b) Click the Edit... for the Energy to open the Energy sources dialog box.
2. Select fluid from the Phase drop-down list and click Edit... to open the Fluid dialog
box.
(a) Enable Source Terms and click the Source Terms tab.
c ANSYS, Inc. March 1, 2011 7
Horizontal Film Boiling
(b) Click the Edit... for the Mass to open the Mass sources dialog box.
3. Select gas from the Phase drop-down list and click Edit... to open the Fluid dialog box.
(a) Enable Source Terms.
(b) Click the Edit... for the Mass to open the Mass sources dialog box.
i. Set the Number of Mass sources to 1.
ii. Select udf gas::libudf from the drop-down list below Number of Mass sources.
iii. Click OK to close the Mass sources dialog box.
(c) Click OK to close the Fluid dialog box.
8
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
1. Enable Gravity.
3. Enable Specified Operating Density and set the Operating Density to 5 kg/m3 .
1. Set the surface tension calculation options using the following TUI commands:
You may need to press the <Enter> key to get the > prompt.
> solve/set/st
Number of smoothings
[1]
c ANSYS, Inc. March 1, 2011 9
Horizontal Film Boiling
10
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
c ANSYS, Inc. March 1, 2011 11
Horizontal Film Boiling
12
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
10. Enable autosaving of the data file after every 100 time steps.
Calculation Activities
(a) Enter 100 for Autosave Every (Time Steps).
(b) Click Edit... to open Autosave dialog box.
i. Enter an appropriate file name (test-2d0100.dat.gz).
ii. Click OK to close the Autosave dialog box.
c ANSYS, Inc. March 1, 2011 13
Horizontal Film Boiling
1. Display filled contours of volume fraction of gas after 900 time steps (t = 0.9s).
To display the contours at t = 0.9s, read the data file corresponding to 900 time steps.
Graphics and Animations Contours Set Up...
(a) Select Filled in the Options group box.
(b) Decrease Levels to 2.
(c) Select Phases... and Volume fraction in the Contours of drop-down lists.
(d) Select gas in the Phase drop-down list.
(e) Click Display (see Figure 5).
Figure 5 shows a mirrored view across the symmetry boundary. To obtain such
a view, separate the single symmetry zone into two symmetry zones and use one
of these zones to mirror the display.
(f) Separate the symmetry zone into two symmetry zones.
Mesh Separate Faces...
14
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
2. Display filled contours of volume fraction of gas after 1100 time steps (t = 1.1s). See
Figure 6.
c ANSYS, Inc. March 1, 2011 15
Horizontal Film Boiling
3. Display filled contours of user-defined memory after 1000 time steps (t = 1.0s).
(a) Increase Levels to 9.
(b) Select User Defined Memory... and User Memory 1 in the Contours of drop-down
lists.
(c) Click Display (see Figure 7).
16
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
5. Display contours of volume fraction of fluid after 1000 time steps (t = 1.0s). See
Figure 9.
c ANSYS, Inc. March 1, 2011 17
Horizontal Film Boiling
Results
This problem requires a UDF for implementing mass exchange source terms in mass equa-
tions for each phase (liquid and vapor). It also requires a source term in the energy equation
to account for latent heat transfer.
The general form of the mass source in the vapor phase is:
00 00
(qg ql ). 5 l
S g = (1)
L
00
Here, q is the heat flux across the interface per unit area of the interface, the subscripts g
and l refer to vapor and liquid, respectively, and L is the latent heat.
As a first order approximation, the heat flux difference is represented as:
00 00
(qg ql ) (l kl + g kg ) 5 T (2)
(kl l + kg g )(5T. 5 l )
Sg = (3)
L
Since there is no internal mass source, mass source for liquid phase becomes:
Sl = Sg (4)
SE = Sg .L (5)
Interfacial properties include surface tension 0.1 N/m, latent heat 1e5 J/kg, saturation tem-
perature Tsat = 500 K. The length scale of the problem is the most dangerous wavelength
of Taylor-Raleigh instability:
!1/2
3
0 = 2 = 0.0787 m (6)
(l g )gy
q
gy 0 = 0.878 m/s (7)
q
0 /gy = 0.09 s (8)
18
c ANSYS, Inc. March 1, 2011
Horizontal Film Boiling
The domain horizontal width is 0 /2 and the vertical height is 30 /2. The mesh resolution
is 64(hor)x192(ver). The initial shape of the vapor-liquid interface must be perturbed to
initiate bubble growth. Therefore, there is another initialization UDF which fills with gas
all the cells satisfying the following condition:
00
| q | 0
Nu = (10)
kl (Twall Tsat )
Since the time scale of this problem is 0.1s, the time step is 0.001, i.e., 100 time steps
resolution. In all, the problem should run for about 1200 time steps to capture the first
bubble emission.
Postprocessing the results will show void fraction and temperature profiles at 900th and
1100th time steps, corresponding to 0.9 and 1.1 seconds. These times correspond to the
minimum and maximum thickness of the boiling film at the heated wall. They correspond
to minimum and maximum values of Nusselt number, respectively.
Summary
This tutorial demonstrated the application of the VOF model in a film boiling regime. Also,
UDFs were used to enhance the standard features of ANSYS FLUENT.
DEFINE ADJUST (area density) is a general purpose macro that can be used to adjust
or modify ANSYS FLUENT variables. In this tutorial, it calculated the dot product
and stored the value in accordance with Equation 3.
For details, see Section 2.2.1, DEFINE ADJUST in ANSYS FLUENT 13.0 UDF Man-
ual.
DEFINE SOURCE (gas) uses UDMI(0) and the user input for L to compute the mass
source term (refer Equation 3) for the gas phase and stores it in UDMI(1). This macro
also computes the energy source (refer Equation 5) and stores it in UDMI(2).
For details, see Section 2.3.22, DEFINE SOURCE in ANSYS FLUENT 13.0 UDF Man-
ual.
DEFINE SOURCE (liquid) assigns UDMI(1) with a negative sign as a liquid mass source
in accordance with Equation 4.
c ANSYS, Inc. March 1, 2011 19
Horizontal Film Boiling
DEFINE INIT (my init function) initializes the gas void fraction in accordance with
Equation 9.
For details, see Section 2.2.8, DEFINE INIT in ANSYS FLUENT 13.0 UDF Manual.
20
c ANSYS, Inc. March 1, 2011