ANSYS Fluent Advanced Add-On Modules
ANSYS Fluent Advanced Add-On Modules
ANSYS Fluent Advanced Add-On Modules
2015 SAS IP, Inc. All rights reserved. Unauthorized use, distribution or duplication is prohibited.
ANSYS, ANSYS Workbench, Ansoft, AUTODYN, EKM, Engineering Knowledge Manager, CFX, FLUENT, HFSS, AIM
and any and all ANSYS, Inc. brand, product, service and feature names, logos and slogans are registered trademarks
or trademarks of ANSYS, Inc. or its subsidiaries in the United States or other countries. ICEM CFD is a trademark
used by ANSYS, Inc. under license. CFX is a trademark of Sony Corporation in Japan. All other brand, product,
service and feature names or trademarks are the property of their respective owners.
Disclaimer Notice
THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFID-
ENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS. The software products
and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement
that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The software products
and documentation may be used, disclosed, transferred, or copied only in accordance with the terms and conditions
of that software license agreement.
For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license agreement, the use,
duplication, or disclosure by the United States Government is subject to restrictions stated in the ANSYS, Inc.
software license agreement and FAR 12.212 (for non-DOD licenses).
Third-Party Software
See the legal information in the product help files for the complete Legal Notice for ANSYS proprietary software
and third-party software. If you are unable to access the Legal Notice, Contact ANSYS, Inc.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. iii
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
iv of ANSYS, Inc. and its subsidiaries and affiliates.
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. v
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
vi of ANSYS, Inc. and its subsidiaries and affiliates.
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. vii
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
viii of ANSYS, Inc. and its subsidiaries and affiliates.
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. ix
Fluent Advanced Add-On Modules
6.9. User-Accessible Functions for the Solid Oxide Fuel Cell With Unresolved Electrolyte Model ....... 351
6.9.1. Compiling the Customized Solid Oxide Fuel Cell With Unresolved Electrolyte Source
Code ...................................................................................................................................... 352
6.9.1.1. Compiling the Customized Source Code Under Linux ............................................. 352
6.9.1.2. Compiling the Customized Source Code Under Windows ....................................... 353
6.10. Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Text User Interface ...................... 353
Bibliography ....................................................................................................................................... 355
VI. ANSYS Fluent Magnetohydrodynamics (MHD) Module .................................................................... 357
Using This Manual ............................................................................................................................ ccclix
1.The Contents of This Manual .................................................................................................... ccclix
1. Introduction .................................................................................................................................. 361
2. Magnetohydrodynamic Model Theory ......................................................................................... 363
2.1. Introduction ........................................................................................................................... 363
2.2. Magnetic Induction Method .................................................................................................... 364
2.2.1. Case 1: Externally Imposed Magnetic Field Generated in Non-conducting Media ............. 364
2.2.2. Case 2: Externally Imposed Magnetic Field Generated in Conducting Media ..................... 365
2.3. Electric Potential Method ........................................................................................................ 365
3. Implementation ............................................................................................................................ 367
3.1. Solving Magnetic Induction and Electric Potential Equations ................................................... 367
3.2. Calculation of MHD Variables ................................................................................................... 368
3.3. MHD Interaction with Fluid Flows ............................................................................................ 368
3.4. MHD Interaction with Discrete Phase Model ............................................................................ 368
3.5. General User-Defined Functions .............................................................................................. 368
4. Using the ANSYS Fluent MHD Module .......................................................................................... 369
4.1. MHD Module Installation ........................................................................................................ 369
4.2. Loading the MHD Module ....................................................................................................... 369
4.3. MHD Model Setup .................................................................................................................. 370
4.3.1. Enabling the MHD Model ............................................................................................... 371
4.3.2. Selecting an MHD Method .............................................................................................. 372
4.3.3. Applying an External Magnetic Field ............................................................................... 372
4.3.4. Setting Up Boundary Conditions ..................................................................................... 376
4.3.5. Solution Controls ........................................................................................................... 378
4.4. MHD Solution and Postprocessing ........................................................................................... 379
4.4.1. MHD Model Initialization ................................................................................................ 379
4.4.2. Iteration ......................................................................................................................... 380
4.4.3. Postprocessing ............................................................................................................... 380
4.5. Limitations ............................................................................................................................. 381
A. Guidelines For Using the ANSYS Fluent MHD Model ......................................................................... 383
A.1. Installing the MHD Module ..................................................................................................... 383
A.2. An Overview of Using the MHD Module .................................................................................. 383
B. Definitions of the Magnetic Field ..................................................................................................... 387
C. External Magnetic Field Data Format ................................................................................................ 389
D. MHD Module Text Commands ........................................................................................................ 391
Bibliography ....................................................................................................................................... 393
VII. ANSYS Fluent Population Balance Module ....................................................................................... 395
Using This Manual ........................................................................................................................ cccxcvii
1. The Contents of This Manual ................................................................................................ cccxcvii
1. Introduction .................................................................................................................................. 399
1.1. The Discrete Method ............................................................................................................... 399
1.2. The Inhomogeneous Discrete Method ..................................................................................... 399
1.3. The Standard Method of Moments .......................................................................................... 401
1.4.The Quadrature Method of Moments ....................................................................................... 402
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
x of ANSYS, Inc. and its subsidiaries and affiliates.
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xi
Fluent Advanced Add-On Modules
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
xii of ANSYS, Inc. and its subsidiaries and affiliates.
Using This Manual
This preface is divided into the following sections:
1.The Contents of the Fluent Manuals
2.Typographical Conventions
3. Mathematical Conventions
4.Technical Support
Fluent Getting Started Guide contains general information about getting started with using
Fluent and provides details about starting, running, and exiting the program.
Fluent Migration Manual contains information about transitioning from the previous release of Fluent,
including details about new features, output changes, and text command list changes.
Fluent User's Guide contains detailed information about running a simulation using the solution
mode of Fluent, including information about the user interface, reading and writing files, defining
boundary conditions, setting up physical models, calculating a solution, and analyzing your results.
ANSYS Fluent Meshing Migration Manual contains information about transitioning from the previous
release of Fluent Meshing, including descriptions of new features and text command list changes.
ANSYS Fluent Meshing User's Guide contains detailed information about creating 3D meshes
using the meshing mode of Fluent.
Related video help can be found on the ANSYS How To Videos page.
Fluent in Workbench User's Guide contains information about getting started with and using Fluent
within the Workbench environment.
Fluent Theory Guide contains reference information for how the physical models are implemented in
Fluent.
Fluent Customization Manual contains information about writing and using user-defined functions
(UDFs).
Fluent Tutorial Guide contains a number of examples of various flow problems with detailed instructions,
commentary, and postprocessing of results.
The latest updates of the ANSYS Fluent tutorials are available on the ANSYS Customer Portal. To
access tutorials and their input files on the ANSYS Customer Portal, go to http://support.ansys.com/
training.
The latest updates of the ANSYS Fluent Meshing tutorials are available on the ANSYS Customer
Portal. To access tutorials and their input files on the ANSYS Customer Portal, go to http://sup-
port.ansys.com/training.
Fluent Text Command List contains a brief description of each of the commands in Fluents solution
mode text interface.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xiii
Using This Manual
ANSYS Fluent Meshing Text Command List contains a brief description of each of the commands in
Fluents meshing mode text interface.
ANSYS Fluent Advanced Add-On Modules contains information about the usage of the different advanced
Fluent add-on modules, which are applicable for specific modeling needs.
Part I: ANSYS Fluent Adjoint Solver contains information about the background and usage of Fluent's
Adjoint Solver Module that allows you to obtain detailed sensitivity data for the performance of a
fluid system.
Part II: ANSYS Fluent Battery Module contains information about the background and usage of Fluent's
Battery Module that allows you to analyze the behavior of electric batteries.
Part III: ANSYS Fluent Continuous Fiber Module contains information about the background and usage
of Fluent's Continuous Fiber Module that allows you to analyze the behavior of fiber flow, fiber
properties, and coupling between fibers and the surrounding fluid due to the strong interaction that
exists between the fibers and the surrounding gas.
Part V: ANSYS Fluent Fuel Cell Modules contains information about the background and the usage
of two separate add-on fuel cell models for Fluent that allow you to model polymer electrolyte
membrane fuel cells (PEMFC), solid oxide fuel cells (SOFC), and electrolysis with Fluent.
Part VI: ANSYS Fluent Magnetohydrodynamics (MHD) Module contains information about the back-
ground and usage of Fluent's Magnetohydrodynamics (MHD) Module that allows you to analyze the
behavior of electrically conducting fluid flow under the influence of constant (DC) or oscillating (AC)
electromagnetic fields.
Part VII: ANSYS Fluent Population Balance Module contains information about the background and
usage of Fluent's Population Balance Module that allows you to analyze multiphase flows involving
size distributions where particle population (as well as momentum, mass, and energy) require a balance
equation.
Fluent as a Server User's Guide contains information about the usage of Fluent as a Server which allows
you to connect to a Fluent session and issue commands from a remote client application.
Running ANSYS Fluent Using a Load Manager contains information about using third-party load managers
with ANSYS Fluent.
Part I: Running ANSYS Fluent Under LSF contains information about using Fluent with Platform
Computings LSF software, a distributed computing resource management tool.
Part II: Running ANSYS Fluent Under PBS Professional contains information about using Fluent with
Altair PBS Professional, an open workload management tool for local and distributed environments.
Part III: Running ANSYS Fluent Under SGE contains information about using Fluent with Univa Grid
Engine (formerly Sun Grid Engine) software, a distributed computing resource management tool.
2. Typographical Conventions
Several typographical conventions are used in this manuals text to help you find commands in the
user interface.
Different type styles are used to indicate graphical user interface items and text interface items. For example:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
xiv of ANSYS, Inc. and its subsidiaries and affiliates.
Typographical Conventions
The text interface type style is also used when illustrating exactly what appears on the screen to distinguish
it from the narrative text. In this context, user inputs are typically shown in boldface. For example,
solve/initialize/set-fmg-initialization
Mini flow charts are used to guide you through the ribbon or the tree, leading you to a specific option, dialog
box, or task page. The following tables list the meaning of each symbol in the mini flow charts.
For example,
Indicates selecting the Setting Up Domain ribbon tab, clicking Reorder (in the Mesh group box)
and selecting Domain, as indicated in the figure below:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xv
Using This Manual
Indicates expanding the Setup and Models branches, right-clicking Viscous, and selecting Realizable
k-epsilon from the Model sub-menu, as shown in the following figure:
And
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
xvi of ANSYS, Inc. and its subsidiaries and affiliates.
Mathematical Conventions
In this manual, mini flow charts usually accompany a description of a dialog box or command, or a
screen illustration showing how to use the dialog box or command. They show you how to quickly
access a command or dialog box without having to search the surrounding material.
In-text references to File ribbon tab selections can be indicated using a /. For example File/Write/Case...
indicates clicking the File ribbon tab and selecting Case... from the Write submenu (which opens the Select
File dialog box).
3. Mathematical Conventions
Where possible, vector quantities are displayed with a raised arrow (e.g., , ). Boldfaced characters
are reserved for vectors and matrices as they apply to linear algebra (e.g., the identity matrix, ).
The operator , referred to as grad, nabla, or del, represents the partial derivative of a quantity with respect
to all directions in the chosen coordinate system. In Cartesian coordinates, is defined to be
(1)
The gradient of a scalar quantity is the vector whose components are the partial derivatives; for example,
(2)
The gradient of a vector quantity is a second-order tensor; for example, in Cartesian coordinates,
(3)
(4)
The divergence of a vector quantity, which is the inner product between and a vector; for example,
(5)
The operator , which is usually written as and is known as the Laplacian; for example,
(6)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xvii
Using This Manual
(7)
An exception to the use of is found in the discussion of Reynolds stresses in Turbulence in the Fluent
Theory Guide, where convention dictates the use of Cartesian tensor notation. In this chapter, you will also
find that some velocity vector components are written as , , and instead of the conventional with
directional subscripts.
4. Technical Support
If you encounter difficulties while using ANSYS Fluent, please first refer to the section(s) of the manual
containing information on the commands you are trying to use or the type of problem you are trying
to solve. The product documentation is available from the online help, or from the ANSYS Customer
Portal. To access documentation files on the ANSYS Customer Portal, go to http://support.ansys.com/
documentation.
If you encounter an error, please write down the exact error message that appeared and note as much
information as you can about what you were doing in ANSYS Fluent.
Technical Support for ANSYS, Inc. products is provided either by ANSYS, Inc. directly or by one of our
certified ANSYS Support Providers. Please check with the ANSYS Support Coordinator (ASC) at your
company to determine who provides support for your company, or go to www.ansys.com and select
Contacts> Contacts and Locations.
If your support is provided by ANSYS, Inc. directly, Technical Support can be accessed quickly and effi-
ciently from the ANSYS Customer Portal, which is available from the ANSYS Website (www.ansys.com)
under Support > Customer Portal. The direct URL is: support.ansys.com.
One of the many useful features of the Customer Portal is the Knowledge Resources Search, which can
be found on the Home page of the Customer Portal. To use this feature, enter relevant text (error
message, etc.) in the Knowledge Resources Search box and click the magnifying glass icon. These
Knowledge Resources provide solutions and guidance on how to resolve installation and licensing issues
quickly.
NORTH AMERICA
All ANSYS Products except Esterel, Apache and Reaction Design products
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
Toll-Free Telephone: 1.800.711.7199 (Please have your Customer or Contact ID ready.)
Support for University customers is provided only through the ANSYS Customer Portal.
GERMANY
ANSYS Mechanical Products
Telephone: +49 (0) 8092 7005-55 (CADFEM)
Email: support@cadfem.de
All ANSYS Products
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
National Toll-Free Telephone: (Please have your Customer or Contact ID ready.)
German language: 0800 181 8499
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
xviii of ANSYS, Inc. and its subsidiaries and affiliates.
Technical Support
UNITED KINGDOM
All ANSYS Products
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
Telephone: Please have your Customer or Contact ID ready.
UK: 0800 048 0462
Republic of Ireland: 1800 065 6642
Outside UK: +44 1235 420130
Email: support-uk@ansys.com
Support for University customers is provided only through the ANSYS Customer Portal.
JAPAN
CFX and Mechanical Products
Telephone: +81-3-5324-7305
Email:
Mechanical: japan-ansys-support@ansys.com
Fluent: japan-fluent-support@ansys.com;
CFX: japan-cfx-support@ansys.com;
Polyflow: japan-polyflow-support@ansys.com;
Icepak
Telephone: +81-3-5324-7444
Email: japan-icepak-support@ansys.com
Licensing and Installation
Email: japan-license-support@ansys.com
INDIA
All ANSYS Products
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
Telephone: +91 1 800 209 3475 (toll free) or +91 20 6654 3000 (toll) (Please have your Customer or
Contact ID ready.)
FRANCE
All ANSYS Products
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xix
Using This Manual
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
Toll-Free Telephone: +33 (0) 800 919 225 Toll Number: +33 (0) 170 489 087 (Please have your Customer
or Contact ID ready.)
Email: support-france@ansys.com
Support for University customers is provided only through the ANSYS Customer Portal.
BELGIUM
All ANSYS Products
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
Toll-Free Telephone: (0) 800 777 83 Toll Number: +32 2 620 0152 (Please have your Customer or Contact
ID ready.)
Email: support-benelux@ansys.com
Support for University customers is provided only through the ANSYS Customer Portal.
SWEDEN
All ANSYS Products
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
Telephone: +46 (0) 10 516 49 00
Email: support-sweden@ansys.com
Support for University customers is provided only through the ANSYS Customer Portal.
ITALY
All ANSYS Products
Web: Go to the ANSYS Customer Portal (http://support.ansys.com) and select the appropriate option.
Toll-Free Telephone: 800 789 531 Toll Number: +39 02 00621386 (Please have your Customer or Contact
ID ready.)
Email: support-italy@ansys.com
Support for University customers is provided only through the ANSYS Customer Portal.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
xx of ANSYS, Inc. and its subsidiaries and affiliates.
Technical Support
K0REA
Telephone: 82-2-3441-5000
CHINA
Toll-Free Telephone: 400 819 8999 Toll Number: +86 10 82861715
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. xxi
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
xxii of ANSYS, Inc. and its subsidiaries and affiliates.
Part I: ANSYS Fluent Adjoint Solver
Tutorial: Using the Adjoint Solver 2D Laminar Flow Past a Cylinder (p. 63)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. iii
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
iv of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Introduction to the Adjoint Solver
This chapter provides background for the ANSYS Fluent adjoint solver.
1.1. Overview
1.2. Discrete Versus Continuous Adjoint Solver
1.3. Discrete Adjoint Solver Overview
1.4. Adjoint Solver Stabilization
1.5. Solution-Based Adaption
1.6. Using The Data To Improve A Design
In addition, see Using the Adjoint Solver Module (p. 19) and the Fluent Tutorial Guide for more inform-
ation about using the adjoint solver. (To access tutorials and their input files on the ANSYS Customer
Portal, go to http://support.ansys.com/training.)
1.1. Overview
An adjoint solver is a specialized tool that extends the scope of the analysis provided by a conventional
flow solver by providing detailed sensitivity data for the performance of a fluid system.
In order to perform a simulation using the ANSYS Fluent standard flow solvers, a user supplies system
geometry in the form of a computational mesh, specifies material properties and physics models, and
configures boundary conditions of various types. The conventional flow solver, once converged, provides
a detailed data set that describes the flow state governed by the flow physics that are being modeled.
Various postprocessing steps can be taken to assess the performance of the system.
If a change is made to any of the data that defines the problem, then the results of the calculation can
change. The degree to which the solution changes depends on how sensitive the flow is to the partic-
ular parameter that is being adjusted. Indeed, the derivative of the solution data with respect to that
parameter quantifies this sensitivity to first order. Determining these derivatives is the domain of sens-
itivity analysis.
There is a large collection of derivative data that can be computed for a fluid system, given the extensive
set of input data that is required, and the extensive flow data that is produced. The matrix of derivatives
of output data with respect to input data can be vast. Depending upon the goal of the analysis only a
portion of this derivative data may be needed for engineering analysis and decision-making.
The adjoint solver accomplishes the remarkable feat of calculating the derivative of a single engineering
observation with respect to a very large number of input parameters simultaneously via a single compu-
tation. The engineering observation could be a measure of the system performance, such as the lift or
drag on an airfoil, or the total pressure drop through a system. Most importantly, the derivatives with
respect to the geometric shape of the system are found.
Understanding such sensitivities in a fluid system can provide extremely valuable engineering insight.
A system that is highly sensitive may exhibit strong variability in performance due to small variations
in manufacturing or variations in the environment in which it is operating. Alternatively, high-sensitivity
may be leveraged for fluid control, with a small actuator being able to induce strong variations in be-
havior. Yet another perspective is that sensitivity of a performance measure implies that the device in
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
Introduction to the Adjoint Solver
question is not fully optimized and there is still room for improvementassuming that constraints do
not preclude further gains.
The sensitivities of a fluid system provided by an adjoint solver satisfy a central need in gradient-based
shape optimization. This makes an adjoint solver a unique and powerful engineering tool for design
optimization.
Adjoint data can also play a role in improving solver numerics. Regions of high sensitivity are indicative
of areas in the flow where discretization errors can potentially have a strong effect. This information
can be used to guide how best to refine a mesh to improve flow solution accuracy.
The process of computing an adjoint solution resembles that for a standard flow calculation in many
respects. The adjoint solver solution advancement method is specified, residual monitors configured,
and the solver is initialized and run through a sequence of iterations to convergence. One notable dif-
ference is that a scalar-valued observation is selected as being of interest prior to starting the adjoint
calculation.
Once the adjoint solution is converged the derivative of the observable with respect to the position of
each and every point on the surface of the geometry is available, and the sensitivity of the observation
to specific boundary condition settings can be found. This remarkable feature of adjoint solutions has
been known for hundreds of years, but only in the last 25 years has the significance for computational
physics analysis been recognized widely.
The power of this methodology is highlighted when an alternative for assembling the same information
is considered. Imagine a sequence of flow calculations in which each point on an airfoil surface is moved
in turn a set small distance in the surface-normal direction, and the flow and drag recomputed. If there
are points on the surface, then flow calculations are required to build the data set. Considering
that the same data is provided by a single adjoint computation, the adjoint approach has an enormous
advantage. Remember that for even modest 3D flow computations there may be many thousands of
coordinates or more on a surface.
Once the adjoint is computed it can be used to guide intelligent design modifications to a system. After
all, the adjoint sensitivity data provides a map across the entire surface of the geometry of the effect
of moving the surface. Design modifications can be most effective if made in regions of high sensitivity
since small changes will have a large effect upon the engineering quantity of interest. This principle of
making changes to a system in proportion to the local sensitivity is the foundation for the simple
gradient algorithm for design optimization.
Once a candidate change in shape or other boundary condition has been selected, the effect of that
change can be estimated using the computed derivative data. This amounts to a first order extrapolation
using a Taylor series expansion around the baseline flow state. Clearly if a modification is chosen that
is large enough that nonlinear effects become important then the accuracy of the predicted change
cannot be guaranteed.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Overview
Moment of force: the aerodynamic moment about a specified moment center and moment axis. The integ-
ration is made over a specified collection of wall zones. Note that in 2D, the moment axis is normal to the
plane of the flow.
Swirl: the moment of the mass flow (with velocity ) relative to an axis defined by a point, , and a direction
. The two options are:
Swirl integral
(1.1)
where denotes the volume over which the integration is made, and denotes the relative pos-
ition to the point .
(1.2)
Note
These integrals can be used to construct quantities such as tumble ratio that are of signi-
ficance for internal combustion engine analysis.
pressure drop between an inlet (or group of inlets) and an outlet (or group of outlets)
fixed value: a simple fixed value can be specified and used in the assembly of the observables. This is con-
venient when some scaling or normalization of the observable is desired. It must be noted that this value
is treated strictly as a constant for the purposes of any derivative calculations.
surface integral: a variety of surface integrals can be constructed for a specified field variable on a set of
user-selected surfaces:
Facet sum: a simple sum of the field value on each facet of the computational mesh
(1.3)
Facet average: the facet sum is divided by the total number of facets,
(1.4)
Facet variance: the sum of the squares of the deviations from the facet average
(1.5)
Integral: the sum of the field value on each face multiplied by the face area
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
Introduction to the Adjoint Solver
(1.6)
(1.7)
Area-weighted variance: the sum of the squares of the deviations from the area-weighted average, divided
by the total face area
(1.8)
Mass-weighted integral: the sum of the field value on each face, weighted by the magnitude of the local
mass flow through the face.
(1.9)
Mass-weighted average integral: the mass-weighted integral divided by the sum of the magnitudes of
the local mass flow rates through the faces on which the integral is defined.
(1.10)
Mass-weighted variance: the mass-weighted integral of the square of the deviation from the mass-weighted
average, divided by the sum of the magnitudes of the local mass flow rates through the faces on which
the integral is defined.
(1.11)
Flow-rate weighted: the rate at which the field is convected through the defined surfaces.
(1.12)
Pressure
Total pressure
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.
Overview
volume integral: you can compute a variety of volume integrals of a chosen field variable.
Volume: computes the total volume of the selected zones as a summation of the individual cell volumes.
(1.13)
Sum: computes the sum of a chosen field variable over the selected zones.
(1.14)
Volume Integral: is calculated by summing the product of cell volume and the selected field variable over
the selected zones.
(1.15)
Volume-Weighted Average: is computed by dividing the volume integral of a selected field variable
(Equation 1.15 (p. 9)) by the total volume of the selected zones.
(1.16)
Volume Variance: is the volume-weighted integral of the square of the deviation from the volume-weighted
average (Equation 1.16 (p. 9)), divided by the total volume of the selected zone.
(1.17)
Mass Integral: is computed by summing the product of density, cell volume, and the chosen field variable.
(1.18)
Mass: is computed by summing the product of cell density and cell volume.
(1.19)
Mass-Weighted Average: is computed by dividing the Mass Integral of the chosen field variable (Equa-
tion 1.18 (p. 9)) by the total Mass (Equation 1.19 (p. 9))
(1.20)
Mass Variance: is computed as the mass-weighted summation of the square of the deviation of the chosen
field variable from its mass-weighted average (Equation 1.20 (p. 9)) divided by the total mass (Equa-
tion 1.19 (p. 9)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 9
Introduction to the Adjoint Solver
(1.21)
The volume integrals listed above can be computed for the following field variables:
Pressure
Total Pressure
Velocity
Velocity Magnitude
Vorticity
Vorticity Magnitude
Turbulence Production:
(1.22)
(1.23)
(1.24)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
10 of ANSYS, Inc. and its subsidiaries and affiliates.
Discrete Versus Continuous Adjoint Solver
ln
log10
While a user of the adjoint solver may experience no particular difference in workflow for the two sep-
arate solver types, it is important to be aware that there are two primary classes of adjoint solver and
the approach chosen can have implications for the accuracy of the results.
A continuous adjoint solver relies heavily on mathematical properties of the partial-differential equations
that define the physics of the problem. In this case those equations are the Navier-Stokes equations.
With this approach an adjoint partial differential equation set is formulated explicitly and is accompanied
by adjoint boundary conditions that are also derived mathematically. Only after this derivation is complete
can the adjoint partial differential equations be discretized and solved, often with extensive re-use of
existing solver machinery. This class of solver was implemented by ANSYS Fluent as a research effort.
Such a solver has the benefit that it is decoupled largely from the original flow solver. They share only
the fact that they are based on the Navier-Stokes equations. The process of discretizing and solving the
partial differential equations in each case could in principle be very different indeed. While this flexibility
may be appealing it can also be the downfall of the approach. Inconsistencies in modeling, discretization
and solution approaches can pollute the sensitivity information significantly, especially for problems
with wall functions and complex engineering configurations such as those of interest to ANSYS Fluent
users.
The continuous adjoint approach can be effective for some classes of problems. However, until there
is a significant advance in handling some key challenges, ANSYS Inc. has concluded that it is an unsuitable
approach for meeting the needs of our broad client base for the classes of problems of interest to them.
A discrete adjoint solver is based not on the form of the partial differential equations governing the flow,
but the particular discretized form of the equations used in the flow solver itself. The sensitivity of the
discretized equations forms the basis for the sensitivity calculation. In this approach the adjoint solver
is much more tightly tied to the specific implementation of the original flow solver. This has been ob-
served to yield sensitivity data that provides valuable engineering guidance for the classes of problem
of interest to ANSYS Fluent users, including problems with wall functions.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 11
Introduction to the Adjoint Solver
For the above reasons, the discrete adjoint approach has been adopted for the ANSYS Fluent adjoint
solver.
An adjoint method can be used to compute the derivative of an observation of interest for the fluid
system with respect to all the user-specified parameters, with any changes that arise in the flow variables
themselves eliminated. There are three key ingredients to consider when developing the method:
All values set by a user in the boundary condition panels for each boundary in the problem.
The computational mesh. More specifically the locations of the nodes of the mesh and how they define
the edges, faces, and ultimately the cells used in the finite-volume computation. This includes both in-
terior as well as boundary nodes.
Material properties.
Note that the settings that define the problem are being distinguished from settings that define
how the solution advancement is to be performed to converge the problem. Only the former are
of interest here. For the sake of clarity, let us denote the vector of all of the values in the list by .
These are considered to be the control variables for the problem, that is, the variables that a user
can set explicitly that affect the solution.
It is worth noting that the topological definition of the mesh is fixedit is not considered to be a
control variable here. The effect of collapsing cells or remeshing on the flow solution is not address-
able without further development in view of the discrete changes that are implied. This topic is
beyond the scope of the current document.
The main effort in a flow computation is in the determination of the flow state, namely the velocity,
pressure, density and possibly other fluid-related variables. For a cell-centered finite-volume scheme,
the flow state is defined at the cell centroids by a vector of real values. In the simplest case these
th
values are the pressure and flow velocity components. Let the vector of the variables in the cell
be denoted here by .
where is the number of cells in the problem, and there are conditions on each cell. This expres-
sion is a compact way of denoting conservation of mass and momentum and other constraints.
Let
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
12 of ANSYS, Inc. and its subsidiaries and affiliates.
Discrete Adjoint Solver Overview
(1.26)
denote a scalar of interest that depends both on the flow state and perhaps directly on the control
variables. It is assumed that the observable is differentiable with respect to both the flow and the
controls. The inclusion of the control variables here is essential since in many cases the mesh geometry
is included directly in the evaluation of the observable. For example, the evaluation of the force on
a boundary involves the wall normal and face areas, which change when mesh nodes are moved.
The goal is to determine the sensitivity of the observation with respect to the user-specified control
variables. What makes defining this relationship more challenging is the fact that changing the user
inputs changes the flow, which indirectly changes the engineering observation. The adjoint method
has a specific role in managing this chain of influences by providing a mechanism for eliminating the
specific changes that happen in the flow whenever the inputs change.
If a variation is introduced into the control variables then a linearization of the governing equations
(Equation 1.25 (p. 12)) shows that the variations in the flow state must satisfy
(1.27)
where there is an implied summation over and , and denotes that the flow solution is held constant
while the derivative is taken.
Meanwhile, if both the control variables and the flow state change, then the observation will change:
(1.28)
The particular way in which the flow responds to the changes in the control variables can be computed
using (Equation 1.27 (p. 13)) only after specific changes, , have been chosen. It is prohibitive to
consider solving (Equation 1.27 (p. 13)) for more than a handful of prescribed changes because of
the excessive computing time that would be needed. However, when redesigning the shape of parts
of a system there may be pressure to explore a large number of candidate modifications. This conflict
is reconciled by eliminating the variations of the flow solution from the expression (Equation 1.28 (p. 13))
and producing an explicit relationship between changes in the control variables and the observation
of interest.
This is accomplished by taking a weighted linear combination of the linearized governing equations
(Equation 1.27 (p. 13)) in a very particular way. A set of adjoint variables is introduced with a one-
to-one correspondence with the governing equations (Equation 1.25 (p. 12)). This results in a relationship
(1.29)
The term in square brackets on the left is now matched to the coefficient for the variation in the flow
in (Equation 1.28 (p. 13)) in order to define values for the adjoint variables:
(1.30)
These are the discrete adjoint equations, and the solution of this system that is the primary goal for
the adjoint solver. It is important to recognize that these equations have not been derived. They are
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 13
Introduction to the Adjoint Solver
defined in this way with a specific goal in mindthe elimination from (Equation 1.28 (p. 13)) of the
perturbations to the flow field as shown below:
(1.31)
Note the use of Equation 1.29 (p. 13) and Equation 1.30 (p. 13) in the derivation of Equation 1.31 (p. 14).
The flow perturbation has now been eliminated from the expression, yielding a direct relation between
the control variables and the observable of interest.
There are several important observations to be made about (Equation 1.30 (p. 13)):
The dimension of the problem to be solved is the same as the original flow problem, although the adjoint
problem is linear.
While the adjoint solution may be considered strictly as a vector of numeric values, experience with the
continuous adjoint provides guidance on how the adjoint solution can be interpreted. The vector of weights
associated with the components of the residual of the momentum equation in each cell is termed the adjoint
velocity. The adjoint value associated with the residual of the continuity equation is termed the adjoint
pressure.
The right hand side is defined purely on the basis of the observable that is of interest.
The matrix on the left hand side is the transpose of the Jacobian of the governing system of equations
(Equation 1.25 (p. 12)). This seemingly innocent transposition has a very dramatic impact on how the adjoint
system is solved. This will be discussed below.
The adjoint equations are defined by the current state of the flow, and the specific physics that is employed
in the modeling. Each adjoint solution is specific to the flow state.
At first glance it appears that solving the adjoint problem may be straightforward. After all it simply
involves setting-up and solving a linear (albeit large) system of equations. In practice both steps can
represent a significant challenge, especially when the problem is large.
The evaluation of the residuals of the flow equations is an integral part of the pre-existing ANSYS Fluent
flow solvers. However, it is necessary to compute the Jacobian of the system and then transpose
it, or at the very least to be able to make a matrix-free transpose matrix-vector product with the adjoint
solution. There are several technical approaches to accomplishing this task whose description goes
beyond the scope of this document. Suffice to say that it is not trivial to encode this functionality, but
that it has been done successfully here.
For the present implementation, a pre-conditioned iterative scheme, based on pseudo-time marching,
is adopted to solve the adjoint system. The equations that define the advancement process can be
written as
(1.32)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
14 of ANSYS, Inc. and its subsidiaries and affiliates.
Adjoint Solver Stabilization
where is a local time step size based on the local flow conditions, is a user-specified CFL
number. The matrix is a simplified form of the system Jacobian that is amenable to solution using
the AMG linear solver that is the workhorse of the conventional flow solver. The preconditioning matrix
is a diagonal matrix. Artificial compressibility is introduced on the adjoint continuity equation to
aid in the relaxation of the adjoint pressure field.
The correction is under-relaxed and added to the adjoint solution and the process repeated
until the right hand side is adequately small.
Three stabilization schemes are available in Fluent in order to overcome these stability difficulties when
larger cases are being solved. The stabilization schemes are designed to intervene only when the
standard advancement scheme is experiencing instability.
Spatial scheme
The spatial scheme operates by identifying parts of the domain where unstable growth is occurring and
applying a more direct and stable solution procedure in those regions.
Modal scheme
The modal scheme involves a process of identifying the particular details of the unstable growth patterns
or modes. These patterns are localized in space and they are used to split the solution into parts that have
stable and unstable characteristics when advanced. The stable part is advanced as usual, while the algorithm
is designed now to compensate for the unstable part so that the overall calculation is stabilized.
The emergence of the unstable patterns can happen at any time during the adjoint calculation and
the total number of unstable patterns is case-dependent. Having 10 to 20 unstable modes present
would not be considered unusual. Large cases may have many more. As a general trend, the most
rapidly-growing unstable patterns appear often within a few iterations with more slowly-growing
modes appearing later in the calculation. The unstable patterns are handled as they appear.
Dissipation scheme
The dissipation scheme provides stabilization for the solution advancement of the adjoint solution by in-
troducing nonlinear damping strategically into the calculation domain. The strategy is intended to provide
minimal intervention in order to damp the growth of instabilities that lead to adjoint solution divergence.
A marker is tracked, based on the state of the adjoint solution, and damping is applied directly to the adjoint
solution in regions where the marker becomes large.
Unlike the modal and spatial schemes, the dissipation scheme can affect the adjoint solution slightly.
In general, the spatial order of the damping is chosen to be one order larger than the adjoint calcu-
lation order. This means that the formal order of accuracy of the adjoint solver is unaffected by the
addition of the dissipation scheme. In practice, regions of intense dissipation can appear for some
cases which may result in isolated spots and/or streaks in the solution on surfaces. However, the
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 15
Introduction to the Adjoint Solver
scale of these solution features is such that they are often easily smoothed during postprocessing
to generate design changes.
Some additional computational overhead is associated with the stabilization schemes. In general, the
dissipation scheme is the least resource-intensive of the three schemes.
For information about using the stabilization schemes, refer to Stabilized Scheme Settings (p. 32).
Once the governing equations for the system (Equation 1.25 (p. 12)) have been converged there remains
a discretization error, , such that
(1.33)
While specific estimates for this discretization error may be tricky to define, it is often estimated to be
, where is the local grid size, and is the order of the discretization scheme. That is, for a
first-order scheme and for a second order scheme. Alternatively, can be considered to be the
residual associated with a solution that is not converged fully.
The correction to the flow field, , that compensates for this inhomogeneity is given by
(1.34)
(1.35)
This simple expression provides an estimate of the effect of the presence of on the observation, .
The presence of discretization errors, or lack of convergence, on the engineering quantity of interest is
assessed by weighting the inhomogeneous term by the local adjoint solution. It is clear that even in
regions of the domain where the residuals or discretization errors are small, an accompanying adjoint
velocity or pressure that is large in magnitude implies that there may be a significant source of error
in the observable. A finer mesh in regions where the adjoint is large will reduce the influence of discret-
ization errors that may adversely affect the engineering result of interest. In practice, adapting cells
which have large magnitude adjoint velocity and/or adjoint pressure will achieve this goal.
A common strategy for deciding how to modify the system is based on the gradient algorithm. The
underlying principle is quite simply that modifying a system in a manner to which it is most sensitive
maximizes the effect of the change. The change to a control variable is made in proportion to the
sensitivity of the value of interest with respect to that control variable.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
16 of ANSYS, Inc. and its subsidiaries and affiliates.
Using The Data To Improve A Design
(1.36)
where is the th coordinate of the th node in the mesh. Here is a notation for the subset of the
control variables for the system that correspond to mesh node positions. Then an adjustment
(1.37)
will provide the maximum adjustment to for given norm of , where is an arbitrary scaling
factor. Note that can be picked to be positive or negative depending upon whether is to be increased
or decreased respectively. This is essentially a statement of the method of steepest descent.
(1.38)
For a sufficiently small adjustment, the change to the observation will strictly have the same sign as
the scaling factor , provided the gradient is not identically zero.
In regions where the sensitivity is high, small adjustments to the shape will have a large effect on the
observable. This corresponds directly with the idea of engineering robustness. If a configuration shows
high sensitivities, then the performance will likely be subject to large performance variations if there
are manufacturing inconsistencies. For a robust design, the goal is to have the sensitivity be tolerably
small.
In practical cases the field can be noisy, especially for large, turbulent flow problems. If the
noisy field is used directly to modify a boundary shape using (Equation 1.37 (p. 17)), then the modified
surface can have many inflections. This is not helpful for engineering design work. In the next section,
the use of mesh morphing technology not only to smooth the sensitivity field, but also to provide
smooth boundary and interior mesh deformation, is described.
Note
For simplicity, the smoothing and morphing equations are presented here for the case of a
2D domain. The same approach is extended and used for 3D problems.
A Cartesian region is selected that encompasses all or a part of the problem domain. Only the mesh
nodes that fall within this region may move as a result of the morphing operation. A local ( , ) coordinate
system is defined, where and . A regular array of control points is then distrib-
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 17
Introduction to the Adjoint Solver
uted in the control volume. The motion of the mesh at any point in the domain is determined by the
movement of the control points.
In general, an optimization problem may include both free-form minimization or maximization of the
observable(s) and constraints that are localized in space. This requires an approach that can provide a
deformation field that is well-behaved and consistent with manufacturability requirements, while still
allowing locally sharper deformations where required to satisfy the imposed constraints.
To achieve this, two coincident sets of control points are created. Bernstein polynomials and B-splines
are used, respectively, to map the control point motions to the computational mesh nodes.
th
The Bernstein polynomial of degree is:
(1.39)
th
The B-spline of degree is the non-periodic B-spline that uses a knot-vector, , where:
(1.40)
(1.41)
Depending on the degree of the B-spline, the function is zero on some portion of the unit interval. This
is in contrast to the Bernstein polynomials that are strictly non-zero everywhere on the unit interval.
th th
Let denote the coordinate of the mesh node, and let denote the change in the position
th
of the node due to the morphing process. Let denote the displacement of the control
th
point associated with the Bernstein polynomials in the coordinate direction, and let denote
th
the displacement of the control point associated with the B-splines. If denotes the po-
th
sition of the mesh node, then the displacement of the node is defined by the superposition:
(1.42)
The control-point movement for the Bernstein polynomials controls the large-scale smooth deformation,
while the control-point movement for the B-splines controls fine-scale motions.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
18 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Using the Adjoint Solver Module
This chapter describes the process for loading the adjoint solver module, as well as setting up, running,
and postprocessing the adjoint solutions. Also, this chapter demonstrates the shape modification process
that is guided by the adjoint solution.
The typical use of the adjoint solver involves the following steps:
7. Post-process the adjoint solution to extract the sensitivity of the observable with respect to boundary
condition settings.
8. Post-process the adjoint solution to extract the sensitivity of the observable with respect to shape of the
geometry.
9. Modify boundary shapes based on shape-sensitivity data and recompute the flow solution.
This chapter provides information about using the ANSYS Fluent adjoint solver in the following sections:
2.1. Installing the Adjoint Solver Module
2.2. Loading the Adjoint Solver Module
2.3. Model Considerations for Using Adjoint Solver
2.4. Defining Observables
2.5. Solving the Adjoint
2.6. Postprocessing of Adjoint Solutions
2.7. Modifying the Geometry Using the Design Tool
2.8. Using the Adjoint Solver Modules Text User Interface
In addition, see the Fluent Tutorial Guide for more information about using the adjoint solver. (To access
tutorials and their input files on the ANSYS Customer Portal, go to http://support.ansys.com/training.)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 19
Using the Adjoint Solver Module
Select the adjoint solver model by entering the module number 6. During the loading process a scheme
library containing the graphical and text user interface, and a UDF library containing a set of user-defined
functions (UDFs) are loaded into ANSYS Fluent. The Adjoint-Based group box in the Design ribbon
tab becomes available once the adjoint module is loaded.
The flow state is for a steady single-phase flow, or ideal gas, in an inertial reference frame that is
either laminar or turbulent.
For turbulent flows a frozen turbulence assumption is made, in which the effect of changes to the state of
the turbulence is not taken into account when computing sensitivities.
For turbulent flows standard wall functions are employed on all walls.
The adjoint solver uses methods that are first order accurate in space by default. If desired, you can select
second order accurate methods (see Using the Adjoint Solution Methods Dialog Box (p. 29)).
Wall
Velocity inlet
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
20 of ANSYS, Inc. and its subsidiaries and affiliates.
Model Considerations for Using Adjoint Solver
Pressure outlet
Symmetry
It is important to note that these requirements are not strict conditions for the conventional flow solver,
but rather modeling limitations for the adjoint solver.
When the adjoint solver is initialized or an observable is evaluated, and before iterations are performed,
a series of checks is performed to determine the suitability of the existing flow solution for analysis
with the adjoint solver. Two types of message may appear:
Warning message: There are certain physics models and boundary condition types that are not explicitly
modeled in the adjoint solver, but their absence does not disallow you from proceeding with the calculation.
In this case, a warning message will be printed that explains the nature of the inconsistency.
Checking adjoint setup...
-- Warning: Model is active but not included in adjoint calculation: P1 radiation model Done
The adjoint solver will still run in this case but the quality of the adjoint solution data can be expected
to be poorer as a result of the inconsistency. This is because in such cases the unsupported settings
will revert to corresponding supported settings for the adjoint solver. Though the calculation will
proceed, it is important to note that the results produced should be considered on this basis. When
reverting back to the fluid calculation, the original settings will be preserved and the modified settings
are not migrated onto the original case. The warning indicates that the setting change will be made
automatically and specifically for the adjoint solution.
Error message: There are some model and boundary conditions that are incompatible with the computation
of an adjoint solution with the current adjoint solver implementation. In this case, an explanatory error
message will be printed in the console window.
Checking adjoint setup...
** Unable to proceed: Model is active but not compatible with adjoint calculation:
Transition SST turbulence model
Done
The adjoint solver will not run in this case and changes must be made manually to the settings
identified in the console before the solver can be run.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 21
Using the Adjoint Solver Module
Function returns
real
Consider a source that may depend on velocity, pressure, and cell-centroid coordinates:
where , , and are the Cartesian velocity components in the cell, is the pressure in the cell, and
are the cell centroid coordinates as defined by the C_CENTROID macro. If the source strength
depends on one or more of these quantities, then the derivatives of the source strength with respect
to those variables must be computed and filled in as entries to the dS[] array. In particular,
must be defined in the UDF if there is a dependency of the source upon them. The specification of this
derivative information is essential for sensitivities, including shape sensitivity, to be computed correctly
by the adjoint solver.
Observables are created and selected in the Adjoint Observables dialog box, which is accessed by
clicking Observable... in the Design ribbon tab (Adjoint-Based group box). (Figure 2.1: Adjoint Observ-
ables Dialog Box (p. 23)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
22 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Observables
In the Create New Observable dialog box (Figure 2.2: Create New Observable Dialog Box (Observable
Types) (p. 24)) you can choose from several observable types and operation types. Various types of
observable quantities can be defined and each can be given a name. The available types of observables
are described in General Observables (p. 6).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 23
Using the Adjoint Solver Module
Select Observable types and pick an observable from the list. Keep the default name, or use the Name
field to designate a different name for the observable of interest. Click OK to create the new observable,
or click Cancel to dismiss the dialog box without creating an observable.
You can also combine existing observables in various ways or apply unary operations to create a wide
variety of compound observables. The operations that you can apply to existing observables are described
in General Operations (p. 10).
Select Operation types and choose an operation from the list. Keep the default name, or use the Name
field to designate a different name for the observable of interest. Click OK to create the new observable,
or click Cancel to dismiss the dialog box without creating an observable.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
24 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Observables
Once created, you must edit the definition of the new observable (Editing Observable Definitions (p. 25)).
Once the observable properties are defined (Inputs for Observable Types (p. 26)), click Apply to apply
the settings and proceed to define other observables, or click OK in the Manage Adjoint Observables
dialog box to apply the settings and close the dialog box. Available observables are described in Gen-
eral Observables (p. 6).
Note
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 25
Using the Adjoint Solver Module
1. Select the walls that are to contribute to the force of interest in the Wall Zones list.
2. Define the direction in which the force is to be computed by entering the components of this dir-
ection in the X Component, Y Component, and Z Component (for 3D) fields.
1. Select the inlets and outlets between which the total pressure drop is to be computed using the
Inlets and Outlets lists.
1. Select the type of integral from the Integral Type drop-down list. Available integral types are de-
scribed in General Observables (p. 6).
1. Select the type of integral from the Volume Integral Type drop-down list. Available integral types
are described in General Observables (p. 6).
2. Select the Field Variable of interest. If the chosen field variable is a vector quantity, you will need
to specify a Direction along which the field variable will be evaluated.
3. Under Zones of Integration, select whether to integrate over selected Zones or Integrate over a
box.
4. Select the Zones for integration under Zone Settings or the coordinates of the rectangular (in 2D)
or hexahedral (in 3D) integration region under Box Settings.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
26 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Observables
1. Select an observable from the Numerator drop-down list to represent the numerator of the ratio.
2. Select an observable from the Denominator drop-down list to represent the denominator of the
ratio.
1. Select two observables from the corresponding drop-down list that will be used to compute their
product.
1. Select an operation from the drop-down list (see General Observables (p. 6) for a list of available
operators).
2. Select an observable from the corresponding drop-down list upon which the unary operation is to
be applied.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 27
Using the Adjoint Solver Module
You can select which observable to use for the sensitivity calculation in the list of Observable Names.
Note
Only one observable can be used in any one adjoint calculation. In the Adjoint Observables
dialog box, the observable that is currently highlighted is the observable that will be used
in the sensitivity calculation.
Any observables that have been created but which are missing required inputs will not appear
in the list of Observable Names.
Clicking the Evaluate button computes the current value of the selected observable quantity and prints
the result in the console window. Clicking the Write... button provides the option to write the result
to a named file.
The Sensitivity Orientation determines the sign of the post-processed sensitivities. For instance, if you
select Maximize then changes in the direction of positive sensitivities will increase the value of the
observable. A standard rule of thumb can be applied: if you want to improve the solution, then follow
the direction of the sensitivity vectors. Another standard rule of thumb can also be applied for post-
processed scalars: if you want to improve the solution, then increase values where the sensitivity is
positive and/or decrease values where the sensitivity is negative.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
28 of ANSYS, Inc. and its subsidiaries and affiliates.
Solving the Adjoint
The Adjoint Solution Methods dialog box shows a side-by-side comparison of the schemes used for
the flow solver and for the adjoint solver. Using the same scheme for the adjoint solution and the flow
solution yields the most accurate discrete derivative calculation when the adjoint solution is converged.
However, not all schemes used for the flow solver are supported for the adjoint solver. In these cases
an alternate adjoint scheme must be used. This does not typically lead to severe deterioration of the
adjoint results quality. Even if the same scheme is available for the adjoint solver this is not always
practical because stability may be reduced with some schemes. Therefore, you can use the drop-down
lists under Adjoint Solver to select alternate schemes as needed.
In some cases it may not be desirable to solve the energy adjoint even if energy is solved in the flow
solver. For example, consider an incompressible flow where the specified observable does not involve
thermal quantities. In this case the adjoint for the energy equation is identically zero, but its inclusion
would add an unnecessary numerical burden. You can disable the Adjoint Energy option to avoid
solving the energy adjoint.
If the primary flow is a compressible ideal gas, you can specify that the physics of the compressible
flow are modeled in the adjoint solver by enabling the Adjoint Ideal Gas option. Enabling this option
automatically enables the Adjoint Energy option as well. If the flow is not a compressible ideal gas, it
will be treated as being incompressible for the purposes of the adjoint calculation.
Clicking Default will configure the adjoint solver to use the default low-order schemes (Standard for
pressure and First Order Upwind for momentum), which are chosen for their stability. Clicking Best
Match will attempt to match the adjoint schemes to the flow schemes that should in general provide
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 29
Using the Adjoint Solver Module
more accurate calculations at convergence. Where they cannot be matched, the default scheme will be
used.
By default, the adjoint solver advancement settings will be automatically adjusted during calculation
to encourage convergence, with initial values determined by the state of the flow solution. If needed,
you can adjust the advancement controls in the Adjoint Solution Controls dialog box.
To open the Adjoint Solution Controls dialog box, click Solver Controls... in the Design ribbon tab
(Adjoint-Based group box).
Options
Auto-Adjust Controls
When enabled, the convergence of the AMG solver and the adjoint residuals are monitored during
solution advancement. Based on the trends observed, the advancement controls are automatically
adjusted to encourage reliable solution advancement and convergence. This is especially useful when
a new type of problem is being solved for which appropriate settings are not initially clear. The ad-
vancement will begin with either user-specified settings or those from Solution-Based Controls Ini-
tialization. You can enable or disable Auto-Adjust Controls at any time during the solution.
If Auto-Adjust Controls is enabled, messages will appear as the calculation progresses indicating
the adjustments that are being made.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
30 of ANSYS, Inc. and its subsidiaries and affiliates.
Solving the Adjoint
Advancement Controls
Apply Preconditioning
Enables solution preconditioning. This is needed for most cases involving turbulent flow. If precondi-
tioning is enabled, the following controls are available:
Courant Number
A higher number corresponds to a more aggressive advancement of the computation at the risk
of instability. Disabling preconditioning corresponds to an infinite Courant number.
Artificial Compressibiilty
A nonzero value introduces artificial compressibility into the computation of the adjoint continuity
equation. A value of 1.0 or less is reasonable.
Under-Relaxation Factors
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 31
Using the Adjoint Solver Module
Adjoint Momentum, Adjoint Continuity, Adjoint Local Flow Rate, Adjoint Energy
Each of these can be set to a value between 0.0 to 1.0. A higher value leads to a more aggressive
algorithm that is less likely to be stable. A value of 1.0 for each can be used for some simple cases
without difficulty.
Algebraic Multigrid
Tolerance
The tolerance used for judging convergence.
Maximum Iterations
The maximum number of inner iterations of the AMG solver.
Show Iterations
If enabled, a more verbose iteration history is printed in the text console during iterations. The details
of the inner iteration can be useful when deciding on appropriate Courant Number, Artificial Com-
pressibility, and Flow Rate Courant Scaling. If many inner iterations are needed, or if the inner itera-
tions diverge, this signals that a reduction in Courant Number may be needed. Alternatively, an increase
in Artificial Compressibility or a reduction in the Flow Rate Courant Scaling may be sufficient for
the AMG iterations to converge.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
32 of ANSYS, Inc. and its subsidiaries and affiliates.
Solving the Adjoint
Coherence Threshold
controls the preliminary screening for growth. It defines the threshold for relative variance of growth
between iterations at which a more detailed search is activated. A smaller value will tend to delay the ac-
tivation of the more detailed search for unstable growth at the risk of allowing unstable growth to continue
for more iterations.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 33
Using the Adjoint Solver Module
of cells out of the entire flow domain. However, there can be transiently growing corrections to the adjoint
solution that masquerade as unstable patters. This cell limit suppresses such false patters from consideration.
Regularization
acts to regularize the advancement of the unstable mode components. The stiffness of the adjoint governing
equations can give rise to difficulty in discerning the unstable pattern from nearby stable patterns. Increasing
the regularization tends to overcome this difficulty and adds stability to the calculation at the expense of
potentially slower convergence. Valid values are between 0 and 1.
When using the modal stabilization scheme, the following behavior can be observed:
When the primary advancement scheme is proceeding in a stable manner, the stabilization scheme
will remain idle and no output will be generated.
When a candidate unstable pattern appears it will be tracked and a message will appear with information
about the detected mode:
Mode growth: 1.34390e+00 Coherence: 8.28546e-02
In the above example, the message indicates that an unstable pattern that grows by more than 34%
in one iteration is present. The value of the Coherence corresponds to the variance in growth between
iterations.
When a candidate unstable pattern is identified that meets the coherence threshold, the secondary
refinement stage is activated:
Mode growth: 1.35752e+00 Coherence: 3.95870e-02
Growing pattern cell count: 929
Isolating new mode
Iteration: 0 Growth rate: 1.42665e+00 Residual: 5.88196e-02
Iteration: 1 Growth rate: 1.41329e+00 Residual: 1.34600e-02
Iteration: 2 Growth rate: 1.41227e+00 Residual: 2.25348e-02
New growing mode with 597 cells
If the growing pattern cell count exceeds Maximum Number of Cells the refinement procedure is
postponed. Likewise, if after refinement the number of cells involved exceeds the specified limit the
mode is rejected. Each iteration corresponds to a refinement of the unstable pattern. The adjoint
solution itself is not advanced during this process. The residual corresponds to the purity of the mode
and must eventually fall below the Mode Purity Threshold for the mode to be accepted. A minimum
of 3 iterations is taken so that the occurrence or absence of a conjugate pair can be verified.
The presence of the sometimes violent unstable growth that can occur gives a jagged appearance to
the adjoint residual plots. However, the underlying trend of the residual plots should correspond to a
converging adjoint solution process.
The unstable patterns of solution advancement are specific to the flow solution, choice of discretization
schemes, and solution advancement controls for the adjoint solver. If any of these values changes, then
the unstable modal patterns must be recomputed so that the stabilization scheme will function to full
effect. In the event that any of these parameters is changed and the adjoint solution is restarted a mode
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
34 of ANSYS, Inc. and its subsidiaries and affiliates.
Solving the Adjoint
recalibration process will be initiated. It should be noted that if there are many unstable modes that
have been identified then this recalibration may take some time.
In contrast, the patterns of unstable growth are not specific to the observable that has been selected.
Given that there is computational effort needed to identify the instabilities, a separate initialization
process is available just for the unstable modal patterns. This allows the adjoint solution itself to be
initialized for a new observable while retaining the knowledge of how to stabilize the solution advance-
ment. A much smoother path to solution for the second and subsequent observables is then achieved.
The four items on the left side of the dialog box relate to unstable mode tracking and selection, while
the items on the right provide options for the response once a mode is identified. The values have the
following meaning:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 35
Using the Adjoint Solver Module
Resolution Threshold
defines a threshold for the separation between modes based on their amplitudes. A value of 0.1 implies
that the second most-dominant mode must be 0.1 of the amplitude of the primary mode before an unstable
mode can be considered as being adequately resolved.
Coherence Threshold
defines a threshold that must be met for the closeness of the mode to pure exponential growth as the it-
erations progress. A smaller number means that a tighter tolerance must be met before an unstable mode
is considered as having been identified.
Growth Threshold
defines the growth rate threshold for unstable modes that must be met before the algorithm responds to
the presence of the mode. The growth threshold defines the number of iterations that would have to take
place for the mode to grow by one order of magnitude. That is, a value of 0.01 signifies that a mode that
would grow one order of magnitude or more in 100 iterations will be handled. A negative value for this
threshold is not recommended as multiple stable modes may be tracked.
Solution Blending
defines an under-relaxation factor for blending the stabilized part of the scheme with the standard ad-
vancement scheme. A default of 0.1 is chosen. The value should lie between 0 and 1.
The following is an example of what is printed when a mode becomes more fully resolved:
Mode present> Growth : 1.35318e-01 Coherence : 2.84133e-04
Resolution Threshold : 1.00000e-01 Resolution : 2.75312e-04
Growth Threshold : 5.60193e-02 Growth : 1.35318e-01
Coherence Threshold : 1.00000e-02 Coherence : 2.84133e-04
Local stabilization required: Instability detected in 5 cells
The final line only appears when a coherent and resolved instability has been identified successfully.
Subsequently, the solution advancement algorithm automatically adjusts to eliminate this unstable
behavior.
The percentage residual indicates the fraction of the total residual that is associated with the local
solution process.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
36 of ANSYS, Inc. and its subsidiaries and affiliates.
Solving the Adjoint
Default
provides a set of default values for the various fields in the dialog box.
Damping Factor
The overall level of dissipation is proportional to this value although the damping level is determined ulti-
mately through a nonlinear process.
Damping Relaxation
The damping relaxation can be used to control the rate at which the dissipation is updated as the adjoint
solution progresses. A value of 1 freezes the dissipation, while a value of 0 means that the choice of dissip-
ation is based purely on the adjoint solutions state at the previous iteration.
Damping Order
The spatial order of the dissipation. A higher order leads to more intense and localized damping. This can
typically be set to be one order larger than the adjoint calculation spatial order.
Since the order of discretization of the dissipation scheme is usually set higher than the adjoint, the
formal order of accuracy of the adjoint solution is unaffected by the addition of dissipation. However,
regions of intense dissipation can appear for some cases when using this scheme. This can sometimes
appear as isolated spots and streaks in the adjoint solution on surfaces. The scale of these features is
such that they are often easily smoothed during postprocessing to generated design changes.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 37
Using the Adjoint Solver Module
1. Decide whether or not the residuals are to be printed in the console by setting the Print to Console check
box as desired.
2. Decide whether or not the residuals are to be plotted in the main window by setting the Plot check box
as desired.
3. Set the id of the window in which the adjoint residuals are to appear in the Window field.
4. Set how many iterations are to be shown in the residual curves that are plotted in the Iterations to Plot
field.
5. Enable and/or disable those values that are to be used as criteria for convergence, and set the Criteria in
each case. The options are to test the residuals for the Adjoint continuity and/or Adjoint velocity and/or
Adjoint local flow rate equations.
Click the OK or Apply buttons to confirm that the settings are acceptable. Clicking Plot will cause ex-
isting adjoint residuals to be plotted in the main graphics window.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
38 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing of Adjoint Solutions
Initialize
sets the value of the adjoint velocity and pressure to zero everywhere in the problem domain.
Initialize Stabilization
clears all of the unstable modes that have been identified in calculations using the modal stabilization
scheme, but leaves the adjoint solution unchanged. Only available when Modal is selected in the Stabilized
Scheme Settings dialog box.
Calculate
advances the adjoint solver by the Number of Iterations specified in the adjacent field.
Depending on the monitor settings, the residuals may be printed in the console and/or plotted in the
main graphics window.
Since the ANSYS Fluent adjoint solver is a discrete adjoint solver, the primitive adjoint solution data
provides sensitivity to changes cell-wise for the computational mesh. Normalization of these results by
the cell volume provides a mesh-independent view into the data set.
Information regarding postprocessing the adjoint solutions can be found in the following sections:
2.6.1. Field Data
2.6.2. Scalar Data
In the Contours dialog box, under Sensitivities..., you can find the following fields:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 39
Using the Adjoint Solver Module
Sensitivity to Body Force X-Component (Cell Values), Sensitivity to Body Force Y-Component (Cell
Values), and Sensitivity to Body Force Z-Component (Cell Values)
These are the components of the adjoint velocity primitive field. These fields show the sensitivity of
the observable to the various components of a body force that may be applied to a cell, or other
factors that may change the momentum balance on the cell. As such, it is a mesh-dependent quantity.
Sensitivity to Body Force X-Component, Sensitivity to Body Force Y-Component, and Sensitivity to
Body Force Z-Component (in 3D) fields
These are the components of the adjoint velocity primitive field normalized by cell volume. This field
can be interpreted as the magnitude of the sensitivity of the observable to components of a body
force per unit volume. Consider a body force distribution, expressed as a force per unit volume. The
integral of the vector product of that distribution with the components of this field gives a first-order
estimate of the net effect of the body force on the observation.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
40 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing of Adjoint Solutions
vation of interest is potentially sensitive to particular features of the mesh and discretization process
that affect local mass balance. When plotted on a boundary, this field indicates the effect of the addition
or removal of fluid from the domain upon the quantity of interest. It is important to note that in this
scenario the effect of the momentum of the fluid that is added or removed is not taken into account.
The boundary velocity sensitivity should be plotted if that effect is also of interest.
Sensitivity to Viscosity
This field shows the sensitivity of the quantity of interest to variations in the turbulent effective vis-
cosity for a turbulent problem, or the laminar viscosity in a laminar case. The sensitivity is normalized
by the cell volume to account for cell size variations in the mesh.
Shape Sensitivity X-Component, Shape Sensitivity Y-Component, and Shape Sensitivity Z-Component
(in 3D) fields
These fields are the individual components of the sensitivity of the observable of interest with respect
to the mesh node locations. It is plotted as cell data and is computed as the average of the nodal
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 41
Using the Adjoint Solver Module
sensitivities for a given cell, divided by the cell volume. Note that for this discrete adjoint solver the
sensitivity of the result with respect to node locations both on and off boundaries is computed. The
normalization by cell volume indicates that the fields that are plotted are the weighting factors for a
continuous spatial deformation field. (Note that the nodal sensitivity data itself is used when mesh
morphing is performed, and predictions about the effect of shape changes are made.)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
42 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing of Adjoint Solutions
by the vector product of this force with the adjoint velocity field. The flow blockage field that is plotted
is , namely the negative of the vector product of the flow velocity and the adjoint velocity (Cell
Value).
The surface shape-sensitivity fields contain the derivatives of the chosen observable with respect to the
position of the bounding walls of the problem.
In the Vectors dialog box, under Vectors of..., you can find the following custom vector fields:
Optimal Displacement
The optimal displacement field is defined once a design change has been computed using the design tool.
This vector field shows the optimal displacement based on the design goals that have been specified and
any prescribed boundary motions. Note that when plotting this vector field, if the Auto Scale option is
deselected, and the vector Scale option is set to 1, then the vectors as shown display the absolute displace-
ment that will occur.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 43
Using the Adjoint Solver Module
Select a single boundary of the problem in the Boundary choice selection box.
Click Report to see the boundary condition settings and the sensitivity of the observable with respect to
those settings. An example of a report is shown below:
Velocity inlet id 5
Velocity magnitude = 4.000000000e+01 (m/s),
Sensitivity = 5.429127866e+01 ((n)/(m/s))
In this case, the report shows that for every change of the boundary velocity by 1 m/s, a change in
the predicted observable (in this case a force) of 54.2 N is expected. This prediction is based on a
linear extrapolation.
Click Write... to write the report for the selected boundary to a file.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
44 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying the Geometry Using the Design Tool
general constraints on deformations including restrictions on direction of motion, symmetry, and boundary
conditions.
equality and/or inequality constraints on geometry (fixed walls, bounding boxes, and so on).
The Design Tool is accessed by clicking Design Tool... in the Design ribbon tab (Adjoint-Based group
box).
1. Select those boundaries that are free to be deformed in the Zones To Be Modified field on the Design
Change tab. Boundaries that are not selected in this box that intersect the control volume will be con-
strained not to move. This is useful if there are walls which, for design reasons, must not move.
2. Define the region that will be modified in the Region tab. (Defining the Region for the Design
Change (p. 46))
3. Define conditions on the deformation region such as number of control points, symmetry, directional
invariance, and boundary continuity. (Defining Region Conditions (p. 47))
4. Compute and export the sensitivities from the adjoint solution for each observable of interest. (Exporting
Sensitivity Data (p. 47))
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 45
Using the Adjoint Solver Module
5. Import the sensitivity data for each observable that will participate in the design change and specify the
optimization goals for the observables. (Defining Observable Objectives (p. 48))
Note
Export and Import of sensitivity data is only required for multi-objective analysis.
6. Define constraining and/or deformation conditions on the design change, such as fixed boundaries,
prescribed boundary deformation (through a profile, translation, rotation, or scaling), and bounding
surfaces / planes. (Defining Conditions for the Deformation (p. 49))
7. Specify weights for the various objectives, a scaling factor for the deformation, and whether the
design conditions are strictly enforced. (Shape Modification (p. 53))
2. Enable the Show Bounding Box option to make a bounding box visible when the mesh is displayed.
3. Click the Get Bounds... button to open the Bounding Box Definition dialog box. Select the Zones to
be bounded from the list of zones. This will populate the X Min, X Max, Y Min, and Y Max (and Z Min
and Z Max in 3D) fields with the bounding box for the selected zones. Click the Larger Box and Smaller
Box buttons to adjust the control volume size as needed. The limits of the bounding box can be entered
individually by hand if desired.
Note
If the deformation region includes symmetry planes that are to be respected in the de-
formation, the control volume should be defined such that it is bisected by the symmetry
planes. The symmetry planes must be oriented with normals in the Cartesian coordinate
directions.
4. Click Update Region. This will set the values for the region boundaries and update the display of the
design change region.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
46 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying the Geometry Using the Design Tool
2. Specify the control points and motion conditions for each coordinate direction.
The control points are distributed uniformly in each coordinate direction. The spacing between
the control points defines the characteristic spatial scale for the morphing operation. The larger
the number of control points, the smaller the spacing and hence, the smaller the spatial scale
on which changes can be made. 20 to 40 control points for each coordinate direction is typical.
b. If you want to prevent deformation of the control volume in the given coordinate direction, un-check
Motion Enabled.
c. If you want the motion along a coordinate direction to be uniform in one or more directions, enable
Invariant in X, Invariant in Y, and Invariant in Z (3D) as appropriate.
d. If the deformation region includes a symmetry boundary with a normal in one of the Cartesian co-
ordinate directions, you can enable Symmetric in X/Y/Z as appropriate to allow morphing in the
symmetry plane.
Note
The deformation region must be defined such that it is bisected by the sym-
metry plane(s).
3. The Region Boundary Continuity settings control the order of continuity of the morphing process at
the boundaries of the control volume. This is of particular relevance when the boundary of the control
volume intersects a wall. The Continuity Order controls the smoothness of the transition from the unmoved
wall lying outside the control volume to the deformed wall within. A value of 1 ensures first order continuity
at the transition, in other words, a continuous first derivative of the morphing operation. A value of 2
ensures second order continuity, and so forth.
By default, the continuity Definition is Uniform and is enforced at all control volume boundaries.
Alternatively, you can choose By Boundary to use different continuity conditions at each control-
volume boundary. For each boundary (X-Min, X-Max, etc.) you can specify what order continuity
to enforce for each motion direction, as well as specify In-Plane Motion Only on that boundary.
The continuity settings will not affect the transition between fixed and movable boundaries within
the control volume, only mesh nodes in the transition zone from inside to outside the control
volume.
4. Click Apply.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 47
Using the Adjoint Solver Module
2. For each observable solve for and export the sensitivity data.
b. In the Region tab of the Design Tool dialog box, specify the deformation region and click Export
Sensitivities...
The exported file contains the sensitivities of the observable for the mesh nodes within the specified
deformation region. The deformation regions for the various observables can, in principle, be different.
However, it is advisable that there is as much overlap as possible for observables that will be used to-
gether in a multi-objective design process.
2. To import previously saved sensitivity data, click Manage Data.... In the Manage Sensitivity Data dialog
box click Import Sensitivities... to load previously saved sensitivity files and close the Manage Sensitivity
Data dialog box.
3. If you want to include computed sensitivity data in the current session that you have not exported yet
enable Include current data.
Objective
determines how Fluent will attempt to change the value of the observable through the design change.
You can choose to increase or decrease the value of the observable optimally, or you can specify a
target change in value. You can also select None in which case the observable will not be considered
in computing the optimal design change, but the predicted change in observable value will still be
reported.
Target/Reference Change
When the chosen Objective is Target Change in Value, this field corresponds to the desired change
in the value. When the chosen Objective is Maximize or Minimize, the magnitude of this field is a
reference weighting for the observable. This can be used to normalize the objectives in cases where
you have multiple observables of vastly differing magnitudes, thereby allowing the values entered
for Weight in the Design Change tab to all be of similar scale. You can check As Percentage to specify
the Target/Reference Change as a percentage of the value of the observable.
Note
You must click Apply for each objective you define before moving on to the next one.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
48 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying the Geometry Using the Design Tool
Important
Note that a given surface cannot have multiple conditions of type prescribed-profile, rota-
tion, translation, or scaling.
Fixed Walls
The fixed-walls constraint can be applied to clip-surfaces of walls in the deformation region. This offers
a fine-grained control over parts of the geometry that should not move. Whereas deselecting a zone
in the Zones To Be Modified list on the Design Change tab will fix an entire wall zone, selecting a
clip-surface from in the Fixed Walls Condition list will fix only the portion of the wall that forms the
clip-surface.
Any clip surfaces you have defined will appear in the Clip Surfaces list. You can assign clip surfaces to
a fixed walls constraint by selecting them in the list and clicking Apply.
Bounding Planes
The bounded-by-plane condition allows you to define one or more bounding planes that constrain
the geometry deformation in such a way that the geometry cannot cross the given planes, thereby re-
specting packaging or form-factor constraints. The bounding plane is characterized by a vector normal
to the plane and a distance measured from the global coordinate system origin to the plane, along the
normal direction. The motion of the selected wall surface(s) will be constrained such that all points on
the surface(s) lie on the side of the bounding plane that is opposite to the normal direction.
n
r
r
Origin n Origin
d>0
d<0
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 49
Using the Adjoint Solver Module
In Figure 2.14: Specifying a Bounding Plane for Design Changes (p. 49) the bounding plane normal
vector is denoted by and the distance is denoted by . is the position vector of a point on the wall
surface subject to the bounded-by-plane condition. Note that a positive value for the distance yields a
bounding plane that is oriented with its normal pointing away from the origin, while a negative value
for the distance yields a bounding plane oriented with its normal direction pointing towards the origin.
The constraint equation can be expressed as:
1. Select the surfaces (or clip-surfaces) that are subject to the bounding plane condition in the Bounded
Surfaces list.
3. Enter the distance of the plane from the origin (along the normal direction).
4. Click Apply.
Bounding Surfaces
The bounded-by-surfaces condition allows you to import one or more bounding surfaces that constrain
the geometry deformation in such a way that the geometry cannot cross the nearest facet of the
bounding surfaces, thereby respecting packaging or form-factor constraints. The bounding surfaces can
be read from an .stl, .msh, or .cas file. The deformation of the selected bounded surfaces will be
constrained such that all points on the surfaces lie on the sides of the bounding surfaces that have a
positive orientation.
1. Select the surfaces (or clip-surfaces) that are subject to the bounded-by-surface condition in the Bounded
Surfaces list.
2. Use the Read... button to import a .stl, .msh, or .cas file that contains the appropriate bounding
surface(s). Note that the file you read must have the same dimensionality (2D or 3D) as the working case
file.
3. Select the Imported Surfaces that will constrain the bounded surfaces.
4. To visually confirm that the selected Bounded Surfaces and Imported Surfaces are appropriate, click
the Display button. The imported surfaces will be colored green by default.
Note
When examining the surfaces, it may be helpful to revise display properties of particular
surfaces (for example, the color, the level of transparency, and the visibility of the mesh
edges or faces). This can be done using the Scene Description dialog box, as described
in Composing a Scene in the Fluent User's Guide. Note that you can even revise the display
properties of the imported surfaces, the names of which will be displayed with the
prefix bounding-.
5. To ensure that the Bounded Surfaces are constrained on the correct side of the Imported Surfaces (that
is, the side that has a positive orientation), click the Orientation... button. The selected Imported Surfaces
will be displayed, with their orientation indicated by arrows. In the dialog box that opens (Figure 2.15: The
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
50 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying the Geometry Using the Design Tool
Bounding Orientation Dialog Box (p. 51)), you can select individual Bounding Surfaces and Reverse
their orientation as necessary; you can also increase the Skip value to display less orientation arrows, for
cases where the arrow density obscures the orientation. Note that the orientation you define for a partic-
ular bounding surface will be used globally for all bounded-by-surfaces conditions.
When reviewing the orientation of a bounding surface, you should verify that the facets have a
uniform orientation, that is, all of the arrows are on the same side of the surface. Bounding surfaces
with facets that have a mixed orientation can affect the convergence and/or accuracy of the calcu-
lation.
6. Click Apply in the Design Conditions tab of the Design Tool dialog box to save your settings.
Note
When using the bounded-by-surfaces condition, it is recommended that you apply precon-
ditioning on the advancement of the process for updating the freeform displacements (by
changing the Preconditioning field to a positive value in the Numerics tab of the Design
Tool dialog box, as described in Design Tool Numerics (p. 56)), in order to encourage the
stability of the solution.
Prescribed Profiles
You can use the prescribed-profile condition to assign a motion profile to a wall zone or zones using
a DEFINE_GRID_MOTION UDF.
1. Select the wall zones for which to prescribe the displacement in the Wall Zones list.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 51
Using the Adjoint Solver Module
4. Specify the Scale Factor to be applied to the deformation profile. Alternatively, you can specify or create
an input parameter to use for the Scale Factor by clicking the p button next to the Scale Factor field.
5. Click Apply.
Rotation
The rotation condition allows you to specify that surfaces undergo rotation.
1. Select the surfaces (or clip-surfaces) you want to rotate in the Surfaces list.
2. Enter the rotation Angle in degrees. Note that you can enter a set value, or use the button to
assign an input parameter (for example, as part of a parametric study managed by Workbench);
see Select Input Parameter Dialog Box in the Fluent User's Guide for details.
3. Define the Origin about which you want the surfaces to rotate.
4. For 3D cases, define the Axis of rotation. For 2D cases, this is automatically defined as the positive Z axis.
5. Click Apply.
Translation
The translation condition allows you to specify that surfaces undergo translation.
1. Select the surfaces (or clip-surfaces) you want to translate in the Surfaces list.
2. Define the Displacement to be applied along each coordinate axis. Note that for each field you
can enter a set value, or use the button to assign an input parameter (for example, as part of a
parametric study managed by Workbench); see Select Input Parameter Dialog Box in the Fluent
User's Guide for details.
3. Click Apply.
Scaling
The scaling condition allows you to specify that surfaces are scaled along one or more axes.
1. Select the surfaces (or clip-surfaces) you want to scale in the Surfaces list.
Radial
This type scales the surfaces radially about the Origin, using a single scaling Factor along each
of the coordinate axes. The size of the surfaces will change, though not the shape.
In-Plane
This type is available for 3D cases, and scales the surfaces about the Origin using a single scaling
Factor along the two axes of a plane (as defined by the Normal Direction).
Axial
This type scales the surfaces about the Origin using a scaling Factor along a single Axis.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
52 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying the Geometry Using the Design Tool
General
This type scales the surfaces about the Origin using a separate scaling Factor for each of the
defined axes. For 2D cases, you define one Axis, and the second axis is automatically defined as
being perpendicular; for 3D cases, you define Axis 1 and Axis 2 (which should not be parallel),
and the third axis is defined automatically as the cross product. Note that the surfaces will be
scaled along each axis sequentially, so the order will be relevant for non-orthogonal axes.
For all types, the scaling Factor must be positive. A value of 1 results in no change, while a value
greater or less than 1 results in stretching or shrinking, respectively. Note that you can enter a set
value, or use the button to assign an input parameter (for example, as part of a parametric study
managed by Workbench); see Select Input Parameter Dialog Box in the Fluent User's Guide for details.
3. Click Apply.
2. Select those boundaries that are free to be partially constrained or deformed in the Zones To Be
Modified field. Boundaries that are not selected in this box that intersect the control volume will
be constrained not to move. This is useful if there are walls that, for design reasons, must remain
fixed and not move.
3. Select the constraining and/or deformation conditions (Defining Conditions for the Deforma-
tion (p. 49)) to be applied to the design change in the list of Applied Conditions. Note that a
given surface cannot have multiple conditions of type prescribed-profile, rotation, translation,
or scaling.
4. For each observable, specify its Weight in the optimization calculation. The weights are applied to the
Target/Reference Change you specified in the Objectives tab. That is, if you have two observables that
are each given a Weight equal to 1, Fluent will attempt to find an optimal design change that alters the
observable values in proportion to their respective values for Target/Reference Change.
Note
Weights are only required if there are two or more objectives that do not have explicit
target changes specified.
a. Choose a Freeform Scaling Scheme and specify the Freeform Scaling Factor. This setting controls
how the overall scaling factor for the design change magnitude is interpreted.
Control-point spacing
The magnitude of the freeform deformation will be based on the control-point spacing. That is,
a Freeform Scale Factor of 1.0 leads a to maximum control point movement on the order of
one sub-cell of the control volume. The sub-cell size is determined by a uniform sub-division of
the morphed region based on the number of control points specified (Defining Region Condi-
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 53
Using the Adjoint Solver Module
tions (p. 47)). A value of 1.0 is a reasonable default to preserve mesh quality during the
morphing process.
b. If you have disabled Auto-Select Smoothness in the Numerics tab (Design Tool Numerics (p. 56))
you can also specify a value for Smoothness of the deformed geometry. A lower value will allow
locally sharper changes in the geometry, potentially at the expense of manufacturability.
c. If you used an input parameter as part of the setup of a deformation condition in the Design
Conditions tab, the initial value will be displayed and is available for modification.
6. Click the Check button to verify that your constraining and/or deformation conditions are set up
in such a way as to produce good results. A report will be printed in the console, summarizing the
number of control points defined in the Region Conditions tab that are active (that is, not disqual-
ified by other constraints) and listing conflicts between multiple constraints / deformations applied
on a single node (including the Design Conditions and the continuity constraint applied along
the boundary of the morphing region). The conflicts are categorized as being either of type Fatal
(which indicates the solution is unlikely to converge or be desirable) or Possible (which may be
allowable, depending on the details of the applied conditions).
7. By default, the condition or conditions specified for a given zone (including the selected Applied
Conditions, as well as the fixed condition applied to the unselected Zones To Be Modified) are
not applied to every node, but instead to a subset of nodes distributed throughout the zone; this
is to avoid overly constraining the zone. Consequently, some nodes will not strictly adhere to the
condition, even if you have defined the constraint tolerance to be small or the residuals are small.
To specify that all nodes of the zone strictly obey the condition, click the Strict Conditions... button
and use the dialog box that opens (Figure 2.16: The Strict Conditions Dialog Box (p. 54)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
54 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying the Geometry Using the Design Tool
Select the conditions for which you want strict enforcement and click OK. For unselected conditions,
only the default subset of nodes will strictly obey the condition.
Note
Strict enforcement is a direct modification of the surface mesh nodes to satisfy the
design condition, and no modification is applied on the interior mesh. Consequently,
when the boundary node modification is large, it may deteriorate the mesh or even
cause negative volumes. Therefore you should use this condition carefully: the design
condition should reach a good convergence and there should be enough control points.
When you click the Modify Mesh button (as described in a later step), the maximum offset for
each condition (that is, the maximum distance a node has deviated from the prescribed condition)
will be printed to the console.
8. Click Calculate Design Change to compute the optimal design change. The Expected change for each
observable will be reported in the Design Tool dialog box.
9. (optional) Click Write Expected Change... to write to file the adjustment in the observable that is expected
due to the change defined by the current settings.
10. (optional) Click Export Displacements... to write to file the optimal surface displacement field (overwriting
any pre-existing file of the same name). An example of the format of the text file that is written (for three-
dimensions) is as follows:
Line 1: n
Lines 2 to n+1: x y z dx dy dz
11. The planned change to the geometry can be visualized by plotting the optimal displacement vector field
or a contour plot of surface deformation.
12. Click Modify Mesh to deform the boundary and interior mesh with the optimal design change. If you
determine that the change is unsatisfactory, you can click Revert to undo the mesh changes.
Upon successful modification of the geometry of the system, the modified shape can be viewed using
the usual commands for viewing the mesh in ANSYS Fluent. After the mesh has been modified according
to the control settings, the original flow calculation can be restarted and converged with the modified
geometry. Upon successful convergence, the observable value should now have changed by an amount
similar to that reported when the Expected Change button was clicked prior to deforming the geometry.
For 3D cases, you have the option of exporting the surfaces from your modified geometry as an .stl
file, for use in other software packages. Click the Export STL... button near the bottom of the Design
Change tab, select the Surfaces of interest in the dialog box that opens (Figure 2.17: The Export STL
Dialog Box (p. 56)) and Export... them.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 55
Using the Adjoint Solver Module
The ability to vary the smoothness parameter is particularly important when prescribed displacements
and design conditions are applied. Deformation at smaller spatial scales relieves the stiffness that would
otherwise cause numerical challenges as well as lead to poor quality of the computed design and mesh.
By default, Fluent will automatically choose the smoothness. In the Numerics tab, you can disable Auto-
Select Smoothness in which case a Smoothness input will be made available on the Design Change
tab.
Calculation Numerics
Note
If no Design Conditions are imposed, and if there are no walls that are treated as fixed
which intersect the region being modified, the numerical settings described below are not
used.
In many cases, no adjustment of the detailed numerics will be required for the design tool to compute
an optimal solution. However, if the problem under investigation involves many Design Conditions
and/or large displacements, the settings may need to be adjusted.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
56 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying the Geometry Using the Design Tool
Prescribed Motions
Max. Iterations
The maximum number of inner iterations that will be performed in an effort to compute displacements
from prescribed changes.
Constraint Relaxation
The under-relaxation factor that is applied to the field to converge the prescribed displacements. This
takes a value between 0 and 1.
Preconditioning
A value of 0 yields the most aggressive advancement, while a larger value encourages more stable,
albeit slower, advancement of the process for updating the prescribed displacements. A value of order
1 is typical in the event that preconditioning needs to be applied.
Freeform Motions
Max. Iterations
The maximum number of inner iterations that will be performed in an effort to compute freeform
displacements that satisfy the applied Design Conditions.
Constraint Relaxation
The under-relaxation factor that is applied to the field to converge the constrained freeform displace-
ments. This takes a value between 0 and 1.
Preconditioning
A value of 0 means that no preconditioning is applied, while a larger value encourages more stable,
albeit slower, advancement of the process for updating the freeform displacements. A value of order
1 is typical in the event that preconditioning needs to be applied.
Parameter Relaxation
For design conditions such as the Bounded-By-Plane condition there are additional parameters that
are implicit in the calculation. The values of these parameters are computed as part of the solution
process. The value of the parameter relaxation defines the rate at which these parameters are corrected
as the calculation progresses. This takes a value between 0 and 1.
Tolerances
Constraints
The tolerance for convergence of the residuals associated with the design conditions themselves, or
fixed zone conditions.
Parameters
The tolerance for convergence of the parameters associated with the design conditions.
Using a value of 1 for Constraint Relaxation and a value of 0 for Preconditiong yields the most ag-
gressive behavior. This can result in the fewest number of iterations to converge a constrained problem,
at the expense of some added numerical effort and memory in preparing the preconditioning. For 2D
and small 3D problems the added cost in time and memory is typically small. For larger problems in-
volving multiple constraints a non-zero Preconditioning and Constraint Relaxation less than 1 may
be preferable. The execution time to set up the preconditioning will be less, as will the memory usage.
Calculation stability can also be improved. The number of iterations required to converge the problem
will increase. However, this can prove to be an effective strategy that results in an overall shorter time
needed to compute the design change.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 57
Using the Adjoint Solver Module
adjoint/observable
Menu to create and configure observables of interest.
create
A new observable of the specified type and name is created and the definition is populated with default
parameters.
rename
An existing observable is renamed to a new specified name.
delete
Removes a named observable.
select
A named observable is selected as the one for which an adjoint solution is to be computed.
specify
The parameters that define a named observable are configured.
write
Evaluates the current value of the selected observable and writes the result to a file.
evaluate
Evaluates the current value of the selected observable and prints the result to the console.
adjoint/design-tool
design-conditions/
Text menu to create, delete, rename, and set conditions on the geometry deformation.
design-change/
Text menu to perform optimal shape modification.
calculate-design-change
Compute the optimal design change.
check
Print a report in the console that summarizes the control points defined for the region, the defined
constraining and/or deformation conditions, and any possible conflicts between multiple constraints
/ deformations applied on a single node.
export-displacements
Export the computed optimal displacements.
export-stl
Export specified surfaces from 3D cases as an .stl file.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
58 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Adjoint Solver Modules Text User Interface
modify-mesh
Apply the computed optimal displacement to the mesh.
multi-objective-weights
Set the weights for multiple free-form objectives.
revert
Revert (reject) the last mesh modification.
select-conditions
Select which conditions to apply to the mesh deformation.
select-strict-conditions
Select constraining and/or deformation conditions you want strictly enforced (that is, applied to
all of the nodes of the associated zones).
select-zones
Select which zones are allowed to deform.
settings
Specify global deformation scale and settings.
write-expected-changes
Write out the expected changes in the observables for the computed optimal design change.
numerics
Adjust numerics settings for computing the optimal displacement.
objectives/
Text menu to configure observable objectives.
include-current?
Optionally include the most-recently computed observable sensitivity in the multi-objective design
computation.
manage/
Text menu to import and manage previously exported sensitivity data.
set
Configure the objectives for loaded observables.
region-conditions/
Text menu to configure conditions on the deformation region
boundaries
Specify what degree of continuity to enforce at the boundaries of the deformation region.
motion
Specify conditions on the movement of the control points.
points
Specify the number of control points in the deformation region.
symmetry
Specify symmetry conditions for the deformation region.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 59
Using the Adjoint Solver Module
region/
Text menu to define the deformation region.
cartesian-limits
Directly specify the bounds of the deformation region.
export-sensitivities
Export the sensitivity to mesh node movement for the currently-selected observable. Sensitivities
are only exported for mesh nodes that lie within the specified deformation region.
get-bounds
Set the limits for the deformation region to a bounding box that encompasses a list of selected
surfaces.
larger-box
Uniformly increase the size of the deformation region.
smaller-box
Uniformly decrease the size of the deformation region.
adjoint/controls
Menu to configure adjoint solver controls.
settings
Text menu to set parameters for the adjoint solver numerics.
stabilization
Text menu to set parameters for the adjoint stabilization schemes.
adjoint/methods
Menu to configure adjoint discretization settings.
settings
Text menu to set discretization methods for the adjoint solver.
default-settings
Sets discretization methods for the adjoint solver to the defaults.
best-match-settings
Sets discretization methods for the adjoint solver that best match with those for the flow solver.
adjoint/monitors
Menu to configure monitors for the adjoint solver.
plot-residuals
Plots the adjoint residuals in the designated graphics window.
settings
Text menu to configure the monitors and convergence criteria for the adjoint solver.
adjoint/run
Menu to initialize and compute the adjoint solution.
initialize
Initializes the adjoint solution field to zero everywhere.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
60 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Adjoint Solver Modules Text User Interface
initialize-stabilization
Initialize the stabilization data (only available if modal stabilization is used).
iterate
Advances the adjoint solver by a specified number of iterations, or until the convergence criteria are
met.
adjoint/reporting
Menu to report sensitivity data from the adjoint solution.
report
Reports sensitivity data on a named flow boundary.
write
Reports sensitivity data on a named flow boundary and writes it to a named file.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 61
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
62 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3:Tutorial: Using the Adjoint Solver 2D Laminar Flow Past
a Cylinder
A tutorial is available that provides an example of how to generate sensitivity data for flow past a circular
cylinder, how to postprocess the results, and how to use the data to perform a multi-objective design
change that reduces drag and increases lift by morphing the mesh. The latest update of this tutorial is
available on the ANSYS Customer Portal. To access tutorials and their input files on the ANSYS Customer
Portal, go to http://support.ansys.com/training.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 63
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
64 of ANSYS, Inc. and its subsidiaries and affiliates.
Part II: ANSYS Fluent Battery Module
Tutorial: Simulating a Single Battery Cell Using the MSMD Battery Model (p. 127)
Tutorial: Simulating a 1P3S Battery Pack Using the MSMD Battery Model (p. 129)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. lxvii
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
lxviii of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Introduction
The application of lithium ion batteries has been rapidly expanding from electric appliances and elec-
tronic devices to hybrid electric vehicles (HEVs) and electric vehicles (EVs), due to their high energy
density. The main concerns when designing a Li-ion battery are its performance, life, and safety. The
ANSYS Fluent battery models allow simulating a single battery cell or a battery pack using CFD technology
to study their thermal and electrochemical behavior. The ANSYS Fluent battery models are provided as
add-on modules with the standard ANSYS Fluent licensed software.
Note that the Fluent Tutorial Guide provides tutorials that illustrate how to use the ANSYS Fluent battery
models. (To access tutorials and their input files on the ANSYS Customer Portal, go to http://support.an-
sys.com/training.)
1.1. Overview
In a lithium-ion battery, the anode and cathode are made of active materials coated on the surface of
metal foils. A polymer separator is placed between the foils of opposite polarity to prevent electrons
from passing between them. To predict the evolution of the chemical, thermal, and electrical processes
in a battery, ANSYS Fluent offers the following models:
The Single-Potential Empirical Battery Model is useful if the geometries of the current collector, electrodes,
and separator can be fully resolved. One potential equation is solved in the computational domain. This
model is best suited for electrode-scale predictions in a single battery cell.
The model, however, has a limited ability to study the full range of electrochemical phenomena in
battery systems, especially systems having complex geometry. When constructing a battery cell, the
anode-separator-cathode sandwich layer is usually wound or stacked up into a 'jelly roll' or a prismatic
shape. It would be very expensive to resolve all the layers explicitly, even for a single battery cell. Fur-
thermore, many industrial applications use a battery pack consisting of a large number of cells connected
in series or in parallel.
The ANSYS Fluent Dual Potential Multi-Scale Multi-Dimensional (MSMD) Battery model overcomes these
limitations by using a homogeneous model based on a multi-scale multi-dimensional approach. In this
approach, the whole battery is treated as an orthotropic continuum; thus, the mesh is no longer con-
strained by the micro-structure of the battery. Two potential equations are solved in the battery domain.
To fit various analysis needs, the model includes three electrochemical submodels, namely, the Newman,
Tiedemann, Gu, and Kim (NTGK) empirical model, the Equivalent Circuit model (ECM), and the Newmans
Pseudo-2D (P2D) model having different level of complexity. The model offers you the flexibility to
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 69
Introduction
study the physical and electrochemical phenomena that extend over many length scales in battery
systems of various arrangements.
4. Load the module and use the Battery Model dialog box to define the battery model parameters.
Important
Note that the majority of this manual describes how to set up the ANSYS Fluent Battery
Model using the graphical user interface. You can also perform various tasks using the text
user interface.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
70 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Single-Potential Empirical Battery Model
This chapter discusses the theoretical background and the use of the Single-Potential Empirical Battery
model with ANSYS Fluent. The information is organized in the following sections:
2.1. Single-Potential Empirical Battery Model Theory
2.2. Using the Single-Potential Empirical Battery Model
2.1.1. Introduction
Given the important role of a battery in electric and/or hybrid electric vehicles there have been a
number of models proposed in the literature to simulate the transient behavior of a rechargeable battery.
These models vary in complexity from a zero-dimension resistor-capacitor circuit to a multi-dimension
potential-current distribution, and, all the way to detailed electrochemistry modeling inside active
separator layers. Computing resources (CPU time and memory) increase considerably with model com-
plexity. Combining the need for model accuracy and the requirement for model usability, ANSYS Fluent
has adopted a modeling approach that was based upon the 1D model initially proposed by Tiedemann
and Newman [3] (p. 131), later used by Gu [1] (p. 131), and, more recently used by Kim et al [2] (p. 131)
in their 2D study. ANSYS Fluent has extended the model formulation for use in 3D computations.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 71
Single-Potential Empirical Battery Model
(2.1)
In the above equation the source term , also called the apparent current density, has non-zero value
only at the anode-cathode interface (separator interface); is the local surface area of the interface,
and is the electric conductivity.
In their independent studies of small electrodes, Tiedemann and Newman [3] (p. 131), and Gu [1] (p. 131)
observed that the apparent current density (A/m2) varies linearly with cell voltage,
(2.2)
where the cell voltage is the difference between the cathode- and anode-side electric potentials at the
separator interface ( ). From Equation 2.2 (p. 72) it is clear that on an experimentally measured
polarization curve, namely the voltage-current (V-I) curve of a battery cell, U would be the intercept of
V at I=0; and, would be the inverse of the slope of the V-I curve. Moreover, Gus experimental data
[1] (p. 131) indicate that both and vary with respect to the depth of discharge (DoD) defined relative
to the theoretical battery capacity ( ),
(2.3)
(2.4)
where the coefficients and are constants; and the local value of the depth of discharge
is computed as follows,
(2.5)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
72 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Single-Potential Empirical Battery Model
2. Temperature dependent apparent current density ( ) by modifying Equation 2.4 (p. 72),
(2.6)
(2.7)
where is the volume of the computing cell. Since the potential jump takes place only at the
separator interface, the heat generated, Equation 2.9 (p. 73), is split equally between the two com-
puting cells on either side of the interface. and are two additional model coefficients.
For information about inputs related to other models used in conjunction with the battery model, see
the appropriate sections for those models in the ANSYS Fluent User's Guide.
Anode
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 73
Single-Potential Empirical Battery Model
Cathode
Note
The battery module is loaded into ANSYS Fluent through the text user interface (TUI). The module can
be loaded only when a valid ANSYS Fluent case file has been set or read. The text command to load
the module is
Select the single-potential battery model by entering the module number 7. During the loading process,
a scheme library containing the graphical and text user interface, and a UDF library containing a set of
user-defined functions (UDFs) for the battery module are loaded into ANSYS Fluent. This is reported to
the console. The UDF library also becomes visible as a new entry in the UDF Library Manager dialog
box. The basic setup of the battery model is performed automatically when the battery module is suc-
cessfully loaded.
Once the module has been loaded, in order to set battery model parameters and assign properties to
the relevant regions in your battery, you need to access the battery graphical user interface (the Battery
Model dialog box).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
74 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Single-Potential Empirical Battery Model
To enable the battery model: In the tree under the Models branch, right-click Battery Model and click
Edit... in the menu that opens.
Once you open the Battery Model dialog box, you can select the Enable Battery Model check box to
enable the model so that you can use it in your simulation. Enabling the model expands the dialog box
to reveal additional model options and solution controls.
The Model Parameters tab of the Battery Model dialog box allows you to access general model settings
when solving a battery problem. Likewise, the Separator tab allows you to set options for the battery
separator. Finally, the Electric Field tab allows you to set parameters for the electric field. For additional
information, see the following sections:
2.2.3.1. Specifying Single-Potential Empirical Battery Model Parameters
2.2.3.2. Specifying Separator Parameters
2.2.3.3. Specifying Electric Field Parameters
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 75
Single-Potential Empirical Battery Model
Figure 2.2: The Battery Model Dialog Box (Model Parameters Tab)
In the Model Parameters tab, you can set various model options, solution controls, electrical parameters,
as well as activation parameters.
Enable Joule Heat Source in order to include the Joule Heating source in the thermal energy equation
(Equation 2.8 (p. 73)). (enabled by default)
Enable E-Chem Heat Source in order to include the heat source due to electrochemistry in the thermal
energy equation (Equation 2.9 (p. 73)). (enabled by default)
Enable Separator Submodel in order to specify your own values for the Separator Thickness and Resistiv-
ity, instead of the Y Coefficients, for modeling the separator. Note that when this option is selected, the
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
76 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Single-Potential Empirical Battery Model
inputs for the Y Coefficients are grayed out, and the Separator Property fields are active in the Separator
tab.
Note
For Solution Controls, you can set the Current Under-Relaxation Factor.
For Electrical Parameters, you can set the Nominal Capacity (the capacity of the battery cell). If you
select Fixed DoD (for steady state simulation only), then you can specify a Nominal DoD value (depth
of discharge). For the Solution Options, if you select:
Specified C-Rate, you can set a value for the Discharge C-Rate (the hourly rate at which a battery is
discharged). In this case, the total current at the cathode tabs are fixed as the product of C-Rate and
Nominal Capacity, while the electrical potential is anchored at zero on the anode tabs.
Specified System Current, you can set a value for the total current (applied to the anode tabs). In this
case, the electrical potential is set to zero at the anode tabs.
Specified System Voltage, you can set a value for the System Voltage (applied to the cathode tab;
the anode tab has a voltage of 0 V).
Set in Boundary Conditions, you can set the UDS boundary conditions directly, for example, the
voltage value or the current value (specified flux), using the Boundary Conditions task page in ANSYS
Fluent for the specific face zone.
Note
When the steady state solver is used, the Fixed DoD option has to be selected. Altern-
atively, the transient solver can be used to analyze variable DoD problems.
For Activation Parameters, you can specify the U Coefficients for Equation 2.3 (p. 72) and the Y
Coefficients for Equation 2.4 (p. 72) (if the Enable Separator Submodel option is disabled).
Note
The coefficient values for the Activation Parameters are based on battery cell polarization
test curves. Obtaining coefficient values (other than the default values) can be dependant
on your battery configuration and material properties. For more information about coefficient
values, refer to the work performed by Gu [1] (p. 131). You will likely need to make adjustments
(for example, if you are modeling lithium ion batteries) when using your own experimental
data.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 77
Single-Potential Empirical Battery Model
You can also specify the Temperature Corrections, if needed, though the default values are suitable
in most cases. The temperature corrections provide additional accuracy to account for local temperature
effects, and correspond to the temperature terms in Equation 2.6 (p. 73) and Equation 2.7 (p. 73).
In the Separator tab, specify the zones for the Anode Separator and the Cathode Separator. If the
Enable Separator Submodel option is selected in the Model Parameters tab, you can specify the
Separator Properties such as the Separator Thickness and the Separator Resistivity.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
78 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Single-Potential Empirical Battery Model
Figure 2.4: The Battery Model Dialog Box (Electric Field Tab)
In the Electric Field tab, specify the zones for the Conductive Regions and the Contact Surfaces (as
well as the Contact Resistance) for any selected contact surface. In addition, you can specify the anode
and cathode tap surfaces for the External Connectors of the battery.
Also, keep in mind the Advanced Solution Controls dialog box, where you can set the multigrid cycle
type for the electric potential equation, if required.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 79
Single-Potential Empirical Battery Model
Note
When choosing a solution method for your simulation, the Least Squares Cell Based gradient
spatial discretization method is recommended because of its greater accuracy. The Green-
Gauss Cell Based gradient spatial discretization method is adequate if the mesh is evenly
spaced in the system current direction, and if there are not large differences in the electrical
conductivities in the materials used in the simulation.
Note
In transient simulations, you should start the calculation with a smaller time step (1 ~ 2
seconds) initially. The time step can be increased to a large value (for example, 30 seconds),
however, you will likely need to search for a suitable value to make sure reasonable conver-
gence is achieved within each time step.
Electric Potential
Diff Coef of Electric Potential (the electrical conductivity of the conductive field)
X Current Density
Y Current Density
Z Current Density
Volumetric Ohmic Source (the energy source due to the electric Joule heating)
Electrochemistry Source
Activation Over-Potential (the net electrode potential change across the anode and cathode of the
system when there is a current flowing through the system, that is, (Volts)
Depth of Discharge
U Function
Y Function
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
80 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Single-Potential Empirical Battery Model
Separator Voltage Jump (the net potential difference across the separator)
Effective Electric Resistance (the effective resistance of the separator used in the potential field calculation)
Other
By default, the ANSYS Fluent Battery Model defines several user-defined scalars and user-defined memory
allocations, described in Table 2.1: User-Defined Scalar Allocations (p. 81) and Table 2.2: User-Defined
Memory Allocations (p. 81).
Note
For field variables that are stored in UDM, use the corresponding variables for post processing.
Post processing the UDM itself is not recommended.
For reviewing simulation results in CFD Post for cases involving UDM or UDS, export the
solution data as CFD-Post-compatible file (.cdat) in Fluent and then load this file into CFD-
Post.
The following listing represents a description of the contents of the batt_user.c source code file:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 81
Single-Potential Empirical Battery Model
real CONDUCTIVITY_CELL(cell_t c, Thread *t): Returns values for the electrical conductivity
for cells inside conductive zones, overwriting the values set in the Electric Field tab of the Battery Model
dialog box.
real CONTACT_RESIST_FACE(cell_t f, Thread *t): Returns values for the electrical contact
resistance, overwriting the values set in the Electric Field tab of the Battery Model dialog box.
real Compute_U (face_t f, Thread *t, real DOD, real dUdJ, real a[], real
*dUdJ): Returns values for both U and the derivative of U with respect to J (dUdJ). Note that DOD represents
the depth of discharge and a[] is the set of U coefficients.
real Compute_Y (face_t f, Thread *t, real DOD, real b[]): Returns values for Y. Note
that DOD represents the depth of discharge and b[] is the set of Y coefficients.
Important
It is assumed that you have a basic familiarity with compiling user-defined functions (UDFs).
For an introduction on how to compile UDFs, refer to the Fluent Customization Manual.
You will first want to use a local copy of the battery directory in the addons directory before you
recompile the Battery module.
Important
The custom version of the library must be named according to the convention used by
ANSYS Fluent: for example, battery.
4. Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
5. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Battery
module.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
82 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Single-Potential Empirical Battery Model
where your_arch is lnx86 on LINUX, or ultra on the Sun operating system, etc.
The following example demonstrates the steps required to set up and run a customized version of the
Battery module that is located in a folder call home/sample:
Using a text editor, make the appropriate changes to the batt_user.c file located in
/home/sample/battery/src/batt_user.c
Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
Set the FLUENT_ADDONS environment variable (using CSH, other shells will differ).
setenv FLUENT_ADDONS /home/sample
Start ANSYS Fluent and load the customized module using the text interface command.
2. Make sure that the FLUENT_INC environment variable is correctly set to the current ANSYS Fluent install-
ation directory (for example, ANSYS Inc\v170\fluent).
6. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Battery
module.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 83
Single-Potential Empirical Battery Model
2.2.7. Using the Single-Potential Empirical Battery Model Text User Interface
All of the features for the Battery Model that are available through the graphical user interface are also
available through text user interface (TUI) commands. The TUI allows text commands to be typed directly
in the ANSYS Fluent console window where additional information can be extracted and processed for
more advanced analysis.
Once the battery module is loaded, you can access the text user interface through the Console Window
under battery-model. A listing of the various text commands is as follows:
battery-model/
Battery model menu
activation-parameters/
Activation parameter setup.
t-coefficients
Specify the temperature coefficients in Equation 2.6 (p. 73) and Equation 2.7 (p. 73).
u-coefficients
Specify the U coefficients for Equation 2.3 (p. 72).
y-coefficients
Specify the Y coefficients for Equation 2.4 (p. 72).
anode-interface
Anode interface options.
cathode-interface
Cathode interface options.
electric-field-model/
Electric field setup.
conductive-regions
List zone names and IDs.
contact-resistance-regions
List zone names and IDs.
current-tap
List zone names and IDs.
voltage-tap
List zone names and IDs.
electrochemistry
Electrochemistry parameters.
enable-battery-model?
Enable/disable battery model.
model-parameters
Model parameters.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
84 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Dual-Potential MSMD Battery Model
This chapter discusses how you can model the battery using Dual Potential Multi-Scale Multi-Domain
(MSMD) approach. It includes a summary of the theory and implementation of three electrochemical
submodels that are available in ANSYS Fluent. The information is organized in the following sections:
3.1. Dual-Potential MSMD Battery Model Theory
3.2. Using the Dual-Potential MSMD Battery Model
Battery thermal and electrical fields are solved in the CFD domain at the battery cell's scale using the
following differential equations:
(3.1)
(3.2)
where and are the effective electric conductivities for the positive and negative electrodes,
and are phase potentials for the positive and negative electrodes, and are the volumetric
current transfer rate and the electrochemical reaction heat due to electrochemical reactions, respectively,
and are the current transfer rate and heat generation rate due to battery internal short-circuit,
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 85
Dual-Potential MSMD Battery Model
respectively, and is the heat generation due to the thermal runaway reactions under the thermal
abuse condition.
For normal operation, is set to zero. For more information, refer to Thermal Abuse Model (p. 95).
The source terms and are computed using an electrochemical submodel. If there is no internal
short-circuit, and are equal to zero. For more information, refer to External and Internal
Electric Short-Circuit Treatment (p. 94).
In addition, you can define your own electrochemical model via user-defined functions and hook it to
the Fluent MSMD battery module.
To use the MSMD approach in an arbitrary finite volume of the cell composite, the following conditions
must be met:
These conditions are usually met for aligned stack cells or wound cells with extended foil-type continuous
current tabs.
where is the specific area of the electrode sandwich sheet in the battery, and are the model
parameters which are functions of the battery depth of discharge (DoD):
(3.4)
where denotes the battery volume, and is the battery total electric capacity in Ampere hours.
For a given battery, the voltage-current response curve can be obtained through experimentation.
and can then be determined by curve fitting the data. ANSYS Fluent has adopted the following for-
mulation for the and functions proposed in [[11] (p. 131)]:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
86 of ANSYS, Inc. and its subsidiaries and affiliates.
Dual-Potential MSMD Battery Model Theory
(3.5)
(3.6)
where the first term is heat due to overpotential and the second term is heat due to entropic heating.
The voltage-current relation can be obtained by solving the electric circuit equations:
(3.7)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 87
Dual-Potential MSMD Battery Model
For a given battery, the open circuit voltage, resistors' resistances, and capacitors' capacitances are
functions of the battery state of charge (SOC). These functions could be expressed in two different ways
in ANSYS Fluent:
(3.9)
The source terms for Equation 3.1 (p. 85) and Equation 3.2 (p. 85) are computed as:
(3.10)
(3.11)
where denotes the battery volume, is the current, and is the open circuit voltage.
Figure 3.2: Electrode and Particle Domains in the Newmans Model (p. 89) schematically shows the
electrode plate pair in the Li-ion battery. The composite electrode consists of active materials and
electrolyte solution. The electrolyte phase is continuous across the negative electrode, separator and
positive electrode while solid phase only exists in the negative and positive electrode. The solid active
material is modeled as a matrix of mono-sized spherical particles.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
88 of ANSYS, Inc. and its subsidiaries and affiliates.
Dual-Potential MSMD Battery Model Theory
During the discharge process, Li diffuses to the surface of negative electrode particles and undergoes
an electrochemical reaction. This reaction releases an electron and transfers Li to the electrolyte phase.
The Li-ions diffuse and conduct through the electrolyte solution from the negative electrode to the
positive electrode, where a similar reaction transfers Li to the positive solid phase. Li is stored inside
the positive electrode particles until the cell is later recharged.
The Li-ion transport phenomena in the porous electrode and electrolyte can be described by the charge
and mass conservation laws. Charge conservation governs phase potentials, and , while mass
conservation governs the phase concentrations, and , where the subscripts and are used to
denote the electrolyte and solid (electrode) phases, respectively.
The conservation equations relevant to electrolyte and solid phases are described as:
(3.12)
(3.13)
(3.14)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 89
Dual-Potential MSMD Battery Model
(3.15)
The Lithium conservation diffusion equation needs to be solved at every discretized spatial location in
the electrode zone. The Lithium conservation equation is solved in the r-dimension of the spherical
particlesthe pseudo second dimension. That is why the model is often referred to as the Newmans
P2D model in the literature.
The Butler-Volmer equation is used to couple the charge and species governing equations by describing
as a function of overpotential, :
(3.16)
where is defined by
(3.17)
Effective properties are used in the above equations in which the electrolyte ionic diffusivity, conduct-
ivity, diffusional conductivity, and solid phase electric conductivity are defined as:
(3.19)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
90 of ANSYS, Inc. and its subsidiaries and affiliates.
Dual-Potential MSMD Battery Model Theory
The source terms for the potential equations (Equation 3.2 (p. 85)) and the energy equation (Equa-
tion 3.1 (p. 85)) is computed as:
(3.20)
(3.21)
where is the specific area of the electrode sandwich sheet in the battery, , , and are the thicknesses
of positive electrode, negative electrode, and separator, respectively, and is the transverse current
density
(3.22)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 91
Dual-Potential MSMD Battery Model
The current transfer rate, , is more or less uniform, but current itself is not. As a result, instead of
solving the submodel for every computational cell, we can group CFD cells into clusters and solve the
submodel only once for each cluster.
ANSYS Fluent provides a tool for grouping the CFD cells into clusters. For a user-specified number of
clusters Nx, Ny, and Nz in the X, Y, and Z directions respectively, the solver will divide the battery elec-
trochemical domain into NxNyNz clusters and then obtain the solution for each cluster using the cluster-
average values.
Figure 3.3: Solution Domain for Two Potential Equations in a Battery Pack System (p. 92) schematically
shows an example in which three battery cells are connected in series.
Figure 3.3: Solution Domain for Two Potential Equations in a Battery Pack System
The positive tab of one battery is connected to the next batterys negative tab. As a result, the of
the first battery is about at the same level as the of the second battery. In other words, of the
first battery and of the second battery should be solved in the same domain. We still can use only
two potential fields to capture the electric field, however, we can no longer interpret them as the po-
tential fields of the positive and negative electrodes.
In Figure 3.3: Solution Domain for Two Potential Equations in a Battery Pack System (p. 92), different
shades of gray are used for cell zones to demonstrate the different equations being solved (for the
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
92 of ANSYS, Inc. and its subsidiaries and affiliates.
Dual-Potential MSMD Battery Model Theory
convenience of bookkeeping, we introduce the "level" of a zone to mark which equation needs to be
solved for a given zone):
An active zone (where electro-chemical reactions occur) belongs to two "levels". Both and are solved:
is solved for the zones at the odd level and is solved in the zones at the even level.
A passive zone (tab or busbar) belongs to only one level, where only one potential equation is solved.
For example, for N batteries connected in series, there will be N+1 levels. Except for the first and the
last levels, each level is isolated in the sense that there is no flux across its boundary. Two levels are
coupled only through the equations source terms. Two potential equations are solved continuously
across all the conductive zones. In a passive zone, however, only one potential equation is solved, and
the second equation is excluded by setting the electrical conductivity to zero.
Battery Connections
Batteries in a pack can be connected through either real connections or virtual connections.
Real connections are busbars that are physically resolved and meshed in the model.
Virtual connections are busbars or battery tab volumes that are not explicitly resolved in the model.
Instead, the connection information is provided in a battery connection definition file as described in
Specifying Electric Contacts (p. 115). The solver reads this information and sets the electric boundary
conditions for each individual battery through the virtual connections.
Using virtual connections saves the time and effort of meshing busbar and tab volumes, which are
usually very thin and difficult to mesh. The disadvantage is that electric resistance and Joule heating
are not considered in these unresolved volumes.
You can select the method that best suits your needs in your simulation. Refer to Specifying Electric
Contacts (p. 115) for the details on using the battery virtual connections in a battery pack.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 93
Dual-Potential MSMD Battery Model
However, under the following two conditions, the solution of these two potential equations can be
easily found without solving them repeatedly:
A careful examination of Equation 3.2 (p. 85) and their boundary conditions reveals that the two
equations become homogeneous linear partial differential equations under those two conditions. Instead
of solving them at each time step, a scaling procedure can be used, so that the two potential fields
under any electric load condition can be obtained from a reference potential field. The reference potential
field can be pre-calculated at a reference load condition. By using this method, the need to solve the
two potential equations at each CFD time step is eliminated entirely. The cost of a general electrochem-
ical-thermal coupled simulation is reduced to that of a pure thermal simulation. This can save a significant
amount of computational time in a battery simulation.
External Short-Circuit
In the case of an external short-circuit, battery's positive and negative tabs are connected directly with
no electric load. In ANSYS Fluent, an electric load boundary condition for the external resistance enables
you to directly specify the total external electric resistance, . The battery model solver will guarantee
that the ratio of the battery's tab voltage, , to the tab current, , equals the specified resistance
value:
Internal Short-Circuit
Under normal battery operation, the batterys positive and negative electrodes are divided by a separ-
ator, usually a thin polymer material that prevents electrons from traveling directly from the negative
electrode to the positive electrode. In the case of an internal short-circuit, which could be a result of a
nail penetration or a crash accident, the separator is ruptured in a localized area. Besides providing the
normal tab current, the battery produces a secondary electric current from electrochemical reactions
that is wasted through the shorted area.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
94 of ANSYS, Inc. and its subsidiaries and affiliates.
Dual-Potential MSMD Battery Model Theory
(3.23)
The above formulation is general enough to cover non-short cases where tends to infinity. Contact
resistance could be a function of time and location, therefore allowing the dynamic evolution of the
changes in the size of the shorted region and the intensity of the short-circuit current.
For information on how to use and set up this feature, see Specifying External and Internal Short-Circuit
Resistances (p. 118).
One-Equation Model
Four-Equation Model
For details on how to set up and use these model, see Specifying Advanced Option (p. 116).
One-Equation Model
In the one-equation model, thermal runaway reactions are lumped together as one reaction that can
be described by the following kinetics equation:
(3.24)
where:
= degree of conversion
= pre-exponential factor of the reaction (s-1)
= activation energy of the reaction (J/mol)
= universal gas constant
= temperature
and = reaction order parameters
Equation 3.24 (p. 95) is solved to keep track of the progress of the thermal runaway reaction. changes
from 0 to 1, with 0 denoting no reaction, and 1 denoting completion of reaction.
With computed from Equation 3.24 (p. 95), the heat generation rate due to thermal runaway can be
calculated as:
(3.25)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 95
Dual-Potential MSMD Battery Model
Four-Equation Model
In the four-equation model, thermal runaway reactions are put into the following four categories
[7] (p. 131):
To keep track of the progress of each type of reactions, a lumped Arrhenius kinetics rate is used:
(3.26)
(3.27)
(3.28)
(3.29)
where:
, , and various are reaction kinetics parameters, representing pre-exponential factor,
activation energy, and reaction order, respectively
subscripts , , , and denote parameters associated with SEI decomposition reaction,
negative electrode-electrolyte reaction, positive electrode-electrolyte reaction, and electrolyte
decomposition reaction, respectively
, , , and are dimensionless variables that can be interpreted as the fraction of the
remaining reactant associated to each type of reactions in the medium as reactions proceed
is the dimensionless measure of a SEI layer thickness
is the reference SEI layer thickness
is the temperature
is the universal gas constant
The values of , , and change from 1 (representing the state when nothing has reacted yet) to
0 (denoting the state with reactants being completely consumed). , on the other hand, varies from 0
to 1, as in the One-Equation model.
where and are two initial values. Note that the SEI layer is growing as the negative electrode-
electrolyte reaction progresses.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
96 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
The total heat generation due to the thermal runaway reactions (in units of W/m3) can be computed
as:
(3.30)
where is the heat of reaction (J/kg), and (kg/m3) is density of reactants in the medium.
3.2.1. Limitations
Note the following limitations when using the Dual-Potential MSMD Battery model:
For battery pack simulations, all batteries in the pack must be identical initially, having the same battery
type with the same initial conditions.
For battery pack simulations, all batteries in the pack must have the nPmS connection pattern; that is, n
batteries connected in parallel, and then m such units connected in series.
A conductive zone must be continuous. Disconnected zones cannot be grouped as one entity.
System positive and negative tabs must be continuous surfaces. Disconnected faces cannot be grouped
together as one entity.
The positive and negative tabs must be connected by either the real tab/busbar conductive volumes or the
virtual connections defined through a file.
A battery tab cannot be directly contact another battery tab. They must be connected by busbars.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 97
Dual-Potential MSMD Battery Model
Cell
Tab
When using the real battery connections you need to create busbar zones and specify them under
Basbar Components (see Specifying Conductive Zones (p. 114) for details). Since both tab zones and
busbar zones are passive zones, you can group them all under busbar for simplicity. However, busbars
sometimes may not be assigned to the tab zone category because a battery tab zone cannot directly
connect to another battery tab zone.
When using the virtual battery connections you do not need to create busbar zones. You only need to
create tab zones (if you have tab volumes) and specify them under Tab Components (see Specifying
Conductive Zones (p. 114) for details).
Select the dual-potential MSMD battery model by entering the module number 8. During the loading
process, a scheme library containing the graphical and text user interface, and a UDF library containing
a set of user-defined functions (UDFs) for the battery module are loaded into ANSYS Fluent. This is re-
ported to the console. The UDF library also becomes visible as a new entry in the UDF Library Manager
dialog box. The basic setup of the battery model is performed automatically when the battery module
is successfully loaded.
To enable the MSMD battery model: In the tree under the Models branch, right-click MSMD Battery
Model and click Edit... in the menu that opens.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
98 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
In the MSMD Battery Model dialog box that opens, select the Enable Battery Model check box to
activate the model.
The MSMD Battery Model dialog box expands to reveal additional model options and solution controls.
The inputs for the battery model are entered using the following tabs:
Model Options
contains the general model settings to define problems using the battery model.
Model Parameters
is where you specify the parameters to be used for solving the model equations.
Conductive Zones
allows you to select zones for the active, tab and busbar components.
Electric Contacts
allows you to define the contact surface and external connectors.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 99
Dual-Potential MSMD Battery Model
Advanced Option
allows you to enable a thermal abuse model and specify its parameters.
Note
When setting up the model, you can click the Apply button to save your input values and
your choices for your model. To restore the last saved settings for all tabs, click the Reset
button.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
100 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
Figure 3.5: The MSMD Battery Model Dialog Box (Model Options Tab)
The following submodels are available in ANSYS Fluent under the E-Chemistry Models group box:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 101
Dual-Potential MSMD Battery Model
User-defined E-Model
is the user-specified electrochemical submodel. To be able to use this option in the Fluent MSMD method
framework, you must provide the void user_defined_echem_model() function in the customizable
cae_user.c source code file.
Solving Transport Equation, two potential equations will be solved during each iteration in the simulation.
Reduced Order Method, the solution will be obtained (faster) using the reduced order method (ROM). You
can use this option if the two conditions listed in Reduced Order Solution Method (ROM) (p. 94) are met.
See Reduced Order Solution Method (ROM) (p. 94) for details.
Note that, prior to using the ROM, you must first run a simulation with the Solving Transport
Equation option for at least three time steps. ANSYS Fluent will use these results as reference potential
fields for the ROM method.
Once you have selected Reduced Order Method, you can set Number of Sub-Steps/Time Step.
Using this value, you can specify the ratio of the time steps for thermal and electro-chemistry calcu-
lations. For example, if the Number of Sub-Stepes/Time Step is set to 10, the solver will use one
tenth of the CFD time step for the electro-chemistry calculation.
Important
If internal short circuit occurs in a battery, the Reduced Order Method cannot be used.
Enable Joule Heat Source in order to include the Joule Heating source in the thermal energy equation
Equation 3.1 (p. 85). (enabled by default)
Enable E-Chem Heat Source in order to include the heat source due to electrochemistry in the thermal
energy equation Equation 3.1 (p. 85). (enabled by default)
Set Current Under-Relaxation Factor. The volumetric current density used in the two potential equations
are under-relaxed according to this factor. The default value of 0.8 may be sufficient for most cases. The
values in the range of 0.81.0 are recommended.
Set Voltage Correction Under-Relaxation Factor. The default value of 1.0 is acceptable for most cases.
You should reduce this value only if the convergence difficulty occurs during the solution of the potential
equations.
(Equivalent Circuit Model and Newman P2D Model) Select the Cluster Cells check box to enable cell clus-
tering and specify the number of clusters Nx, Ny, and Nz in X, Y, and Z directions respectively. The solver will
divide the battery domain into Nx x Ny x Nz clusters and solve submodel equations for each cluster using
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
102 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
cluster-average information. The default values for Nx, Ny, and Nz are 1, 1, and 1, respectively. For the initial
run, the default settings are recommended.
For Electrical Parameters, you can specify the following operation conditions:
Set the Nominal Cell Capacity (the capacity of the battery cell).
Discharge C-Rate (the hourly rate at which a battery is discharged; a positive value means dischar-
ging C-rate and a negative value means charging C-rate). In this case, the total current at the
cathode tabs is fixed as the product of C-Rate and Nominal Capacity, while the electrical potential
is anchored at zero on the anode tabs.
Min. Stop Voltage and Max. Stop Voltage. The simulation will automatically stop once the battery
cell voltage reaches the minimum or maximum value. For a battery pack, the battery-average cell
voltage is used.
System Current (applied at the cathode tabs). A positive value means discharging current and a
negative value means charging current.
Min. Stop Voltage and Max. Stop Voltage. (Same as for Specified C-rate.)
Specified System Voltage, you can set a value for the System Voltage (applied to the cathode tab;
the anode tab has a voltage of 0 V).
System Power. If you specify the total power output from your battery, Fluent solver will ensure
that the product of the system current and voltage equals the system power. A positive value
means discharging power output and a negative value means charging power input.
Min. Stop Voltage and Max. Stop Voltage. (Same as for Specified C-rate.)
Specified Resistance, you can specify the external electric resistance in an external short-circuit
simulation.
External Resistance. If you specify the external electric resistance in Ohm, the Fluent solver will
ensure that the ratio of the system voltage to the system current equals the specified external
resistance.
Set in Boundary Conditions, you can set the UDS boundary conditions directly, for example, the
voltage value or the current value (specified flux), using the Boundary Conditions task page in ANSYS
Fluent for the specific face zone.
Using Profile, you can select Time-Scheduled or Event-Scheduled under Profile Type and provide
time-dependent or event-dependent input (respectively) for the C-rate, current, voltage, or power.
The time-scheduled and event-scheduled profiles enable you to change the electric load type and
electric value in the simulation on the fly.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 103
Dual-Potential MSMD Battery Model
Once the profile type is selected, you can browse to the ASCII text file with either the .dat
or .txt file extension that you generated beforehand.
The inputs for the Time-Scheduled and Event-Scheduled profiles are described below.
1. Time
0: C-rate
1: Current
2: Voltage
3: Power
3. The battery is charged at a constant 1 C-rate for the last 500 seconds.
Note
For current, power, or C-rate, a positive value means discharging and a negative value
means charging.
ANSYS Fluent solver uses linear interpolation of your time-scheduled profile data in the
problem simulation. If you want to capture a sudden change in the profile accurately, use
smaller time gaps to describe the profile.
The Event-Scheduled profile file must be organized in the following five columns:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
104 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
Just as in the time-scheduled profile, the electric load type is defined by an integer
number:
0: C-rate
1: Current
2: Voltage
3: Power
3. Forwarding condition
5. Stop flag
The stop flag is an integer value of 0 or 1, where 0 specifies that the run should continue
to the next event entry line, and 1 specifies that the run should end.
2. The battery is charged at constant current 15 A until the voltage reaches 4.1 V.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 105
Dual-Potential MSMD Battery Model
3. The battery keeps charging at 4.1 V until the current is greater -1 A. The simulation stops after
reaching this point.
Note
For current, power, or C-rate, a positive value means discharging and a negative value
means charging.
Any time-scheduled profile can be rewritten in an event-scheduled profile format, but not
vice-versa. The example shown in the time-scheduled profile can be redefined in an event-
scheduled profile format as follows.
1 15 1 500 0
3 60 1 1000 0
0 -1 1 1500 1
Both profile types can be read into ANSYS Fluent. You can choose the most convenient one
to use in your specific application.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
106 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
For the NTGK Empirical Model, you can specify polynomial coefficients for , , and temperature
correction in Equation 3.5 (p. 87).
Note
The polynomial coefficients for the NTGK Model Polarization Parameters are based on battery
cell polarization test curves. Obtaining polynomial coefficients (other than the default coefficients)
can be dependant on your battery configuration and material properties. The default coefficients
are taken from Kims paper [9] (p. 131). If you model a battery having a different design, you must
provide a different set of battery parameters.
ANSYS Fluent provides the parameter estimation tool for computing the coefficients of the U
and Y polynomial functions from the battery's testing dataconstant discharging curves. The
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 107
Dual-Potential MSMD Battery Model
tool is available via the text-user-interface (TUI). For details, see Using the Dual-Potential MSMD
Battery Model Text User Interface (p. 124)
You can also set values for Initial DoD and Reference Capacity. The default value of 0 for Initial DoD
indicates the fully-charged state of the battery cell.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
108 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
For the Equivalent Circuit Model, you can specify the function coefficients for the resistors' resistances
(Rs, R1, and R2), capacitors' capacitances (C1 and C2), and the open circuit voltage (Voc) to be used in
Equation 3.9 (p. 88).
If you want to specify the ECM model functions in the polynomial form, select Using polynomials and
enter parameters for Equation 3.8 (p. 88).
In addition, you can turn on the Using different coefficient for charging and discharging option and
specify the coefficients for Charging parameters.
You can also set values for Initial State of Charge and Reference Capacity. The default value of 1 for
Initial State of Charge indicates the fully-charged state of the battery cell.
Note
The polynomial coefficients for the Equivalent Circuit Model are battery specific and need to
be specified before conducting a simulation. The default coefficients are taken from Chen
[5] (p. 131). If you model a battery of different design, you should specify a different set of battery
parameters.
ANSYS Fluent provides the parameter estimation tool for computing the polynomial coefficients
of all the ECM parameters from the battery's testing datatypically, the HPPC data. The tool is
available via the text-user-interface (TUI). For details, see Using the Dual-Potential MSMD Battery
Model Text User Interface (p. 124).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 109
Dual-Potential MSMD Battery Model
The following parameters are available under Model Parameters for the Newmans P2D model:
Thickness
are , , and in Equation 3.21 (p. 91).
Number of Grids
is a number of grid points used to discretize the positive electrode, negative electrode, and separator
zones.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
110 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
Particle Diameter
is the particle diameter of the active material.
Stoi. at 0% SOC
is the stoichiometry at 0% SOC that is used to compute theoretical capacity and initial lithium concentration
in the electrode.
Volume Fraction
is the volume fraction of the active material in the electrode, in Equation 3.19 (p. 90).
Filler Fraction
is the volume fraction of the filler material in the electrode, in Equation 3.19 (p. 90).
Ref. Diffusivity
is the diffusion coefficient of lithium ion in the electrode at reference temperature =25C, in
Equation 3.19 (p. 90).
Tortuosity
is the Bruggeman porosity exponent, in Equation 3.19 (p. 90).
Conductivity
is the electric conductivity, in Equation 3.19 (p. 90).
Trans. Coef. a
is the charge transfer coefficient at anode, in Equation 3.18 (p. 90).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 111
Dual-Potential MSMD Battery Model
Trans Coef. c
is the charge transfer coefficient at cathode, in Equation 3.18 (p. 90).
Electrolyte Diffusivity
is the diffusion coefficient of Li+ in the electrolyte phase, in Equation 3.18 (p. 90).
t+ Factor
is the transference number of lithium ion, in Equation 3.19 (p. 90).
You can also set values for Initial State of Charge. The default value of 1 for Initial State of Charge
indicates the fully-charged state of the battery cell.
Theoretical Capacity is computed from the Newman input parameters automatically and reported in
the MSMD Battery Model dialog box.
By default, ANSYS Fluent discretizes the lithium conservation equation and solves it numerically. ANSYS
Fluent also offers an option to use the reduced order method to solve the lithium diffusion equation
in solid [4] (p. 131). To use this method, select the Use Analytical Cs check box and enter the value for
the Cs Function Order.
Note
Model parameters are battery specific. The default values are taken from Cai & White
[4] (p. 131). To simulate a battery of different design, you should provide a user-specified set
of battery parameters.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
112 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
The following parameters are available under User-Defined E-Chem Model Parameters:
Initial SOC
is the value of the battery initial state of charge.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 113
Dual-Potential MSMD Battery Model
Reference Capacity
is the battery capacity (Ah/m2).
Figure 3.10: The MSMD Battery Model Dialog Box (Conductive Zones Tab)
In the Conductive Zones tab, select the appropriate zones for the Active Components, Tab Compon-
ents, and, if you simulate the battery pack with the real battery connections, the Basbar Components.
If you simulate the battery pack with the virtual battery connections, do not select any zones under
Basbar Components.
Battery cells are modeled as active zones; and battery tabs and busbars are modeled as passive zones.
Electrochemical reactions occur only in the active zones. The potential field is solved in both active and
passive zones.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
114 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
If you are using the NTGK Empirical Model, you can also specify the specific area of the electrode
sandwich sheet in the battery using the Specific Area control under Active Region Property.
Figure 3.11: The MSMD Battery Model Dialog Box (Electric Contacts Tab)
If you want to consider contact resistance, select zones for the Contact Surfaces and set the Contact
Resistance for any selected contact surface.
When using real connections, define the system negative and positive tabs under External Connectors.
When using the virtual connection option in a battery pack simulation, select the Use virtual battery
connection check box and in the Specify connection file text-entry box that appears, enter the filename
containing the virtual connection definition.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 115
Dual-Potential MSMD Battery Model
where:
The first line specifies the number of parallel batteries in a stage (mP).
The second line specifies the number of stages in series in a pack (nS).
The remaining lines contain pairs of the face names of the negative and positive tabs for each battery. The
battery data are listed in the following order: 1P1S ... 1PnS to mP1S ... mPnS.
For the above battery connection file example, the battery solver establishes the 1P4S connection pattern.
The following figure shows the different resulting connection patterns for the different connection data.
Once all conductive zones and the positive and negative tabs have been defined, ANSYS Fluent auto-
matically detects the battery network connection.
After you have defined all the conductive zones or modified zone related data, click Print Battery
System Connection Information, and review the battery connection information printed in the ANSYS
Fluent console window for any errors. If necessary, re-define the connections in the Conductive Zones
and Electric Contacts tabs.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
116 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
Figure 3.12: The MSMD Battery Model Dialog Box (Advanced Option Tab)
When you select One-equation kinetics model, you can specify the battery constants , , , ,
and used in Equation 3.24 (p. 95) through Equation 3.25 (p. 95), as well as the initial value for .
When you select Four-equation kinetics model, you can specify the battery constants , , , ,
and used in Equation 3.26 (p. 96)) through Equation 3.30 (p. 97), as well as the initial values for ,
, , and .
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 117
Dual-Potential MSMD Battery Model
For both models, you can select Run thermal abuse model only (battery model is turned off) if you
want to solve the energy equation (Equation 3.1 (p. 85)) alone. Otherwise, the two battery potential
equations (Equation 3.2 (p. 85)) will also be solved.
Note
The kinetics parameters in thermal abuse models are specific to the battery material. The default
settings may not be appropriate for your battery. You must provide parameter data for your own
battery.
For the One-Equation thermal abuse model, you can use the ANSYS Fluent parameter estimation
tool available through the TUI to compute the kinetics parameters from the battery oven testing
data. The entry fields in the MSMD Battery Model dialog box will be automatically populated
with fitted results for the kinetics parameters. For details, see Using the Dual-Potential MSMD
Battery Model Text User Interface (p. 124).
Internal Short-Circuit
The intensity of the internal short-circuit is determined by the value of volumetric contact resistance
(External and Internal Electric Short-Circuit Treatment (p. 94). In the ANSYS Fluent battery model,
this value is saved in a predefined user-defined memory allocation, Short Circuit Resistance. You can
modify the value of this user-defined memory allocation to simulate the internal short circuit.
By default, the contact resistance is set to a very large number, so that and , that is,
there is no internal short.
You can simulate an internal short-circuit using either of the following two ways:
Patching: Patch the contact resistance to the short circuit zone. The short circuit zone can be defined using
the marking feature available in the Region Adaption dialog box. See Performing Region Adaption in the
Fluent User's Guide for more details.
Using UDF: Use DEFINE_ADJUST or DEFINE_ON_DEMAND UDFs to specify the contact resistance using
the UDM macro, C_UDMI(c,t,SHORT_R). The contact resistance could be a function of location and
time. See the Fluent Customization Manual for details.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
118 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
Initialize the flow field from the Solution Initialization task page. The battery model will be initialized
also.
Initialize the battery model in isolation by clicking the Init button in the MSMD Battery Model dialog
box. Other flow variables remain untouched.
Use the second method if you want to freeze the flow field and use a different battery model
to simulate the battery field. When switching from one battery submodel to another, the battery
model must be re-initialized. The Init button in the MSMD Battery Model dialog box provides
a convenient way to accomplish this if you do not want to initialize the flow field.
1. In the Create/Edit Materials dialog box, select defined-per-uds from the drop-down list for UDS Diffus-
ivity.
The UDS Diffusion Coefficients dialog box is opened listing the uds-0 and uds-1 scalar diffusion
coefficients defined in ANSYS Fluent. Both scalars are set at the default values of 1e+07.
2. Modify the default values for uds-0 and uds-1 (if necessary).
3. For anisotropic material, select the orthotropic, cyl-orthotropic, or anisotropic option from the Coefficient
drop-down list and specify the diffusion coefficients as described in Fluent Customization Manual.
Note, that if the UDS Diffusion Coefficients are defined through the defined-per-uds option,
the Fluent solver does not use the value for Electrical Conductivity.
1. In the Create/Edit Materials dialog box, in the Properties group box, select user-defined from the drop-
down list for UDS Diffusivity.
3. In the Create/Edit Materials dialog box, in the Properties group box, specify the value for Electrical
Conductivity (Fluent solver uses this value for the definition of battery_e_cond).
1. When defining a material for the odd zones, in the UDS Diffusion Coefficients dialog box, enter the value
of for uds-0 and the value of for uds-1.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 119
Dual-Potential MSMD Battery Model
2. When defining a material for the even zones, copy the odd-zone material that you have already defined
and modify the UDS0 and UDS1 scalars by interchanging their values, that is entering the value of for
uds-0 and the value of for uds-1.
3. In the Cell Zone Conditions task page, attach the odd zone material to the odd zones, and even zone
material to the even zones. To determine whether a zone belongs to the odd or even zone, use the Print
Battery System Connection Information button in the Electric Contracts tab of the MSMD Battery
Model dialog box and review the report printed in the console window.
Potential Phi+
Potential Phi-
X Current Density
Y Current Density
Z Current Density
Volumetric Ohmic Source (the energy source due to the electric Joule heating)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
120 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
Cell Voltage
Activation Over-Potential (the net electrode potential change across the anode and cathode of the
system when there is a current flowing through the system, that is, (Volts)
Depth of Discharge
Volumetric Current Source (the transfer current density in Equation 3.2 (p. 85).
Other
Note
For reviewing simulation results in CFD Post for cases involving UDM or UDS, export the
solution data as CFD-Post-compatible file (.cdat) in Fluent and then load this file into CFD-
Post. This will ensure that the full variable set is available for post processing in CFD-Post.
The following listing represents a description of the contents of the cae_user.c source code file:
real CONDUCTIVITY_CELL(cell_t c, Thread *t, int i): Returns values for the electrical
conductivity for cells inside passive conductive zones, overwriting the values set in the Create/Edit Mater-
ials dialog box.
real CONTACT_RESIST_FACE(cell_t f, Thread *t): Returns values for the electrical contact
resistance, overwriting the values set in the Electric Field tab of the MSMD Battery Model dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 121
Dual-Potential MSMD Battery Model
real Compute_U (face_t f, Thread *t, real DOD, real dUdJ, real a[], real
*dUdJ): Returns values for both U and the derivative of U with respect to J (dUdJ). Note that DOD represents
the depth of discharge and a[] is the set of U coefficients.
real Compute_Y (face_t f, Thread *t, real DOD, real b[]): Returns values for Y. Note
that DOD represents the depth of discharge and b[] is the set of Y coefficients.
real Compute_OCP_NE(real x): Returns a value for open circuit potential at negative electrode (
in Equation 3.2 (p. 85)). By default, it is computed using functions in [4] (p. 131).
real Compute_OCP_PE(real x): Returns a value for open circuit potential at positive electrode (
in Equation 3.2 (p. 85)). By default, it is computed using functions in [4] (p. 131).
real Compute_kappa(real ce, real T): Returns a value for (Equation 3.19 (p. 90)). By default,
it is computed using functions in [4] (p. 131).
real Compute_Diff0_ce(real ce, real T): Returns a value for (Equation 3.19 (p. 90)). By
default, it is computed using functions in [4] (p. 131).
real Compute_tplus(real ce, real T): Returns a value for (Equation 3.19 (p. 90)). By default,
it is computed using functions in [4] (p. 131).
real Compute_dlnfdlnce(real ce, real T): Returns a value for the term from Equa-
tion 3.19 (p. 90). By default, this term is not considered.
real Compute_entropy_heat(real soc): Returns the entropic heat. By default, it is not considered
in all MSMD submodels. You can include it by defining in this UDF.
Important
It is assumed that you have a basic familiarity with compiling user-defined functions (UDFs).
For an introduction on how to compile UDFs, refer to the separate Fluent Customization
Manual.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
122 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
You will first want to use a local copy of the msmdbatt directory in the addons directory before you
recompile the Battery module.
Important
The custom version of the library must be named according to the convention used by
ANSYS Fluent: for example, msmdbatt.
4. Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
5. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Battery
module.
The following example demonstrates the steps required to set up and run a customized version of the
Battery module that is located in a folder call home/sample:
Using a text editor, make the appropriate changes to the cae_user.c file located in
/home/sample/msmdbatt/src/cae_user.c
Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 123
Dual-Potential MSMD Battery Model
Set the FLUENT_ADDONS environment variable (using CSH, other shells will differ).
setenv FLUENT_ADDONS /home/sample
Start ANSYS Fluent and load the customized module using the text interface command.
2. Make sure that the FLUENT_INC environment variable is correctly set to the current ANSYS Fluent install-
ation directory (for example, ANSYS Inc\v170\fluent).
6. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Battery
module.
3.2.10. Using the Dual-Potential MSMD Battery Model Text User Interface
All of the features for the Battery Model that are available through the graphical user interface are also
available through text user interface (TUI) commands. The TUI allows text commands to be typed directly
in the ANSYS Fluent console window where additional information can be extracted and processed for
more advanced analysis.
Once the battery module is loaded, you can access the text user interface through the Console Window
by entering define models battery-model. A listing of the various text commands is as follows:
battery-model/
Enter the battery model menu.
enable-battery-model?
Enable/disable battery model.
electric-field-model/
Enter the electric field setup menu.
conductive-regions
Specify active conductive regions.
contact-resistance-regions
Specify contact resistance regions.
current-tap
Set cathode tap.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
124 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Dual-Potential MSMD Battery Model
voltage-tap
Set anode tap.
model-parameters
Set battery model options (see Specifying Battery Model Options (p. 100) for definitions of the MSMD
model general parameters).
ntgk-parameters
Set NTGK model-specific parameters (see Inputs for the NTGK Empirical Model (p. 107) for definitions
of the MTGK model parameters).
ecm-parameters
Set ECM model-specific parameters (see Inputs for the Equivalent Circuit Model (p. 108) for definitions
of the ECM model parameters).
newman-parameters
Set Newman model-specific parameters (see Inputs for the Equivalent Circuit Model (p. 108) for definitions
of the Newman model parameters).
parameter-estimation-tool
Compute the model parameters from battery's testing data. You can use the estimation tool to compute
model parameters for the NTGK or ECM model, or for the One-Equation thermal abuse model. You
must provide battery's testing data as a text file in a specific format for each model. When you enable
this tool and select the model option, Fluent will show the required format for the input file in the
console. You can contact ANSYS Technical Support for clarifications on how to use this tool.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 125
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
126 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4:Tutorial: Simulating a Single Battery Cell Using the MSMD
Battery Model
A tutorial is available that provides an example of how to set up a battery cell simulation using the
three submodels that are available in ANSYS Fluent. The latest update of this tutorial is available on the
ANSYS Customer Portal. To access tutorials and their input files on the ANSYS Customer Portal, go to
http://support.ansys.com/training.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 127
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
128 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 5:Tutorial: Simulating a 1P3S Battery Pack Using the MSMD
Battery Model
A tutorial is available that provides an example of how to set up a battery pack (battery system connected
in parallel / series pattern) simulation in ANSYS Fluent. The latest update of this tutorial is available on
the ANSYS Customer Portal. To access tutorials and their input files on the ANSYS Customer Portal, go
to http://support.ansys.com/training.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 129
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
130 of ANSYS, Inc. and its subsidiaries and affiliates.
Bibliography
[1] H. Gu. Mathematical Analysis of a Zn/NiOOH Cell. J. Electrochemical Soc.. Princeton, NJ. 1459-1. 464.
July 1983.
[2] U. S. Kim, C. B. Shin, and C.-S. Kim. Effect of Electrode Configuration on the Thermal Behavior of a
Lithium-Polymer Battery. Journal of Power Sources. Princeton, NJ. 180. 909916. 2008.
[3] Tiedemann and Newman. S.Gross Editor. Battery Design and Optimization. Proceedings, Electrochem-
ical Soc. Princeton, NJ. 79-1. 39. 1979.
[4] L. Cai and R.E. White. Reduction of Model Order Based on Proper Orthogonal Decomposition for Lithium-
Ion Battery Simulations. J. of Electrochemical Soc.. 156(3). A154-A161. 2009.
[5] M. Chen and G. A. Rincon-Mora. Accurate Electrical Battery Model Capable of Predicting Runtime and
I-V Performance. IEEE Trans. On Energy Conversion. Vol. 21. No.2. A154-A161. June 2006.
[6] M. Doyle, T.F. Fuller and J. Newman. Modeling of Galvanostatic Charge and Discharge of the Lithi-
um/Polymer/Insertion Cell. J. of Electrochemical Soc.. Vol 140, No. 6. 1526-1533. 1993.
[7] G-H. Kim, A. Peraran, R. Spotnitz. A Three-dimensional thermal abuse model for lithium-ion cells.
Journal of Power Sources. 170 (2). 476-489. 2007.
[8] G-H. Kim et al. Multi-Domain Modeling of Lithium-Ion Batteries Encompassing Multi-Physics in Varied
Length Scales. J. of Electrochemical Soc.. 158 (8). A955-A969. 2011.
[9] U. S. Kim et al. Modeling the Dependence of the Discharge Behavior of a Lithium-Ion Battery on the
Environmental Temperature. J. of Electrochemical Soc.. 158 (5). A611-A618. 2011.
[10] U. S. Kim et al. Effect of electrode configuration on the thermal behavior of a lithium-polymer battery.
Journal of Power Sources. 180 (2). 909-916. 2008.
[11] K. H. Kwon et al. A Two-dimensional Modeling of a Lithium-polymer battery. Journal of Power Sources.
163. 151-157. 2006.
[12] K. Smith and C.Y. Wang. Solid-state Diffusion Limitations on Pulse Operation of a Lithium ion Cell for
Hybrid Electric Vehicles. Journal of Power Sources. 161. 628-639. 2006.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 131
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
132 of ANSYS, Inc. and its subsidiaries and affiliates.
Part III: ANSYS Fluent Continuous Fiber Module
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. cxxxv
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
cxxxvi of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Introduction
The continuous fiber model is provided as an add-on module with the standard ANSYS Fluent licensed
software.
Several fiber spinning techniques exist in industrial fiber production. The most common types are melt
spinning and dry spinning.
In melt spinning, the polymer is heated above its melting point and extruded in a liquid state through
nozzles into a vertical spinning chamber. The molten polymer is processed in an inert gas environment,
such as nitrogen, then extruded at high pressure and a constant rate into a cooler air stream, thus so-
lidifying the fiber filaments.
In dry spinning, the liquefaction of the polymer is obtained by dissolving it in a suitable solvent. This
technique often is applied to polymers that are destroyed thermally before reaching its melting point
or if the production process leads to a solvent/polymer mixture. In the spinning chamber, the solvent
vaporizes by drying with a hot air stream. The solidification ensures that the fiber is nearly free of solvent.
ANSYS Fluents continuous fiber model allows you to analyze the behavior of fiber flow, fiber properties,
and coupling between fibers and the surrounding fluid due to the strong interaction that exists between
the fibers and the surrounding gas.
This document describes the ANSYS Fluent Continuous Fiber model. Continuous Fiber Model The-
ory (p. 139) provides theoretical background information. Instructions for getting started with the model
are provided in Using the Continuous Fiber Module (p. 155).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 137
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
138 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Continuous Fiber Model Theory
This chapter presents an overview of the theory and the governing equations for the mathematical
model and ANSYS Fluents capabilities to predict melt and dry spinning processes.
2.1. Introduction
2.2. Governing Equations of Fiber Flow
2.3. Discretization of the Fiber Equations
2.4. Numerical Solution Algorithm of Fiber Equations
2.5. Residuals of Fiber Equations
2.6. Coupling Between Fibers and the Surrounding Fluid
2.7. Fiber Grid Generation
2.8. Correlations for Momentum, Heat and Mass Transfer
2.9. Fiber Properties
2.10. Solution Strategies
2.1. Introduction
ANSYS Fluents Continuous Fiber Model uses a one-dimensional approach used to predict the flow in
fibers and to predict the flow field in the spinning chamber.
In melt spinning, where the extruded molten polymer is sent through the nozzles into the spinning
chamber, the velocity of the liquid jet increases due to gravity and the tensile force, which is applied
at the take-up point of the fibers. The conservation of mass leads to a decrease in the cross-section of
the jet up to the final diameter. The molten polymer is cooled by an air stream until the solidification
temperature is reached.
In dry and melt spinning, production of hundreds or thousands of fibers in a spinning chamber leads
to strong interaction between the fibers and the surrounding gas, requiring a coupled calculation pro-
cedure for the fibers and the fluid flow in the spinning chamber.
where
= fiber density
= surface area vector of the fiber surface parallel to the flow direction
= mass fraction of the solvent in the fiber
= evaporated mass flow rate of the solvent
= fiber diameter
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 139
Continuous Fiber Model Theory
(2.2)
where
= mass transfer coefficient estimated from an appropriate correlation (see Correlations for
Momentum, Heat and Mass Transfer (p. 147))
= solvents molecular weight
= molar concentration of the surrounding gas
= mole fraction of the solvent vapor in the surrounding gas
At the fiber surface, the mole fraction of the solvent in the gas is related to the solvent mass fraction
in the fiber by the vapor-liquid equilibrium equation given by Flory [1] (p. 191),
(2.3)
where
= Flory-Huggins parameter
= absolute pressure in the surrounding flow
= saturation vapor pressure of the solvent
These equations are used only when dry spun fibers have been selected.
The formation of fibers is based on tensile forces in the fiber that are applied at the take-up point and
result in the drawing and elongation of the fiber.
A force balance for a differential fiber element gives the equation of change of momentum in the fiber.
(2.4)
The tensile force in the fiber changes due to acceleration of the fiber, friction force with the surrounding
gas, and the gravitational forces.
where
= gas density
= axial friction factor parallel to the fiber
= gas velocity parallel to the fiber
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
140 of ANSYS, Inc. and its subsidiaries and affiliates.
Governing Equations of Fiber Flow
(2.6)
Neglecting visco-elastic effects and assuming Newtonian flow one can obtain
(2.8)
(2.9)
leading to
(2.10)
The elongational viscosity is estimated by multiplying the zero shear viscosity by three.
The transport of enthalpy in and to a differential fiber element is balanced to calculate the fiber tem-
perature along the spinning line.
(2.11)
where
= fiber enthalpy
= fiber thermal conductivity
= fiber temperature
= enthalpy of the solvent vapor
= heat transfer coefficient
In the case of a melt spinning process, is zero because there is no mass transfer. The term for heat
generation due to viscous heating is derived from the fluid mechanics of cylindrical flow to be
(2.12)
(2.14)
where
= thermal irradiation
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 141
Continuous Fiber Model Theory
= fibers emissivity
= Boltzman constant
(2.15)
It uses the specific heat capacity of the polymer and the specific heat capacity of the solvent in
the fiber.
The enthalpy of the solvent vapor at a given temperature depends on the heat of vaporization ,
given at the vaporization temperature , and is computed from
(2.16)
where
The convective terms in Equation 2.1 (p. 139), Equation 2.4 (p. 140), and Equation 2.11 (p. 141) are discretized
using first order upwinding, central differencing or the DISC scheme [6] (p. 191). While the first two
schemes are well described in the ANSYS Fluent User's Guide, the reader is referred to [6] (p. 191) to
learn more about the DISC scheme. It is the recommended scheme because it provides outstanding
numerical stability combined with second order accuracy. The diffusion terms are discretized with
second order accuracy. All other terms are treated as source terms and linearized according to Patankar
[5] (p. 191).
2.3.1. Under-Relaxation
Because the fiber equations are nonlinear, the change of the solution variable has to be controlled.
This is achieved by under-relaxation. The new value of in each cell depends to some degree upon
the old value and the change in , . It is computed for a given under-relaxation factor as
follows:
(2.17)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
142 of ANSYS, Inc. and its subsidiaries and affiliates.
Residuals of Fiber Equations
1. The fiber properties are updated based on the initialized or the current solution.
2. The friction factors for momentum exchange between the fibers and surrounding fluid are computed based
on current values of fiber and fluid velocities.
3. The fiber momentum equation is solved and current values of the mass fluxes in the fiber are used.
4. The heat transfer coefficients are computed using Reynolds numbers from the beginning of the iteration
loop.
6. In the case of dry spun fibers, the equation for the mass fraction of the solvent is solved. First, the mass
transfer coefficient is updated. The evaporated (condensed) mass is computed based on the vapor liquid
equilibrium at the beginning of the iteration loop. Finally, the governing equation is solved.
7. The mass fluxes and the diameter of the fiber cells are updated.
These steps are continued until the convergence criteria are met for all equations of the considered
fiber or until the number of iterations exceed the given limit.
(2.18)
where
= center coefficient
= influence coefficients for the neighboring cells
= constant part of the source term
= linear part of the source term
The residual computed by the fiber model is the imbalance in Equation 2.18 (p. 143) summed over
all fiber cells.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 143
Continuous Fiber Model Theory
(2.19)
This is called the absolute residual. Relative residuals are defined as the change of the absolute residuals
between two subsequent iterations divided by the absolute residual.
(2.20)
Momentum transfer from the fibers to the surrounding fluid is computed in ANSYS Fluent by considering
the change of momentum of the fiber as it crosses each control volume in the ANSYS Fluent model. It
is computed as
(2.21)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
144 of ANSYS, Inc. and its subsidiaries and affiliates.
Coupling Between Fibers and the Surrounding Fluid
where
This momentum exchange appears as a momentum source in the surrounding fluid momentum balance
and is taken into account during every continuous phase computation. It can be reported as described
in Exchange Terms of Fibers (p. 185).
(2.22)
The mass exchange appears as a mass source in the continuity equation of the surrounding fluid as
well as a source of chemical species of the solvent vapor defined by you. It is included in every sub-
sequent calculation of the continuous phase flow field and is reported as described in Exchange Terms
of Fibers (p. 185).
(2.23)
where
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 145
Continuous Fiber Model Theory
This heat exchange appears as a source in the surrounding fluid energy balance and is taken into account
during every continuous phase computation. It can be reported as described in Exchange Terms of
Fibers (p. 185).
(2.24)
(2.25)
where
= fiber surface area
= Boltzman constant
= irradiation of the surrounding flow
= emissivity of the fiber
Important
The transfer of the fiber radiation energy to the surrounding flow is only considered when
the single-band Discrete-Ordinate Model is used in the ANSYS Fluent flow model. While ra-
diation effects on the fibers are taken into account when the P1 model is used, there is no
two-way coupling for this model.
(2.28)
where is the under-relaxation factor for fibers that you can set in the Solution Controls task page.
The default value for is 0.5. This value may be reduced in order to improve the stability of coupled
calculations. Note that the value of does not influence the predictions obtained in the final converged
solution.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
146 of ANSYS, Inc. and its subsidiaries and affiliates.
Correlations for Momentum, Heat and Mass Transfer
The fiber grids are generated by defining fiber injections. The fibers are considered to be straight lines
between injection points and a take-up point. Each fiber is divided into a number of volume cells.
For the grid generation, the following grid types are available:
equidistant
All cells of the fiber have the same length.
one-sided
The cells are graded near the injection point of the fiber and change their size according to a specified
growth factor.
two-sided
In addition to the injection point the cells can also be graded at the take-up point by specifying a second
growth factor at the end of the fiber.
three-sided
The second point where the fiber cells are graded at the end can be moved to a local refinement point
laying between injection and take-up point. This generates fibers with a mesh graded at the injection point
and at the local refinement point.
All grid types, except the equidistant grid type, require the specification of a growth factor , which
is the ratio of two subsequent fiber grid cells. It refines the mesh for values larger than 1 and coarsens
the mesh for values smaller than 1.
If a finite fiber volume cell spans across several ANSYS Fluent grid cells, a weighted average is used to
estimate the corresponding variables of the surrounding flow. This averaging procedure considers the
intersection point of each fiber volume cell with the boundaries of the ANSYS Fluent grid cell.
When computing the source terms in an ANSYS Fluent grid cell, only the part of each fiber volume cell
that is inside the ANSYS Fluent grid cell is taken into account. This provides a proper computation of
ANSYS Fluent fiber interactions even in hanging node adapted grids.
Important
If the grid is adapted, the data structures that include information about neighbor cells are
not updated automatically. For this you have to reinitialize all fibers to start a new search of
the neighboring ANSYS Fluent grid cells.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 147
Continuous Fiber Model Theory
const-drag
A constant value for the drag can be specified.
kase-matsuo
A drag coefficient using the model taken from Kase and Matsuo [3] (p. 191), see Equation 2.29 (p. 149).
gampert
A drag coefficient using the model from Gampert [2] (p. 191).
Gampert provided analytical and numerical solutions for laminar axisymmetric flow of a moving
cylinder in stationary air including strong curvature effects in the boundary layer, [2] (p. 191). The
drag coefficient and the Nusselt number are shown as dimensionless groups in Figure 2.2: Dimen-
sionless Groups of Drag Coefficient and Nusselt Number (p. 148).
Note that the curvature is defined as the abscissa in Figure 2.2: Dimensionless Groups of Drag
Coefficient and Nusselt Number (p. 148). This correlation is recommended in laminar flows.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
148 of ANSYS, Inc. and its subsidiaries and affiliates.
Correlations for Momentum, Heat and Mass Transfer
user-defined
A drag coefficient that you specify in a user-defined function (UDF). See User-Defined Functions (UDFs)
for the Continuous Fiber Model (p. 175) for more information on using UDFs in the fiber model.
(2.29)
In Figure 2.2: Dimensionless Groups of Drag Coefficient and Nusselt Number (p. 148) and Equa-
tion 2.29 (p. 149), the Reynolds number is computed based on the relative velocity of the surrounding
Lateral drag due to flow of the surrounding fluid perpendicular to the fibers is computed by a correlation
from Schlichting [7] (p. 191)
(2.30)
In Equation 2.30 (p. 149) the Reynolds number is computed based on the relative velocity of the sur-
rounding flow perpendicular to the fibers .
const-htc
A constant value for the heat transfer coefficient in SI units can be specified.
kase-matsuo-1
A heat transfer coefficient based on a model from Kase and Matsuo [3] (p. 191) that considers pure parallel
flow, see Equation 2.31 (p. 149).
(2.31)
kase-matsuo-2
A heat transfer coefficient based on a model from Kase and Matsuo [3] (p. 191) that also considers cross
flow, see Equation 2.32 (p. 149). Refer to Momentum Exchange (p. 144) for definitions of the variables below.
(2.32)
gampert
A heat transfer coefficient based on a model from Gampert [2] (p. 191).
Gampert provided analytical and numerical solutions for laminar axisymmetric flow of a moving
cylinder in stationary air including strong curvature effects in the boundary layer, [2] (p. 191). The
drag coefficient and the Nusselt number are shown as dimensionless groups in Figure 2.2: Dimen-
sionless Groups of Drag Coefficient and Nusselt Number (p. 148). This correlation is recommended
for laminar flows.
user-defined
A heat transfer coefficient that you specify in a user-defined function (UDF). See User-Defined Functions
(UDFs) for the Continuous Fiber Model (p. 175) for more information on using UDFs in the fiber model.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 149
Continuous Fiber Model Theory
const-mtc
If you select this coefficient, you specify the direct transferred mass flow rate in , rather than
the mass transfer coefficient.
kase-matsuo-1
A mass transfer coefficient based on a model from Kase and Matsuo [3] (p. 191) that considers pure parallel
flow, see Equation 2.33 (p. 150).
(2.33)
kase-matsuo-2
A mass transfer coefficient based on a model from Kase and Matsuo [3] (p. 191) that also considers cross
flow, see Equation 2.34 (p. 150).
(2.34)
gampert
A mass transfer coefficient based on a model from Gampert [2] (p. 191).
Gamperts analytical and numerical solutions for laminar axisymmetric flow of a moving cylinder in
stationary air include strong curvature effects in the boundary layer, [2] (p. 191). The Sherwood
number is analogous to the Nusselt number as shown as dimensionless groups in Figure 2.2: Dimen-
sionless Groups of Drag Coefficient and Nusselt Number (p. 148). This correlation is recommended
for laminar flows.
user-defined
A mass transfer coefficient that you specify in a user-defined function (UDF). See User-Defined Functions
(UDFs) for the Continuous Fiber Model (p. 175) for more information on using UDFs in the fiber model.
Because these correlations are valid only for nearly-zero mass transfer due to the Reynolds analogy, a
film theory is used to compute the nonzero mass transfer, see Equation 2.2 (p. 140).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
150 of ANSYS, Inc. and its subsidiaries and affiliates.
Fiber Properties
this approach is applied to the computation of melt and dry spun fibers, only the zero shear viscosity
is described.
(2.35)
Below this temperature the value given in the material dialog box for the fiber polymer material is used.
Typically, a high value like is used for the fiber viscosity to simulate a solid fiber. This value
may depend on your polymer and the range of viscosity values in your simulation. You can use every
profile available in the materials dialog box except UDFs to describe temperature dependency of the
viscosity of the solidified fiber.
The fiber model uses a blending interval for the temperature to provide a smooth
transition of the viscosity between liquid and solid state of the fiber. The viscosity in this blending in-
terval is computed as
(2.36)
Important
The chosen values of the blending interval may influence the results. Values for the blending
interval should be adapted to the rheological data of the polymer.
(2.37)
In this equation, is considered to be the degree of polymerization as it is used by Ohzawa [4] (p. 191).
, , , , , and are user-specified constants.
If you enable the vapor-liquid equilibrium given by Flory [1] (p. 191), Equation 2.3 (p. 140) is used to
compute the mole fraction of the solvent in the surrounding gas.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 151
Continuous Fiber Model Theory
(2.39)
2.9.4. Emissivity
If the P-1 or the discrete ordinates radiation model is enabled, the emissivity of the fiber has to be
specified. The fiber diameter can approach the order of magnitude of the wavelength of the irradiation.
In this parameter range, additional effects like diffraction take place in addition to scattering and
transmission. Because these properties are not well known for fibers, diffraction, scattering, and trans-
mission are neglected. They have to be included only in the fiber emissivity.
When you start with a fiber simulation, chose the appropriate models needed for the fibers. For the
first simulation, disable options like Include Lateral Drag, Fiber Radiation Interaction, and Fiber
Viscous Heating to reduce possible interactions.
When specifying the grid of the fibers be sure to refine the grid in the area where large gradients of
the velocity appear. This is mainly near the injection point where the fiber is released and near the
point of solidification. Because this point is not known a priori, you have to refine the grid during sub-
sequent steps.
If the fiber grid seems to be well suited, you can influence the convergence behavior by starting the
iteration with low under-relaxation factors in the Fiber Solution Controls dialog box. This may help in
most situations where the species and energy equations are strongly coupled (for example, dry spinning
applications), or if the solvent has a very high latent heat of vaporization (for example, water).
Important
Be sure to increase the under-relaxation factor of the momentum equation to 1, when doing
a melt spinning case to achieve a converged solution. This should be done after a numerically
stable solution has been set up.
When the solution process of the pure fiber equations show a numerically stable behavior, you can in-
crease the complexity of the models by activating viscous heating, or radiation interaction, if such effects
are important in their application. After this, you can proceed with a coupled solution by solving the
fiber equations and the fluid flow equations alternately. If the solution algorithm of the fluid flow
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
152 of ANSYS, Inc. and its subsidiaries and affiliates.
Solution Strategies
equations diverges, you must investigate the source terms computed by the fiber model, see Exchange
Terms of Fibers (p. 185).
You can damp strong changes of the source terms with a low under-relaxation factor. Another choice
is to increase the number of ANSYS Fluent iterations between two subsequent fiber computations.
If the coupled solution process converges, you can increase the under-relaxation factor of the source
terms and decrease the number of ANSYS Fluent iterations between two subsequent fiber computations.
You may also want to consider underrelaxing the fluid flow equations. This helps especially for the energy
and species equations.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 153
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
154 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Using the Continuous Fiber Module
The procedure for setting up and solving fiber spinning flows is described in detail in this chapter. Only
the steps related to fiber modeling are shown here. Refer to Continuous Fiber Model Theory (p. 139) for
information about the theory.
Important
Note that the continuous fiber model is available for the pressure-based solver, only.
For information about inputs related to other models used in conjunction with the fiber models, see
the appropriate sections for those models in the ANSYS Fluent User's Guide.
3.1. Installing the Continuous Fiber Module
3.2. Loading the Continuous Fiber Module
3.3. Getting Started With the Continuous Fiber Module
3.4. Fiber Models and Options
3.5. Fiber Material Properties
3.6. Defining Fibers
3.7. User-Defined Functions (UDFs) for the Continuous Fiber Model
3.8. Fiber Model Solution Controls
3.9. Postprocessing for the Continuous Fibers
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 155
Using the Continuous Fiber Module
Select the continuous fiber model by entering the module number 2. During the loading process a
scheme library containing the graphical and text user interface, and a UDF library containing a set of
user-defined functions (UDFs) are loaded into ANSYS Fluent.
If you answer yes the standard fiber source term UDFs will be assigned to all fluid zones in your case,
and a message will be reported to the console window confirming this:
Assigning standard fiber source terms to all fluid zones.
If you answer no to presetting source term UDFs to all fluid zones in the domain, then three options
will be available to you when setting up source terms for fluid zones in your fiber model: no source,
constant source, or UDF source. Note that it is your responsibility to specify the rest of the settings for
a proper fiber simulation. See Source Term UDF Setup (p. 158) for details.
If you are loading an existing case file then you should answer the question with no. Otherwise, your
saved source term settings will be replaced by a UDF.
If a mixture material has been defined, then you will be asked an additional question
Preset mass exchange source terms hooks? [no]
If you intend to conduct a dry spinning simulation, then you should reply yes.
During the loading process the UDF library for the continuous fiber module is loaded in ANSYS Fluent.
This is reported to the console (see below). The UDF library also becomes visible as a new entry in the
UDF Library Manager dialog box. The basic setup of the continuous fiber model is performed automat-
ically when the fiber module is successfully loaded.
Opening library "/.../addons/fiber"...
Library "/...addons/fiber/lnx86/3d/libudf.so" opened
fm_adjust
fm_src_mass
fm_src_x_mom
fm_src_y_mom
fm_src_z_mom
fm_src_enthalpy
fm_src_dom
fm_on_demand Done.
If you did not preset the fiber model specific UDF hooks, you will need to check allocation of user-
defined memory, hook an adjust function (fm_adjust) to ANSYS Fluent, and set up the source terms
on your own. This is explained is User-Defined Memory and the Adjust Function Setup (p. 157).
Important
Note that user-defined memory locations for the fiber model will not be allocated properly
if you do not initialize the flow field. If you are setting up a fiber computation based on a
converged case, you must re-load the ANSYS Fluent data file after initializing the solution.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
156 of ANSYS, Inc. and its subsidiaries and affiliates.
Getting Started With the Continuous Fiber Module
The continuous fiber module setup is saved with the ANSYS Fluent case file. The module is loaded
automatically when the case file is subsequently read into ANSYS Fluent. Note that in the saved case
file, the continuous fiber module is saved with the absolute path. Therefore, if the locations of the
continuous fiber module installation or the saved case file are changed, then ANSYS Fluent will not be
able to load the module when the case file is subsequently read. In this situation, you will have to unload
the UDF library using the UDF Library Manager dialog box after the case file is read, and then reload
the continuous fiber module. To unload the UDF library go to the UDF Library Manager dialog box
select the fiber library under UDF Libraries, and click Unload. Previously-saved continuous fiber model
setup and parameters will be preserved in this process.
Important
Note that you must initialize your solution (in the Solution Initialization task page) in
order for user-defined memory to be allocated properly. If you are setting up a fiber
simulation based on a converged case, then you will have to reload the ANSYS Fluent
data file after initializing the solution.
2. Hook the adjust function UDF to ANSYS Fluent by choosing fm_adjust::fiber from the drop-down
list for Adjust in the User-Defined Function Hooks dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 157
Using the Continuous Fiber Module
For each fluid zone in your model, specify none, constant, or UDF for all of the source terms by fol-
lowing the procedure below:
1. In the Cell Zone Conditions task page, select a fluid zone under Zone and click edit.... This opens the
Fluid dialog box.
2. In the Fluid dialog box, check Source Terms and click the Source Terms tab.
3. For each of the source terms in the scroll list (Mass, X Momentum, and so on), click the Edit... button next
to each source term to open the corresponding source dialog box. Leave the default none, or choose
constant or UDF from the drop-down list. Choose the UDF in the drop-down list that corresponds to
the particular source term. For example, udf fm_src_mass corresponds to the Mass source term. Use
the table below (Table 3.1: Source Terms and Corresponding UDFs (p. 158)) as a reference guide.
5. Repeat this process for the remaining fluid zones in your ANSYS Fluent model.
Important
If you want to include radiative interaction of the fibers with the discrete ordinate (DO)
radiation model, then the appropriate source term UDF (udf fm_src_dom) will be
hooked automatically when you select Fiber Radiation Interaction in the Fiber Model
dialog box. You must initialize the solution (which will allocate memory for the DO
model) before the fiber model will be ready to accept the fiber radiation interaction data.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
158 of ANSYS, Inc. and its subsidiaries and affiliates.
Fiber Models and Options
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 159
Using the Continuous Fiber Module
the fibers. In such cases, select Melt Spun Fibers under Model in the Fiber Model dialog box (Fig-
ure 3.1: The Fiber Model Dialog Box (p. 159)).
When the fiber polymer can be liquefied with a suitable solvent, or the fiber polymers production
process involves a solvent, the fibers are formed typically in a dry spinning process. In such cases, select
Dry Spun Fibers under Model in the Fiber Model dialog box (Figure 3.1: The Fiber Model Dialog
Box (p. 159)).
For the Drag Coefficient, you can choose between const-drag, kase-matsuo, gampert and user-defined
from the drop-down list. If you choose const-drag, the constant you enter must be specified as a dimension-
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
160 of ANSYS, Inc. and its subsidiaries and affiliates.
Fiber Material Properties
less value. See Drag Coefficient (p. 148) for a description of these options. User-defined functions (UDFs) are
described in detail in User-Defined Functions (UDFs) for the Continuous Fiber Model (p. 175).
For the Heat Transfer Coefficient you can choose between const-htc, kase-matsuo-1, kase-matsuo-2,
gampert, and user-defined from the drop-down list. If you choose const-htc, the constant you enter must
be specified SI units of . See Heat Transfer Coefficient (p. 149) for a description of these options.
User-defined functions (UDFs) are described in detail in User-Defined Functions (UDFs) for the Continuous
Fiber Model (p. 175).
For the Mass Transfer Coefficient you can choose between const-mtc, kase-matsuo-1, kase-matsuo-2,
gampert, and user-defined. If you choose const-mtc, you must enter the mass transfer rate in units of
instead of the mass transfer coefficient. See Mass Transfer Coefficient (p. 150) for a description
of these options. User-defined functions (UDFs) are described in detail in User-Defined Functions (UDFs) for
the Continuous Fiber Model (p. 175).
The continuous fiber model makes use of ANSYS Fluents material concept for the Material Type of
the fluid. Because not all properties are available in ANSYS Fluents Create/Edit Materials dialog box
for this material type, some additional property information can be provided through the Fiber Model
dialog box (Figure 3.1: The Fiber Model Dialog Box (p. 159)). The procedure to define the material prop-
erties for the fibers in your simulation is as follows:
1. In the Create/Edit Materials dialog box, set the Material Type as fluid. This fluid will be used as the
polymer or solvent in the fiber.
You can use all profiles available in the Create/Edit Materials dialog box to define the properties
as functions of temperature. In order to invoke user-defined fiber properties, you need to use the
UDF template file (see User-Defined Functions (UDFs) for the Continuous Fiber Model (p. 175) for
details). UDF access is available for viscosity, density, specific heat capacity, thermal conductivity
and solvent liquid-vapor equilibrium pressure.
3. Select the Polymer in the Materials group box of the Fiber Model dialog box.
4. For dry spinning simulations, you also have to select Solvent and the gas phase species that represents
the Solvent Vapor.
5. Enter any additional data needed for the fiber material in the Fiber Model dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 161
Using the Continuous Fiber Module
The following list describes the properties you may need for a fiber material. For every property listed,
the dialog box name is provided where the property can be defined.
Blending Interval
(Fiber Model dialog box) is the temperature interval used to compute an average of the fiber viscosities
in liquid and solid state of Melt Spun Fibers. This option is only available when the Melt Spun Fibers
option is selected. See Fiber Viscosity (p. 150) for details about how the Blending Interval is applied to the
fiber viscosity.
Cp
(Create/Edit Materials dialog box) is the specific heat, , of the fiber in units of energy per mass and
temperature. In the case of dry spun fibers, a mass average is computed based on the values entered for
Polymer and its Solvent. You can use any of the functions available to define temperature dependency.
If you want to use a user-defined function profile, you need to modify the UDF template provided by ANSYS
Fluent. See User-Defined Functions (UDFs) for the Continuous Fiber Model (p. 175) for details.
Density
(Create/Edit Materials dialog box) is the density, , of the fiber in units of mass per unit volume. This
density is the mass density and not the volume density. In the case of dry spun fibers, a mass average is
computed based on the values entered for Polymer and its Solvent. You can use any of the functions
available to define temperature dependency. If you want to use a user-defined function profile, you need
to modify the UDF template provided by ANSYS Fluent. See User-Defined Functions (UDFs) for the Con-
tinuous Fiber Model (p. 175) for details.
Emissivity
(Fiber Model dialog box) is the emissivity of fibers in your model, , used to compute radiation heat
transfer to the fibers (Equation 2.13 (p. 141), Equation 2.14 (p. 141), Equation 2.24 (p. 146) and Equa-
tion 2.25 (p. 146)) when the P-1 or discrete ordinates radiation model is active. Note that you must enable
radiation to fiber, using the Fiber Radiation Interaction option in the Fiber Model dialog box.
Flory Huggins
(Fiber Model dialog box) can be enabled to apply Equation 2.3 (p. 140) to compute the vapor-liquid equi-
librium at the fiber surface. When it is enabled, you have to specify an appropriate value for the dimension-
less Flory Huggins parameter, . This option is only visible when Dry Spun Fibers has been chosen.
Latent Heat
(Fiber Model dialog box) is the latent heat of vaporization of the Solvent when evaporated from a dry
spun fiber. Note that you have to enter the vaporization or reference temperature, , where the specified
value of the latent heat has been measured. This vaporization temperature is used to automatically consider
the change of latent heat with temperature. See Equation 2.16 (p. 142) and Equation 2.39 (p. 152) for more
information on how this is achieved. These options are only visible when Dry Spun Fibers has been chosen.
Solidification Temperature
(Fiber Model dialog box) is the temperature below which the fiber polymer of a Melt Spun Fiber will so-
lidify. It will be used when computing the viscosity of Melt Spun Fibers. This option is only visible when
Melt Spun Fibers has been chosen.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
162 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Fibers
pressure. Below the minimal temperature the vapor pressure at the minimal temperature will be used.
Above the maximal temperature, the vapor pressure at the maximal temperature is used.
Thermal Conductivity
(Create/Edit Materials dialog box) is the thermal conductivity, , of the fiber in units of power per length
and temperature. In the case of dry spun fibers, a mass average is computed based on the values entered
for Polymer and its Solvent. You can use any of the functions available to define temperature dependency.
If you want to use a user-defined function profile, you need to modify the UDF template provided by ANSYS
Fluent. See User-Defined Functions (UDFs) for the Continuous Fiber Model (p. 175) for details.
For Melt Spun Fibers, you have to enter the viscosity of the fiber in solid state in the Create/Edit
Materials dialog box for the fluid you have selected as the fiber polymer. Typically this value will
be very high compared to the liquid fiber viscosity to represent the fibers as solids. For the solid
fiber viscosity you can make use of any temperature-dependent function available in the Create/Edit
Materials dialog box. If you want to use a user-defined function profile, you need to modify the
UDF template provided by ANSYS Fluent. See User-Defined Functions (UDFs) for the Continuous
Fiber Model (p. 175) for details.
In the Fiber Model dialog box, you have to enter the coefficients for the fiber viscosity in liquid
state (Equation 2.35 (p. 151)). To define viscosity as a function of fiber velocity gradient, set to a
value different than 1. In the case of Melt Spun Fibers, you also have to enter data for the Solidi-
fication Temperature and the Blending Interval. The blending of the viscosities in liquid and
solid state will be computed based on Equation 2.36 (p. 151).
For Dry Spun Fibers you only have to enter the coefficients for Equation 2.37 (p. 151) in the Fiber
Model dialog box. To specify fiber viscosity as a function of fiber velocity gradient, set to a value
different than 1. Any value entered in the Create/Edit Materials dialog box for viscosities of the
fluids used as fiber polymer and fiber solvent will not be considered.
Note
Note that depending on fiber velocity gradient, the numerical behavior of the Fiber
Model equations may become unstable in combination with fiber viscosity.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 163
Using the Continuous Fiber Module
3.6.1. Overview
The primary inputs that you must provide for the continuous fiber model calculations in ANSYS Fluent
are the starting positions, mass flow rate, take up positions, and other parameters for each fiber. These
provide the boundary conditions for all dependent variables to be solved in the continuous fiber
model. The primary inputs are:
Number of fibers in group. Each defined fiber can represent a group of fibers that will be used only to
compute the appropriate source terms of a group of fibers.
Mass flow rate per nozzle to compute the velocity of the fiber fluid in the nozzle. The velocity is used as
boundary condition for the fiber momentum equation.
Solvent mass fraction of the fiber fluid in the nozzle. This value is used as boundary condition for the solvent
continuity equation.
Velocity or force at take-up point to describe the second boundary condition needed for the fiber momentum
equation (see Equation 2.4 (p. 140)).
In addition to these parameters, you have to define parameters for the grid that is distributed between
the start position and take-up point of the fibers. On this grid the dependent fiber variables are solved,
by discretizing Equation 2.1 (p. 139), Equation 2.4 (p. 140), and Equation 2.11 (p. 141).
You can define any number of different sets of fibers provided that your computer has sufficient memory.
single
line
Use this option when the fibers you want to define start from a line and the starting points are located
at constant intervals on this line.
Use this option when the fiber starting points are arranged in the shape of a rectangle.
file
Use an ASCII file for entering coordinates and material properties of individual fiber injections in a
tabular format as shown below.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
164 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Fibers
where each injection is described by the following data fields, all on one line, separated by spaces:
x, y, and z are the Cartesian coordinates of the injection point. The z coordinate must be
included for both 3D and 2D solvers to maintain the sequence in which the data entries are
interpreted, however, the z coordinate is not used in 2D.
df is the fiber diameter
m is the mass flow rate
Tf is the temperature
Ys is the solvent liquid mass fraction (ignored for melt spinning)
You can include an arbitrary number of comments anywhere in the file. Commentary lines must begin
with a semicolon (;).
You will use the Fiber Injections dialog box (Figure 3.2: The Fiber Injections Dialog Box (p. 165)) to create,
modify, copy, delete, initialize, compute, print, read, write, and list fiber injections. To access the Fiber
Injections dialog box, first make sure you enable a fiber model, then go to
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 165
Using the Continuous Fiber Module
You can select several fiber injections when you want to initialize several fiber injections at one time.
Important
If you do not select a fiber injection and click Initialize, all fiber injections will be initialized.
You can select several fiber injections when you want to compute several fiber injections at one time.
Important
If you do not select a fiber injection and click Compute, all fiber injections will be computed.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
166 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Fibers
You can select several fiber injections when you want to print several fiber injections at one time.
Important
If you do not select a fiber injection and click Print, all fiber injections will be printed.
You can select several fiber injections when you want to store several fiber injections in one file.
Important
If you do not select a fiber injection and click Write Data, all fiber injections will be stored
in the specified file.
You can select several fiber injections when you want to store several fiber injections in binary format
in one file.
Important
If you do not select a fiber injection and click Write Binary Data, all fiber injections will be
stored in binary format in the specified file.
, , and position of the starting point in the columns headed (X), (Y), and (Z).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 167
Using the Continuous Fiber Module
The number of fibers represented by this fiber group in the column headed (FIBERS).
The number of fiber grid cells defined for this fiber in the column headed (CELLS).
A notification whether the starting point of the fiber is located inside or outside the domain in the column
headed (IN DOMAIN?).
The boundary conditions at the take up point are also listed. This list consists of the following (in SI
units):
, , and position of the take-up point in the columns headed (X), (Y), and (Z).
Boundary condition type and its specified value (VELOCITY for given take-up velocity, FORCE for given
force in the fiber) in the column headed (BOUNDARY CONDITION).
You can select several fiber injections when you want to list several fiber injections.
Important
If you do not select a fiber injection and click List, all fiber injections will be listed.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
168 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Fibers
1. If you want to change the name of the fiber injection from its default name, enter a new one in the Fiber
Injection Name field. This is recommended if you are defining a large number of injections so you can
easily distinguish them.
2. Choose the type of fiber injection in the Fiber Injection Type drop-down list. The three choices (single,
line, and matrix) are described in Fiber Injection Types (p. 164).
3. Click the Injection Point Properties tab (the default), and specify the point coordinates according to the
fiber injection type, as described in Point Properties Specific to Single Fiber Injections (p. 172)Point
Properties Specific to Matrix Fiber Injections (p. 172).
4. If each of the defined fibers is referring to a group of fibers, enter the number of fibers in Number of
Fibers in Group. If your nozzle plate has 400 holes and you can simulate them as a line fiber injection
with 5 groups, you have to enter a value of 80. This means that only 5 fibers are solved numerically, but
each of these fibers stands for 80 fibers to be used to compute the source terms for the surrounding fluid.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 169
Using the Continuous Fiber Module
This enables you to reduce computing efforts while achieving a proper coupling with the surrounding
fluid.
Important
Note that the Number of Fibers in Group is applied to all fibers, defined in your injec-
tion. If the number of fiber groups in your line or matrix injection is not the same for
all fibers in this injection, you should split this injection into several fiber injections.
6. Enter the mass flow rate for a single nozzle in the Flow rate per Nozzle field. This will be used to compute
the starting velocity of the fiber fluid.
Important
Note that the value specified refers to one single nozzle and not to the mass flow rate
of all fibers defined in this fiber injection.
7. Specify the temperature of the fiber fluid leaving the nozzle in the Temperature field.
8. If you are modeling dry spun fibers you also have to enter the solvents mass fraction at the nozzle in the
Solvent Mass Fraction field.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
170 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Fibers
Figure 3.4: The Set Fiber Injection Properties Dialog Box With Take-Up Point Properties
9. Click the Takeup Point Properties tab and enter the coordinates of the take-up point (see Figure 3.4: The
Set Fiber Injection Properties Dialog Box With Take-Up Point Properties (p. 171)).
Important
Note that all fibers defined in the fiber injection are collected at the same point. If the
fibers of your line or matrix injection vary in this property, you have to define them using
several fiber injections.
10. Select the appropriate boundary condition from the Boundary Condition drop-down list and specify the
value for this boundary condition. Choose prescribed-velocity if you know the drawing or take-up velocity.
Choose tensile-force if you want to prescribe a given tensile force in the fiber at the take-up point.
11. Click the Grid Properties tab and enter all data needed to generate the fiber grid as described in Define
Fiber Grids (p. 173).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 171
Using the Continuous Fiber Module
In addition to the coordinates, you have to set the number of fibers defined in the line injection by
entering the appropriate value in the Point Density Edge1 field. See Figure 3.5: Line Injections (p. 172)
for an example of a line fiber injection with a Point Density Edge1 of 5.
You have to specify the coordinates of the starting point and the end of point of the first row and the
coordinates where the last row should start. Click the Injection Point Properties tab in the Set Fiber
Injection Properties dialog box (Figure 3.3: The Set Fiber Injection Properties Dialog Box (p. 169)). In
the Points region, set the , , and coordinates in the x0, y0, and z0 fields for the starting point and
the , , and coordinates in the x1, y1, and z1 fields for the end point of the first row of fibers. The
, , and coordinates of the starting point of the last row have to be entered in the x2, y2, and z2
fields.
At each row, the number of fibers specified in the Point Density Edge1 field are injected. The number
of rows to be injected is specified in Edge2.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
172 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Fibers
You can double check the number of fibers computed in this fiber injection if you inspect the Numbers
of Fibers Computed field.
Important
Note that this fiber injection type is only available for 3D problems.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 173
Using the Continuous Fiber Module
Click the Compute button to estimate the Number of Cells behind Grid Refinement Point.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
174 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Defined Functions (UDFs) for the Continuous Fiber Model
Figure 3.11: Defining a Three-Sided Fiber Grid Using the Set Fiber Injection Properties Dialog Box
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 175
Using the Continuous Fiber Module
path/ansys_inc/v170/fluent/fluent17.0.0/addons/fiber/
where path is the directory in which you have installed ANSYS Fluent.
2. Make a local copy of the fiber folder (not a symbolic link) by copying it from the folder below to your
working folder.
path\ANSYS Inc\v170\fluent\fluent17.0.0\addons\fiber\
where path is the folder in which you have installed ANSYS Fluent (by default, the path is
C:\Program Files).
3.7.2. Customizing the fiber_fluent_interface.c File for Your Fiber Model Ap-
plication
Now that you have copied the fiber directory to your working directory, you can edit the UDF template
file and customize it to fit your model needs.
1. In your working directory, change directories to fiber/src. The /src directory contains the UDF
template source file fiber_fluent_interface.c.
2. In the /src directory, use any text editor and edit fiber_fluent_interface.c.
3. Scroll down to the bottom of the fiber_fluent_interface.c file to the section that contains
concatenated functions for friction factor (drag coefficient), heat transfer coefficient, mass transfer coeffi-
cient, fiber viscosity, fiber density, fiber thermal conductivity, fiber specific heat, and vapor liquid equilib-
rium, respectively. These are the UDFs that you can modify and customize.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
176 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Defined Functions (UDFs) for the Continuous Fiber Model
4. Edit the function(s) you require for your particular application. Save fiber_fluent_interface.c
and overwrite the existing file.
Important
Do not save the file with another name because it will not be recognized by the system.
Important
There are two arguments to the user_heat_transfer_coefficient UDF: Fiber and Loc-
al_Fiber_Data_Type. Fiber *f is a pointer to the fiber structure that contains information about
the fiber and Local_Fiber_Data_Type *fd accesses temporary variables that are needed during
the calculation of the fiber.
In the sample UDF below, a loop is performed over all fiber grid cells using the macro FIB_N(f) which
represents the number of grid cells for the fiber f. The Reynolds number is computed based on the
relative velocity, (ABS(FIB_C_U(f,i)-fd->up[i])), the fiber diameter; FIB_C_D(f,i),
the density of the surrounding fluid; fd->rho[i], and the viscosity of the surrounding fluid; fd-
>vis[i]. The heat transfer coefficient is computed from the Nusselt number using the thermal
conductivity of the surrounding fluid, , (fd->k[i]) and is stored in fd->alpha[i].
void
user_heat_transfer_coefficient(Fiber *f, Local_Fiber_Data_Type *fd)
{
int i;
real Red, Nud;
All variables and macros that are used in user_heat_transfer_coefficient are defined in
header files provided with the continuous fiber model. For example, you will find the type definition
Fiber and the macros that are used to access variables of a single fiber in the header file fiber.h.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 177
Using the Continuous Fiber Module
Temporary variables used in the type definition of Local_Fiber_Data_Type can be found in the
header file fib-mem.h.
Important
Note that you must not modify the header files provided with the continuous fiber model.
Otherwise the compiled library will not be compatible with ANSYS Fluent and will show run
time errors.
Important
All variables and macros defined in the header files are provided with the continuous fiber model. For
example, you will find the type definition Fiber and the macros to access variables of a single fiber
in the header file fiber.h. The temporary variables used in the type definition of Loc-
al_Fiber_Data_Type can be found in the header file fib-mem.h.
Important
You must not modify the header files provided with the continuous fiber model. Otherwise
the compiled library will not be compatible with ANSYS Fluent resulting in runtime errors
(messages will be printed in the console).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
178 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Defined Functions (UDFs) for the Continuous Fiber Model
where your_arch is replaced by the architecture of the machine you are running (for example, lnx86).
For example, if your computer architecture is lnx86 type the following command in a terminal session:
make -f Makefile-client FLUENT_ARCH=lnx86
To identify the architecture of the machine you are running on, scroll up the ANSYS Fluent console
window to the message that begins with Starting.
When you run the makefile process, the source code (fluent_fiber_interface.c) will be
compiled into object code and a shared library will be built for the computer architecture and version
of ANSYS Fluent you are running. Messages about the compile/build process will be displayed on the
console window. You can view the compilation history in the log file that is saved in your working dir-
ectory. Below is an example of console messages for a lnx86 architecture running a 2D version of ANSYS
Fluent.
Working...
for d in lnx86[23]*; do \
( \
cd $d; \
for f in ../../src*.[ch] ../../src/makefile; do \
if [ ! -f basename $f ]; then \
echo "# linking to " $f "in" $d; \
ln -s $f .; \
fi; \
done; \
echo ""; \
echo "# building library in" $d; \
make -kmakelog 2&1; \
cat makelog; \
) \
done
# linking to ... myudf.c in lnx86/2d
Done.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 179
Using the Continuous Fiber Module
nmake /f makefile_master-client.nt
To identify the architecture of the machine you are running on, scroll up the ANSYS Fluent console
window to the message that begins with Starting.
When you run the makefile process, the source code (fluent_fiber_interface.c) will be
compiled into object code and a shared library will be built for the computer architecture and version
of ANSYS Fluent you are running. Messages about the compile/build process will be displayed on the
console window. You can view the compilation history in the log file that is saved in your working dir-
ectory.
If you want to use UDFs to define fiber material properties, select the Enable UDF Properties check
box, and then enable individual property UDFs under the User Defined Properties group box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
180 of ANSYS, Inc. and its subsidiaries and affiliates.
Fiber Model Solution Controls
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 181
Using the Continuous Fiber Module
The Fiber Solution Controls dialog box enables you to set common solution parameters for the fiber
equations and their coupling with the surrounding fluid.
Solve
is used to enable and disable the solution of the fiber equations for Momentum (Equation 2.4 (p. 140)),
Energy (Equation 2.11 (p. 141)), and Species (Equation 2.1 (p. 139)). When switching off the solution of one
of these equations, it is not computed for all fibers defined in your model.
Discretization
provides a drop-down list where you can assign to each of the fiber equations one of three different dis-
cretization schemes explained in Discretization of the Fiber Equations (p. 142).
Underrelaxation
contains all under-relaxation factors for all fiber equations that are being solved in the continuous fiber
model. See Under-Relaxation (p. 142) for additional background information and see Solution
Strategies (p. 152) for how to make use of under-relaxation factors in your solution strategy.
Convergence Criterion
is used to stop the fiber iterations when the residuals of all fiber equations are below the prescribed criteria.
You can define a separate convergence criterion for every fiber equation.
Check Convergence
must be turned on if you want to compare the residuals of the fiber equations with the Convergence
Criterion. If you turn this option off, the given number of fiber iterations will be computed.
Relative Residuals
are used to compute the change of the residual of two subsequent iterations relative to the residual of
the last iteration by applying Equation 2.20 (p. 144). The result of this is compared to the Convergence
Criterion to check whether convergence has been achieved.
Iterations
defines the number of Fiber Iterations performed every time the fiber equations are updated.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
182 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing for the Continuous Fibers
Reporting Interval
sets the number of fiber iterations that will pass before the residuals will be printed.
You can reduce the output to the last fiber iteration by specifying Reporting Interval as 0. This is
recommended when performing a solution that is coupled with the surrounding flow.
For additional information on how to set and choose values for the options in the Fiber Solutions
Control dialog box, see Solution Strategies (p. 152).
The following data can be displayed using graphical and alphanumeric reporting facilities:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 183
Using the Continuous Fiber Module
Figure 3.14: Displaying Fiber Locations Using the Contours Dialog Box
In the Contours of drop-down list, select Custom Field Functions..., then select fiber-location. The
values in this field are between zero and the number of fiber cells in an ANSYS Fluent grid cell.
You may generate iso-surfaces of constant values of fiber-location to display the fibers in 3D problems.
You can also display the locations of the fibers and their grid discretization using the Fiber Mesh Display
dialog box, which can be accessed from the Results/Graphics/Fiber Mesh tree item.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
184 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing for the Continuous Fibers
Draw Fluent mesh: Enables the display of the CFD mesh geometry with the mesh display settings specified
in the Mesh Display dialog box. The Mesh Display dialog box will appear automatically when you enable
the Draw Fluent mesh option.
You can set the fiber Line Width in the Fiber Style Attribute dialog box accessed by clicking the Style
Attributes... button.
For the injections selected in the Fiber Injections selection list, you can display either all injection fibers
or single fibers with a specified Fiber ID (when the Show Single Fiber option is selected).
fiber-mass-source
defined by Equation 2.22 (p. 145).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 185
Using the Continuous Fiber Module
fiber-x-momentum-source
is the x-component of the momentum exchange, defined by Equation 2.21 (p. 144).
fiber-y-momentum-source
is the y-component of the momentum exchange, defined by Equation 2.21 (p. 144).
fiber-z-momentum-source
is the z-component of the momentum exchange, defined by Equation 2.21 (p. 144).
fiber-energy-source
defined by Equation 2.23 (p. 145).
fiber-dom-absorption
defined by Equation 2.24 (p. 146).
fiber-dom-emission
defined by Equation 2.25 (p. 146).
Note that these exchange terms are updated and displayed only when coupled computations are per-
formed.
3.9.3.1. XY Plots
To investigate fiber variables you have to generate an xy-file for every variable using the following
procedure from the text command interface (assuming that you have already defined a fiber injection):
continuous-fiber print-xy
3. Specify a variable for x-column. This will be used as abscissa in the file plot.
4. Specify another variable for y-column, which will be used as ordinate in the file plot.
6. Load the file with ANSYS Fluents xy plot facilities, described in the ANSYS Fluent manual.
axial drag
conductivity
curvature
diameter
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
186 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing for the Continuous Fibers
enthalpy
lateral drag
length
mass flow
mass fraction
Nusselt number
Sherwood number
Reynolds number
specific heat
temperature
tensile force
user variable
velocity
velocity gradient
viscosity
If a fiber injection consists of several fibers, the data of all fibers in this fiber injection will be stored in
the xy-file.
In addition to this, you can store a fiber history file for a fiber injection as described in Print Fiber Injec-
tions (p. 166). This can be used to analyze a single fiber using ANSYS Fluent xy-plot facilities or by ex-
ternal postprocessing programs.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 187
Using the Continuous Fiber Module
The Fiber Display dialog box offers the same display options as those in the Fiber Mesh Display dialog
box (Figure 3.15: The Fiber Mesh Display Dialog Box (p. 185)). Similarly, for the injections selected in the
Fiber Injections selection list, you can display either all injection fibers or single fibers with a specified
Fiber ID (when the Show Single Fiber option is selected).
You can color the fibers by the fiber variables listed in XY Plots (p. 186) or by the following additional
fiber variables:
Fiber ID
Fiber Density
Fiber Tension
You can control the smooth gradation of fiber colors by specifying the number of fiber Levels.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
188 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing for the Continuous Fibers
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 189
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
190 of ANSYS, Inc. and its subsidiaries and affiliates.
Bibliography
[1] P. J. Flory. Thermodynamics of High Polymer Solutions. Journal of Chemical Physics. 10. 5161. 1942.
[3] S. Kase and T. Matsuo. Studies on Melt Spinning. II. Steady-State and Transient Solution of Fundamental
Equations Compared with Experimental Results. Journal of Applied Polymer Science. 11. 251287.
1967.
[4] Y. Ohzawa, Y. Nagano, and T. Matsuo. Fundamental Equations of Dry Spinning with an Example Cal-
culation. Proceedings, 5th Intern. Congress on Rheology. 393408. Kyoto. 1968.
[5] S. V. Patankar. Numerical Heat Transfer and Fluid Flow. McGraw-Hill. Washington, New York, London
1980.
[6] C. H. Rexroth, H. J. Bauer, and S. Wittig. DISCAn efficient method for the discretization of convection
on unstructured grids. Aerospace Science and Technology. 6. 1997.
[7] H. Schlichting and K. Gersten. Grenzschicht-Theorie. Springer. Berlin, Heidelberg, New York, London
1997.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 191
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
192 of ANSYS, Inc. and its subsidiaries and affiliates.
Part IV: ANSYS Fluent Macroscopic Particle Module
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. cxcv
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
cxcvi of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Introduction
Traditional Lagrangian discrete phase models only apply when particle sizes are small enough to be
regarded as point masses within a single cell and when the total particle volume is insignificant within
the flow domain volume. In these applications particle-particle and particle-flow interactions are evaluated
in terms of impulse, heat, and mass transfer.
However, the total particle volume must be considered when a particle size is larger than several fluid
cells because it will affect all the cells within the flow domain volume. ANSYS Fluent Macroscopic Particle
Model (MPM) predicts the behavior of large (macroscopic) particles and their interaction with the fluid
flow, walls, and with other particles.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 197
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
198 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Macroscopic Particle Model Theory
The Macroscopic Particle Model (MPM) is a UDF-based quasi-direct numerical approach for tracking
macroscopic particles [4] (p. 225). The MPM is applicable to Lagrangian particulate flows that cannot be
solved using conventional point-mass particle models. In such flows, the particle size cannot be neglected.
In these situations, particle volume must be considered when modeling hydrodynamics and wall effects.
The MPM model provides a special treatment that accounts for the following:
In the MPM approach [1] (p. 225), each macroscopic particle spans several computational cells. Each
particle is represented by a sphere with six degrees of freedom to account for the particle translational
and rotational motion. The particle is injected in the flow domain at the beginning of a flow time step.
The particle is assumed to be touching a computational cell during the time step if one or more nodes
of the cell are located inside the particle volume. Each particle transport equation is solved in a Lag-
rangian reference frame.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 199
Macroscopic Particle Model Theory
(2.1)
The th virtual mass component of the fluid force and torque experienced by a particle, , is calculated
as the integral of the rate of change of momentum for all fluid cells within a particle volume:
(2.2)
where is the cell fluid mass; and are the fluid and particle velocities in the direction , re-
spectively; and is the flow time step.
The th pressure component of the fluid force and torque acting on the particle surface, , is calculated
based on the pressure distribution around the particle:
(2.3)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
200 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle/Particle and Particle/Wall Collisions
where is the pressure, is the approximated area of a particle surface in a fluid cell touching the
particle, is the radius vector from the fluid cell center to the particle center, and is the Cartesian
th
component of vector in the direction.
The th viscous component of the fluid force and torque acting on a particle surface, , is calculated
based on the shear stress distribution around the particle:
(2.4)
th th
where is the shear stress in the positive direction acting on a plane perpendicular to the dir-
th
ection, and is the Cartesian component of vector in the direction.
Based on fluid forces and torques, the new particle position, velocities, and accelerations are calculated
at each flow time step.
The motions of two particles at the time of the collision are expressed as:
(2.5)
where,
and subscripts refer to particles participating in the collision
is the particle mass
is the particle moment of inertia
and are the linear and angular particle velocities, respectively
superscript refers to particle velocities before the collision
is the particle radius
is the impulse force
is the unit vector in the normal direction
The impulse force in the tangential direction for sticking collision is expressed as:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 201
Macroscopic Particle Model Theory
(2.7)
The impulse force in the tangential direction for sliding collision is expressed as:
(2.8)
is the relative surface velocity (rotational and translational) of the two particles
Other particle-particle field forces, such as electrostatic, magnetic or cohesive forces, are implemented
in the MPM using a potential force model in which inter-particle field forces acting on the particle are
defined as:
(2.9)
where,
and = masses of the interacting particles and
= distance between the interacting particles and
, , , and = user-specified particle constants
The model constants , , , and can be indirectly related to the tensile strength or cohesive
forces in solids.
(2.10)
where,
= the closest distance of the particle from the wall
, , , = user-specified particle constants
The signs of the constants and determine whether the particle-particle and particle-wall field
forces are attraction or repulsion forces.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
202 of ANSYS, Inc. and its subsidiaries and affiliates.
Particle Deposition and Buildup
The deposition model also allows for detachment of the particle if the fluid force exceeds a critical user-
specified limit.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 203
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
204 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Using the Macroscopic Particle Model
This chapter provides an overview of how to use the MPM add-on module in ANSYS Fluent. For more
information about the theoretical background for the MPM modeling approach, see Macroscopic Particle
Model Theory (p. 199).
The MPM is not a general purpose model. The model has been shown to give good results for applications
in which macroscopic particles with Reynolds number << 1 move in a flow having a fluid-to-particle
density ratio, , in the order of 1. For other values of and , the drag prediction may not
be accurate; in such cases the MPM model may be used when drag is not important.
Simulations of densely-packed particles are not supported because only one collision event is handled for
each particle time step.
Coupling with Multiphase models is possible, but manual settings are required for source terms (mass,
momentum, and heat).
Sub-iterations of MPM particle tracks within one time step are not supported.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 205
Using the Macroscopic Particle Model
(TUI). Note that the module can be loaded only when a valid ANSYS Fluent case file has been set or
read. To load the MPM add-on module, issue the following TUI command in the Fluent console:
Select the Macroscopic Particle Model by entering the module number 10. During the loading process,
a scheme library containing the graphical and text user interface, and a UDF library containing a set of
user-defined functions (UDFs) for the MPM add-on module are automatically loaded into ANSYS Fluent.
This process is reported in the Fluent console. Once the MPM module is loaded into ANSYS Fluent, the
Macroscopic Particles model appears under the Models tree branch, and the UDF library also becomes
visible as a new entry in the UDF Library Manager dialog box. By default, the Macroscopic Particles
model is enabled.
Note
4. For most cases except for cemented particles simulations, select the Transient solver from the Time list
in the General task page.
5. Define the boundary conditions and physical properties for fluid flow as usual.
6. (optional) Initialize the flow variables and run the flow simulation until the flow converges.
This step could be performed to improve solution stability. Using a converged flow solution as a
starting point for an MPM simulation can be particularly helpful in situations where there is a strong
influence of macroscopic particles on the fluid flow.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
206 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
7. Use the Macroscopic Particle Model dialog box to specify the parameters for the MPM simulation.
8. Initialize either the MPM model as described in the sections that follow or the flow field in the usual way.
11. Review the simulation results by generating plots or alphanumeric reports using the ANSYS Fluent post-
processing facilities.
Figure 3.1: Macroscopic Particle Model Dialog Box (Particle Tracking Tab)
The inputs for the MPM model are entered using the following tabs:
Particle Tracking
is where you can define parameters for particle tracking.
Drag
contains drag law options and parameters for the particle drag calculations.
Collision
allows you to enable particle-particle and particle-wall collisions and define the collision parameters.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 207
Using the Macroscopic Particle Model
Deposition
allows you to enable particle deposition on selected surfaces and particles and define the relevant para-
meters.
Injections
allows you to define macroscopic particle injections.
Attraction Forces
is where you can specify parameters for particle-particle and particle-wall attraction forces.
Initialize MPM
contains controls for initializing the macroscopic particles and displaying particle injections.
Note
The default settings may not be appropriate for your case. You must provide parameter data
for your specific material.
Particle Zones
contains a selectable list of the cell zones in which you can use the MPM model.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
208 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
Note
The particle time step should be chosen so that macroscopic particles do not cross more
than one CFD mesh cell.
In the ANSYS Fluent MPM model, the following formulations are available for modeling the drag forces
between the continuous and macroscopic particle phases:
In this formulation, the momentum exchange coefficient between fluid and solid phases is calcu-
lated as:
where is the drag function, and is the macroscopic particle time step.
The accuracy of the implicit calculations using the Momentum Deficit Rate model depends on number
of cells comprising the macroscopic particle. This drag correlation is more suitable for bigger size
particles.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 209
Using the Macroscopic Particle Model
Morsi-Alexander (MA)
In the Morsi-Alexander based drag correlation [3] (p. 225) adopted in ANSYS Fluent, the Reynolds
number for the fluid phase is calculated by:
where,
= fluid density
= fluid viscosity
= particle diameter
= relative velocity of the discrete and fluid phases
The Morsi-Alexander based drag correlation is suitable for smaller size particles.
This option implies that the drag is evaluated using a constant drag coefficient. This correlation is
suitable for cases where the particle is moving at a certain specified velocity (or acceleration).
When this option is selected, the ANSYS Fluent solver automatically switches between the Momentum
Deficit Rate and Morsi-Alexander drag laws based on a critical diameter. This drag formulation is best
suited for cases involving wide range of particle sizes in a single simulation. For particles with a dia-
meter below the value that you specify for Critical Diameter, the Mosi-Alexander drag law will be
used. Otherwise, the Momentum Deficit Rate formulation will be used.
You can define a drag factor in a specific direction (X-dir,Y-dir,Z-dir). A drag factor of 1 means that the
virtual mass force equalizes the momentum difference of fluid in cells touched by the particle surface
within a single flow time step. As a consequence, the particle sub-time step has to be much smaller
(about one-fourth) than the momentum relaxation time [5] (p. 225):
where and are the particle and fluid densities, respectively, is the particle diameter, and is
the fluid viscosity.
Besides, the accuracy of the predicted drag depends on the number of cells touched by the particle.
At least 20-30 cells are required across the particle diameter.
For multiphase flows, you can select an appropriate fluid velocity field to be used in the drag force
calculations. The following options are available in the Multipahse: Drag Based On group box:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
210 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
Coefficient of Friction
corresponds to in Equation 2.8 (p. 202).
If you also want to account for collisions between particles and walls:
2. From the Participating Zones For Collision selection list, select the appropriate walls.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 211
Using the Macroscopic Particle Model
3. In addition to Coefficient of Restitution (Normal Dir) and Coefficient of Restitution (Tangential Dir)
on the selected walls, you can specify the following parameters:
2. From the Zones for Deposition selection list, select the wall zones on which the macroscopic particles
will adhere upon collision.
Max Normal Velocity for Particle Deposition, Max Tangential Velocity for Particle Deposition
specify the normal and tangential components of the approach velocity at or below which the particles
deposit on the surface.
4. If you want to save particle deposition history data in ASCII format, enable Write Particle Deposition File.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
212 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
5. To account for particle agglomeration, select Enable Particle-Particle Deposition. A particle that collides
with any previously deposited particles will attach to the particle surface. The deposition parameters that
you have specified for particle-wall deposition will be also used for modeling particle-particle deposition.
The procedures for creating, modifying and interacting with injections are also similar to those for the
DPM injections. The differences related to the MPM injections will be further emphasized. For more in-
formation about using these controls, see the Fluent Users Guide.
To create an MPM injection: click Create... and set the injection properties using the Create/Modify Injection
dialog box (see Defining MPM Injection Properties (p. 214)). After the injection is created, it will appear in
the Injections selection list, in the Macroscopic Particle Model dialog box.
To edit an existing MPM injection: select it from the Injections selection list, click Edit..., and in the Cre-
ate/Modify Injection dialog box that will open, modify the injection properties as necessary .
To copy an existing MPM injection to a new injection: select it from the Injections selection list and click
Copy. The name of the new copied injection appended with _d will appear in the Injections list.
To delete an existing MPM injection: select it from the Injections selection list and click Delete.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 213
Using the Macroscopic Particle Model
To write information about all injections created in a case: click Write All Injections... and in the Select File
dialog box that will open, enter the name for the injection file.
Note
Write All Injections... is not supported for steady flows with cemented particles.
To read previously generated injection file into your case: click Read... and in the Select File dialog box that
will open, select the injection file to read in. If the injection with the same name already exists in your current
case, then ANSYS Fluent will rename the imported injection by appending _d to the name.
1. (Optional) Change the default name of the injection (injection-id) by entering a new name in the
Injection Name entry field.
2. From the Injection Type drop-down list, select the injection type. In the ANSYS Fluent MPM model, you
can create the following types of injections:
Important
Note
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
214 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
6. (Optional) If you want to model a continuous generation of particle injections, select Enable Continuous
Injection and in the Define Continuous Injection dialog box that opens when you click Set..., specify the
relevant parameters.
New macroscopic particle will be injected into the domain at regular time intervals specified in
Injection Interval Time from the Injection Start Time to the Injection Stop Time.
(Optional) Moving and/or rotating injection release point parameters (available when Moving Injection
is enabled):
The origin (X, Y, Z) and the direction of the axis (X, Y, or Z) about which the injection is rotating
At each time step, the MPM solver determines a new position of a particle injection based on the
injection origin at the previous time step and the specified translational velocities.
7. Click Create/Modify.
The new injection that you have created appears under the Injections selection list.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 215
Using the Macroscopic Particle Model
For a point injection of a macroscopic particle, you need to define the following initial conditions in
the Create/Modify Injection dialog box:
Particle diameter
Particle density
Specific heat of the particle material (only for heat transfer simulations)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
216 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
1. Specify the particle initial conditions as described in Inputs for point Injections (p. 216), except for the
particle release location. Note that for plane injections, velocities and initial position can be specified only
in Cartesian coordinates.
Rectangular
Macroscopic particles will be injected from a rectangular plane surface that is offset from a co-
ordinate plane by a distance specified in X, Y, or Z Position in the selected X, Y, or Z axis direction.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 217
Using the Macroscopic Particle Model
The minimum and maximum limits of the rectangular surface are defined under the Extents of
Rectangular Plane group box.
Circular
Macroscopic particles will be injected from a circular plane surface that is perpendicular to a se-
lected coordinate direction (X, Y, or Z). The origin and radius of the circle are specified under the
Center Location/Radius of Circular Plane group box.
Random
The MPM model will inject particles into a flow domain from random locations on the injection
plane. The total number of the released particles is specified in the Total # of Particles integer
entry field.
Uniform
The particles will be injected into a flow domain from points arranged in a rectangular pattern.
The number of the release points in two axial directions is specified in the appropriate integer
entry fields (for example, # of Particles in X-dir and # of Particles in Y-dir).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
218 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
1. Specify particle initial conditions as described in Inputs for point Injections (p. 216), except for the particle
release location. Note that for plane injections, velocities and initial position can be specified only in
Cartesian coordinates.
For a Box-type packing, specify the minimum and maximum X, Y, and Z coordinates for the packing
bounding box under the Box Extents group box.
For a Cylinder-type packing, specify the bounding cylinder axis, minimum and maximum coordinates
for the cylinder height, cylinder origin and inner and out diameters.
Random
The initial volume fraction of particles in the packing is specified in the Particle VOF entry field.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 219
Using the Macroscopic Particle Model
Uniform
The distance between particles in the initial spatially uniform packing is specified in the Inter
Particle Gap entry field.
4. If you want to allow a part of the particle to be outside of the domain (with the particle center being in the
domain), enable Allow Partial Particles in the Domain.
For injections that you want to specify using the from-file option, the file format is:
number-of-particles
diameter density x-pos y-pos z-pos x-vel y-vel z-vel x-rot y-rot z-rot pstart pstop pinterval cemented
...
where the first line specifies the number of particles (number-of-particles), followed by number-
of-particles lines that define parameters for the injection particles. For each particle, you must
specify the diameter, density, initial position, linear and angular velocities, start, end, and interval times,
and the integer flag (cemented in the above file format specification) indicating whether or not the
particle is moving. Note that cemented=1 indicates a stationary particle, while cemented=0 indicates
a moving particle. Values describing an injection should be separated by one or more spaces and can
be specified using scientific notation (e or E) if needed.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
220 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
Figure 3.6: Macroscopic Particle Model Dialog Box (Attraction Forces Tab)
2. Specify the model constants n1, n2, n3, and G_p used in Equation 2.9 (p. 202).
3. Specify the model constants n4, n5, and G_w used in Equation 2.10 (p. 202).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 221
Using the Macroscopic Particle Model
Figure 3.7: Macroscopic Particle Model Dialog Box (Initialize MPM Tab)
Once you have set up the MPM model, you need to perform the following steps:
This will set up macroscopic particle related source terms and apply them to the continuous phase.
It will also hook all appropriate UDF functions to the Fluent solver.
Initializing MPM functions adds the following two commands to the solver that will be executed
during simulation:
mpm3: writes the particle position(s) at each iteration step in PNG format.
You can disable these commands or modify the reporting frequency in the Execute Command
dialog box (accessible from the Solution/Calculation Activities/Execute Commands tree item).
If you want the solver to report or monitor additional solution quantities during calculation, you
can define your own execute command(s) using Fluent TUI commands. For more information, see
Executing Commands During the Calculation in the Fluent User's Guide.
For coupled simulations, once you click Initialize MPM Functions, the pressure discretization scheme
will automatically switch to PRESTO! to provide a more robust solution.
2. Initialize either the macroscopic particles by clicking Initialize Particles or the flow field in the usual way
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
222 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Macroscopic Particles
The macroscopic particle(s) will be introduced into the fluid flow during the next computational
time step.
Upon completion of the MPM simulation, you can click Display Injections... and use the Display
Particles dialog box to display the computed particle trajectories.
In the Display Particles dialog box, you can select the particle coloring option. You can color particle
by the following particle variable values:
diameter
mass
particle ID
velocity magnitude
For the Particle Velocity Magnitude option, you can specify the minimum and maximum range of
the velocity magnitude values.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 223
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
224 of ANSYS, Inc. and its subsidiaries and affiliates.
Bibliography
[1] M. Agrawal, A. Bakker, and M. T. Prinkey. "Macroscopic Particle Model Tracking Big Particles in CFD".
AIChE 2004 Annual Meeting. Particle Technology Forum - Paper 268b. Austin, Texas, USA. 2004.
[2] M. Agrawal, K. Ogawa. "Drag force formulation in macroscopic particle model and its validation". AIChE
2009 Annual Meeting. Paper 163b. Nashville, TN, USA. 2009.
[3] S. A. Morsi and A. J. Alexander. "An Investigation of Particle Trajectories in Two-Phase Flow Systems". J.
Fluid Mech. 55(2). 193208. September 26 1972.
[4] S. Ookawara, M. Agrawal, D. Street, and K. Ogawa. "Quasi-direct numerical simulation of lift force-induced
particle separation in a curved microchannel by use of a macroscopic particle model". Chemical
Engineering Science. 62. 9. 24542465. 2007.
[5] S. Ookawara, M. Agrawal, D. Street, and K. Ogawa. "Modeling the motion of a sphere falling in a quiescent
Newtonian liquid in a cylindrical tube by using the macroscopic particle model". The Seventh World
Congress of Chemical Engineering. Glasgow, Scotland. C39-004. 2005.
[6] D. Wadnerkar, M. Agrawal, and V. Pareek. "Terminal Velocity of Particles Falling in Non-Newtonian Yield
Pseudo-plastic Fluids using a Macroscopic Particle Model". In 7th International Conference on Mul-
tiphase FLOW. ICMF 2010Tampa, FL. 2010.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 225
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
226 of ANSYS, Inc. and its subsidiaries and affiliates.
Part V: ANSYS Fluent Fuel Cell Modules
PEMFC Model - allows you to model polymer electrolyte membrane fuel cells (PEMFC) with (or without)
micro-porous layers. This model is a new and recommended model for simulating energy conversion processes
in a PEM fuel cell. For more information, see PEMFC Model Theory (p. 231) and Using the PEMFC Model (p. 245).
Fuel Cell and Electrolysis Model - allows you to model polymer electrolyte membrane fuel cells (PEMFC),
solid oxide fuel cells (SOFC), and electrolysis with ANSYS Fluent. This model is sometimes referred to as the
Resolved Electrolyte model. Note that the PEMFC sub-model is being retained in the current release. However,
it will be removed in future releases because the new PEMFC Model mentioned above is more advanced
and complete as described in the Release Notes for ANSYS Fluent R17.0. For more information, see Fuel Cell
and Electrolysis Model Theory (p. 281) and Using the Fuel Cell and Electrolysis Model (p. 291).
SOFC With Unresolved Electrolyte Model - allows you to model solid oxide fuel cells (SOFC). For more inform-
ation, see SOFC Fuel Cell With Unresolved Electrolyte Model Theory (p. 327) and Using the Solid Oxide Fuel
Cell With Unresolved Electrolyte Model (p. 337).
SOFC Fuel Cell With Unresolved Electrolyte Model Theory (p. 327)
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model (p. 337)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. ccxxix
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
ccxxx of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: PEMFC Model Theory
This chapter presents the theoretical background for the advanced Polymer Electrolyte Membrane Fuel
Cell (PEMFC) modeling capabilities in ANSYS Fluent.
1.1. Introduction
1.2. Electrochemistry Modeling
1.3. Current and Mass Conservation
1.4. Water Transport and Mass Transfer in PEMFC
1.5. Heat Source
1.6. Properties
1.7.Transient Simulations
1.8. Leakage Current (Cross-Over Current)
1.1. Introduction
The PEMFC module is provided as an add-on module with the standard ANSYS Fluent licensed software.
A fuel cell is an energy conversion device that converts the chemical energy of fuel into electrical energy.
With the PEMFC model, both the Triple Phase Boundary (TPB), also known as the catalyst layer, and the
ionic conducting electrolyte, also known as the membrane in PEMFC terminology, are included in the
computational domain. The PEMFC module allows you to model polymer electrolyte membrane fuel
cells.
To determine the physical domains that are included in the PEMFC module, a schematic of a polymer
electrolyte membrane fuel cell (PEMFC) is shown in Figure 1.1: Schematic of a PEM Fuel Cell (p. 231).
Hydrogen flows into the fuel cell on the anode side. It diffuses through the porous gas diffusion layer
(GDL) and micro-porous layer (MPL), which is optional for the operation of a PEMFC, and then comes
in contact with the catalyst layer. Here it forms hydrogen ions and electrons. The hydrogen ions diffuse
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 231
PEMFC Model Theory
through the polymer electrolyte membrane at the center, the electrons flow through the gas diffusion
layer to the current collectors and into the electric load attached. Electrons enter the cathode side
through the current collectors and the gas diffusion layer. Similarly, oxygen (or air) flows into the fuel
cell on the cathode side and diffuses through the porous gas diffusion layer and then micro-porous
layer to reach the catalyst layer. At the catalyst layer, the electrons, the hydrogen ions, and the oxygen
combine to form water.
In the PEMFC model in ANSYS Fluent, two electric potential fields are solved. One potential is solved
in the membrane and the catalyst layer. The other is solved in the TPB catalyst layer, the micro-porous
layer, the porous electrode, and the current collectors. The rates of electrochemical reactions are com-
puted in the TPB layers at both the anode and the cathode. Based on the cell voltage that you prescribe,
the current density value is computed. Alternatively, a cell voltage can be computed based on a pre-
scribed average current density.
The polymer electrolyte membrane fuel cell (PEMFC) has emerged as a favored technology for auto
transportation and power generation because it is compact, clean, runs at low temperature (<100 C),
permits an adjustable power output, and can be started relatively rapidly. Hydrogen is supplied at the
anode and air is supplied at the cathode. The following electrochemical reactions take place in the anode
and cathode triple phase boundary (TPB) layers, respectively,
(1.1)
(1.2)
Electrons produced in the anode travel through an external circuit to the cathode, while protons ( )
travel through the membrane from the anode TPB to the cathode TPB, thereby forming an electrical
circuit.
In a PEM fuel cell, the three phases of water are present. The gas and liquid water phases are present
in all the physical domains except the solid membrane and current collectors. Water is also present in
the dissolved phase, but only inside the catalyst layers and the membrane. The water produced by the
cathode side electro-chemistry is assumed to be in the dissolved phase (Equation 1.2 (p. 232)).
The driving force behind these reactions is the surface overpotential: the difference between the phase
potential of the solid and the phase potential of the electrolyte/membrane. Therefore, two potential
equations are solved. One potential equation (Equation 1.3 (p. 232)) accounts for the electron transport
of through the solid conductive materials and is solved in the TPB catalyst layer, the solid grids of
the porous media, and the current collector; the other potential equation (Equation 1.4 (p. 232)) represents
the protonic (that is, ionic) transport of and is solved in the TPB catalyst layer and the membrane.
The two potential equations are as follows:
(1.3)
(1.4)
where
= electrical conductivity (1/ohm-m)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
232 of ANSYS, Inc. and its subsidiaries and affiliates.
Electrochemistry Modeling
The following figure illustrates the boundary conditions that are used to solve for and .
Figure 1.2: Boundary Conditions for the Electric Potentials (Solid and Membrane) PEM Fuel
Cell
There are two types of external boundaries: those that have an electrical current passing through them,
and those that do not.
As no ionic current leaves the fuel cell through any external boundary, there is a zero flux boundary
condition for the membrane phase potential, , on all outside boundaries.
For the solid phase potential, , there are external boundaries on the anode and the cathode side
that are in contact with the external electric circuit. Electrical current generated in the fuel cell only
passes through these boundaries. On all other external boundaries there is a zero flux boundary condition
for .
On the external contact boundaries, fixed values for (potentiostatic boundary conditions) are re-
commend. If the anode side is set to zero, the (positive) value prescribed on the cathode side is the
cell voltage. Specifying a constant flux (say on the cathode side) means to specify galvanostatic
boundary conditions.
The transfer currents, or the source terms in Equation 1.3 (p. 232) and Equation 1.4 (p. 232), are nonzero
only inside the catalyst layers and are computed as:
For the potential equation in the solid phase, on the anode side and on
the cathode side.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 233
PEMFC Model Theory
For the potential equation in the membrane phase, on the anode side and
on the cathode side.
The source terms in Equation 1.3 (p. 232) and Equation 1.4 (p. 232), also called the exchange current
density ( ), have the following general definitions:
(1.5)
(1.6)
where
= reference exchange current density per active surface area ( )
= specific active surface area (1/m)
, = local species concentration, reference value ( )
= concentration dependence
and = anode and cathode transfer coefficients of the anode electrode, respectively
(dimensionless)
and = anode and cathode transfer coefficients of the cathode electrode, respectively
(dimensionless)
= surface overpotential given by Equation 1.11 (p. 235)
= surface overpotential given by Equation 1.12 (p. 235)
= Faraday constant ( C/kmol)
= the universal gas constant
= temperature
The above equation is the general formulation of the Butler-Volmer function. A simplification to this is
the Tafel formulation given by:
(1.7)
(1.8)
By default, the Butler-Volmer function is used in the ANSYS Fluent PEMFC model to compute the
transfer currents inside the catalyst layers. When the magnitude of the surface over-potential ( ) is large,
the Butler-Volmer formulation reduces to the Tafel formulation.
In Equation 1.5 (p. 234) through Equation 1.8 (p. 234), and represent the molar concentration of
the species upon which the anode and cathode reaction rates depend, respectively. That is, represents
and represents .
The reference exchange current density and are dependent on the local temperature as
follows:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
234 of ANSYS, Inc. and its subsidiaries and affiliates.
Electrochemistry Modeling
(1.9)
(1.10)
where
= user-specified activation energy
= user-specified reference temperature
The driving force for the kinetics is the local surface overpotential, , also known as the activation loss.
It is generally the difference between the solid and membrane potentials, and .
(1.11)
(1.12)
The half cell potentials at anode and cathode and are computed by Nernst equations as follows
[10] (p. 355):
(1.13)
(1.14)
where is the water saturation pressure (Equation 1.45 (p. 242)) and , , and are the partial
pressures of hydrogen, oxygen, and water vapor, respectively. In the above equations, the standard
state ( , ), the reversible potentials and , and the reaction entropies and are user-
specified quantities.
From Equation 1.3 (p. 232) through Equation 1.14 (p. 235), the two potential fields can be obtained.
In the ANSYS Fluent PEMFC model, including these resistances in calculations of the transfer current is
optional. The volumetric transfer current inside the cathode layers is represented by:
(1.15)
where is the concentration of oxygen at the wall. The is a user-specified value, and the is
calculated by:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 235
PEMFC Model Theory
(1.16)
where
= specific active surface area for the cathode catalyst (1/m)
= liquid saturation
= porosity
= particle diameter
= product of oxygen solubility and diffusivity in liquid water (on the order of
-10
10 m2/s)
(1.17)
Here, is the ideal transfer current computed using Equation 1.6 (p. 234), but without considering
resistance.
(1.19)
(1.20)
In the above equations, , , and are the molecular mass of water, oxygen and hydrogen,
respectively, is the Faraday constant, and 2 and 4 are the numbers of electrons per mole of reactants
and products.
Since the total electrical current produced in the cathode and the anode catalyst layer, respectively, is
the same, we have the following equation for current conservation:
(1.21)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
236 of ANSYS, Inc. and its subsidiaries and affiliates.
Water Transport and Mass Transfer in PEMFC
While the presence of water keeps the membrane hydrated (which is necessary for PEM fuel cell oper-
ation), the liquid water blocks the gas diffusion passage and decreases the diffusion rate and the effective
reacting surface area hence reducing the cell performance. Therefore, water formation and transport
should be considered when modeling PEMFC systems. In this section, the modeling approaches adopted
in ANSYS Fluent are described.
(1.22)
where
= porosity of porous media
= the ionic current density calculated as
= dissolved water content
= osmotic drag coefficient
= diffusion coefficient of water content
= water generation rate due to cathode side reaction in the catalyst layer
(Equation 1.20 (p. 236))
= rate of mass change between gas and dissolved phases
= rate of mass change between liquid and dissolved phases
(1.23)
(1.24)
where
= dry ionomer, or membrane, density
= equivalent weight of the membrane
= liquid saturation
= equilibrium water content
and = gas and liquid mass exchange rate constants
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 237
PEMFC Model Theory
where is the water vapor partial pressure, and is the saturation pressure.
1.4.2.1. Liquid Water Transport Equation in the Porous Electrode and the Membrane
The driving force of the liquid water transport is the liquid pressure gradient ([10] (p. 355)):
(1.27)
where
= liquid water density
= liquid dynamic viscosity
= absolute permeability
= relative permeability
= liquid pressure
= rate of mass change between gas and liquid phases
In the porous gas diffusion and micro-porous layers, the relative permeability is computed as:
(1.28)
(1.29)
Replacing in Equation 1.27 (p. 238) with the sum of the capillary pressure and the gas pressure ,
Equation 1.27 (p. 238) can be rewritten as:
(1.30)
The mass transfer rate between the gas and the liquid phases is computed based on the unidirectional
diffusion theory [2] (p. 355) and [10] (p. 355):
(1.31)
where is the porosity, is the geometric factor of the droplet size (typically on the order of 108 m-2),
and has the following form:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
238 of ANSYS, Inc. and its subsidiaries and affiliates.
Water Transport and Mass Transfer in PEMFC
The ANSYS Fluent PEMFC module solves for the capillary pressure (Equation 1.30 (p. 238)). Then, because
capillary pressure is a function of saturation, liquid saturation can be computed. Note that even though
the capillary pressure is continuous across various porous zones, liquid saturation can be discontinuous
at the zone interfaces.
Equation 1.30 (p. 238) is solved in all the regionsfrom the anode GDL-channel interface all the way to
the cathode GDL-channel interface. At these two interface boundaries, liquid water flux is assumed to
go out of the GDL and into the gas channel only. No backflow is allowed. The flux is assumed to be
driven by the capillary pressure ([10] (p. 355)):
(1.32)
Once the capillary pressure is obtained by solving Equation 1.30 (p. 238), liquid saturation is computed
from the following Leverett function:
(1.33)
(1.34)
Liquid water will reduce the effective active surface area in the catalyst layers. This is modeled by
modifying the transfer currents as follows:
(1.35)
where is the liquid water diffusion coefficient in the gas channel, and is the liquid velocity which
is assumed to be a fraction of the gas velocity :
(1.37)
At the anode and cathode flow inlets, liquid saturation = 0. The liquid flux calculated from Equa-
tion 1.32 (p. 239) is used as a boundary condition at the GDL-channel interfaces for Equation 1.36 (p. 239).
Since it is reasonable to assume that the flow is convection-dominated, the phase change in the gas
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 239
PEMFC Model Theory
channel is not considered here. With some meaningful level of saturation in the gas channels, momentum
resistance can be constructed to model the pressure drop using the UDF function resist-
ance_in_channel (real sat) in pemfc_user.c.
Membrane (solid)
Current Collector (solid)
In this table, and are the magnitude of the solid phase and membrane phase current density, re-
spectively, and is the latent heat due to water condensation.
1.6. Properties
Gas Phase Species Diffusivity
Gas phase species diffusivities can be computed either by using the dilute approximation method
or by using the full multicomponent method. With the dilute approximation method, we have
(1.38)
where is the porosity of the porous medium, is the mass diffusivity of species at reference
temperature and pressure ( , ) [12] (p. 355). These reference values and the exponents ( ) as
well as the exponent of pore blockage ( ) are defined in the PEMFC user-defined functions (UDF)
as,
(1.39)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
240 of ANSYS, Inc. and its subsidiaries and affiliates.
Properties
In addition to Equation 1.38 (p. 240), the ANSYS Fluent PEMFC model also contains a method to
compute the gas phase species diffusion (a full multicomponent diffusion method with corrections
to account for the porous media tortuosity):
(1.40)
where is the effective gas species diffusivity, and is the gas species mass diffusivity computed
by the full multicomponent diffusion method (as described in Full Multicomponent Diffusion in the
separate ANSYS Fluent User's Guide). Note that in Equation 1.40 (p. 241) is used to model the effect
of tortuosity. While this is implemented as the default method in the PEMFC, you can overwrite it
with your own correction methods by using the user-modifiable routines that are provided.
Properties such as electrolyte phase electrical conductivity, water diffusivity, and the osmotic drag
coefficient are evaluated as functions of the water content, using various correlations as suggested
by [11] (p. 355). To capture the relevant physics of the problem, various properties of the membrane
are incorporated into the model as default options. You can, however, directly incorporate your own
formulations and data for these properties by editing the functions defined in the provided source
code file called pem_user.c and compiling the code yourself. For more information, see User-Ac-
cessible Functions (p. 272).
The electrolyte (also called the membrane) phase conductivity is modeled based upon [11] (p. 355):
(1.41)
where is the water content, and is the activation energy for the temperature correction term.
The is calculated as ([10] (p. 355)):
(1.42)
where
= anode ionomer volume fraction
= cathode ionomer volume fraction
= anode ionomer tortuosity
= cathode ionomer tortuosity
Two model constants, and are introduced in ANSYS Fluent for generality. Equation 1.41 (p. 241)
becomes the original correlation from [11] (p. 355) when .
The diffusivity coefficient in the water content transport equation is obtained from [13] (p. 355):
(1.43)
where is a user-specified coefficient for generality, and the function has the following form:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 241
PEMFC Model Theory
where is a user-specified coefficient for generality with the default value of 1.0. The default for-
mulation for is:
This formulation can be changed using the provided user-accessible function code file pemfc_user.c.
Saturation Pressure
(1.45)
ANSYS Fluent allows you to provide a custom formulation by modifying the user-accessible function
code file pemfc_user.c.
Assuming that the time scales associated with the electric fields are much smaller than those associated
with the flow and thermal fields, the steady-state equations are retained for the two electric potentials
(Equation 1.3 (p. 232) and Equation 1.4 (p. 232)). Transient terms in all other equations such as momentum
transport, energy transport, species transport, dissolved water transport (Equation 1.22 (p. 237)), liquid
water transport (the capillary pressure Equation 1.30 (p. 238)), and the liquid saturation in gas channels
(Equation 1.36 (p. 239)), are activated.
(1.47)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
242 of ANSYS, Inc. and its subsidiaries and affiliates.
Leakage Current (Cross-Over Current)
(1.48)
Here, and are the volumes of the catalytic layers on the anode and cathode sides,
and 2 and 4 are the numbers of electrons per mole of reactants and products.
Accordingly, the volumetric leakage current ( ) is subtracted from the cathode transfer current
( ) that is computed by Equation 1.6 (p. 234) and Equation 1.8 (p. 234).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 243
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
244 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Using the PEMFC Model
The procedure for setting up and solving fuel cell problems using the PEMFC model is described in
detail in this chapter. Refer to the following sections for more information:
2.1. Overview and Limitations
2.2. Geometry Definition for the PEMFC Model
2.3. Installing the PEMFC Model
2.4. Loading the PEMFC Module
2.5. Setting Up the PEMFC Module
2.6. Modeling PEM Fuel Cells
2.7. PEMFC Model Boundary Conditions
2.8. Solution Guidelines for the PEMFC Model
2.9. Postprocessing the PEMFC Model
2.10. User-Accessible Functions
2.11. Using the PEMFC Text User Interface
The anisotropic species diffusivity option is not compatible with the PEMFC model.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 245
Using the PEMFC Model
The following zones have to be identified, if present in the fuel cell mesh:
Coolant channel
Select the PEM Fuel Cell Model by entering the module number 9. During the loading process, a scheme
library (containing the graphical and text user interface) and a UDF library (containing a set of user
defined functions) are loaded into ANSYS Fluent.
You must start ANSYS Fluent in 3D double-precision mode. Note that the PEMFC model is only
available in 3D.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
246 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
4. Use the PEM Fuel Cell Model dialog box to define the fuel cell model parameters.
Important
The PEM Fuel Cell Model dialog box greatly simplifies the input of parameters and boundary
conditions, but it does not replace the boundary conditions interface. Therefore, it is a good
policy to start the setup with the PEM Fuel Cell Model dialog box and do the finishing steps
for boundary conditions afterwards.
Important
Note that the majority of this chapter describes how to set up the ANSYS Fluent PEMFC
model using the graphical user interface. You can also perform various tasks using the text
user interface. For more information, see Using the PEMFC Text User Interface (p. 277).
To open the PEM Fuel Cell Model dialog box: In the tree, under the Models branch, right-click PEM
Fuel Cel and select Edit... in the menu that opens.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 247
Using the PEMFC Model
Using the PEM Fuel Cell Model dialog box, you can identify the relevant zones for the current collectors,
flow channels, gas diffusion layers, micro porous layers, catalyst layers, and the electrolyte (membrane).
You can specify the following inputs using the PEM Fuel Cell Model dialog box. Optional inputs are
indicated as such.
3. Select the appropriate zones and specify the properties on the anode side.
4. Select the appropriate zones and specify the properties of the electrolyte/membrane.
5. Select the appropriate zones and specify the properties on the cathode side.
6. Provide input for advanced features such as contact resistivities, coolant channel properties, or stack
management settings (optional).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
248 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
Figure 2.2: The Model Options in the PEM Fuel Cell Model Dialog Box
Options
Several fuel cell model options are available including:
Joule Heating
takes into account ohmic heating. This option includes the terms in the energy source term in the
calculations. See Table 1.1: Volumetric Heat Source Terms (p. 240) for the list of additional volumetric sources
in the thermal energy equation.
Reaction Heating
takes into account the heat generated by the electrochemical reactions.
Electrochemistry Sources
allows the PEMFC model to take electrochemistry effects into account. If you are only interested in the
basic flow field throughout the fuel cell, you can turn off the Electrochemistry Sources option in order
to suppress most effects of the PEMFC model. You may also turn off the effect of these sources in order
to obtain a fluid flow initially, and then turn it back on.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 249
Using the PEMFC Model
Butler-Volmer Rate
(the default) is used to compute the transfer currents inside the catalyst layers. If this option is turned off,
the Tafel approximation (Equation 1.7 (p. 234) and Equation 1.8 (p. 234)) is used.
Liquid Phase
takes into account liquid phase calculations. Use this option if you are solving for liquid transport in the
fuel cell.
Multicomponent Diffusion
is used to compute the gas species mass diffusivity using the full multicomponent diffusion method as
described in Equation 1.40 (p. 241), as opposed to the default option that uses Equation 1.38 (p. 240).
Due to the fibrous structure of the porous material that is used for the electrodes (or gas diffusion
layer), the electrical conductivity is typically non-isotropical, with the cross-plane components being
orders of magnitude smaller than the in-plane components. This can be modeled using the Aniso-
tropic E-Conductivity in Porous Electrode setting. When this option is enabled, the Electrical
Conductivity for the solid material used in the porous electrodes is no longer used. Instead, you
need to specify, for this solid material, the electrical conductivity by choosing one of the three non-
isotropical options for the UDS diffusivity (UDS-0). The three options are: anisotropic; orthotropic;
and cyl-orthotropic. For more information about these UDS Diffusivity options, refer to the ANSYS
Fluent User's Guide.
Select the Anisotropic E-Conductivity in Porous Electrode option in the Model tab of the PEM Fuel
Cell Model dialog box.
In the Create/Edit Materials dialog box, select defined-per-uds for UDS Diffusivity for the solid
material that is to be used for the porous electrode.
Select one of the three options for UDS-0: anisotropic; orthotropic; or cyl-orthotropic and set the
appropriate values.
Important
Note that, in this case, the Electrical Conductivity for this solid material is ignored.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
250 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
Liquid Phase
enables the liquid water transport equations in the computations. By default, this option is enabled.
Under-Relaxation Factors
You can use the Under-Relaxation Factors fields to influence the solution process.
Liquid-Vapor
The source term in Equation 1.30 (p. 238) usually requires under-relaxation. Since the is computed
explicitly as a source term for the capillary pressure equation (Equation 1.30 (p. 238)), the under-relaxation
factor usually needs to be a small value in order to obtain convergence. You can change the default value
for the under-relaxation factor by changing the value for Liquid-Vapor.
Disvd-Vapor/Liquid
The source terms and in Equation 1.22 (p. 237) usually require under-relaxation also. You can change
the default value for the under-relaxation factor by changing the value for Disvd-Vapor/Liquid.
Automatic Settings
The following parallel multigrid solver control parameter is available:
Note
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 251
Using the PEMFC Model
Figure 2.3: The Parameters Tab of the PEM Fuel Cell Model Dialog Box
Electrochemistry
There are various parameters under Electrochemistry in the PEM Fuel Cell Model dialog box. For both
the anode and the cathode, you can set the following parameters or leave the default values:
J_ref
corresponds to and , the reference exchange current density from Equation 1.9 (p. 235) and Equa-
tion 1.10 (p. 235).
C_ref
corresponds to the reference concentration ( and ) with units of 1 kgmol/m3 (see Equa-
tion 1.5 (p. 234) and Equation 1.6 (p. 234)).
Con. Exponent
corresponds to , the concentration dependence from Equation 1.5 (p. 234).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
252 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
Std. State E0
are the reversible potentials and in Equation 1.13 (p. 235) and Equation 1.14 (p. 235), respectively.
This field appears only when Use Half-Cell Potentials option is selected under the Model tab.
Entropy
is the reaction entropy and in Equation 1.13 (p. 235) and Equation 1.14 (p. 235).
V_Open
corresponds to the constant value assigned to cathode half-cell potential and . This parameter
appears only when Use Half-Cell Potentials option is not selected under the Model tab.
I_leak
is the leakage current density (A/m2). It is used to compute the total leakage current (in Equa-
tion 1.46 (p. 242) through Equation 1.48 (p. 243)) by:
where is the electrolyte projected area (specified under the Reports tab). When leakage through
the electrolyte occurs, the fuel cell generates less current especially for cases with low values of fuel
or air utilization. Note that you can also specify the total leakage current through the user-defined
function Leakge_Current(). For more information, see User-Accessible Functions (p. 272).
Note
The default values of the model parameters are determined based on various data available
in the literature ([8] (p. 355), [9] (p. 355), [12] (p. 355) [13] (p. 355), and others).
Reference Diffusivity
The parameters in the Reference Diffusivity group box appear only if the Multicomponent Diffusion
option is turned off in the Model tab. These parameters correspond to the species mass diffusivity
from Equation 1.38 (p. 240).
Liquid Phase
When the Liquid Phase option is selected under the Model tab, you can specify the following parameters
that appear in the Liquid Phase group box:
Expont Diff_gas
corresponds to from Equation 1.38 (p. 240) for multiphase PEMFC calculations.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 253
Using the PEMFC Model
Expont J_ref
is the exponent that is used to modify and according to Equation 1.35 (p. 239) to account for liquid
blockage to the reaction surface in Equation 1.5 (p. 234) through Equation 1.8 (p. 234).
Expont K_rel
is the exponent that is used to compute the relative permeability in (Equation 1.28 (p. 238)).
Expont Liq_coverage
is the exponent that is used to compute the phase-change rates and (Equation 1.23 (p. 237) and
Equation 1.24 (p. 237)).
Liq.-Gas Phase
is the geometric factor of the droplet size that is used to compute the rate of mass change between
gas and liquid phases (Equation 1.31 (p. 238)).
Liq.-Disved Phase
is the mass exchange rate constant that is used to compute the rate of mass change between liquid
and dissolved phases (Equation 1.24 (p. 237)).
V_liq/V_gas in Chan.
is the liquid to gas velocity ratio in the channel ( in Equation 1.36 (p. 239)). This parameter appears only
when the Compute Liquid In Channel option is selected under the Model tab.
Other Parameters
Under Other Parameters, you can specify the following:
Gas-Disved Phase
is the mass exchange rate constant that is used to compute the rate of mass change between gas and
dissolved phases (Equation 1.23 (p. 237)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
254 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
2. From the Zone(s) selection list, select a corresponding zone. If you are modeling a fuel cell stack, then you
must select all zones of a particular type as a group.
3. From the Solid Material drop-down list, select the appropriate material. You can use the Create/Edit
Materials dialog box to customize solid materials. Note that for the Electrical Conductivity, you can only
select a constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is
the diffusivity of the solid phase potential in the solid zones.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 255
Using the PEMFC Model
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
256 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
2. From the Zone(s) selection list, select a corresponding zone. If you are modeling a fuel cell stack, then you
must select all zones of a particular type as a group.
3. From the Solid Material drop-down list, select the appropriate material. You can use the Create/Edit
Materials dialog box to customize solid materials. Note that for the Electrical Conductivity, you can only
select a constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is
the diffusivity of the solid phase potential in the solid zones.
Porosity
is in Equation 1.38 (p. 240).
Absolute Permeability
is in Equation 1.27 (p. 238).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 257
Using the PEMFC Model
2. From the Zone(s) selection list, select a corresponding zone. If you are modeling a fuel cell stack, then you
must select all zones of a particular type as a group.
3. From the Solid Material drop-down list, select the appropriate material. You can use the Create/Edit
Materials dialog box to customize solid materials. Note that for the Electrical Conductivity, you can only
select a constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is
the diffusivity of the solid phase potential in the solid zones.
Porosity
is in Equation 1.38 (p. 240).
Absolute Permeability
is in Equation 1.27 (p. 238).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
258 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
Surface/Volume Ratio
is the specific active surface area in Equation 1.5 (p. 234).
Ionomer Tortuosity
is the in Equation 1.42 (p. 241) (available only when the Effective P-Conductivity in MEA option is
selected under the Model tab).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 259
Using the PEMFC Model
2.6.3.5. Specifying Micro Porous Layer (Optional) Properties for the Anode
Figure 2.8: The Anode Tab of the PEM Fuel Cell Model Dialog Box with Micro Porous Layer Selected
2. From the Zone(s) selection list, select a corresponding zone. If you are modeling a fuel cell stack, then you
must select all zones of a particular type as a group.
3. From the Solid Material drop-down list, select the appropriate material. You can use the Create/Edit
Materials dialog box to customize solid materials. Note that for the Electrical Conductivity, you can only
select a constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is
the diffusivity of the solid phase potential in the solid zones.
Porosity
is in Equation 1.38 (p. 240).
Absolute Permeability
is in Equation 1.27 (p. 238).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
260 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
Figure 2.9: The Electrolyte Tab of the PEM Fuel Cell Model Dialog Box
1. From the Zone(s) selection list, select a corresponding zone. If you are modeling a fuel cell stack, then you
must select all zones of a particular type as a group.
2. From the Solid Material drop-down list, select the appropriate material. You can use the Create/Edit
Materials dialog box to customize solid materials.
Equivalent Weight
is the in Equation 1.23 (p. 237) and Equation 1.24 (p. 237).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 261
Using the PEMFC Model
Absolute Permeability
is the in Equation 1.27 (p. 238).
Note that the PEMFC model allows you to model the electrolyte/membrane as a solid zone only. However,
it still allows for dissolved water, liquid or capillary pressure, and the ionic current to pass through.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
262 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
2. From the Zone(s) selection list, select a corresponding zone. If you are modeling a fuel cell stack, then you
must select all zones of a particular type as a group.
3. From the Solid Material drop-down list, select the appropriate material. You can use the Create/Edit
Materials dialog box to customize solid materials. Note that for the Electrical Conductivity, you can only
select a constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is
the diffusivity of the solid phase potential in the solid zones.
Porosity
is in Equation 1.38 (p. 240).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 263
Using the PEMFC Model
Absolute Permeability
is in Equation 1.27 (p. 238).
Surface/Volume Ratio
is the specific active surface area in Equation 1.6 (p. 234).
Ionomer Tortuosity
is the in Equation 1.42 (p. 241) (available only when the Effective P-Conductivity in MEA option is
selected under the Model tab).
Besides the parameters for the catalyst layer listed above, you can also specify the following para-
meters for the The Cathode Particle Model (p. 235):
2.6.5.5. Specifying Micro Porous Layer (Optional) Properties for the Cathode
The procedure for specifying the catalyst layer properties for the cathode is similar to that for the anode.
For specific steps, refer to Specifying Micro Porous Layer (Optional) Properties for the Anode (p. 260)
and then substitute cathode for anode where appropriate.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
264 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 265
Using the PEMFC Model
2. From the Available Zone(s) selection list, select any number of corresponding interfaces. These zones are
face zones over which a jump in electrical potential is caused by imperfect conduction.
Note
The contact resistance will be applied only to wall and porous jump types of interfaces.
4. To simplify the input, you can choose to use the resistivity value of the first selected zone for all others as
well by selecting the Use First Value for All option.
2.6.6.2. Setting Coolant Channel Properties for the PEMFC Model (Optional)
Figure 2.12: The Advanced Tab of the PEM Fuel Cell Model Dialog Box for the Coolant Channel
2. From the Zone(s) selection list, select any number of corresponding zones.
4. To enable the coolant channel, select the Enable Coolant Channel(s) option. Amongst other settings, this
will automatically create a new mixture material pem+cool-mixture consisting of hydrogen, oxygen,
water-vapor, coolant-liquid, and nitrogen.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
266 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling PEM Fuel Cells
5. Using the Create/Edit Materials dialog box, set all other material properties for the new fluid coolant-
liquid.
6. Specify the inlet and outlet conditions for cooling channels using standard boundary conditions dialog
boxes.
The ANSYS Fluent PEMFC model allows you to model fuel cell stacks as well as individual fuel cells. In
the Advanced tab of the PEM Fuel Cell Model dialog box, you can define fuel cell units for each fuel
cell in a stack. A fuel cell unit consists of all zones of a single fuel cell in the stack.
Important
If you are only modeling a single fuel cell, then you do not need to set anything for Stack
Management in the Advanced tab of the PEM Fuel Cell Model dialog box.
1. Select the Advanced tab of the PEM Fuel Cell Model dialog box.
3. Since a fuel cell unit consists of all zones of a single fuel cell in the stack, select the corresponding zones
from the Zone(s) list.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 267
Using the PEMFC Model
4. Create a new fuel cell unit by clicking the Create button. The new fuel cell is listed under Fuel Cell Unit(s)
with a default name.
5. Edit a pre-existing fuel cell unit by selecting it in the Fuel Cell Unit(s) list. The zones in this fuel cell unit
are automatically selected in the Zone(s) list. You can then modify the zones that comprise the fuel cell
unit and/or change its name in the Name field and click Modify to save the new settings.
6. Remove a pre-existing fuel cell unit by selecting it in the Fuel Cell Unit(s) list and clicking the Delete
button.
Note
When deleting a unit, make sure that the electrical connectivity remains intact.
7. If your model contains many zone names, you can use the Match Zone Name Pattern field to specify a
pattern to look for in the names of zones. Type the pattern in the text field and click Match to select (or
deselect) the zones in the Zones list with names that match the specified pattern. You can match additional
characters using * and ?. For example, if you specify wall*, all surfaces whose names begin with wall
(for example, wall-1, wall-top) will be selected automatically. If they are all selected already, they will be
deselected. If you specify wall?, all surfaces whose names consist of wall followed by a single character
will be selected (or deselected, if they are all selected already).
For example, in a stack there are many fuel cells, say 10100, each having at least 9 zones (current
collector, gas channel, diffusion layer, and catalyst layer for both anode and cathode and a membrane).
Additionally, there may be coolant channels, and it may be that for mesh construction reasons each
of these physical zones is made up of more than one mesh zone. Even for small stacks, you can
easily end up having hundreds of cell zones in an ANSYS Fluent mesh. Therefore, you may want to
consider numbering the fuel cells in a stack and to use the assigned fuel cell number in the names
of the mesh zones. When you set up your stacked fuel cell case, you would use the Match Zone
Name Pattern field to pick all the zones belonging to a single fuel cell in the stack, rather than
scrolling through the potentially very long list and selecting them manually.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
268 of ANSYS, Inc. and its subsidiaries and affiliates.
PEMFC Model Boundary Conditions
Figure 2.14: The Reports Tab of the PEM Fuel Cell Model Dialog Box
The Electrolyte Projected Area field requires the projected area of the Membrane Electrolyte Assembly
(MEA) and is only used to calculate the average current density. The assembly consists of the membrane
and the catalyst layers above and below the membrane.
The External Contact Interface(s) fields require the face zones that act as external electrical contact
surfaces for the anode and the cathode.
These inputs are used to report cell voltage. For potentiostatic boundary conditions, this is the difference
between the provided values, but for galvanostatic boundary conditions, the cell voltage is part of the
solution.
Anode Inlet
Temperature
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 269
Using the PEMFC Model
Cathode Inlet
Temperature
Temperature
Terminal Anode
Terminal Cathode
UDS-0 (electric potential) is set to the voltage of the cathode (if solving to constant voltage), or the UDS-
0 (electric potential) flux is set to the current density in (SI units) (if solving for constant current).
Note that the sign of the UDS-0 flux on the cathode side is negative.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
270 of ANSYS, Inc. and its subsidiaries and affiliates.
Postprocessing the PEMFC Model
In the event of convergence problems, it is recommended that you change the multigrid cycle to F-
cycle with BCGSTAB (bi-conjugate gradient stabilized method) selected as the stabilization method for
the species and the two potential equations. For the species and the user-defined scalar equations, it
may be necessary to reduce the termination (criteria) of the multigrid-cycles to . For stack simu-
lations, the termination criterion may be reduced to for the two potential equations.
Also, it may be useful to turn off Joule Heating and Reaction Heating in the PEM Fuel Cell Model
dialog box (in the Model tab) for the first few (approximately 5-10) iterations after initialization. This
allows the two electric potentials to adjust from their initial values to more physical values, avoiding
the possibility of extreme electrochemical reactions and electric currents that would in turn adversely
impact the solution.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 271
Using the PEMFC Model
You can obtain this list by opening the Execute On Demand dialog box and pulling down the Function
drop-down list.
Alternatively, you can view the listing that appears when you first load your PEMFC case, or you can
type list_pemfc_udf in the text user interface and the listing will appear in the console window.
Note
For field variables that are stored in UDM, use the corresponding variables for postprocessing.
Postprocessing the UDM itself is not recommended.
For reviewing simulation results in CFD Post for cases involving UDM or UDS, export the
solution data as CFD-Post-compatible file (.cdat) in Fluent and then load this file into CFD-
Post.
Important
When you load older PEM Fuel Cell cases into ANSYS Fluent, and you are monitoring a UDS
using volume or surface monitors, make sure you re-visit the corresponding monitors dialog
box (for example, the Volume Monitor or the Surface Monitor dialog box) to verify that
the correct UDS name is used for the appropriate monitor.
The following listing represents a description of the contents of the pemfc_user.c source code file:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
272 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Accessible Functions
real Compute_Js(real s)
Compute the Leverett function; namely, the - relation (Equation 1.33 (p. 239)).
Returns the value of the anode reaction reference current density used in Equation 1.5 (p. 234).
Returns the value of the cathode reaction reference current density used in Equation 1.6 (p. 234).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 273
Using the PEMFC Model
If you want to change the names of UDSs, change the second argument of the strncpy functions,
recompile and link the module as with any modification to pemfc_user.c. Note that
STRING_SIZE is fixed in pemfc.h and should not be changed.
Important
When you load older PEM Fuel Cell cases into ANSYS Fluent, and you are monitoring a
UDS using volume or surface monitors, make sure you re-visit the corresponding monitors
dialog box (for example, the Volume Monitor or the Surface Monitor dialog box) to
make sure that the correct UDS name is used for the appropriate monitor.
If you want to change the names of UDMs, change the second argument of the strncpy functions,
recompile and link the module as with any modification to pemfc_user.c. Note that
STRING_SIZE is fixed in pemfc.h and should not be changed.
Important
When you load older PEM Fuel Cell cases into ANSYS Fluent, and you are monitoring a
UDM using volume or surface monitors, make sure you re-visit the corresponding monitors
dialog box (for example, the Volume Monitor or the Surface Monitor dialog box) to
make sure that the correct UDM name is used for the appropriate monitor.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
274 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Accessible Functions
Important
It is assumed that you have a basic familiarity with compiling user-defined functions (UDFs).
For an introduction on how to compile UDFs, refer to the Fluent Customization Manual.
You will first want to use a local copy of the pemfc directory in the addons directory before you re-
compile the PEM Fuel Cell module.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 275
Using the PEMFC Model
Important
The custom version of the library must be named according to the convention used by
ANSYS Fluent: for example, pemfc.
4. Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
5. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the PEM
Fuel Cell module.
where your_arch is lnx86 on LINUX, or ultra on the Sun operating system, and so on.
The following example demonstrates the steps required to set up and run a customized version of the
PEM Fuel Cell module that is located in a folder call home/sample:
Using a text editor, make the appropriate changes to the pemfc_user.c file located in
/home/sample/pemfc/src/pemfc_user.c
Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
Set the FLUENT_ADDONS environment variable (using CSH, other shells will differ).
setenv FLUENT_ADDONS /home/sample
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
276 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the PEMFC Text User Interface
Start ANSYS Fluent and load the customized module using the text interface command.
2. Make sure that the $FLUENT_INC environment variable is correctly set to the current ANSYS Fluent in-
stallation directory (for example, ANSYS Inc\v170\fluent).
6. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the PEM
Fuel Cell module.
Once the fuel cell module is loaded (see Loading the PEMFC Module (p. 246)), you can access the text
user interface through the console window under pemfc. A listing of the various text commands is as
follows:
enable-fc-model?
Enable/disable PEMFC model
model-options
Model options
model-parameters
Model parameters
anode-setup/
Anode setup
catalyst-layer
Set catalyst layer
current-collector
Set current collector
flow-channel
Set flow channel
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 277
Using the PEMFC Model
list-zones-briefly
List zone names and IDs
micro-porous-layer
Set micro-porous layer
porous-electrode
Set porous electrode
cathode-setup/
Cathode setup
catalyst-layer
Set catalyst layer
current-collector
Set current collector
flow-channel
Set flow channel
list-zones-briefly
List zone names and IDs
micro-porous-layer
Set micro-porous layer
porous-electrode
Set porous electrode
electrolyte-setup/
Electrolyte setup
electrolyte-layer
Set electrolyte layer
list-zones-briefly
List zone names and IDs
advanced-setup/
Advanced setup
list-zones-briefly
List zone names and IDs
contact-resistivity
Set contact resistivity
coolant-channel
Set coolant channel
stack-management/
Stack setup
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
278 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the PEMFC Text User Interface
list-fc-units
List fuel cell units
list-zones-briefly
List zone names and IDs
create-fc-unit
Create fuel cell unit
modify-fc-unit
Modify fuel cell unit
delete-fc-unit
Delete fuel cell unit
set-stack-current-density
Set the current density on the anode or cathode and modify the current solution to assist conver-
gence. Note: Input here is in units of A/cm2. This is only available if the case contains valid data
(for example, after initialization, iterating, or reading in data). For more information, see IV-Curve
Calculations Using the Text Interface (p. 279).
set-stack-voltage
Set the voltage difference in Volts between the anode and the cathode and modify the current
solution to assist convergence. This is only available if the case contains valid data (for example,
after initialization, iterating, or reading in data). For more information, see IV-Curve Calculations
Using the Text Interface (p. 279).
reset-setup
Reset the stack setup in case mistakes are made
submit-setup
Submit the stack setup and makes the stack setup take effect
reports
Set electrolyte project area and external contacts
For fuel cells, you either prescribe the voltage and obtain the total current delivered by the fuel cell as
a result, or you specify the total current (via flux boundary conditions multiplied by the area) and obtain
the voltage as part of the solution. The details of this IV-relation are specific for each single fuel cell
and depend on mass and heat transport, electrochemistry and inlet conditions, outlet conditions, oper-
ating conditions, and any other parameter or material property involved in the calculation. The IV-curve
is important for applications, because its product is the power delivered by the system.
As described earlier in this manual, you would start a new simulation from fairly static conditions, that
is, high voltage/low current (which implies low species transport and low heat generation). After con-
vergence, you typically may be interested in solutions for new electric boundary conditions, that is,
either for a new cell/stack voltage or current.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 279
Using the PEMFC Model
In such cases, simply going to the Boundary Conditions task page and changing the value of the
electric potential (uds-0) boundary condition, typically allows only small changes, most notably for
stacks. Otherwise the solution will not converge. This is where the set-stack-voltage and set-
stack-current-density commands are important.
In addition to changing the boundary conditions (either to a prescribed voltage or current density),
these commands process the current data in order to estimate the solution for the new boundary
conditions. Because these commands modify the data, you are prompted to save your data, if you have
not already done so.
Before going into details of the commands, here are some general remarks about electric potential
boundary conditions.
For fixed voltage boundary conditions, both external contacts have a fixed value for the electric potential
(uds-0). The anode value will typically be zero, but it does not have to be. The cathode value will be
larger than the anode value and the difference ( - ) is the positive cell/stack voltage.
For a fixed current boundary condition, one external contact has to have a fixed value and the other
flux boundary conditions. As described earlier in the manual, typically, the anode will have a fixed (zero)
value, and the cathode will be floating, however, you can also set the cathode to a fixed zero potential,
yielding a floating negative anode potential.
The set-stack-voltage command sets the effective stack voltage, that is, the difference ( -
). For fixed voltage boundary conditions for the previous solution, boundary conditions on both
boundaries are of type fixed value and then the cathode value will be changed accordingly. In the case
of fixed current boundary conditions for the previous solution, the flux boundary condition will be
changed to a fixed value boundary condition, and the value adjusted accordingly with respect to the
other fixed value boundary condition.
The set-stack-current-density command sets the current density on one boundary to the
desired value. Note that the input will be in , not as you would normally have to enter in the
Boundary Conditions task page. The reason for this is that average current densities reported in the
text command interface are also in , and this makes it easier to choose the conditions you would
like to prescribe next. Also, flux boundary conditions entered in the Boundary Conditions dialog box
would have to have a positive sign on the anode side, and a negative sign on the cathode side. The
input for the text interface command is just a positive number, signs are automatically accounted for.
For fixed current boundary conditions for the previous solution, the set-stack-current-density
command changes the respective flux boundary condition accordingly. In the case of fixed voltage
boundary conditions for the previous solution, the cathode side is chosen to be changed from a fixed
value to a flux boundary condition with the new flux.
The two commands may be mixed in an IV-curve calculation. For the type of boundary condition setups
currently described in this manual, boundary condition changes will consistently happen on the cathode
side. However, if anode flux boundary conditions had been chosen initially, switching to fixed voltage
boundary conditions by set-stack-voltage command and then back to fixed current boundary
conditions by the set-stack-current-density command will then have flux boundary conditions
on the cathode side. In this case, using the set-stack-current-density command exclusively
will preserve the anode flux boundary condition setting.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
280 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Fuel Cell and Electrolysis Model Theory
This chapter presents the theoretical background for the Fuel Cell and Electrolysis modeling capabilities
in ANSYS Fluent.
3.1. Introduction
3.2. Electrochemistry Modeling
3.3. Current and Mass Conservation
3.4. Heat Source
3.5. Liquid Water Formation, Transport, and its Effects (PEMFC Only)
3.6. Properties
3.7.Transient Simulations
3.8. Leakage Current (Cross-Over Current)
3.1. Introduction
The Fuel Cell and Electrolysis module (sometimes referred to as the Resolved Electrolyte module) is
provided as an add-on module with the standard ANSYS Fluent licensed software.
A fuel cell is an energy conversion device that converts the chemical energy of fuel into electrical energy.
With the Fuel Cell and Electrolysis Model, both the triple-phase boundary (TPB), also known as the
catalyst layer, and the ionic conducting electrolyte (also known as the membrane in PEMFC terminology)
are included in the computational domain. The Fuel Cell and Electrolysis module allows you to model
PEMFC, SOFC, and high-temperature electrolysis.
To determine the physical domains that are included in the Fuel Cell and Electrolysis module, a
schematic of a polymer electrolyte membrane fuel cell (PEMFC) is shown in Figure 3.1: Schematic of a
PEM Fuel Cell (p. 282).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 281
Fuel Cell and Electrolysis Model Theory
Hydrogen flows into the fuel cell on the anode side. It diffuses through the porous gas diffusion layers
and comes in contact with the catalyst layer. Here it forms hydrogen ions and electrons. The hydrogen
ions diffuse through the polymer electrolyte membrane at the center, the electrons flow through the
gas diffusion layer to the current collectors and into the electric load attached. Electrons enter the
cathode side through the current collectors and the gas diffusion layer. At the catalyst layer on the
cathode side, the electrons, the hydrogen ions, and the oxygen combine to form water.
In the Fuel Cell and Electrolysis Model in ANSYS Fluent, two electric potential fields are solved. One
potential is solved in the electrolyte and the TPB catalyst layer. The other is solved in the TPB catalyst
layer, the porous electrode, and the current collectors. The rate of electrochemical reactions are computed
in the TPB layers at both the anode and the cathode. Based on the cell voltage that you prescribe, the
current density value is computed. Alternatively, a cell voltage can be computed based on a prescribed
average current density.
(3.2)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
282 of ANSYS, Inc. and its subsidiaries and affiliates.
Introduction
Electrons produced in the anode travel through an external circuit to the cathode, while protons ( )
travel through the membrane from the anode TPB to the cathode TPB, thereby forming an electrical
circuit.
As more and more water is generated at the cathode, due to both osmotic drag and electrochemical
reactions, water vapor pressure exceeds saturation pressure forming liquid water. The formation and
transport of liquid water in the cathode is an important feature that can strongly influence cell perform-
ance of a PEMFC.
(3.4)
In the cathode TPB, oxygen is reduced to oxygen ions which are then conducted through the ceramic
electrolyte to the anode TPB where they react with hydrogen to form water and release electrons. The
electrons travel through an external circuit to a load and then back to the cathode to close the circuit.
Note that, conventionally, the negative voltage is supplied to the cathode side in power consuming
devices such as electrolyzers. ANSYS Fluent adopts the inverse notation where the negative voltage is
supplied to the anode side whilst cathode remains positively charged. The main reason for this discrep-
ancy is that the same infrastructure is used for both the electrolysis and fuel cells models. Usage of the
terms "anode" and "cathode" in this manual and in the user interface should be interpreted according
to conventions for power-supplying devices.
In electrolysis, the activation overpotentials have the opposite sign of what is used in fuel cells. This
means that the cell voltage is higher than the open circuit voltage, since power is added to overcome
the activation overpotentials. The ionic conductivity in the electrolyte is typically a function of temper-
ature, such as in the case of SOFC. And it is pointed out here that, for an electrolyzer, high thermody-
namic efficiency can be achieved only at a high operating temperature ( C). Because of this, the
flow field is in vapor phase only and is handled as such within ANSYS Fluent.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 283
Fuel Cell and Electrolysis Model Theory
The driving force behind these reactions is the surface overpotential: the difference between the phase
potential of the solid and the phase potential of the electrolyte/membrane. Therefore, two potential
equations are solved for in the Fuel Cell and Electrolysis Model: one potential equation (Equa-
tion 3.7 (p. 284)) accounts for the electron transport through the solid conductive materials and is
solved in the TPB catalyst layer, the solid grids of the porous media, and the current collector; the other
potential equation (Equation 3.8 (p. 284)) represents the protonic (that is, ionic) transport of or
and is solved in the TPB catalyst layer and the membrane. The two potential equations are as follows:
(3.7)
(3.8)
where
= electrical conductivity (1/ohm-m)
= electric potential (volts)
= volumetric transfer current ( )
The following figure illustrates the boundary conditions that are used to solve for and .
Figure 3.2: Boundary Conditions for the Electric Potential (Solid and Membrane) PEM Fuel Cell
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
284 of ANSYS, Inc. and its subsidiaries and affiliates.
Electrochemistry Modeling
There are two types of external boundaries: those that have an electrical current passing through them,
and those that do not.
As no ionic current leaves the fuel cell through any external boundary, there is a zero flux boundary
condition for the membrane phase potential, , on all outside boundaries.
For the solid phase potential, , there are external boundaries on the anode and the cathode side
that are in contact with the external electric circuit and only through these boundaries passes the
electrical current generated in the fuel cell. On all other external boundaries there is a zero flux
boundary condition for .
On the external contact boundaries, we recommend to prescribe fixed values for (potentiostatic
boundary conditions). If the anode side is set to zero, the (positive) value prescribed on the cathode
side is the cell voltage. Specifying a constant flux (say on the cathode side) means to specify galvano-
static boundary conditions.
The transfer currents, or the source terms in Equation 3.7 (p. 284) and Equation 3.8 (p. 284), are nonzero
only inside the catalyst layers and are computed as:
For the potential equation in the solid phase, on the anode side and on
the cathode side.
For the potential equation in the membrane phase, on the anode side and
on the cathode side.
The source terms in Equation 3.7 (p. 284) and Equation 3.8 (p. 284), also called the exchange current
density ( ), have the following general definitions:
(3.9)
(3.10)
where
= reference exchange current density per active surface area ( )
= specific active surface area (1/m)
, = local species concentration, reference value ( )
= concentration dependence
= transfer coefficient (dimensionless)
= Faraday constant ( C/kmol)
The above equation is the general formulation of the Butler-Volmer function. A simplification to this is
the Tafel formulation that reads,
(3.11)
(3.12)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 285
Fuel Cell and Electrolysis Model Theory
By default, the Butler-Volmer function is used in the ANSYS Fluent Fuel Cell and Electrolysis Model to
compute the transfer currents inside the catalyst layers.
In Equation 3.9 (p. 285) through Equation 3.12 (p. 285), and represent the molar concentration
of the species upon which the anode and cathode reaction rates depend, respectively. For PEMFC and
SOFC, represents and represents . For Electrolysis, represents and is 1.0 (which in-
dicates that the cathode reaction does not depend on any species concentration).
The driving force for the kinetics is the local surface overpotential, , also known as the activation loss.
It is generally the difference between the solid and membrane potentials, and .
The gain in electrical potential from crossing from the anode to the cathode side can then be taken
into account by subtracting the open-circuit voltage on the cathode side.
(3.13)
(3.14)
From Equation 3.7 (p. 284) through Equation 3.14 (p. 286), the two potential fields can be obtained.
For PEMFC:
(3.15)
(3.16)
(3.17)
For SOFC:
(3.18)
(3.19)
(3.20)
For Electrolysis:
(3.21)
(3.22)
(3.23)
In the above equations, , , and are the molecular mass of water, oxygen and hydrogen,
respectively, is the Faraday constant, and 2 and 4 are the numbers of electrons per mole of reactants
and products.
Since the total electrical current produced in the cathode and the anode TPBs, respectively, is the same,
we have the following equation for current conservation:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
286 of ANSYS, Inc. and its subsidiaries and affiliates.
Liquid Water Formation, Transport, and its Effects (PEMFC Only)
(3.24)
where is the net enthalpy change due to the electrochemical reactions, is the product
of the transfer current and the overpotential in the anode or the cathode TPB, is the ohmic resistivity
of the conducting media, and is the enthalpy change due to condensation/vaporization of water.
3.5. Liquid Water Formation, Transport, and its Effects (PEMFC Only)
Since PEM fuel cells operate under relatively low temperature ( C), the water vapor may condense
to liquid water, especially at high current densities. While the existence of the liquid water keeps the
membrane hydrated, it also blocks the gas diffusion passage, reduces the diffusion rate and the effective
reacting surface area and hence the cell performance. To model the formation and transport of liquid
water, ANSYS Fluent uses a saturation model based on [8] (p. 355), [6] (p. 355). In this approach, the liquid
water formation and transport is governed by the following conservation equation for the volume
fraction of liquid water, , or the water saturation,
(3.26)
where is the porosity, the subscript stands for liquid water, and is the condensation rate that is
modeled as,
(3.27)
where is added to the water vapor equation, as well as the pressure correction (mass source). This
term is applied only inside the catalyst and gas diffusion layers. The condensation rate constant is
hardwired to . It is assumed that the liquid velocity, , is equivalent to the gas velocity inside
the gas channel (that is, a fine mist). Inside the highly-resistant porous zones, the use of the capillary
diffusion term allows us to replace the convective term in Equation 3.26 (p. 287):
(3.28)
Depending on the wetting phase, the capillary pressure is computed as a function of (the Leverett
function),
(3.29)
where is the surface tension (N/m), is the contact angle and the absolute permeability.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 287
Fuel Cell and Electrolysis Model Theory
Equation 3.26 (p. 287) models various physical processes such as condensation, vaporization, capillary
diffusion, and surface tension.
The clogging of the porous media and the flooding of the reaction surface are modeled by multiplying
the porosity and the active surface area by , respectively.
3.6. Properties
Gas Phase Species Diffusivity
Gas phase species diffusivities can be computed either by using the dilute approximation method
or by using the full multicomponent method. With the dilute approximation method, we have
(3.30)
where is the mass diffusivity of species at reference temperature and pressure ( , ) [12] (p. 355).
These reference values and the exponents ( ) as well as the exponent of pore blockage ( ) are
defined in the Fuel Cell and Electrolysis user defined functions (UDF) as,
(3.31)
In addition to Equation 3.30 (p. 288), the ANSYS Fluent Fuel Cell and Electrolysis Model also contains
a method to compute the gas phase species diffusion (a full multicomponent diffusion method with
corrections to account for the porous media tortuosity):
(3.32)
where is the effective gas species diffusivity, is the porosity of the porous medium, and is
the gas species mass diffusivity computed by the full multicomponent diffusion method (as described
in Full Multicomponent Diffusion in the separate ANSYS Fluent User's Guide). Note that in Equa-
tion 3.32 (p. 288) is used to model the effect of tortuosity. While this is implemented as the default
method in the Fuel Cell and Electrolysis Model, you can overwrite it with your own correction methods
by using the user-modifiable routines that are provided.
Properties such as electrolyte phase electrical conductivity, water diffusivity, and the osmotic drag
coefficient are evaluated as functions of the water content, using various correlations as suggested
by [11] (p. 355). To capture the relevant physics of the problem, various properties of the membrane
are incorporated into the model as default options. You can, however, directly incorporate your own
formulations and data for these properties by editing the functions defined in the provided source
code file called pem_user.c and compiling the code yourself. For more information, see User-Ac-
cessible Functions (p. 317).
For SOFC and high-temperature Electrolysis, the ionic conductivity in the electrolyte is modeled as a
function of temperature, and, by default, is defined as:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
288 of ANSYS, Inc. and its subsidiaries and affiliates.
Properties
(3.33)
This is valid for temperatures ranging from 1073 K to 1373 K. You can implement your own models
in the user-customizable UDF function Electrolyte_Conductivity in pem_user.c.
For PEMFC, the electrolyte (also called the membrane) phase conductivity is modeled as:
(3.34)
where is the water content. Two model constants, and are introduced in ANSYS Fluent for
generality. Equation 3.34 (p. 289) becomes the original correlation from [11] (p. 355) when .
where and are the density and the equivalent weight of the dry membrane, respectively.
The water content, , that appears in the preceding property computations are obtained using
Springer et als correlation [11] (p. 355),
(3.38)
where and are the water vapor pressure and the saturation pressure, respectively.
The water vapor pressure is computed based upon the vapor molar fraction and the local pressure,
(3.40)
Saturation Pressure
(3.41)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 289
Fuel Cell and Electrolysis Model Theory
It is noted here that in [11] (p. 355), water activity is defined on the basis of total water or super-sat-
urated water vapor. With phase change being invoked in the present two-phase model, is added
to the original formulation as suggested by [3] (p. 355).
Assuming that the time scales associated with the electric fields are much smaller than those associated
with the flow and thermal fields, the steady-state equations are retained for the two electric potentials,
(that is, Equation 3.7 (p. 284) and Equation 3.8 (p. 284)). Transient terms in all other equations such as
momentum transport, energy transport, species transport, liquid water transport, and membrane water
content equations are activated.
(3.43)
(3.44)
For Electrolysis:
(3.45)
(3.46)
(3.47)
Here, and are the he volumes of the catalytic layers on the anode and cathode sides,
and 2 and 4 are the numbers of electrons per mole of reactants and products.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
290 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4: Using the Fuel Cell and Electrolysis Model
The procedure for setting up and solving fuel cell problems using the Fuel Cell and Electrolysis Model
is described in detail in this chapter. Refer to the following sections for more information:
4.1. Overview and Limitations
4.2. Geometry Definition for the Fuel Cell and Electrolysis Model
4.3. Installing the Fuel Cell and Electrolysis Model
4.4. Loading the Fuel Cell and Electrolysis Module
4.5. Setting Up the Fuel Cell and Electrolysis Module
4.6. Modeling Fuel Cells and Electrolysis
4.7. Modeling Current Collectors
4.8. Fuel Cell and Electrolysis Model Boundary Conditions
4.9. Solution Guidelines for the Fuel Cell and Electrolysis Model
4.10. Postprocessing the Fuel Cell and Electrolysis Model
4.11. User-Accessible Functions
4.12. Using the Fuel Cell and Electrolysis Text User Interface
Note the following limitation when using the Fuel Cell and Electrolysis model:
The anisotropic species diffusivity option is not compatible with the Fuel Cell and Electrolysis model.
4.2. Geometry Definition for the Fuel Cell and Electrolysis Model
Due to the fact that there are a number of different physical zones associated with the fuel cell, the
following regions must be present in the fuel cell mesh:
Membrane layer
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 291
Using the Fuel Cell and Electrolysis Model
The following zones have to be identified, if present in the fuel cell mesh:
Coolant channel
Select the Fuel Cell and Electrolysis Model by entering the module number 3. During the loading process,
a scheme library (containing the graphical and text user interface) and a UDF library (containing a set
of user defined functions) are loaded into ANSYS Fluent.
4. Use the Fuel Cell and Electrolysis Models dialog box to define the fuel cell model parameters.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
292 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
Important
The Fuel Cell and Electrolysis Models dialog box greatly simplifies the input of parameters
and boundary conditions, but it does not replace the boundary conditions interface. Therefore,
it is a good policy to start the setup with the Fuel Cell and Electrolysis Models dialog box
and do the finishing steps for boundary conditions afterwards.
Important
Note that the majority of this chapter describes how to set up the ANSYS Fluent Fuel Cell
and Electrolysis Model using the graphical user interface. You can also perform various tasks
using the text user interface. For more information, see Using the Fuel Cell and Electrolysis
Text User Interface (p. 322).
To open the Fuel Cell and Electrolysis Models dialog box: In the tree under the Models branch, right-
click Fuel Cells and Electrolysis and select Edit... in the menu that opens.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 293
Using the Fuel Cell and Electrolysis Model
Figure 4.1: The Fuel Cell and Electrolysis Option in the Tree
By default, the PEMFC model is already enabled, however, you can also choose the SOFC or the Electro-
lysis models.
Using the Fuel Cell and Electrolysis Models dialog box, you can identify the relevant zones for the
current collectors, flow channels, gas diffusion layers, catalyst layers, and the membrane/electrolyte.
You can specify the following inputs using the Fuel Cell and Electrolysis Models dialog box. Optional
inputs are indicated as such.
1. Enable the appropriate type of fuel cell model, either PEMFC, SOFC, or Electrolysis.
2. Enable either the single-phase or the multi-phase fuel cell model (if PEMFC is selected).
3. Set the appropriate options for the fuel cell model (optional).
5. Select the appropriate zones and specify the properties on the anode side.
6. Select the appropriate zones and specify the properties of the membrane/electrolyte.
7. Select the appropriate zones and specify the properties on the cathode side.
8. Provide input for advanced features such as contact resistivities, coolant channel properties, or stack
management settings (optional).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
294 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
Figure 4.2: The Model Options in the Fuel Cell and Electrolysis Models Dialog BoxPEMFC Enabled
Several fuel cell model options are available in the Model tab of the Fuel Cell and Electrolysis Models
dialog box including:
The Joule Heating option takes into account ohmic heating. This option includes the term in the energy
source term from Equation 3.25 (p. 287) in the calculations.
The Reaction Heating option takes into account the heat generated by the electrochemical reactions, which
includes the term, and the product of transfer current and the over-potentials in the energy source
term from Equation 3.25 (p. 287) in the calculations.
The Electrochemistry Sources option allows the Fuel Cell and Electrolysis Model to take electrochemistry
effects into account. If you are only interested in the basic flow field throughout the fuel cell, you can turn
off the Electrochemistry Sources option in order to suppress most effects of the Fuel Cell and Electrolysis
Model. To turn off all effects of the Fuel Cell and Electrolysis Model, you should also turn off the Membrane
Water Transport and Multiphase options.
The Butler-Volmer Rate option (the default) is used to compute the transfer currents inside the catalyst
layers. If this option is turned off, the Tafel approximation (Equation 3.12 (p. 285)) is used.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 295
Using the Fuel Cell and Electrolysis Model
The Membrane Water Transport option takes into account the transport of water across the membrane.
This option is only available for the PEMFC model.
The Multiphase option takes into account multiphase calculations. Use this option if you are solving for
approximate liquid transport in the gas diffusion layer of the fuel cell. (PEMFC only)
The Multicomponent Diffusion option is used to compute the gas species mass diffusivity using the full
multicomponent diffusion method as described in Equation 3.32 (p. 288), as opposed to the default option
that uses Equation 3.30 (p. 288).
The Anisotropic E-Conductivity in Porous Electrode option is used to model the typically non-isotropic
electrical conductivity. It is applicable only for porous electrodes (gas diffusion layers).
Due to the fibrous structure of the porous material that is used for the electrodes (or gas diffusion
layer), the electrical conductivity is typically non-isotropical, with the cross-plane components being
orders of magnitude smaller than the in-plane components. This can be modeled using the Aniso-
tropic E-Conductivity in Porous Electrode setting. When this option is enabled, the Electrical
Conductivity for the solid material used in the electrolyte is no longer used. Instead, you need to
specify, for this solid material, the electrical conductivity by choosing one of the three non-isotropical
options for the UDS diffusivity (UDS-0). The three options are: anisotropic; orthotropic; and cyl-
orthotropic. For more information about these UDS Diffusivity options, refer to the ANSYS Fluent
User's Guide.
Select the Anisotropic E-Conductivity in Porous Electrode option in the Model tab of the Fuel Cell
and Electrolysis Models dialog box.
In the Create/Edit Materials dialog box, select defined-per-uds for UDS Diffusivity for the solid
material that is to be used for the porous electrode.
Select one of the three options for UDS-0: anisotropic; orthotropic; or cyl-orthotropic and set the ap-
propriate values.
Important
Note that, in this case, the Electrical Conductivity for this solid material is ignored.
For PEMFC problems, you can use the Under-Relaxation Factors fields to influence the solution process.
The saturation source term in Equation 3.27 (p. 287) usually requires under-relaxation. You can
change the default value for the under-relaxation factor by changing the value for Saturation Source.
The water content, , in Equation 3.38 (p. 289) also may need under-relaxation. You can change the
default value for the under-relaxation factor by changing the value for Water Content.
Under Automatic Settings, the following parallel multigrid solver control parameters are available:
Enable Smooth Partition: Enables the smooth partitioning process when running in Parallel.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
296 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
F-cycle for All Equations: Sets the multigrid cycle type to F cycle for all equations that are being solved.
This control overrides the equation cycle settings in the Advanced Solution Controls dialog box.
Nearly all options are turned on by default. You may want to override the default values, depending
on the problem you want to model. For instance, if you are not concerned with the heat generated
due to chemical reaction, then you may want to turn off the Reaction Heating option.
Figure 4.3: The Parameters Tab of the Fuel Cell and Electrolysis Models Dialog Box
There are various parameters under Electrochemistry in the Fuel Cell and Electrolysis Models dialog
box. For both the anode and the cathode, you can also set the following parameters or leave the default
values.
The Ref. Current Density corresponds to and , the reference exchange current density from Equa-
tion 3.9 (p. 285) and Equation 3.10 (p. 285).
The Ref. Concentration corresponds to the reference concentration ( and ) with units of 1
(see Equation 3.9 (p. 285) and Equation 3.10 (p. 285)).
The Concentration Exponent corresponds to , the concentration dependence from Equation 3.9 (p. 285).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 297
Using the Fuel Cell and Electrolysis Model
The Exchange Coefficient (a) and Exchange Coefficient (c) correspond to the transfer coefficients,
and , from Equation 3.9 (p. 285) and Equation 3.10 (p. 285).
The Leakage Current corresponds to in Equation 3.42 (p. 290) through Equation 3.47 (p. 290). This is the
total amount of transfer current (A) due to fuel-oxidant cross-over (leakage through the electrolyte). When
this happens, the fuel cell generates less current especially for cases with low values of fuel or air utilization.
In addition to the constant value you can specify in the Electrochemistry tab, you can also specify the
leakage current through the user-defined function Leakge_Current(). For more information, see User-
Accessible Functions (p. 317).
The Reference Diffusivities correspond to from Equation 3.30 (p. 288), the species mass diffusivity. These
are not be required if the Multicomponent Diffusion option is enabled in the Model tab.
The Pore Blockage for Gas Diffusion corresponds to from Equation 3.30 (p. 288) for multiphase PEMFC
calculations.
The Pore Blockage for Transfer Current is used to account for liquid blockage to the reaction surface by
modifying and in Equation 3.9 (p. 285) through Equation 3.12 (p. 285) as follows:
The Exponent for relative permeability corresponds to in Equation 3.28 (p. 287).
Note that, conventionally, the negative voltage is supplied to the cathode side in power consuming
devices such as electrolyzers. ANSYS Fluent adopts the inverse notation where the negative voltage is
supplied to the anode side whilst cathode remains positively charged. The main reason for this discrep-
ancy is that the same infrastructure is used for both the electrolysis and fuel cells models. Usage of the
terms "anode" and "cathode" in this manual and in the user interface should be interpreted according
to conventions for power-supplying devices.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
298 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
1. Select the Anode tab of the Fuel Cell and Electrolysis Models dialog box.
3. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all zones of a particular type as a group.
4. Select a Solid Material from the corresponding drop-down list. Solid materials can be customized using
the Create/Edit Materials dialog box. Note that for the Electrical Conductivity, you can only choose a
constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is the diffus-
ivity of the solid phase potential in the solid zones.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 299
Using the Fuel Cell and Electrolysis Model
1. Select the Anode tab of the Fuel Cell and Electrolysis Models dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
300 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
1. Select the Anode tab of the Fuel Cell and Electrolysis Models dialog box.
3. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all zones of a particular type as a group.
4. Select a Solid Material from the corresponding drop-down list. Solid materials can be customized using
the Create/Edit Materials dialog box. Note that for the Electrical Conductivity, you can only choose a
constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is the diffus-
ivity of the solid phase potential in the solid zones.
7. Specify a value for the Contact Angle for multiphase fuel cell calculations ( in Equation 3.29 (p. 287)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 301
Using the Fuel Cell and Electrolysis Model
1. Select the Anode tab of the Fuel Cell and Electrolysis Models dialog box.
3. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all zones of a particular type as a group.
4. Select a Solid Material from the corresponding drop-down list. Solid materials can be customized using
the Create/Edit Materials dialog box. Note that for the Electrical Conductivity, you can only choose a
constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is the diffus-
ivity of the solid phase potential in the solid zones.
7. Specify a value for the Surface/Volume Ratio (the specific active surface area in Equation 3.9 (p. 285)).
8. Specify a value for the Contact Angle for multiphase fuel cell calculations ( in Equation 3.29 (p. 287)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
302 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
Figure 4.8: The Electrolyte Tab of the Fuel Cell and Electrolysis Models Dialog Box
1. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all membrane zones as a group.
2. Select a Solid Material from the corresponding drop-down list. Solid materials can be customized using
the Create/Edit Materials dialog box.
3. Specify a value for the Equivalent Weight ( in Equation 3.36 (p. 289)).
4. Specify a value for the Protonic Conduction Coefficient ( in Equation 3.34 (p. 289)). This is used to calculate
the membrane phase electric conductivity.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 303
Using the Fuel Cell and Electrolysis Model
5. Specify a value for the Protonic Conduction Exponent ( in Equation 3.34 (p. 289)).
Note that the Fuel Cell and Electrolysis Model allows you to model the electrolyte/membrane as either
a fluid zone or as a solid zone. For PEMFC, the Fuel Cell and Electrolysis Model still allows for water and
the ionic current to pass through the electrolyte/membrane.
1. Select the Cathode tab of the Fuel Cell and Electrolysis Models dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
304 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
3. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all zones of a particular type as a group.
4. Select a Solid Material from the corresponding drop-down list. Solid materials can be customized using
the Create/Edit Materials dialog box. Note that for the Electrical Conductivity, you can only choose a
constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is the diffus-
ivity of the solid phase potential in the solid zones.
1. Select the Cathode tab of the Fuel Cell and Electrolysis Models dialog box.
3. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all zones of a particular type as a group.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 305
Using the Fuel Cell and Electrolysis Model
1. Select the Cathode tab of the Fuel Cell and Electrolysis Models dialog box.
3. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all zones of a particular type as a group.
4. Select a Solid Material from the corresponding drop-down list. Solid materials can be customized using
the Create/Edit Materials dialog box. Note that for the Electrical Conductivity, you can only choose a
constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is the diffus-
ivity of the solid phase potential in the solid zones.
7. Specify a value for the Contact Angle for multiphase fuel cell calculations ( in Equation 3.29 (p. 287)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
306 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
1. Select the Cathode tab of the Fuel Cell and Electrolysis Models dialog box.
3. Select a corresponding zone from the Zone(s) list. If you are modeling a fuel cell stack, then you must pick
all zones of a particular type as a group.
4. Select a Solid Material from the corresponding drop-down list. Solid materials can be customized using
the Create/Edit Materials dialog box. Note that for the Electrical Conductivity, you can only choose a
constant value in the Create/Edit Materials dialog box. The solid electrical conductivity value is the diffus-
ivity of the solid phase potential in the solid zones.
7. Specify a value for the Surface/Volume Ratio (the specific active surface area in Equation 3.10 (p. 285)).
8. Specify a value for the Contact Angle for multiphase fuel cell calculations ( in Equation 3.29 (p. 287)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 307
Using the Fuel Cell and Electrolysis Model
4.6.6.1. Setting Contact Resistivities for the Fuel Cell and Electrolysis Model
Figure 4.13: The Advanced Tab of the Fuel Cell and Electrolysis Models Dialog Box for Contact
Resistivities
1. Select the Advanced tab of the Fuel Cell and Electrolysis Models dialog box.
3. Select any number of corresponding interfaces from the Available Zone(s) list. These zones are face zones
over which a jump in electrical potential is caused by imperfect conduction.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
308 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
5. To simplify the input, you can choose to use the resistivity value of the first selected zone for all others as
well by turning on the Use First Value for All option.
4.6.6.2. Setting Coolant Channel Properties for the Fuel Cell and Electrolysis Model
Figure 4.14: The Advanced Tab of the Fuel Cell and Electrolysis Models Dialog Box for the Coolant
Channel
1. Select the Advanced tab of the Fuel Cell and Electrolysis Models dialog box.
8. To enable the coolant channel, turn on the Enable Coolant Channel(s) option. Amongst other settings,
this will change the mixture to include the coolant species, which is otherwise absent.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 309
Using the Fuel Cell and Electrolysis Model
4.6.6.3. Managing Stacks for the Fuel Cell and Electrolysis Model
Figure 4.15: The Advanced Tab of the Fuel Cell and Electrolysis Models Dialog Box for Stack
Management
The ANSYS Fluent Fuel Cell and Electrolysis Model allows you to model fuel cell stacks as well as indi-
vidual fuel cells. In the Advanced tab of the Fuel Cell and Electrolysis Models dialog box, you can
define fuel cell units for each fuel cell in a stack. A fuel cell unit consists of all zones of a single fuel cell
in the stack.
Important
If you are only modeling a single fuel cell, then you do not need to set anything for Stack
Management in the Advanced tab of the Fuel Cell and Electrolysis Models dialog box.
1. Select the Advanced tab of the Fuel Cell and Electrolysis Models dialog box.
3. Since a fuel cell unit consists of all zones of a single fuel cell in the stack, select the corresponding zones
from the Zone(s) list.
4. Create a new fuel cell unit by clicking the Create button. The new fuel cell is listed under Fuel Cell Unit(s)
with a default name.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
310 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Fuel Cells and Electrolysis
5. Edit a pre-existing fuel cell unit by selecting it in the Fuel Cell Unit(s) list. The zones in this fuel cell unit
are automatically selected in the Zone(s) list. You can then modify the zones that comprise the fuel cell
unit and/or change its name in the Name field and click Modify to save the new settings.
6. Remove a pre-existing fuel cell unit by selecting it in the Fuel Cell Unit(s) list and clicking the Delete
button.
7. If your model contains many zone names, you can use the Match Zone Name Pattern field to specify a
pattern to look for in the names of zones. Type the pattern in the text field and click Match to select (or
deselect) the zones in the Zones list with names that match the specified pattern. You can match additional
characters using * and ?. For example, if you specify wall*, all surfaces whose names begin with wall
(for example, wall-1, wall-top) will be selected automatically. If they are all selected already, they will be
deselected. If you specify wall?, all surfaces whose names consist of wall followed by a single character
will be selected (or deselected, if they are all selected already).
For example, in a stack there are many fuel cells, say 10100, each having at least 9 zones (current
collector, gas channel, diffusion layer, and catalyst layer for both anode and cathode and a membrane).
Additionally, there may be coolant channels, and it may be that for mesh construction reasons each
of these physical zones is made up of more than one mesh zone. Even for small stacks, you can
easily end up having hundreds of cell zones in an ANSYS Fluent mesh. Therefore, you may want to
consider numbering the fuel cells in a stack and to use the assigned fuel cell number in the names
of the mesh zones. When you set up your stacked fuel cell case, you would use the Match Zone
Name Pattern field to pick all the zones belonging to a single fuel cell in the stack, rather than
scrolling through the potentially very long list and selecting them manually.
8. You can have ANSYS Fluent attempt to automatically determine the zones that constitute a single fuel cell
in a stack using the Suggest Stack Setup button. Manually performing this task is often time-consuming
and error-prone. Using the Suggest Stack Setup button can save you from having to manually enter this
information yourself for potentially hundreds of zones.
When using the Suggest Stack Setup button, ANSYS Fluent needs to correctly identify electrically
conducting parts and their connectivity (anode, electrolyte, cathode, coolant channels, and external
contacts) using zone information generally required by the fuel cell model anyway. ANSYS Fluent
requires zone information to have been specified in all of the following tabs in the Fuel Cell and
Electrolysis Models dialog box:
In the Anode tab, specify zone information for the current collector, the porous electrode, and the TPB
catalyst layer.
In the Cathode tab, specify zone information for the current collector, the porous electrode, and the
TPB catalyst layer.
In the Advanced tab, specify zone information for the coolant channel.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 311
Using the Fuel Cell and Electrolysis Model
Important
If your fuel cell model inputs are incorrect (or incomplete), ANSYS Fluent cannot completely
be sure that the resulting setup is correct. Also, even if your inputs are correct, an uncon-
ventional fuel cell design may cause ANSYS Fluent to suggest an inaccurate stack setup.
So, it is your responsibility to verify the stack setup prior to clicking either the OK or the
Apply buttons.
Figure 4.16: The Reports Tab of the Fuel Cell and Electrolysis Models Dialog Box
The Electrolyte Projected Area field requires the projected area of the Membrane Electrolyte Assembly
(MEA) and is only used to calculate the average current density. The assembly consists of the membrane
and the catalyst layers above and below the membrane. The value of the projected area can be computed
from the Projected Surface Areas dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
312 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Current Collectors
The External Contact Interface(s) fields requires the face zones that act as external contact surfaces
for the anode and the cathode.
These inputs are used to report cell voltage. For potentiostatic boundary conditions, this is the difference
between the provided values, but for galvanostatic boundary conditions, the cell voltage is part of the
solution.
If fluid zones are used to model solid current collectors, ANSYS Fluent automatically sets velocities to
zero and cuts off species transport into these zones. If solid zones are used, however, you need to ac-
tivate the solution of the electric potential (UDS-0) in these solid zones (see the separate ANSYS Fluent
Users Guide for details). The value of the Electric Conductivity for the solid material must be assigned
in the Create/Edit Materials dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 313
Using the Fuel Cell and Electrolysis Model
Figure 4.17: The Electric Conductivity Field in the Create/Edit Materials Dialog Box
Important
For more information on the user-defined scalar diffusivity, see the separate ANSYS Fluent User's Guide.
Note that the Fuel Cell and Electrolysis Model allows you to model current collectors either as porous
media zones (if you want to allow for mass and momentum transport within the collectors) or as solid
zones.
Anode Inlet
Temperature
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
314 of ANSYS, Inc. and its subsidiaries and affiliates.
Solution Guidelines for the Fuel Cell and Electrolysis Model
Cathode Inlet
Temperature
Temperature
Terminal Anode
Terminal Cathode
UDS-0 (electric potential) is set to the voltage of the cathode (if solving to constant voltage), or the UDS-
0 (electric potential) flux is set to the current density in (SI units) (if solving for constant current).
Note that the sign of the UDS-0 flux on the cathode side is negative.
4.9. Solution Guidelines for the Fuel Cell and Electrolysis Model
For potentiostatic boundary conditions, after initialization, steady-state solutions are calculated easily
for cell voltages close to the open-circuit voltage. The same can be said for galvanostatic boundary
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 315
Using the Fuel Cell and Electrolysis Model
conditions and low electric current. By lowering the cell voltage or by raising the average electric current,
you can calculate subsequent stationary solutions.
In the event of convergence problems, it is recommended that you change the multigrid cycle to F-
cycle with BCGSTAB (bi-conjugate gradient stabilized method) selected as the stabilization method for
the species and the two potential equations. For the species and the user-defined scalar equations, it
may be necessary to reduce the termination (criteria) of the multigrid-cycles to . For stack simu-
lations, the termination criterion may be reduced to for the two potential equations.
Also, it may be useful to turn off Joule Heating and Reaction Heating in the Fuel Cell and Electrolysis
Models dialog box (in the Model tab) for the first few (approximately 5-10) iterations after initialization.
This allows the two electric potentials to adjust from their initial values to more physical values, avoiding
the possibility of extreme electrochemical reactions and electric currents that would in turn adversely
impact the solution.
UDM 0
X Current Flux Density ( )
UDM 1
Y Current Flux Density ( )
UDM 2
Z Current Flux Density ( )
UDM 3
Current Flux Density Magnitude ( )
UDM 4
Ohmic Heat Source ( )
UDM 5
Reaction Heat Source ( )
UDM 6 Overpotential (Volts)
UDM 7
Phase Change Source ( )
UDM 8 Osmotic Drag Coefficient
UDM 9 Liquid Water Activity
UDM 10 Membrane Water Content
UDM 11 Protonic Conductivity (1/ohm-m)
UDM 12
Back Diffusion Mass Source ( )
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
316 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Accessible Functions
UDM 13
Transfer Current ( )
UDM 14
Osmotic Drag Source ( )
You can obtain this list by opening the Execute On Demand dialog box and pulling down the Function
drop-down list.
Alternatively, you can view the listing that appears when you first load your Fuel Cell and Electrolysis
case, or you can type list_pemfc_udf in the text user interface and the listing will appear in the
console window.
Note
For field variables that are stored in UDM, use the corresponding variables for postprocessing.
Postprocessing the UDM itself is not recommended.
For reviewing simulation results in CFD Post for cases involving UDM or UDS, export the
solution data as CFD-Post-compatible file (.cdat) in Fluent and then load this file into CFD-
Post.
Important
When you load older Fuel Cell and Electrolysis cases into ANSYS Fluent, and you are monit-
oring a UDS using volume or surface monitors, make sure you re-visit the corresponding
monitors dialog box (for example, the Volume Monitor or the Surface Monitor dialog box)
to verify that the correct UDS name is used for the appropriate monitor.
The following listing represents a description of the contents of the pem_user.c source code file:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 317
Using the Fuel Cell and Electrolysis Model
Returns the value of the anode reaction reference current density used in Equation 3.9 (p. 285).
Returns the value of the cathode reaction reference current density used in Equation 3.10 (p. 285).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
318 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Accessible Functions
If you want to change the names of UDSs, change the second argument of the strncpy functions,
recompile and link the module as with any modification to pem_user.c. Note that STRING_SIZE
is fixed in pem.h and should not be changed.
Important
When you load older Fuel Cell and Electrolysis cases into ANSYS Fluent, and you are
monitoring a UDS using volume or surface monitors, make sure you re-visit the corres-
ponding monitors dialog box (for example, the Volume Monitor or the Surface Monitor
dialog box) to make sure that the correct UDS name is used for the appropriate monitor.
If you want to change the names of UDMs, change the second argument of the strncpy functions,
recompile and link the module as with any modification to pem_user.c. Note that STRING_SIZE
is fixed in pem.h and should not be changed.
Important
When you load older Fuel Cell and Electrolysis cases into ANSYS Fluent, and you are
monitoring a UDM using volume or surface monitors, make sure you re-visit the corres-
ponding monitors dialog box (for example, the Volume Monitor or the Surface Monitor
dialog box) to make sure that the correct UDM name is used for the appropriate monitor.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 319
Using the Fuel Cell and Electrolysis Model
source anode or cathode volumetric transfer current ( in Equation 3.9 (p. 285) or in
Equation 3.10 (p. 285))
*dRade partial derivative of with respect to activation loss
*dRcde partial derivative of with respect to activation loss
4.11.1. Compiling the Customized Fuel Cell and Electrolysis Source Code
This section includes instructions on how to compile a customized Fuel Cell and Electrolysis user-defined
module. Note that you can also refer to the file INSTRUCTIONS-CLIENT that comes with your distri-
bution (see addons/fuelcells).
Important
It is assumed that you have a basic familiarity with compiling user-defined functions (UDFs).
For an introduction on how to compile UDFs, refer to the Fluent Customization Manual.
You will first want to use a local copy of the fuelcells directory in the addons directory before you
recompile the Fuel Cell and Electrolysis module.
Important
The custom version of the library must be named according to the convention used by
ANSYS Fluent: for example, fuelcells.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
320 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Accessible Functions
4. Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
5. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Fuel
Cell and Electrolysis module.
where your_arch is lnx86 on LINUX, or ultra on the Sun operating system, and so on.
The following example demonstrates the steps required to set up and run a customized version of the
Fuel Cell and Electrolysis module that is located in a folder call home/sample:
Using a text editor, make the appropriate changes to the pem_user.c file located in
/home/sample/fuelcells/src/pem_user.c
Edit the makefile located in the src/ directory and make sure that the FLUENT_INC variable correctly
refers to the current ANSYS Fluent installation directory. Be careful not to leave any trailing spaces when
you make your changes.
Set the FLUENT_ADDONS environment variable (using CSH, other shells will differ).
setenv FLUENT_ADDONS /home/sample
Start ANSYS Fluent and load the customized module using the text interface command.
2. Make sure that the $FLUENT_INC environment variable is correctly set to the current ANSYS Fluent in-
stallation directory (for example, ANSYS Inc\v170\fluent).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 321
Using the Fuel Cell and Electrolysis Model
6. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Fuel
Cell and Electrolysis module.
4.12. Using the Fuel Cell and Electrolysis Text User Interface
All of the features for the Fuel Cell and Electrolysis Model (sometimes referred to as the Resolved Elec-
trolyte model) that are available through the graphical user interface are also available through text
user interface (TUI) commands. The TUI allows text commands to be typed directly in the ANSYS Fluent
console window where additional information can be extracted and processed for more advanced
analysis.
Once the fuel cell module is loaded (see Loading the Fuel Cell and Electrolysis Module (p. 292)), you can
access the text user interface through the console window under resolved-MEA-fc. A listing of the
various text commands is as follows:
resolved-MEA-fuelcells/
Fuel cell model menu
enable-fc-model?
Enable/disable fuel cell model
select-model
Select model
model-options
Model options
model-parameters
Model parameters
anode-setup/
Anode setup
list-zones-briefly
List zone names and IDs
current-collector
Set current collector
flow-channel
Set flow channel
porous-electrode
Set porous electrode
catalyst-layer
Set catalyst layer
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
322 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Fuel Cell and Electrolysis Text User Interface
cathode-setup/
Cathode setup
list-zones-briefly
List zone names and IDs
current-collector
Set current collector
flow-channel
Set flow channel
porous-electrode
Set porous electrode
catalyst-layer
Set catalyst layer
electrolyte-setup/
Electrolyte setup
electrolyte-layer
Set electrolyte layer
list-zones-briefly
List zone names and IDs
advanced-setup/
Advanced setup
list-zones-briefly
List zone names and IDs
contact-resistivity
Set contact resistivity
coolant-channel
Set coolant channel
stack-management/
Stack setup
list-fc-units
List fuel cell units
list-zones-briefly
List zone names and IDs
create-fc-unit
Create fuel cell unit
modify-fc-unit
Modify fuel cell unit
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 323
Using the Fuel Cell and Electrolysis Model
delete-fc-unit
Delete fuel cell unit
set-stack-current-density
Set the current density on the anode or cathode and modify the current solution to assist
convergence. Note: Input here is in units of A/cm2. This is only available if the case contains
valid data (for example, after initialization, iterating, or reading in data). For more information,
see IV-Curve Calculations Using the Text Interface (p. 324).
set-stack-voltage
Set the voltage difference in Volts between the anode and the cathode and modify the current
solution to assist convergence. This is only available if the case contains valid data (for example,
after initialization, iterating, or reading in data). For more information, see IV-Curve Calculations
Using the Text Interface (p. 324).
reset-setup
Reset the stack setup in case mistakes are made
submit-setup
Submit the stack setup and makes the stack setup take effect
suggest-setup
Suggest the stack setup, invoking the automatic stack setup
controls
Set model control parameters
reports
Set electrolyte project area and external contacts
set-default
Set default
For fuel cells, you either prescribe the voltage and obtain the total current delivered by the fuel cell as
a result, or you specify the total current (via flux boundary conditions multiplied by the area) and obtain
the voltage as part of the solution. The details of this IV-relation are specific for each single fuel cell
and depend on mass and heat transport, electrochemistry and inlet conditions, outlet conditions, oper-
ating conditions, and any other parameter or material property involved in the calculation. The IV-curve
is important for applications, because its product is the power delivered by the system.
As described earlier in this manual, you would start a new simulation from fairly static conditions, that
is, high voltage/low current (which implies low species transport and low heat generation). After con-
vergence, you typically may be interested in solutions for new electric boundary conditions, that is,
either for a new cell/stack voltage or current.
In such cases, simply going to the Boundary Conditions task page and changing the value of the
electric potential (uds-0) boundary condition, typically allows only small changes, most notably for
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
324 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Fuel Cell and Electrolysis Text User Interface
stacks. Otherwise the solution will not converge. This is where the set-stack-voltage and set-
stack-current-density commands are important.
In addition to changing the boundary conditions (either to a prescribed voltage or current density),
these commands process the current data in order to estimate the solution for the new boundary
conditions. Because these commands modify the data, you are prompted to save your data, if you have
not already done so.
Before going into details of the commands, here are some general remarks about electric potential
boundary conditions.
For fixed voltage boundary conditions, both external contacts have a fixed value for the electric potential
(uds-0). The anode value will typically be zero, but it does not have to be. The cathode value will be
larger than the anode value and the difference ( - ) is the positive cell/stack voltage.
For a fixed current boundary condition, one external contact has to have a fixed value and the other
flux boundary conditions. As described earlier in the manual, typically, the anode will have a fixed (zero)
value, and the cathode will be floating, however, you can also set the cathode to a fixed zero potential,
yielding a floating negative anode potential.
The set-stack-voltage command sets the effective stack voltage, that is, the difference ( -
). For fixed voltage boundary conditions for the previous solution, boundary conditions on both
boundaries are of type fixed value and then the cathode value will be changed accordingly. In the case
of fixed current boundary conditions for the previous solution, the flux boundary condition will be
changed to a fixed value boundary condition, and the value adjusted accordingly with respect to the
other fixed value boundary condition.
The set-stack-current-density command sets the current density on one boundary to the
desired value. Note that the input will be in , not as you would normally have to enter in the
Boundary Conditions task page. The reason for this is that average current densities reported in the
text command interface are also in , and this makes it easier to choose the conditions you would
like to prescribe next. Also, flux boundary conditions entered in the Boundary Conditions dialog box
would have to have a positive sign on the anode side, and a negative sign on the cathode side. The
input for the text interface command is just a positive number, signs are automatically accounted for.
For fixed current boundary conditions for the previous solution, the set-stack-current-density
command changes the respective flux boundary condition accordingly. In the case of fixed voltage
boundary conditions for the previous solution, the cathode side is chosen to be changed from a fixed
value to a flux boundary condition with the new flux.
The two commands may be mixed in an IV-curve calculation. For the type of boundary condition setups
currently described in this manual, boundary condition changes will consistently happen on the cathode
side. However, if anode flux boundary conditions had been chosen initially, switching to fixed voltage
boundary conditions by set-stack-voltage command and then back to fixed current boundary
conditions by the set-stack-current-density command will then have flux boundary conditions
on the cathode side. In this case, using the set-stack-current-density command exclusively
will preserve the anode flux boundary condition setting.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 325
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
326 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 5: SOFC Fuel Cell With Unresolved Electrolyte Model Theory
This chapter presents an overview of theory and equations for solid oxide fuel cell (SOFC, with unresolved
electrolyte) modeling capabilities in ANSYS Fluent.
5.1. Introduction
5.2.The SOFC With Unresolved Electrolyte Modeling Strategy
5.3. Modeling Fluid Flow, Heat Transfer, and Mass Transfer
5.4. Modeling Current Transport and the Potential Field
5.5. Modeling Reactions
5.1. Introduction
The Solid Oxide Fuel Cell (SOFC) With Unresolved Electrolyte Model is provided as an add-on module
with the standard ANSYS Fluent licensed software.
A fuel cell is an energy conversion device that converts the chemical energy of fuel into the electrical
energy. A schematic of a solid oxide fuel cell (SOFC) is shown in Figure 5.1: Schematic of a Solid Oxide
Fuel Cell (p. 327).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 327
SOFC Fuel Cell With Unresolved Electrolyte Model Theory
As noted in [1] (p. 355), a solid oxide fuel cell is typically composed of an anode, cathode, and an elec-
trolyte. Multiple fuel cells can be connected together, or stacked, using electrical interconnects. The
electrolyte material must be solid, that is, non-porous, and exhibit a high ionic conductivity.
Note that the reason this modeling approach is referred to as the SOFC Model with Unresolved Elec-
trolyte" model is that the anode and the cathode interlayers" and electrolyte" (as shown in Fig-
ure 5.1: Schematic of a Solid Oxide Fuel Cell (p. 327)) are not actually included in the computational do-
main. They are modeled as a pair of wall and wall-shadow faces, named electrolyte interfaces," with
the species and energy sources and sinks due to the electrochemical reactions added to the adjacent
computational cells.
All components of the fuel cell must have similar thermal expansion in order to minimize thermal
stresses, which may cause cracking and de-lamination during thermal cycling. In addition, the components
must be chemically stable in order to limit chemical interactions with other cell components.
A solid oxide fuel cell works by having electrically conducting porous ceramic electrodes attached on
each side of an ionically conducting ceramic material. At the cathode/electrolyte/gas interface, also
known as the triple phase boundary, oxygen is reduced to oxygen ions. The oxygen ions are conducted
through the oxygen vacancies in the electrolyte to the anode side. At the anode/electrolyte/gas interface,
oxygen ions combine to react with hydrogen at the anode electrode to form water and release electrons.
The electrons travel through an external circuit to a load and back to the cathode electrode to close
the circuit.
The ANSYS Fluent SOFC With Unresolved Electrolyte Model provides the following features:
Local electrochemical reactions coupling the electric field and the mass, species, and energy transport.
Electric field solution in all porous and solid cell components, including ohmic heating in the bulk material.
Significant geometric flexibility for treating planar, tubular, and other nonstandard SOFC configuration.
Use of non-conformal interface meshing (as a long as these interfaces are not the electrolyte interfaces).
Capture the fluid flow, heat transfer, and the mass transfer in the flow channels and in the porous anode
and cathode electrodes.
Model the transport of the current and the potential field in the porous electrodes and in the solid conducting
regions.
Model the electrochemical reactions that take place at the electrolyte/electrode/gaseous species interface.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
328 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Current Transport and the Potential Field
Figure 5.2: How the SOFC With Unresolved Electrolyte Model Works in ANSYS Fluent
The default multicomponent diffusion model in ANSYS Fluent is used to calculate the mass diffusion
coefficient of species in the mixture.
To account for the effect of porosity on the multicomponent mass diffusion coefficient
(5.1)
where is the porosity and is the tortuosity (that is, the average path length over the actual length).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 329
SOFC Fuel Cell With Unresolved Electrolyte Model Theory
where
(5.3)
and is the electrical conductivity and is the electrical potential. Therefore, the governing equation
for the electric field is the Laplace equation:
(5.4)
Ohmic losses in all the conducting materials, including the electrolyte, electrodes, and current collectors.
Ohmic heating through conduction materials as the result of ohmic losses, and the current density
throughout the domain.
Oxygen is electrochemically reduced at the triple phase boundary at the cathode electrode:
(5.5)
Oxygen is electrochemically re-oxidized at the triple phase boundary at the anode electrode:
(5.6)
In the absence of an electrical load, the oxygen activity on both sides of the electrolyte is fixed and
given by their respective chemical potentials. Under equilibrium, the electromotive force, or reversible
cell voltage, is given by the Nernst equation:
(5.7)
If hydrogen is present at the anode electrode, then the cell reaction becomes:
(5.8)
(5.9)
The cell potential measured at equilibrium (that is, no load), is called the open circuit voltage. The open
circuit voltage should be equivalent to the Nernst potential at no load, unless there is leakage across
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
330 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Current Transport and the Potential Field
the electrolyte. When the external circuit is closed, then cell voltage drops due to polarization losses at
the electrodes.
The electric field and the electrochemistry interact solely at the electrolyte interface. ANSYS Fluent treats
the electrolyte interface as an impermeable wall. The potential field must have a jump" condition applied
to the two sides of this wall to account for the effect of the electrochemistry. To closely couple the
electrochemical behavior to the potential field calculation, you need to include all of the electrochem-
ical effects into this jump condition. It encapsulates the voltage jump due to Nernst, the voltage reduction
due to activation, the Ohmic losses due to the resistivity of the electrolyte, and a linearized for voltage
reduction due to activation. This interface condition relates the potential on the anode side and the
cathode side of the electrolyte and has the following form:
(5.10)
where
(5.11)
where represents the ohmic overpotential of the electrolyte, and represent the activation
overpotential of the anode and the cathode. represent ohmic losses in the solid conducting regions.
represents the Nernst potential.
(5.12)
where is the stoichiometric coefficient of species , is the chemical species, and is the number
of electrons.
(5.13)
where is the voltage, and are the rate constant and the reaction order for the anodic direction,
and are the rate constant and the reaction order for the cathodic direction, is the anodic
transfer coefficient, is the cathodic transfer coefficient, and is the number of electrons that are re-
leased. At equilibrium, the forward and the backward reaction rates are the same, therefore:
(5.14)
The reaction rate (that is, current) can be written in terms of the exchange current density to obtain
the Butler-Volmer formulation [7] (p. 355):
(5.15)
The activation overpotential is the energy lost due to the slowness of electrochemical reactions at the
anode and the cathode electrodes.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 331
SOFC Fuel Cell With Unresolved Electrolyte Model Theory
(5.16)
where
(5.18)
with being the exchange current density at the reference condition, is the mole fraction and
is the concentration exponent for species . More specifically, at the anode side, you have:
(5.19)
(5.20)
Given values for and . the full version of the Butler-Volmer equation can be solved using the
Newton method, therefore finding the activation overpotential at the anode ( ) and the cathode
( ).
(5.21)
and
(5.23)
In all electrically conducting zones (for example, electrodes, current collectors, interconnects), ohmic
heating, , is added to the energy equation as a source term. In other words,
(5.24)
In addition, the energy equation needs treatment at the electrode-electrolyte interface to account for
the heat generated or lost as the result of electrochemistry and the overpotentials (that is, activation
overpotential and ohmic loss through the electrolyte).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
332 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Current Transport and the Potential Field
The total energy balance on the electrolyte interface is computed by enumerating the enthalpy flux of
all species, including the heat of formation (sources of chemical energy entering the system), and then
subtracting off the work done (leaving the system) which is simply the local voltage jump multiplied
by the local current density. What remains is the waste heat due to irreversibilities. For hydrogen reaction,
the balance would be
(5.25)
where is the heat generation (W) and is the total enthalpy of species (J/s) composed of the sensible
enthalpy in addition to the enthalpy of formation.
(5.26)
The source term is then added in the cell energy equation by taking .
One half of this value is applied as a source term to the energy equation of the anode computational
cell adjacent to the electrolyte and the other half is applied as a source term to the energy equation
for the cathode cell adjacent to the electrolyte. The equal distribution of the heat generation/destruction
is purely arbitrary. Note that by using the work term, the effect from all overpotentials are taken into
account.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 333
SOFC Fuel Cell With Unresolved Electrolyte Model Theory
where is the source or sink of the species (molar flux), is the stoichiometric coefficient, is the
current density ( ), is the number of electrons per mole of fuel, and is the Faraday constant.
Using the local current information, the ANSYS Fluent SOFC With Unresolved Electrolyte Model applies
species fluxes to the electrode boundaries. By convention [7] (p. 355), the current density is positive
when it flows from the electrode into the electrolyte solution. The current densities are positive at the
anodes and negative at the cathodes.
or
(5.30)
(5.31)
(5.34)
(5.35)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
334 of ANSYS, Inc. and its subsidiaries and affiliates.
Modeling Reactions
Note that the total enthalpy includes the formation enthalpy for each species only when the volumetric
reactions are enabled. Once the volumetric reactions are enabled, the SOFC model solver can correctly
compute the reaction heat.
(5.38)
(5.39)
(5.40)
By default, Equation 5.36 (p. 335) is used to compute the / split factor, however, you can define
your own split factor in the user-defined function called h2_co_split_func() (see User-Accessible
Functions for the Solid Oxide Fuel Cell With Unresolved Electrolyte Model (p. 351)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 335
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
336 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 6: Using the Solid Oxide Fuel Cell With Unresolved
Electrolyte Model
The procedure for setting up and solving solid oxide fuel cell (SOFC) problems (with unresolved electro-
lyte) is described in detail in this chapter. Refer to the following sections for more information:
6.1. Limitation on Modeling Solid Oxide Fuel Cells
6.2. Installing the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
6.3. Loading the Solid Oxide Fuel Cell With Unresolved Electrolyte Module
6.4. Solid Oxide Fuel Cell With Unresolved Electrolyte Module Set Up Procedure
6.5. Setting the Parameters for the SOFC With Unresolved Electrolyte Model
6.6. Setting Up the Electrochemistry Parameters
6.7. Setting Up the Electrode-Electrolyte Interfaces
6.8. Setting Up the Electric Field Model Parameters
6.9. User-Accessible Functions for the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
6.10. Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Text User Interface
6.2. Installing the Solid Oxide Fuel Cell With Unresolved Electrolyte
Model
The Solid Oxide Fuel Cell (SOFC) With Unresolved Electrolyte Model is provided as an addon module
with the standard ANSYS Fluent licensed software. The module is installed with the standard installation
of ANSYS Fluent in a directory called addons/sofc in your installation area. The SOFC With Unresolved
Electrolyte Model consists of a UDF library and a pre-compiled scheme library, that must be loaded and
activated before calculations can be performed.
6.3. Loading the Solid Oxide Fuel Cell With Unresolved Electrolyte Module
The Solid Oxide Fuel Cell (SOFC) With Unresolved Electrolyte Model is loaded into ANSYS Fluent through
the text user interface (TUI). The module can only be loaded after a valid ANSYS Fluent mesh or case
file has been set or read. The text command to load the addon module is
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 337
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
Select the SOFC With Unresolved Electrolyte Model by entering the module number 4. During the
loading process, a scheme library (containing the graphical and text user interface) and a UDF library
(containing a set of user defined functions) are loaded into ANSYS Fluent.
Once the module has been loaded, the SOFC Model SOFC Model (Unresolved Electrolyte) option
appears in the tree under the Models branch and in the Models task page.
To enable the SOFC model: In the tree under the Models branch, right-click Fuel Cells and Electrolysis
and select Edit... in the menu that opens.
Figure 6.1: Opening the SOFC Model Dialog Box in the Tree
When the SOFC Model dialog box appears, select the Enable SOFC Model option.
6.4. Solid Oxide Fuel Cell With Unresolved Electrolyte Module Set Up
Procedure
The following describes an overview of the procedure required in order to use the SOFC With Unresolved
Electrolyte Model in ANSYS Fluent.
You must start ANSYS Fluent in 3D double-precision mode. Note that the SOFC With Unresolved
Electrolyte Model is only available in 3D.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
338 of ANSYS, Inc. and its subsidiaries and affiliates.
Solid Oxide Fuel Cell With Unresolved Electrolyte Module Set Up Procedure
Setup General
b. In the Energy dialog box, enable the Energy option (if it is not already enabled).
c. In the Viscous Model dialog box, enable the Laminar option (if it is not already enabled).
ii. Enable the Volumetric option under Reactions (see Enabling Species Transport and Reactions and
Choosing the Mixture Material in the Fluent User's Guide for details).
iii. From the Mixture Material drop-down list, select an appropriate mixture material or create your
own mixture material from mixture-template as described in Enabling Species Transport and
Reactions and Choosing the Mixture Material in the Fluent User's Guide. If you consider H2/CO elec-
trochemistry, ensure that your mixture material include H2, CO and CO2.
iv. Disable the Inlet Diffusion option under Options (see Diffusion at Inlets in the Fluent Theory Guide).
v. Enable the Diffusion Energy Source option under Options (see Treatment of Species Transport in
the Energy Equation in the Fluent Theory Guide).
vi. Enable the Full Multicomponent Diffusion option under Options (see Mass Diffusion in Laminar
Flows in the Fluent Theory Guide).
vii. Enable the Thermal Diffusion option under Options (see Mass Diffusion in Laminar Flows in the
Fluent Theory Guide).
e. Enable the SOFC Model model and set the parameters for the SOFC with unresolved electrolyte model:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 339
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
i. In the Model Parameters tab, set the Current Under-Relaxation Factor to a value of either 0.3
or 0.4.
ii. Under Model Options, select the appropriate SOFC model options.
iii. Set the Electrical and Electrolyte Parameters according to your problem specification.
iv. Select the Enable Surface Energy Source option, the Enable Species Sources option, and the
Disable CO Electrochemistry option.
If the electrolyte resistivity changes as a function of temperature, then turn on the Enable
Electrolyte Conductivity Submodel
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
340 of ANSYS, Inc. and its subsidiaries and affiliates.
Solid Oxide Fuel Cell With Unresolved Electrolyte Module Set Up Procedure
Note that UDM-7 and UDM-8 are the linearized values that ANSYS Fluent uses to solve the
potential field and electrochemical coupling. They are necessary to the calculations but do
not contain any real physical meaning.
Note that UDM-10 and UDM-11 contain the disaggregated activation polarizations at the
anode and cathode.
i. Enter values for the Constant Exchange Current Densities for the anode and the cathode. These
are the values in the Butler-Volmer equation (Equation 5.17 (p. 332)) for the anodic and cathodic
reactions. By default, the Anode Exchange Current Density is set to 1000 Amps and the Cathode
Exchange Current Density is set to 100 Amps.
These are the species concentrations at which the exchange current densities were taken
(Equation 5.18 (p. 332)-Equation 5.20 (p. 332)). These are used to adjust the values of reactant
species that are depleted. By default, the H2 Reference Value is set to 0.8 moles/moles,
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 341
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
the 02 Reference Value is set to 0.21 moles/moles, and the H2O Reference Value is set
to 0.2 moles/moles.
iii. Enter values for the Stoichiometric Exponents by setting values for the H2 Exponent, the H20
Exponent, and the O2 Exponent (defaulted to 0.5). These are the stoichiometric factors in the
electrochemical reaction equation. They are used as exponents as part of the scaling (Equa-
tion 5.19 (p. 332) and Equation 5.20 (p. 332).
iv. Enter values for the Butler-Volmer Transfer Coefficients by setting values for the Anodic Transfer
Coefficient ( in Equation 5.17 (p. 332)) and the Cathode Transfer Coefficient ( in Equa-
tion 5.17 (p. 332)) for both the anode reaction and the cathode reaction (defaulted to 0.5). These
are the alpha values in the Butler-Volmer equation (Equation 5.17 (p. 332)). They represent the forward
and backward rates of reaction at both the anode and cathode.
v. Enter values for the Temperature Dependent Exchange Current Density by turning on the Enable
Temperature Dependent I_0 option and setting values for A and B (Equation 6.3 (p. 349)). These
two coefficients allow the for the cathode to vary as a function of temperature.
g. In the Electrode and Tortuosity tab, set the anode and cathode interface components and set the
tortuosity parameters for the SOFC With Unresolved Electrolyte Model.
i. Under Anode Electrolyte, select a zone in the Zone(s) list and enable Anode Interface if it is ap-
plicable.
h. In the Electric Field tab, set the parameters for the electric field model.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
342 of ANSYS, Inc. and its subsidiaries and affiliates.
Solid Oxide Fuel Cell With Unresolved Electrolyte Module Set Up Procedure
a. Create or re-define new solid materials as appropriate for the anode, the cathode, and the electrolyte
according to your problem specification.
Important
Note that although the ANSYS Fluent SOFC With Unresolved Electrolyte Model does
support the shell conduction model that you use to take into account the transversal
conductive heat inside the electrolyte material, it does not currently support a similarly
transversal conduction of electric current inside the electrolyte.
i. In the Create/Edit Materials dialog box, click Fluent Database... to open the Fluent Database
Materials dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 343
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
ii. In the Fluent Database Materials dialog box, make a copy of the h2 fluid material.
iii. In the Create/Edit Materials dialog box, change the Material Type to mixture and click Edit...
for the Mixture Species.
iv. In the Species dialog box, arrange the materials under Selected Species in the following order:
h2o, o2, h2, and n2. (The species ordering is not important as long as n2 is the last species.)
v. In the Create/Edit Materials dialog box, change the Thermal Conductivity and the Viscosity to
ideal-gas-mixing-law.
vi. Change the Mass Diffusivity to user-defined and select diffusivity::sofc as the corresponding
user-defined function.
vii. Change the UDS Diffusivity to user-defined and select E_Conductivity::sofc as the corresponding
user-defined function.
viii.Retain the default values for the other parameters and click Change/Create.
Define the conditions at the anode, the cathode, the interface between the anode and current col-
lector, the interface between the cathode and the current collector, the anode inlet, and the cathode
inlet boundaries according to your problem specification.
Note that sources only need to be hooked to the mass, species, and energy equation in a single
fluid zone in order for the ANSYS Fluent SOFC With Unresolved Electrolyte Model to function properly
(but can be hooked to all zones if you so choose). ANSYS Fluent does not rely on cell or thread ref-
erencing in the sources in order to cover the solution domain.
a. In the Multigrid tab of the Advanced Solution Controls dialog box, set the cycle type for h2, h2o,
and o2 to V-cycle. For serial calculations, set the cycle type for Energy and User-defined Scalar-0 to
W-cycle or F-cycle. For parallel calculations, select the F-cycle option for both.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
344 of ANSYS, Inc. and its subsidiaries and affiliates.
Setting the Parameters for the SOFC With Unresolved Electrolyte Model
In the Residual Monitors dialog box, set the Convergence Criterion for all equations to 1e-08.
The current density in UDM-0 is a conservative flux of electricity ( ). Performing an area integral
over the electrolyte surface will sum to the total current ( ). That value is computed at the electrolyte
faces during the electric field solution. The values in UDM-4 through UDM-6 contain cell-centered values
of the current density vector. These are not, and cannot be, conservative, so depending on the material
conductivity and the geometric configuration, these can sometimes unavoidably produce values that
do not match the UDM values. The same issues exist when interpolating velocity values to obtain the
mass fluxes.
Note that, by default, the ANSYS Fluent SOFC With Unresolved Electrolyte Model defines a single user-
defined scalar:
Note
For field variables that are stored in UDM, use the corresponding variables for post processing.
Postprocessing the UDM itself is not recommended.
For reviewing simulation results in CFD Post for cases involving UDM or UDS, export the
solution data as CFD-Post-compatible file (.cdat) in Fluent and then load this file into CFD-
Post.
6.5. Setting the Parameters for the SOFC With Unresolved Electrolyte
Model
You can specify the general settings for the SOFC With Unresolved Electrolyte Model using the Model
Parameters tab in the SOFC Model dialog box.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 345
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
Figure 6.2: The Model Parameters Tab in the SOFC Model Dialog Box
From this tab, you can set the various parameters for the SOFC With Unresolved Electrolyte Model such
as total system current, electrolyte thickness, electrolyte resistivity, and so on.
The Enable Electrolyte Conductivity Submodel option allows the ionic conductivity (or resistivity) of
the electrolyte to change as a function of temperature. At the moment, there is one correlation that
provides ionic conductivity (or resistivity) of the electrolyte as function of temperature.
(6.1)
Important
Note that this is valid only for temperatures ranging from 1073 K to 1373 K.
By turning off the Enable Surface Energy Source option, ANSYS Fluent excludes the heat addition due
to electrochemistry and all the reversible processes. This option should be turned on at all times.
The Enable Volumetric Energy Source option includes the ohmic heating throughout the electrically
conducting zones. You should keep this option turned off (to avoid slowing the convergence rates)
until a certain rate of convergence for the potential field has been achieved, at which point, you should
turn the option on manually. Note that this option is important so that the solution can account for
the effects of the internal Ohmic heating.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
346 of ANSYS, Inc. and its subsidiaries and affiliates.
Setting Up the Electrochemistry Parameters
The Disable CO Electrochemistry is enabled if there is carbon monoxide (CO) in the fuel line and if
you do not want to include the CO in the electrochemistry.
Since the calculations are very sensitive to large current fluctuations early in the solution process, it is
recommended that you use 0.3 or 0.4 for the Current Under-Relaxation Factor for a more effective
solution.
The leakage current is the total amount of current due to the leakage of oxidizer to the fuel side (through
the electrolyte) and the electric current across the electrolyte due to any short circuit. You can specify
a value for the leakage current under Leakage Current Density.
If the leakage current density is temperature-dependent, you can specify your own temperature-depend-
ent implementation of the leakage current density by performing the following steps:
1. Make the required changes to Leakage_Current_Density (real T) which is a real function in the
user-modifiable source code, constit.c.
For more information, see Compiling the Customized Solid Oxide Fuel Cell With Unresolved Electrolyte
Source Code (p. 352).
The Converge to Specified System Voltage is used when you want to specify a system voltage instead
of system current as an input.
The Set Individual Electrical Boundary Condition from Boundary Conditions Task Page option,
when enabled, allows you to directly specify the current density or voltage for each individual current-
collecting boundary using the ANSYS Fluent Boundary Conditions task page, This allows you to apply
multiple current types or multiple voltage types (either constant or variable) to your boundary conditions.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 347
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
Figure 6.3: The Electrochemistry Tab in the SOFC Model Dialog Box
In the Electrochemistry tab, you can set the anode and cathode exchange current density, the anode
and cathode mole fraction reference values, the concentration exponents, the Butler-Volmer transfer
coefficients, and the temperature-dependent exchange current density.
You can specify a value for the exchange current density at the anode (the default value is 1000
) using the Anode Exchange Current Density field. Likewise, you can specify a value for the
exchange current density at the cathode (the default value is 100 ) using the Cathode Ex-
change Current Density field.
You can also specify Mole Fraction Reference Values (Equation 5.18 (p. 332)-Equation 5.20 (p. 332)) for
the fuel cell reactants in the Electrochemistry tab. By default, the reference value for is 0.8, the
reference value for is 0.21, and the reference value for is 0.2.
The Butler-Volmer transfer coefficients can be set in the Electrochemistry tab as well. These coefficients
are the and from Equation 5.15 (p. 331) for both the anode and the cathode reactions.
(6.2)
Remember that has anodic and cathodic values at both the cathode and the anode. By default, the
value of is set to 0.5 because of the nearly universal assumption that there is a symmetric balance
between the forward and backward reactions. In most cases, these default values will be sufficient.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
348 of ANSYS, Inc. and its subsidiaries and affiliates.
Setting Up the Electrode-Electrolyte Interfaces
If you find yourself changing the Butler-Volmer transfer coefficients, or if you have some other rate-
limiting reaction in your fuel cell simulation, you may also want to consider changing the exponents
for the stoichiometric coefficients for the fuel cell reactants. These exponents can be specified in the
Electrochemistry tab. By default, the exponent values for , , and are 0.5.
The Enable Temperature Dependant I_0 option allows the exchange current density to change as a
function of temperature in an exponential fashion
(6.3)
where you can provide the values for the constants and .
Figure 6.4: The Electrolyte and Tortuosity Tab in the SOFC Model Dialog Box
b. Select the surface that represents the anode electrode interface with the electrolyte from the corres-
ponding Zone(s) list
c. Click Apply.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 349
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
c. As required, assign tortuosity values to any porous zones in your simulation. In a porous zone, the mass
diffusion coefficient is reduced as follows due to the porosity effect:
(6.4)
There typically are no standard means of measuring tortuosity as it must be either measured
experimentally or tuned to match other experimental data. Tortuosity value may typically be in
the range of 2 to 4, although you can use much higher values.
d. Click Apply.
You can do this for as many zones as you need. When you are finished setting up the anode interface,
click the OK button.
Figure 6.5: The Electric Field Tab in the SOFC Model Dialog Box
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
350 of ANSYS, Inc. and its subsidiaries and affiliates.
User-Accessible Functions for the Solid Oxide Fuel Cell With Unresolved Electrolyte
Model
Here, you can designate conductive regions and specify their conductivity, assign boundaries to be
contact surfaces and specify the contact resistances, as well as specify which surfaces are grounded
and which surfaces exhibit a current.
The Voltage Tap Surface is the surface that is grounded (that is, ). The Current Tap Surface is
the surface that current is being drawn from (that is, is assigned a value).
6.9. User-Accessible Functions for the Solid Oxide Fuel Cell With Unre-
solved Electrolyte Model
You can directly incorporate your own formulations and data for the properties of the solid oxide fuel
cell model using the constit.c source code file.
The following listing represents a description of the contents of the constit.c source code file:
real Nernst (real sp_a[], real sp_c[], real P_a, real P_c, real T_a, real
T_c, real *DNDY)
Returns the Nernst potential using Equation 5.9 (p. 330).
real Activation (real Y[], real P, real T, real i, real i_0, real alpha_a,
real alpha_b, int species, real *dA_di)
Returns the activation overpotential by solving Equation 5.15 (p. 331).
real Leakage_Current_Density(realT)
Returns the leakage current density specified in the SOFC Model dialog box and can be overwritten as a
function of temperature.
For more information, see Compiling the Customized Solid Oxide Fuel Cell With Unresolved Electrolyte
Source Code (p. 352).
6.9.1. Compiling the Customized Solid Oxide Fuel Cell With Unresolved Electrolyte Source Code
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 351
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
6.9.1. Compiling the Customized Solid Oxide Fuel Cell With Unresolved Elec-
trolyte Source Code
This section includes instructions on how to compile a customized Solid Oxide Fuel Cell With Unresolved
Electrolyte user-defined module. Note that you can also refer to the file INSTRUCTIONS-CLIENT that
comes with your distribution (see addons/sofc).
Important
It is assumed that you have a basic familiarity with compiling user-defined functions (UDFs).
For an introduction on how to compile UDFs, refer to the Fluent Customization Manual.
You will first want to use a local copy of the sofc directory in the addons directory before you recom-
pile the Solid Oxide Fuel Cell With Unresolved Electrolyte module.
Important
The custom version of the library must be named according to the convention used by
ANSYS Fluent: for example, sofc.
4. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Solid
Oxide Fuel Cell With Unresolved Electrolyte module.
where your_arch is lnx86 on LINUX, or ultra on the Sun operating system, and so on.
The following example demonstrates the steps required to set up and run a customized version of the
Fuel Cell and Electrolysis module that is located in a folder call home/sample:
1. Make a directory.
mkdir -p /home/sample
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
352 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Text User Interface
3. Using a text editor, make the appropriate changes to the constit.c file located in
/home/sample/sofc/src/constit.c
5. Set the FLUENT_ADDONS environment variable (using CSH, other shells will differ).
setenv FLUENT_ADDONS /home/sample
6. Start ANSYS Fluent and load the customized module using the text interface command.
2. Make sure that the $FLUENT_INC environment variable is correctly set to the current ANSYS Fluent in-
stallation directory (for example, ANSYS Inc\v170\fluent).
6. Define the FLUENT_ADDONS environment variable to correspond to your customized version of the Solid
Oxide Fuel Cell With Unresolved Electrolyte module.
6.10. Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Text
User Interface
All of the features for the Solid Oxide Fuel Cell With Unresolved Electrolyte Model that are available
through the graphical user interface are also available through text user interface commands.
Once the fuel cell module is loaded (see Loading the Solid Oxide Fuel Cell With Unresolved Electrolyte
Module (p. 337)), you can access the text user interface through the Console Window under sofc-
model. A listing of the various text commands is as follows:
sofc-model/
SOFC model menu
enable-sofc-model?
Enable/disable SOFC model
model-parameters
Set model parameters
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 353
Using the Solid Oxide Fuel Cell With Unresolved Electrolyte Model
electrochemistry
Set electrochemistry parameters
anode-interface
Set fuel cell anode interface
cathode-interface
Set fuel cell cathode interface
tortuosity-interface
Set fuel cell tortuosity interface
electric-field-model/
Electric field model
voltage-tap
Set voltage tap surface
current-tap
Set current tap surface
conductive-regions
Set conductive regions
contact-resistance-regions
Set contact resistance regions
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
354 of ANSYS, Inc. and its subsidiaries and affiliates.
Bibliography
[1] Fuel Cell Handbook (5th Edition). E G & G Services and Parsons Inc. and Science Applications Interna-
tional Corporation. 2000.
[2] J.C. Barrett and C.F. Clement. "Growth rates for liquid drops". J. Aerosol. Sci.. 19(2). 223-242. 1988.
[3] Brandon M. Eaton. "One-dimensional, Transient Model of Heat, Mass, and Charge Transfer in a Proton
Exchange Membrane". M.S. Thesis. 2001.
[4] A. A. Kulikovsky, J. Divisek, and A. A. Kornyshev. "Modeling the Cathode Compartment of Polymer
Electrolyte Fuel Cells: Dead and Active Reaction Zones". Journal, Electrochemical Society. 146(11).
39813991. 1999.
[5] S. Mazumder and J. V. Cole . Rigorous 3-D Mathematical Modeling of PEM Fuel Cells II. Model Predictions
with Liquid Water Transport". Journal, Electrochemical Society. 150(11). A15101517. 2003.
[6] J. H. Nam and M. Karviany. "Effective Diffusivity and Water-Saturation Distribution in Single- and Two-
layer PEMFC Diffusion Medium". Int. Journal Heat Mass Transfer. 2003.
[7] J. S. Newman. Electrochemical Systems. Prentice Hall. Englewood Cliffs, New Jersey 1973.
[8] T. V. Nguyen. "Modeling Two-Phase Flow in the Porous Electrodes of Proton Exchange Membrane Fuel
Cells Using the Interdigitated Flow Fields". Tutorials in Electrochemical Engineering Mathematical
Modeling. 99(14). 222241. 1999.
[9] U. Pasaogullari and C-Y. Wang. Two-Phase transport and the role of micro-porous layer in polymer
electrolyte fuel cells. Electrochimica Acta. 49(25). 4359-4369. 2004.
[10] H. Scholz. "Modellierung und Untersuchung des Wrme- und Stofftransports und von Flutungsphno-
menen in Niedertemperatur-PEM-Brennstoffzellen". PhD Thesis. 2015.
[11] T. E. Springer, T. A. Zawodzinski, and S. Gottesfeld. "Polymer Electrolyte Fuel Cell Model". Journal,
Electrochemical Society. 138. 23342342. 1991.
[12] Sukkee Um, C. Y. Wang, and K. S. Chen. Computational Fluid Dynamics Modeling of Proton Exchange
Membrane Fuel Cells. Journal, Electrochemical Society. 147(12). 44854493. 2000.
[13] H. Wu, X. Li and P. Berg. On the modeling of water transport in polymer electrolyte membrane fuel
cells. Electrochimica Acta. 54(27). 6913-6927. 2009.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 355
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
356 of ANSYS, Inc. and its subsidiaries and affiliates.
Part VI: ANSYS Fluent Magnetohydrodynamics (MHD) Module
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. ccclix
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
ccclx of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Introduction
The Magnetohydrodynamics (MHD) module is provided as an add-on module with the standard ANSYS
Fluent licensed software.
This document describes the ANSYS Fluent MHD model. Magnetohydrodynamic Model Theory (p. 363)
provides theoretical background information. Implementation (p. 367) summarizes the UDF-based software
implementation. Instructions for getting started with the model are provided in Using the ANSYS Fluent
MHD Module (p. 369). Appendix A (p. 383) provides a condensed overview on how to use the MHD
model, while Appendix B (p. 387) contains definitions for the magnetic field, Appendix C (p. 389) describes
the external magnetic field data format, and Appendix D (p. 391) lists the text commands in the MHD
model.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 361
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
362 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Magnetohydrodynamic Model Theory
This chapter presents an overview of the theory and the governing equations for the mathematical
models used in ANSYS Fluent to predict flow in an electromagnetic field.
2.1. Introduction
2.2. Magnetic Induction Method
2.3. Electric Potential Method
2.1. Introduction
The coupling between the fluid flow field and the magnetic field can be understood on the basis of
two fundamental effects: the induction of electric current due to the movement of conducting material
in a magnetic field, and the effect of Lorentz force as the result of electric current and magnetic field
interaction. In general, the induced electric current and the Lorentz force tend to oppose the mechanisms
that create them. Movements that lead to electromagnetic induction are therefore systematically braked
by the resulting Lorentz force. Electric induction can also occur in the presence of a time-varying mag-
netic field. The effect is the stirring of fluid movement by the Lorentz force.
(2.2)
(2.3)
(2.4)
where (Tesla) and (V/m) are the magnetic and electric fields, respectively, and and are the in-
duction fields for the magnetic and electric fields, respectively. q ( ) is the electric charge density,
and ( ) is the electric current density vector.
where and are the magnetic permeability and the electric permittivity, respectively. For sufficiently
conducting media such as liquid metals, the electric charge density q and the displacement current
are customarily neglected [1] (p. 393).
In studying the interaction between flow field and electromagnetic field, it is critical to know the current
density due to induction. Generally, two approaches may be used to evaluate the current density.
One is through the solution of a magnetic induction equation; the other is through solving an electric
potential equation.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 363
Magnetohydrodynamic Model Theory
In general, Ohms law that defines the current density is given by:
(2.7)
where is the electrical conductivity of the media. For fluid velocity field in a magnetic field , Ohms
law takes the form:
(2.8)
From Ohms law and Maxwells equation, the induction equation can be derived as:
(2.9)
From the solved magnetic field , the current density can be calculated using Amperes relation as:
(2.10)
Generally, the magnetic field in a MHD problem can be decomposed into the externally imposed
field and the induced field due to fluid motion. Only the induced field must be solved.
From Maxwells equations, the imposed field satisfies the following equation:
(2.11)
where is the electrical conductivity of the media in which field is generated. Two cases need to
be considered.
With , the induction equation (Equation 2.9 (p. 364)) can be written as:
(2.14)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
364 of ANSYS, Inc. and its subsidiaries and affiliates.
Electric Potential Method
For the induction equation Equation 2.14 (p. 364) or Equation 2.16 (p. 365), the boundary conditions for
the induced field are given by:
(2.18)
where the subscripts denote the normal and tangential components of the field and is specified by
you. For an electrically insulating boundary, as at the boundary, from Amperes relation one has
at the boundary.
where and are the scalar potential and the vector potential, respectively. For a static field and as-
suming , Ohms law given in Equation 2.8 (p. 364) can be written as:
(2.20)
For sufficiently conducting media, the principle of conservation of electric charge gives:
(2.21)
(2.23)
for an insulating boundary, where is the unit vector normal to the boundary, and
(2.24)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 365
Magnetohydrodynamic Model Theory
for a conducting boundary, where is the specified potential at the boundary. The current density
can then be calculated from Equation 2.20 (p. 365).
With the knowledge of the induced electric current, the MHD coupling is achieved by introducing addi-
tional source terms to the fluid momentum equation and energy equation. For the fluid momentum
equation, the additional source term is the Lorentz force given by:
(2.25)
which has units of N/m in the SI system. For the energy equation, the additional source term is
the Joule heating rate given by:
(2.26)
For charged particles in an electromagnetic field, the Lorentz force acting on the particle is given by:
(2.27)
where is the particle charge density ( ) and is the particle velocity. The force has
units of .
For multiphase flows, assuming that the electric surface current at the interface between phases can
be ignored, the electric conductivity for the mixture is given by:
(2.28)
where and are respectively the electric conductivity and volume fraction of phase . is used in
solving the induction equations.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
366 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Implementation
The MHD model is implemented using user-defined functions (UDF) as an ANSYS Fluent add-on module,
which is loaded into ANSYS Fluent at run time. The model is accessed through a number of UDF schemes.
The magnetic induction equation given by Equation 2.14 (p. 364) or Equation 2.16 (p. 365) and the electric
potential equation given by Equation 2.22 (p. 365) are solved through user-defined scalar (UDS) transport
equations. Other model-related variables such as the external magnetic field data, current density,
Lorentz force and Joule heat are stored as user-defined memory (UDM) variables. The MHD model setup
and parameters are entered using the MHD Model graphical user interface (GUI) dialog box and a set
of text user interface (TUI) commands described in Using the ANSYS Fluent MHD Module (p. 369). Detailed
information can be found in the following sections:
3.1. Solving Magnetic Induction and Electric Potential Equations
3.2. Calculation of MHD Variables
3.3. MHD Interaction with Fluid Flows
3.4. MHD Interaction with Discrete Phase Model
3.5. General User-Defined Functions
The convection and the diffusion terms of the scalar equations are defined using user functions
DEFINE_UDS_FLUX(mhd_flux, ..., ns) and DEFINE_DIFFUSIVITY (mhd_ magnetic_dif-
fusivity, ..., ns) respectively. The user-defined scalar equation is identified by the scalar index
ns.
The source terms to the induction equations and the potential equation are implemented using user
function DEFINE_SOURCE(mhd_mag_source, ..., eqn) and DEFINE_SOURCE
(mhd_phi_source, ..., eqn) respectively, where eqn identifies the scalar equations.
For transient cases, the additional unsteady source term is introduced through the user function
DEFINE_UDS_UNSTEADY(mhd_unsteady_source, ..., ns), where ns identifies the scalar
being solved.
The induction and potential equations can also be solved in solid zones, in which case the fluid velocity
terms in the equations are not considered. For multiphase flows, the MHD equations are solved in the
mixture domain only.
The wall boundary conditions are implemented through user profile functions (DEFINE_PRO-
FILE(mhd_bc_...), and are applied to the Cartesian components of the induced magnetic field
vector or to the electric potential. For external wall boundaries, three types of boundary conditions
(electrically insulating, conducting, and "thin wall"), can be applied. The thin wall type boundary refers
to an external wall where a 1D magnetic or electric potential diffusion normal to the boundary is assumed,
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 367
Implementation
and the wall material and the thickness are specified for the boundary. For internal wall boundaries,
that is the boundaries between fluid/solid or solid/solid zones, a coupled boundary condition is applied.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
368 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4: Using the ANSYS Fluent MHD Module
This chapter provides basic instructions to install the magnetohydrodynamics (MHD) module and solve
MHD problems in ANSYS Fluent. It assumes that you are already familiar with standard ANSYS Fluent
features, including the user-defined function procedures described in the Fluent Customization Manual.
Appendix A (p. 383) also outlines the general procedure for using the MHD model. This chapter describes
the following:
4.1. MHD Module Installation
4.2. Loading the MHD Module
4.3. MHD Model Setup
4.4. MHD Solution and Postprocessing
4.5. Limitations
Select the MHD model by entering the module number 1. During the loading process a scheme library
containing the graphical and text user interface, and a UDF library containing a set of user defined
functions are loaded into ANSYS Fluent. A message Addon Module: mhd...loaded! is displayed at the
end of the loading process.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 369
Using the ANSYS Fluent MHD Module
The basic set up of the MHD model is performed automatically when the MHD module is loaded suc-
cessfully. The set up includes:
Allocating the required number of user-defined scalars and memory locations naming of:
Additional source terms for the fluid momentum and energy equations
DPM related functions are also set, if the DPM option has been selected in the ANSYS Fluent case set up.
The MHD module set up is saved with the ANSYS Fluent case file. The module is loaded automatically
when the case file is subsequently read into ANSYS Fluent. Note that in the saved case file, the MHD
module is saved with the absolute path. Therefore, if the locations of the MHD module installation or
the saved case file are changed, ANSYS Fluent will not be able to load the module when the case file
is subsequently read.
To unload the previously saved MHD module library, open the UDF Library Manager dialog box
and reload the module as described above. Note that the previously saved MHD model setup and
parameters are preserved.
Both the MHD Model dialog box and TUI commands are designed for the following tasks:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
370 of ANSYS, Inc. and its subsidiaries and affiliates.
MHD Model Setup
Operations of these tasks through the MHD Model dialog box are described in the following sections.
The set of MHD text commands are listed in Appendix D (p. 391).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 371
Using the ANSYS Fluent MHD Module
For the Magnetic Induction method, 2 or 3 user-defined scalars are allocated for the solution of the in-
duced magnetic field in 2D or 3D cases. The scalars are listed as B_x, B_y and B_z representing the
Cartesian components of the induced magnetic field vector. The unit for the scalar is Tesla.
For the Electrical Potential method, 1 user-defined scalar is solved for the electric potential field. The
scalar is listed as and has the unit of Volt.
Table 4.1: User-Defined Scalars in MHD Model (p. 372) lists the user-defined scalars used by the two
methods.
With the Patch option enabled, the AC field can be expressed as a function of time (specified by Fre-
quency), and space (specified by wavelength, propagation direction and initial phase offset). The space
components are set under the B0 Component, as in Figure 4.3: The MHD Model Dialog Box for Patching
an External Magnetic Field (p. 373).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
372 of ANSYS, Inc. and its subsidiaries and affiliates.
MHD Model Setup
Figure 4.3: The MHD Model Dialog Box for Patching an External Magnetic Field
You can also specify a Moving Field with a wave form that is either a sinusoidal or a square wave
function (Figure 4.4: The MHD Model Dialog Box for Specifying a Moving Field (p. 374)). Definitions for
the sinusoidal and square wave forms of patched magnetic fields are provided in Appendix B (p. 387).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 373
Using the ANSYS Fluent MHD Module
Figure 4.4: The MHD Model Dialog Box for Specifying a Moving Field
Selecting Import under the B0 Input Option in the MHD Model dialog box, as seen in Figure 4.5: The
MHD Model Dialog Box for Importing an External Magnetic Field (p. 375), will result in the import of
magnetic field data. The data filename can be entered in the B0 Data File Name field, or selected from
your computer file system using the Browse... button. Magnetic data can also be generated using a
third-party program such as MAGNA. The required format of the magnetic field data file is given in
Appendix C (p. 389).
When using the Import option, the B0 Data Media is either set to Non-Conducting or Conducting,
depending on the assumptions used in generating the magnetic field data. (These choices correspond
to Case 1 and Case 2, respectively, as discussed in Magnetic Induction Method (p. 364).)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
374 of ANSYS, Inc. and its subsidiaries and affiliates.
MHD Model Setup
Figure 4.5: The MHD Model Dialog Box for Importing an External Magnetic Field
The Field Type is determined by the field data from the data file. The choice of either the DC Field or
the AC Field option in the dialog box is irrelevant if the import data is either DC or AC. However, selection
of both options indicates that data of both field types are to be imported from the data file, and super-
imposed together to provide the final external field data. Make sure that the data file contains two
sections for the required data. See Appendix C (p. 389) for details on data file with two data sections.
The Apply External Field... button opens the Apply External B0 Field dialog box as shown in Fig-
ure 4.6: Apply External B0 Field Dialog Box (p. 375). To apply the external field data to zones or regions
in the computational domain, select the zone names or register names of marked regions from the
dialog box and click the Apply button.
The Reset External Field button sets the external magnetic field variable to zero.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 375
Using the ANSYS Fluent MHD Module
For cell zones, only the associated material can be changed and its properties modified. Figure 4.7: Cell
Boundary Condition Setup (p. 376) shows the dialog box for cell zone boundary condition setup. The
cell zone material can be selected from the Material Name drop-down list.
Note that the materials available in the list are set in the general ANSYS Fluent case set up. Refer to
the ANSYS Fluent User Guide for details on adding materials to an ANSYS Fluent case. The properties
of the selected material can be modified in the Boundary Condition tab by clicking Edit... to the right
of the material name. This opens the Edit Material dialog box, as shown in Figure 4.8: Editing Material
Properties within Boundary Condition Setup (p. 377). The material properties that may be modified include
the electrical conductivity and magnetic permeability. The material electrical conductivity can be set
as constant, a function of temperature in forms of piecewise-linear, piecewise-polynomial or polynomial,
or as a user-defined function. The material magnetic permeability can only be set as a constant.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
376 of ANSYS, Inc. and its subsidiaries and affiliates.
MHD Model Setup
For wall boundaries, the boundary condition can be set as an Insulating Wall, Conducting Wall,
Coupled Wall or Thin Wall. The dialog box for wall boundary condition set up is shown in Figure 4.9: Wall
Boundary Condition Setup (p. 377).
The insulating wall is used for boundaries where there is no electric current going through the boundary.
The conducting wall is used for boundaries that are perfect conductors.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 377
Using the ANSYS Fluent MHD Module
The coupled wall should be used for wall boundaries between solid/solid or solid/fluid zones where the
MHD equations are solved.
The thin wall type boundary can be used for external wall that has a finite electrical conductivity.
For conducting walls and thin wall boundaries, the wall material can be selected from the Material
Name drop-down list, and its properties modified through the Edit Material dialog box. A wall thickness
must be specified for thin wall type boundaries.
If the Electric Potential method is selected, the conducting wall boundary is specified by either of
Voltage or Current Density at the boundary, as shown in Figure 4.10: Conducting Wall Boundary
Conditions in Electrical Potential Method (p. 378).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
378 of ANSYS, Inc. and its subsidiaries and affiliates.
MHD Solution and Postprocessing
Figure 4.11: Solution Control Tab in the MHD Model Dialog Box
You have the option to enable or disable the Solve MHD Equation. When the Solve MHD Equation
is enabled, you have the choice to Include Lorentz Force and/or Include Joule Heating in the solution
of flow momentum and energy equations. The under-relaxation factor for the MHD equations can also
be set.
The strength of the imposed external magnetic field can be adjusted by specifying and applying scale
factors to the external DC and/or AC magnetic field data.
When an ANSYS Fluent case is initialized, all user-defined scalar and memory variables are set to zero.
The external magnetic field data is set from the External Field B0 tab in the MHD Model dialog box.
The Initialize MHD button under the Solution Control tab can be used to initialize the model during
an ANSYS Fluent solution process. It is used when MHD effects are added to a fully or partially solved
flow field, or when the model parameters are changed during an MHD calculation. It only clears the
scalar variables and most of the memory locations used in the MHD model, the memory variables for
the external magnetic field data are preserved.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 379
Using the ANSYS Fluent MHD Module
4.4.2. Iteration
It is often an effective strategy to begin your MHD calculations using a previously-converged flow field
solution. With this approach, the induction equations themselves are generally easy to converge. The
under-relaxation factors for these equations can be set to 0.8 0.9, although for very strong magnetic
fields, smaller values may be needed. For the electric potential equation, the convergence is generally
slow. However, the under-relaxation value for this equation should not be set to 1. As additional source
terms are added to the momentum and energy equations, the under-relaxation factors for these equations
should generally be reduced to improve the rate of convergence. In case of convergence difficulties,
another helpful strategy is to use the B0 Scale Factor in the Solution Control tab (Figure 4.2: The MHD
Model Dialog Box (p. 371)). This will gradually increase the MHD effect to its actual magnitude through
a series of restarts. When the strength of the externally imposed magnetic field is strong, it is advisable
to start the calculation with a reduced strength external field by applying a small scale factor. When
the calculation is approaching convergence the scale factor can be increased gradually until the required
external field strength is reached.
4.4.3. Postprocessing
You can use the standard postprocessing facilities of ANSYS Fluent to display the MHD calculation results.
Vectors of MHD variables, such as the magnetic field vector and current density vector, can be displayed
using
The vector fields of the MHD variables are listed in the Vectors of drop-down list in the Vectors dialog
box. Table 4.2: MHD Vectors (p. 380) lists the MHD related vector fields.
Note
For field variables that are stored in UDM, use the corresponding variables for post processing.
Post processing the UDM itself is not recommended.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
380 of ANSYS, Inc. and its subsidiaries and affiliates.
Limitations
For reviewing simulation results in CFD Post for cases involving UDM or UDS, export the
solution data as CFD-Post-compatible file (.cdat) in Fluent and then load this file into CFD-
Post.
4.5. Limitations
Many MHD applications involve the simultaneous use of other advanced ANSYS Fluent capabilities such
as solidification, free surface modeling with the volume of fluid (VOF) approach, DPM, Eulerian multiphase,
and so on. You should consult the latest ANSYS Fluent documentation for the limitations that apply to
those features. In addition, you should be aware of the following limitations of the MHD capability.
As explained in Magnetohydrodynamic Model Theory (p. 363), the MHD module assumes a sufficiently con-
ductive fluid so that the charge density and displacement current terms in Maxwells equations can be
neglected. For marginally conductive fluids, this assumption may not be valid. More information about this
simplification is available in the bibliography.
For electromagnetic material properties, only constant isotropic models are available. Multiphase volume
fractions are not dependent on temperature, species concentration, or field strength. However, sufficiently
strong magnetic fields can cause the constant-permeability assumption to become invalid.
You must specify the applied magnetic field directly. The alternative specification of an imposed electrical
current is not supported.
In the case of alternating-current (AC) magnetic fields, the capability has been designed for relatively low
frequencies; explicit temporal resolution of each cycle is required. Although not a fundamental limitation,
the computational expense of simulating high-frequency effects may become excessive due to small required
time step size. Time-averaging methods to incorporate high-frequency MHD effects have not been imple-
mented.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 381
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
382 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix A. Guidelines For Using the ANSYS Fluent MHD Model
This appendix provides a basic outline for installing the magnetohydrodynamics (MHD) module and
solving MHD problems in ANSYS Fluent.
A.1. Installing the MHD Module
A.2. An Overview of Using the MHD Module
Important
While Using the ANSYS Fluent MHD Module (p. 369) covers much of the same material in
greater detail, this appendix presents a set of guidelines for solving typical MHD problems
with ANSYS Fluent, with occasional references to Using the ANSYS Fluent MHD Module (p. 369)
where more information can be found.
only after a valid ANSYS Fluent case file has been set or read.
Once the MHD model is installed, beneath the mhd directory there are two subdirectories: a lib directory,
and a directory corresponding to your specific architecture, ntx86 for example. The lib directory
holds a Scheme code called addon.bin that contains the MHD module graphical interface. The spe-
cific architecture directory, ntx86 for example, contains the following subdirectories that hold various
ANSYS Fluent files:
2d 2ddp 3d 3ddp
2d_host 2ddp_host 3d_host 3ddp_host
2d_node 2ddp_node 3d_node 3ddp_node
To begin modeling your MHD simulation, you need to start an appropriate ANSYS Fluent session.
Choose from either the 2D, 3D, Double Precision, or the parallel version of ANSYS Fluent.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 383
Guidelines For Using the ANSYS Fluent MHD Model
You can have ANSYS Fluent read in your mesh file, a previously saved non-MHD case file, or a pre-
viously saved MHD case file.
Important
Note that if you read in a new mesh file, you need to perform the appropriate mesh
check and mesh scale procedures.
The MHD module is loaded into ANSYS Fluent using the text command
and entering the corresponding module number (Loading the MHD Module (p. 369)).
The MHD Model dialog box is accessed using the graphical user interface (GUI):
If the MHD model is not enabled after the MHD module is loaded for the first time, you can enable
it by clicking the Enable MHD button, which will display the expanded dialog box (Enabling the
MHD Model (p. 371)).
The method used for the MHD calculation can be selected under MHD Method. The two methods
are
This is done by entering values for the B0 components in the External Field B0 tab. B0 input options
can either be
Patched, or
Imported
The Field Type will either be the DC Field or the AC Field. The Field Type is determined by the
field data from the data file. Refer to Applying an External Magnetic Field (p. 372) for details on ap-
plying an external magnetic field.
Under the Boundary Condition tab, cell zones and wall boundaries can be selected as well as the
corresponding zone type.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
384 of ANSYS, Inc. and its subsidiaries and affiliates.
An Overview of Using the MHD Module
Cell zone materials are selected from the Material Name drop-down list. The properties of the se-
lected material can be modified by clicking on the Edit... button to the right of the material name.
Note that the materials available in the list are set in the general ANSYS Fluent case setup.
Setup Materials
The material properties that may be modified include the electrical conductivity and magnetic per-
meability.
Wall boundary conditions can be set as an Insulating Wall, Conducting Wall, Coupled Wall or
Thin Wall (see Setting Up Boundary Conditions (p. 376)).
under-relaxation factors are set (reasonable under-relaxation factors for the MHD equations are 0.8
0.9).
Scale factors can be used to adjust the strength of the imposed external magnetic field. As the calculation
approaches convergence, the scale factor in the Solution Control tab can be increased gradually until
the required external field strength is reached (Solution Controls (p. 378)).
Set the number of iterations. It is often an effective strategy to begin your MHD calculations using
a previously-converged flow field solution. With this approach, the induction equations themselves
are generally easy to converge. For more information, see Iteration (p. 380).
You can use the standard postprocessing facilities of ANSYS Fluent to display the results of an MHD
calculation. Contours of MHD variables can be displayed.
The MHD variables can be selected from the variable list. Vectors of MHD variables, such as the
magnetic field vector and current density vector, can be displayed using custom vectors.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 385
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
386 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix B. Definitions of the Magnetic Field
The sinusoidal form of the magnetic field is defined as:
(1)
where is the mean vector, is the amplitude vector, is defined as the propagation vector, is
the position vector of an arbitrary point. , and are the , and direction cosines
respectively. The quantities , , and are the frequency, wavelength, and phase offset, respectively.
For a non-moving field the propagation vector is zero. For a static field only applies.
(2)
The definition of the propagation vector is the same as for the sinusoidal form.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 387
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
388 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix C. External Magnetic Field Data Format
The external magnetic field data file is in text format and of the following structure:
...
The first line is an identification tag for the data file. The second line defines the number of data points
in the , and directions. The next three lines define the ranges in , and directions. The data
points are assumed to be evenly distributed along each direction. Line 6 defines the AC field flag and
frequency. When nAC = 0, the magnetic field is static. For AC field, nAC = 1 and Freq is the frequency
in Hz.
The rest of the data file contains the magnetic field data points. Each line defines the components of
the real and imaginary parts of the magnetic field vector on one data point. The data points are indexed
as:
(1)
The data is listed in the ascending order from 1 to , where is the total number of data points given
by = .
For magnetic fields composed of both DC and AC fields, the entire file structure described above is re-
peated for the DC and AC parts. These two sections within the same file will be imported into ANSYS
Fluent and stored separately. The order of the DC and AC sections of the file is not important.
The imported data is interpreted as a snapshot of the applied magnetic field at an instant in time.
Complex form is used to accommodate oscillating/moving fields. Thus, using complex numbers, and
with reference to the quantities defined in Appendix B (p. 387),
(2)
For a DC field,
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 389
External Magnetic Field Data Format
(3)
For an AC field,
(4)
and
(5)
Note that when the external magnetic field import option is used, the frequency, , read from this file
supersedes the value specified in the GUI.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
390 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix D. MHD Module Text Commands
mhd-models/
Define solver configuration.
enable-mhd?
Enable/disable MHD model.
mhd-method
Select MHD method.
boundary-conditions/
Define MHD boundary conditions
list-zones
List ANSYS Fluent zone information.
fluid
Set fluid zone boundary condition.
solid
Set solid zone boundary condition.
wall
Set wall boundary condition.
b0-scale-factor
Set and apply external magnetic field scale factor.
external-b0-field
Set and apply external magnetic field data.
initialize-mhd
Initialize MHD model.
initialize-dpm
Initialize DPM related MHD variables.
solution-control
Set MHD solution control parameters.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 391
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
392 of ANSYS, Inc. and its subsidiaries and affiliates.
Bibliography
[1] R. Moreau. Magnetohydrodynamics. Kluwer Academic Publishers. 1990.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 393
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
394 of ANSYS, Inc. and its subsidiaries and affiliates.
Part VII: ANSYS Fluent Population Balance Module
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. cccxcvii
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
cccxcviii of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Introduction
In ANSYS Fluent the population balance model is provided as an add-on module with the standard
ANSYS Fluent licensed software.
Several industrial fluid flow applications involve a secondary phase with a size distribution. The size
distribution of particles, including solid particles, bubbles, or droplets, can evolve in conjunction with
transport and chemical reaction in a multiphase system. The evolutionary processes can be a combination
of different phenomena like nucleation, growth, dispersion, dissolution, aggregation, and breakage
producing the dispersion. Thus in multiphase flows involving a size distribution, a balance equation is
required to describe the changes in the particle population, in addition to momentum, mass, and energy
balances. This balance is generally referred to as the population balance. Cases in which a population
balance could apply include crystallization, precipitative reactions from a gas or liquid phase, bubble
columns, gas sparging, sprays, fluidized bed polymerization, granulation, liquid-liquid emulsion and
separation, and aerosol flows.
To make use of this modeling concept, a number density function is introduced to account for the
particle population. With the aid of particle properties (for example, particle size, porosity, composition,
and so on), different particles in the population can be distinguished and their behavior can be described.
ANSYS Fluent offers three solution methods to the population balance equation: discretized population
balance, standard method of moments, and quadrature method of moments.
1.1.The Discrete Method
1.2.The Inhomogeneous Discrete Method
1.3.The Standard Method of Moments
1.4.The Quadrature Method of Moments
The general transport equation for the discrete bin fraction can be written as
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 399
Introduction
(1.1)
Since all bins belong to a single phase in the homogeneous discrete method, the net mass source for
the phase in case of breakage and agglomeration is zero and can be expressed as
(1.2)
This is shown schematically in Figure 1.1: Homogeneous Discrete Method (p. 401) where all bins are ad-
vected by the same phase velocity . In contrast, the inhomogeneous discrete method shown in Fig-
ure 1.2: Inhomogeneous Discrete Method (p. 401) allows bins to be assigned to multiple phases. Here
bins per phase are distributed over phases for a total of bins. Bins and are advected
by phase velocity and so forth. The sum of bin sources in any given phase is not necessarily equal
to zero since bins in a given phase can migrate to another phase through breakage or agglomeration,
thereby creating a net mass source for that phase.
The net mass source for a given phase can be expressed as the sum of the bin sources belonging to
that phase
(1.3)
For breakage and coalescence the sum over all phase sources is zero
(1.4)
(1.5)
Important
The inhomogeneous discrete method is currently limited to breakage and coalescence only.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
400 of ANSYS, Inc. and its subsidiaries and affiliates.
The Standard Method of Moments
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 401
Introduction
In the SMM approach, no assumptions are made about the size distribution, and the moment equations
are formulated in a closed form involving only functions of the moments themselves. However, this
exact closure requirement poses a serious limitation, as aggregation (with the exception of the constant
aggregation kernel) and breakage phenomena cannot be written as functions of moments.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
402 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Population Balance Model Theory
This chapter presents an overview of the theory and the governing equations for the methods used in
ANSYS Fluent to predict particle growth and nucleation.
2.1.The Particle State Vector
2.2.The Population Balance Equation (PBE)
2.3. Solution Methods
2.4. Population Balance Statistics
(2.1)
The local average number density in physical space (that is, the total number of particles per unit
volume) is given by
(2.2)
(2.3)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 403
Population Balance Model Theory
(2.4)
The volume of a single particle is defined as , and therefore the relationship between and
is
(2.8)
The surface area of a single particle, , is defined as . Thus for a cube or a sphere, .
Important
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
404 of ANSYS, Inc. and its subsidiaries and affiliates.
The Population Balance Equation (PBE)
2.2.2.1. Breakage
The breakage rate expression, or kernel [19] (p. 460), is expressed as
where
= breakage frequency; that is, the fraction of particles of volume breaking
per unit time ( )
= probability density function (PDF) of particles breaking from volume
to a particle of volume
(2.9)
The PDF is also known as the particle fragmentation distribution function, or daughter size
distribution. Several functional forms of the fragmentation distribution function have been proposed,
though the following physical constraints must be met: the normalized number of breaking particles
must sum to unity, the masses of the fragments must sum to the original particle mass, and the number
of fragments formed has to be correctly represented.
(2.11)
(2.12)
The following is a list of models available in ANSYS Fluent to calculate the breakage frequency:
Constant value
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 405
Population Balance Model Theory
Luo model
Lehr model
Ghadiri model
Laakkonen model
User-defined model
ANSYS Fluent provides the following models for calculating the breakage PDF:
Parabolic PDF
Laakkonen PDF
User-defined model
The breakage frequency models and the parabolic and generalized PDFs are described in detail in the
sections that follow.
where the original particle has a volume and the daughter particle has a volume . In the previous
expression, is the breakage frequency, and is the normalized daughter particle dis-
tribution function. For binary breakage, the breakage kernel must be symmetrical with respect to .
The general form is the integral over the size of eddies hitting the particle with diameter (and
volume ). The integral is taken over the dimensionless eddy size . The general form is
(2.15)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
406 of ANSYS, Inc. and its subsidiaries and affiliates.
The Population Balance Equation (PBE)
Where is entered through the GUI. See Lehr [16] (p. 459).
The breakage frequency is related to the material properties and impact conditions:
(2.16)
where is the particle density, is the elastic modulus of the granule, and is the interface energy.
is the impact velocity and is the particle diameter prior to breaking. is the breakage constant
and is defined as
(2.17)
(2.18)
where is the liquid phase eddy dissipation, is the surface tension, is the liquid density, is the
gas density, is the parent particle diameter and is the liquid viscosity.
where and are the daughter and parent particle volumes, respectively. This model is a useful al-
ternative to the widely used Luo model because it has a simple expression for the daughter PDF and
therefore requires significantly less computational effort.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 407
Population Balance Model Theory
where and are the daughter and parent particle volumes, respectively. Depending on the value
of the shape factor , different behaviors will be observed in the shape of the particle breakage distri-
bution function. For example, if , the particle breakage has a uniform distribution. If ,a
concave parabola is obtained, meaning that it is more likely to obtain unequally-sized fragments than
equally-sized fragments. The opposite of this is true for . Values outside of the range of 0 to 3
are not allowed, because the PDF cannot have a negative value.
Note that the PDF defined in Equation 2.20 (p. 408) is symmetric about .
Considering the self-similar formulation [26] (p. 460) where the similarity is the ratio of daughter-to-
parent size (that is, ), then the generalized PDF is given by
(2.21)
where is the self-similar daughter distribution [6] (p. 459). The moment of , , is
(2.22)
where
(2.23)
(2.24)
(2.25)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
408 of ANSYS, Inc. and its subsidiaries and affiliates.
The Population Balance Equation (PBE)
(2.26)
where can be 0 or 1, which represents as consisting of 1 or 2 terms, respectively. For each term,
is the weighting factor, is the averaged number of daughter particles, and are the exponents,
and is the beta function. The following constraints are imposed on the parameters in Equa-
tion 2.26 (p. 409) :
(2.27)
(2.28)
(2.29)
In order to demonstrate how to transform the generalized PDF to represent an appropriate daughter
distribution, consider the expressions shown in the tables that follow:
Type
Type Constraints
Equal-size [14] (p. 459)
Attrition [14] (p. 459) 2
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 409
Population Balance Model Theory
Type Constraints
Power Law [30] (p. 460)
In Table 2.3: Daughter Distributions (p. 409), is the Dirac delta function, is a weighting coefficient,
and , , , and are user-defined parameters.
The generalized form can represent the daughter distributions in Table 2.3: Daughter Distributions (p. 409)
by using the values shown in Table 2.5: Values for Daughter Distributions in General Form (p. 410).
Type Constraints
Equal-size 1 N/A N/A N/A N/A
Attrition 0.5 2 1 0.5 2 1
Power 1 1 N/A N/A N/A N/A
Law
Austin 1 1
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
410 of ANSYS, Inc. and its subsidiaries and affiliates.
The Population Balance Equation (PBE)
Important
Note that for the ANSYS Fluent implementation of the generalized form of the PDF, you will
only enter values for , , , , and , and the remaining values ( , , and ) will be
calculated automatically.
2.2.2.7. Aggregation
The aggregation kernel [19] (p. 460) is expressed as
The aggregation kernel has units of , and is sometimes defined as a product of two quantities:
the efficiency of aggregation (that is, the probability of particles of volume coalescing with particles of
volume ).
(2.30)
where particles of volume aggregate with particles of volume to form particles of volume .
The factor is included to avoid accounting for each collision event twice.
(2.31)
Important
The breakage and aggregation kernels depend on the nature of the physical application. For
example, in gas-liquid dispersion, the kernels are functions of the local liquid-phase turbulent
dissipation.
Constant
Luo model
Turbulent model
User-defined model
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 411
Population Balance Model Theory
The Luo, free molecular, and turbulent aggregation functions are described in detail in the sections that
follow.
where is the characteristic velocity of collision of two particles with diameters and .
(2.34)
where
(2.35)
(2.36)
where is a constant of order unity, , and are the densities of the primary and secondary
phases, respectively, and the Weber number is defined as
(2.37)
(2.38)
where is the Boltzmann constant, is the absolute temperature, is the viscosity of the suspending
fluid. This kernel is also known as the Brownian kernel or the perikinetic kernel.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
412 of ANSYS, Inc. and its subsidiaries and affiliates.
The Population Balance Equation (PBE)
teractions. The size of the smallest eddies is the Kolmogorov microscale, , which is expressed as a
function of the kinematic viscosity and the turbulent energy dissipation rate:
(2.39)
viscous subrange mechanism: this is applied when particles are smaller than the Kolmogorov microscale,
inertial subrange mechanism: this is applied when particles are bigger than the Kolmogorov microscale. In
this case, particles assume independent velocities.
For the viscous subrange, particle collisions are influenced by the local shear within the eddy. Based
on work by Saffman and Turner [28] (p. 460), the collision rate is expressed as,
(2.40)
where is a pre-factor that takes into account the capture efficiency coefficient of turbulent collision,
and is the shear rate:
(2.41)
For the inertial subrange, particles are bigger than the smallest eddy, therefore they are dragged by
velocity fluctuations in the flow field. In this case, the aggregation rate is expressed using Abrahamsons
model [1] (p. 459),
(2.42)
The empirical capture efficiency coefficient of turbulent collision describes the hydrodynamic and at-
tractive interaction between colliding particles. Higashitani et al. [11] (p. 459) proposed the following
relationship:
(2.43)
where is the ratio between the viscous force and the Van der Waals force,
(2.44)
Where is the Hamaker constant, a function of the particle material, and is the deformation rate,
(2.45)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 413
Population Balance Model Theory
The nucleation rate is defined through a boundary condition as shown in Equation 2.5 (p. 404).
The solution methods for the inhomogeneous discrete method are based on the discrete method and
therefore share many of the same fundamentals.
(2.46)
where is the density of the secondary phase and is the volume fraction of particle size , defined
as
(2.47)
where
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
414 of ANSYS, Inc. and its subsidiaries and affiliates.
Solution Methods
(2.48)
and is the volume of the particle size . In ANSYS Fluent, a fraction of , called , is introduced as
the solution variable. This fraction is defined as
(2.49)
The nucleation rate appears in the discretized equation for the volume fraction of the smallest size
. The notation signifies that this particular term, in this case , appears in Equation 2.46 (p. 414)
only in the case of the smallest particle size.
The growth rate in is discretized as follows Equation 2.46 (p. 414) [12] (p. 459):
(2.50)
The volume coordinate is discretized as [12] (p. 459) where and is referred to as
the ratio factor.
(2.51)
(2.52)
(2.53)
(2.54)
where and
(2.55)
is the particle volume resulting from the aggregation of particles and , and is defined as
(2.56)
where
(2.57)
If is greater than or equal to the largest particle size , then the contribution to class is
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 415
Population Balance Model Theory
(2.58)
Important
(2.59)
Here
(2.60)
A more mathematically rigorous formulation is given by Ramkrishna [15] (p. 459), where the breakage
rate is expressed as
(2.61)
where
(2.62)
The Ramkrishna formulation can be slow due to the large number of integration points required.
However, for simple forms of , the integrations can be performed relatively easily. The Hagesather
formulation requires fewer integration points and the difference in accuracy with the Ramkrishna for-
mulation can be corrected by a suitable choice of bin sizes.
Important
To keep the computing time reasonable, a volume averaged value is used for the turbulent
eddy dissipation when the Luo model is used in conjunction with the Ramkrishna formulation.
Note
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
416 of ANSYS, Inc. and its subsidiaries and affiliates.
Solution Methods
th
Defining the moment as
(2.63)
and assuming constant particle growth, its transport equation can be written as
(2.64)
where
(2.65)
(2.66)
(2.67)
(2.68)
is the specified number of moments and is the nucleation rate. The growth term is defined as
(2.69)
and reversing the order of integration. From these moments, the parameters describing the gross
properties of particle population can be derived as
(2.71)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 417
Population Balance Model Theory
(2.72)
(2.73)
(2.74)
(2.75)
These properties are related to the total number, length, area, and volume of solid particles per unit
volume of mixture suspension. The Sauter mean diameter, , is usually used as the mean particle size.
To close Equation 2.64 (p. 417), the quantities represented in Equation 2.65 (p. 417) Equation 2.68 (p. 417)
need to be expressed in terms of the moments being solved. To do this, one approach is to assume
size-independent kernels for breakage and aggregation, in addition to other simplifications such as the
Taylor series expansion of the term . Alternatively, a profile of the PSD could be assumed so
that Equation 2.65 (p. 417) Equation 2.68 (p. 417) can be integrated and expressed in terms of the mo-
ments being solved.
In ANSYS Fluent, an exact closure is implemented by restricting the application of the SMM to cases
with size-independent growth and a constant aggregation kernel.
The QMOM provides an attractive alternative to the discrete method when aggregation quantities,
rather than an exact PSD, are desired. Its advantages are fewer variables (typically only six or eight
moments) and a dynamic calculation of the size bins. The disadvantages are that the number of abscissas
may not be adequate to describe the PSD and that solving the Product-Difference algorithm may be
time consuming.
(2.76)
is exact if is a polynomial of order or smaller [5] (p. 459). In all other cases, the closer is
to a polynomial, the more accurate the approximation.
A direct way to calculate the quadrature approximation is by means of its definition through the mo-
ments:
(2.77)
The quadrature approximation of order is defined by its weights and abscissas and can
be calculated by its first moments by writing the recursive relationship for the poly-
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
418 of ANSYS, Inc. and its subsidiaries and affiliates.
Solution Methods
nomials in terms of the moments . Once this relationship is written in matrix form, it is easy to show
that the roots of the polynomials correspond to the eigenvalues of the Jacobi matrix [25] (p. 460). This
procedure is known as the Product-Difference algorithm [9] (p. 459). Once the weights and abscissas are
known, the source terms due to coalescence and breakage can be calculated and therefore the transport
equations for the moments can be solved.
Applying Equation 2.76 (p. 418) and Equation 2.77 (p. 418), the birth and death terms in Equa-
tion 2.64 (p. 417) can be rewritten as
(2.78)
(2.79)
(2.80)
(2.81)
Theoretically, there is no limitation on the expression of breakage and aggregation kernels when using
QMOM.
The nucleation rate is defined in the same way as for the SMM. The growth rate for QMOM is defined
by Equation 2.69 (p. 417) and represented as
(2.82)
In this implementation of DQMOM, four phases must be specified: one primary phase and three secondary
phases that are DQMOM phases. Compared to QMOM, for a three Quadrature points system, the DQMOM
method only needs three extra equations to solve for the effective length of the particle, but there are
additional source terms for the volume fraction equation for each DQMOM phase. In ANSYS Fluent,
three particle interactions are accounted for, growth, aggregation, and breakage. Nucleation is not
considered.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 419
Population Balance Model Theory
(2.84)
where and are the VOF and the effective length of the particle phase, respectively. is the
number of particles per unit volume and is the growth rate at Quadrature point , while and
can be computed through a linear system resulting from the moment transformation of the particle
number density transport equation using Quadrature points. The linear system can be written in
matrix form as
(2.85)
Where the coefficient matrix is defined by
(2.86)
(2.87)
The right hand side of Equation 2.85 (p. 420) is the known source terms involving aggregation and
breakage phenomena only. The growth term is accounted for directly in Equation 2.83 (p. 419) and
Equation 2.84 (p. 420). At present, nucleation is not considered.
(2.89)
(2.90)
When the abscissas of the Quadrature points are distinct, the matrix is well defined and a unique
solution of Equation 2.85 (p. 420) can be obtained. Otherwise, the matrix is not full rank and cannot
be inverted to find a unique solution for . The method adopted by ANSYS Fluent to overcome this
problem is to employ a perturbation technique. For example, for the current three Quadrature points
system, the perturbation technique will add a small value to the abscissas to make sure the matrix A is
full rank. It is important to note that the perturbation technique is only used for the definition of matrix
and no modifications are made to the source term vector of Equation 2.90 (p. 420). Therefore, both
the weights and overall source terms resulting from aggregation and breakage are not affected by the
perturbation method. The simulation tests have found that the perturbation method can stabilize the
solutions of Equation 2.85 (p. 420) and reduce the physically unrealistically large source terms for the
two phases whose abscissa are too close in value. However, the technique has little effect on the phase
whose abscissa is distinct from the other two.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
420 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Statistics
(2.91)
th
The equation for the moment is now written as
(2.92)
Given moments, the coefficients can be found by a globally convergent Newton-Raphson method
to reconstruct the particle size distribution (for example, Figure 2.2: Reconstruction of a Particle Size
Distribution (p. 421)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 421
Population Balance Model Theory
The log-normal distribution for the number density, , as a function of the particle size, , can be written
as:
(2.93)
where and are, respectively, the location and scale parameters of the distribution and can be written
as
and are the mean and standard deviation, respectively, and are specified in the boundary conditions
as shown in Initializing Bin Fractions With a Log-Normal Distribution (p. 436).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
422 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Using the ANSYS Fluent Population Balance Model
This chapter provides basic instructions to install the population balance model and solve population
balance problems in ANSYS Fluent. It assumes that you are already familiar with standard ANSYS Fluent
features, including the user-defined function procedures described in the Fluent Customization Manual.
This chapter describes the following:
3.1. Population Balance Module Installation
3.2. Loading the Population Balance Module
3.3. Population Balance Model Setup
Select the Population Balance Model by entering the module number 5. During the loading
process a scheme library containing the graphical and text user interface, and a UDF library containing
a set of user defined functions are loaded into ANSYS Fluent. A message Addon Module: pop-
bal...loaded! is displayed at the end of the loading process.
The population balance module setup is saved with the ANSYS Fluent case file. The module is loaded
automatically when the case file is subsequently read into ANSYS Fluent. Note that in the saved case
file, the population balance module is saved with the absolute path. Therefore, if the locations of the
population balance module installation or the saved case file are changed, ANSYS Fluent will not be
able to load the module when the case file is subsequently read.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 423
Using the ANSYS Fluent Population Balance Model
Important
A limitation of the population balance model is that it can be used only on one secondary
phase, even if your problem includes additional secondary phases. Note that a three-phase
gas-liquid-solid case can be modeled, where the population balance model is used for the
gas phase and the solid phase acts as a catalyst. However, if you are using the Inhomogen-
eous Discrete, more than one secondary phase can be used. Note that the properties of the
secondary phases selected for that method should be the same for consistency.
2. To enable the population balance model, follow the instructions in Loading the Population Balance Mod-
ule (p. 423).
3. Open the Population Balance Model dialog box (Figure 3.1: The Population Balance Model Dialog
Box (p. 425)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
424 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
If you select Discrete, you will need to specify the following parameters:
Kv
specifies the value for the particle volume coefficient (as described in Particle Growth and Dissol-
ution (p. 404)). By default, this coefficient has a value of .
Definition
can be specified as a Geometric Ratio or as a File. If Geometric Ratio is selected, then the Ratio
Exponent must be specified. If File is selected, you will click the Load File... button and select the
bin size file that you want loaded.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 425
Using the ANSYS Fluent Population Balance Model
You can input the diameter through the text file, with each diameter listed on a separate line,
starting from the smallest to the largest diameter (one entry per line). Hence, you are not
limited by the choices specified in the dialog box.
Bins
specifies the number of particle size bins used in the calculation.
Ratio Exponent
specifies the exponent used in the discretization of the growth term volume coordinate (see Nu-
merical Method (p. 414)).
Min Diameter
specifies the minimum bin size .
Max Diameter
displays the maximum bin size, which is calculated internally.
To display a list of the bin sizes in the console window, click Print Bins. The bin sizes will be listed
in order of size, from the largest to the smallest. This option is only available when the Geometric
Ratio Definition is selected.
If you select Inhomogeneous Discrete under Method, you will specify the same parameters as for the
Discrete model. Additionally, you can include more than one secondary phase in the bin definition.
Enter the total number of Active Secondary Phases in your simulation.
Note
While reading bins through the Load File... option for the Inhomogeneous Discrete
model, the corresponding phase name must be included, for example (("air-1"
(0.1 0.2 0.3))
If you select Standard Moment under Method, you will specify the number of Moments under Para-
meters.
If you selected Quadrature Moment under Method, you will set the number of moments to either 4,
6 or 8 under Parameters.
If you selected DQMOM under Method, you will select the DQMOM Phases from the list. You will also
specify the following Parameters:
Max Size
specifies the maximum size of the particle.
Min Size
specifies the minimum size of the particle.
Reference Length
is the reference particle size. Normally, the averaged size of the particle group should be sufficient.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
426 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
Min VOF
is the minimum VOF, where the total volume fraction of the particle phases (participating in DQMOM
computations) is below the minimum value; the source terms caused by the breakage and coalescence
are not computed in that cell for the DQMOM and VOF equations.
Note
5. Select the secondary phase from the Phase drop-down list for which you want to apply the population
balance model parameters.
6. For all population balance methods, you can enable the following under Phenomena :
Nucleation Rate
enables you to specify the nucleation rate ( ). You can select constant or user-defined
from the drop-down list. If you select constant, specify a value in the adjacent field. If you have a user-
defined function (UDF) that you want to use to model the nucleation rate, you can choose the user-
defined option and specify the appropriate UDF.
Note
This option is not available when using the Inhomogeneous Discrete method.
Growth Rate
enables you to specify the particle growth rate (m/s). You can select constant or user-defined from
the drop-down list. If you select constant, specify a value in the adjacent field. If you have a user-defined
function (UDF) that you want to use to model the growth rate, you can choose the user-defined option
and specify the appropriate UDF.
Note
This option is not available when using the Inhomogeneous Discrete method.
Aggregation Kernel
enables you to specify the aggregation kernel ( ). You can select constant, luo-model, free-mo-
lecular-model, turbulent-model, or user-defined from the drop-down list:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 427
Using the ANSYS Fluent Population Balance Model
If you select luo-model, the Surface Tension for Population Balance dialog box will open automat-
ically to enable you to specify the surface tension (see Figure 3.2: The Surface Tension for Population
Balance Dialog Box (p. 428)). The aggregation rate for the model will then be calculated based on
Luos aggregation kernel (as described in Particle Birth and Death Due to Breakage and Aggrega-
tion (p. 404)).
Figure 3.2: The Surface Tension for Population Balance Dialog Box
If you select turbulent-model, the Hamaker Constant for Population Balance dialog box will open
automatically to enable you to specify the Hamaker constant (see Figure 3.3: The Hamaker Constant
for Population Balance Dialog Box (p. 428)). More information about this model is available in Turbulent
Aggregation Kernel (p. 412).
Figure 3.3: The Hamaker Constant for Population Balance Dialog Box
If you have a user-defined function (UDF) that you want to use to model the aggregation rate, you
can choose the user-defined option and specify the appropriate UDF.
Breakage Kernel
enables you to specify the particle breakage frequency ( ). You can select constant,
luo-model, lehr-model, ghadiri-model, laakkonen-model or user-defined from the Frequency
drop-down list:
If you select luo-model, the Surface Tension for Population Balance dialog box will open automat-
ically to enable you to specify the surface tension (see Figure 3.2: The Surface Tension for Population
Balance Dialog Box (p. 428)). The frequency used in the breakage rate will then be calculated based
on Luos breakage kernel (as described in Particle Birth and Death Due to Breakage and Aggrega-
tion (p. 404)).
If you select lehr-model, the Surface Tension and Weber Number dialog box will open automatically
to enable you to specify the surface tension and critical Weber number (see Figure 3.4: The Surface
Tension and Weber Number Dialog Box (p. 429)). The frequency used in the breakage rate will then
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
428 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
be calculated based on Lehrs breakage kernel (as described in Particle Birth and Death Due to
Breakage and Aggregation (p. 404)).
Figure 3.4: The Surface Tension and Weber Number Dialog Box
If you select ghadiri-model, the Ghadiri Breakage Constant for Population Balance dialog box
will open automatically to enable you to specify the breakage constant (see Figure 3.5: The Ghadiri
Breakage Constant for Population Balance Dialog Box (p. 429)). The frequency will then be calculated
based on Ghadiris breakage kernel (as described in Particle Birth and Death Due to Breakage and
Aggregation (p. 404)).
Figure 3.5: The Ghadiri Breakage Constant for Population Balance Dialog Box
If you select laakkonen-model, the Surface Tension for Population Balance dialog box will open
automatically to enable you to specify the Surface Tension and the constant C2 (Laakkonen
Breakage Kernels (p. 407)). The frequency will then be calculated based on Laakkonen's breakage
kernel (as described in Laakkonen Breakage Kernels (p. 407)).
If you have a user-defined function (UDF) that you want to use to model the frequency for the
breakage rate, you can choose the user-defined option and specify the appropriate UDF.
If you select parabolic, the Shape Factor for Parabolic PDF dialog box will open automatically to
enable you to specify the shape factor C (see Figure 3.6: The Shape Factor for Parabolic PDF Dialog
Box (p. 430)). The PDF used in the breakage rate will then be calculated according to Equa-
tion 2.20 (p. 408) (as described in Particle Birth and Death Due to Breakage and Aggregation (p. 404)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 429
Using the ANSYS Fluent Population Balance Model
Figure 3.6: The Shape Factor for Parabolic PDF Dialog Box
If you select generalized, the Generalized pdf for multiple breakage dialog box will open auto-
matically (Figure 3.7: The Generalized pdf for multiple breakage Dialog Box (p. 430)).
Figure 3.7: The Generalized pdf for multiple breakage Dialog Box
Perform the following steps in the Generalized pdf for multiple breakage dialog box:
a. Select either One Term or Two Term from the Options list. Your selection will determine
whether in Equation 2.26 (p. 409) is 0 or 1, respectively.
b. Enter a value for the averaged Number of Daughters. It can be any real number (including non-
integers, such as 2.5), as long as it is not less than 2.
c. Define the parameter(s) for Equation 2.26 (p. 409) in the Input Parameters group box. When One
Term is selected from the Options list, you must enter a value for qi0. When Two Term is selected
from the Options list, you must enter values for wi0, pi0, qi0, ri0, and qi1. For information about
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
430 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
appropriate values for these parameters to result in the daughter distributions shown in
Table 2.3: Daughter Distributions (p. 409), see Table 2.4: Daughter Distributions (cont.) (p. 409).
Note
For the equal-size generalized pdf breakage distribution, the value for qi0 should
be set to 1e20.
d. Click the Validate/Apply button to save the settings. The text boxes in the All Parameters group
box will be updated, using the values you entered in the Input Parameters group box, as well
as values derived from the constraints shown in Equation 2.27 (p. 409) Equation 2.29 (p. 409).
e. Verify that the values in the All Parameters group box represent your intended PDF before
clicking Close.
If you have a user-defined function (UDF) that you want to use to model the PDF for the breakage
rate, you can choose the user-defined option and specify the appropriate UDF. See UDFs for Popu-
lation Balance Modeling (p. 447) for details about UDFs for the population balance model.
Choose between the default Hagesather formulation and the Ramakrishna formulation. Detailed
information about these two methods can be found in Breakage Formulations for the Discrete
Method (p. 416).
7. Enable Include Expansion if you want to account for bubble expansion due to large changes in hydrostatic
pressure.
Note
The secondary phase must be modeled as compressible. This option is currently available
for Discrete and QMOM only.
See Postprocessing for the Population Balance Model (p. 443) for details about postprocessing.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 431
Using the ANSYS Fluent Population Balance Model
Figure 3.8: The Population Balance Model Dialog Box for the DQMOM Model
DQMOM Values Produced From PDF, CDF Files, or Overall Moments for the Particles
Three quadrature points are assumed, namely QP0, QP1, and QP2 (see Figure 3.9: DQMOM Values Pro-
duced From a PDF File (p. 433)).
Length, Volume Fraction , and DQMOM-m4 values are given. The latter two can be used for initial
fields of VOF and DQMOM as well as boundary conditions.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
432 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
For verification purposes, the first six moments are also given together with the total volume fraction
of all particles from the PDF or CDF file. It is your responsibility to make sure that these values are correct,
especially the total volume fraction.
The definition of the first six moments of the particles is length based for the overall moments, described
in The Quadrature Method of Moments (QMOM) (p. 418).
In PDF or CDF format, the resultant volume fraction is normally given as unity. If you want the real
particle volume fraction to be reflected in the mixture, the second column of the PDF or CDF data file
need to be multiplied by the value of the real volume fraction. Another way is to multiply the values
of the generated DQMOM volume fraction and DQMOM-m4 using the real particle volume fraction.
The probability density function (PDF) is defined by the probability distribution of particles in terms of
the volume fraction over the particle length (namely the diameter of the particle).
The integration of PDF over all possible particle length (normally from 0 to the maximum diameter)
shall give a value of unity or the real value of the volume fraction of all participating particles.
An integer number specified in the first line, indicating the number of data pairs to follow
The data in the 1st column specifying the length or diameter of particles in ascending order in meters
(m)
The data in the 2nd column specifying the probability density function. Be aware that the integration
of the PDF over the length shall result in a value of volume fraction for that particular particle length
range
37
5e-6 0.000058e6
10e-6 0.000271e6
15e-6 0.000669e6
20e-6 0.001264e6
25e-6 0.002062e6
30e-6 0.003055e6
35e-6 0.004228e6
40e-6 0.005549e6
45e-6 0.006972e6
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 433
Using the ANSYS Fluent Population Balance Model
50e-6 0.008439e6
55e-6 0.00988e6
60e-6 0.011217e6
65e-6 0.012366e6
70e-6 0.013253e6
75e-6 0.013811e6
80e-6 0.013996e6
85e-6 0.013789e6
90e-6 0.013199e6
95e-6 0.012268e6
100e-6 0.011062e6
105e-6 0.009668e6
110e-6 0.00818e6
115e-6 0.006694e6
120e-6 0.00529e6
125e-6 0.004033e6
130e-6 0.002962e6
135e-6 0.002093e6
140e-6 0.00142e6
145e-6 0.000925e6
150e-6 0.000576e6
155e-6 0.000344e6
160e-6 0.000196e6
170e-6 0.000055e6
180e-6 0.000012e6
190e-6 0.000002e6
200e-6 0.
210e-6 0.
The cumulative density function (CDF) is defined as the integration of PDF over all possible particles
up to the length , resulting in a value of volume fraction for all particles less than length .
The value of the CDF at the maximum particle length/diameter shall be unity, or the real value of the
volume fraction of all particles in the mixture.
An integer number specified in the first line, indicating the number of data pairs to follow
The data in the 1st column specifying the length or diameter of particles in ascending order in meters
(m)
The data in the 2nd column specifying the cumulative density function in terms of the volume fraction
of particles
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
434 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
80e-6 48.397e-2
85e-6 56.453e-2
90e-6 63.823e-2
95e-6 70.53e-2
100e-6 76.073e-2
105e-6 81e-2
110e-6 85.057e-2
115e-6 88.187e-2
120e-6 90.89e-2
125e-6 92.897e-2
130e-6 94.437e-2
135e-6 95.543e-2
140e-6 96.523e-2
145e-6 97.173e-2
150e-6 97.717e-2
155e-6 98.007e-2
160e-6 98.363e-2
170e-6 98.88e-2
180e-6 99.16e-2
190e-6 99.327e-2
200e-6 100.e-2
The third option is to specify the first six moments for all particles as shown below.
An integer number specified in the first line, indicating the number of data (moments) to follow. By
default, this shall be 6
six moments from moment-0 to moment-5 are given in that order. The definition of the first six mo-
ments is based on length as described in The Quadrature Method of Moments (QMOM) (p. 418)
1. In the Boundary Conditions task page, select the secondary phase(s) in the Phase drop-down list and
then open the appropriate boundary condition dialog box (for example, Figure 3.10: Specifying Inlet
Boundary Conditions for the Population Balance Model (p. 436)).
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 435
Using the ANSYS Fluent Population Balance Model
Figure 3.10: Specifying Inlet Boundary Conditions for the Population Balance Model
2. In the Multiphase tab, under Boundary Condition, select the type of boundary condition for each bin
(for the discrete method) or moment (for SMM and QMOM) as either Specified Value or Specified Flux.
Note that the boundary condition variables (for example, Bin-0) are labeled according to the following:
bin/moment - th bin/moment
where the th bin/moment can range from 0 (the first bin or moment) to , where is the
number of bins/moments that you entered in the Population Balance Model dialog box.
If you selected Specified Value for the selected boundary variable, enter a value in the field adjacent
to the variable name. This value will correspond to the variable in Equation 2.49 (p. 415) (for the discrete
method) or in Equation 2.64 (p. 417) (for SMM or QMOM). If you are using either of the discrete
methods and have selected Specified Value for all bins, you can optionally specify a log-normal distri-
bution and have Fluent automatically initialize the bin fractions accordingly to a log-normal distribution
(see Initializing Bin Fractions With a Log-Normal Distribution (p. 436)).
If you selected Specified Flux for the selected boundary variable, enter a value in the field adjacent to
the variable name. This value will be the spatial particle volume flux .
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
436 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
terized by a mean and standard deviation that you supply. For details of the log-normal distribution,
refer to The Log-Normal Distribution (p. 422).
Important
The log-normal initialization feature is only meaningful and should only be used when
Specified Value is selected for all bins under Boundary Condition.
2. Enter values for the Mean and Std Dev of the desired distribution.
3. Click Initialize...
The default value under Under-Relaxation Factors (in the Solution Controls task page) for the popu-
lation balance equations is 0.5, and the default Discretization scheme (in the Solution Methods task
page) is First Order Upwind.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 437
Using the ANSYS Fluent Population Balance Model
(3.1)
To specify the Sauter mean diameter as the secondary phase particle diameter, open the Secondary
Phase dialog box.
In the Secondary Phase dialog box (for example, Figure 3.12: The Secondary Phase Dialog box for Hy-
drodynamic Coupling (p. 439)), select sauter-mean from the Diameter drop-down list under Properties.
Note that a constant diameter or user-defined function may also be used.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
438 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
Figure 3.12: The Secondary Phase Dialog box for Hydrodynamic Coupling
As an example, in crystallization, particles are created by means of nucleation ( ), and a growth rate
( ) can also be specified. The mass transfer rate of formation (in ) of particles of all sizes is then
(3.2)
For the discrete method, the mass transfer rate due to growth can be written as
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 439
Using the ANSYS Fluent Population Balance Model
(3.3)
If the nucleation rate is included in the total mass transfer, then the mass transfer becomes
(3.4)
Important
For the discrete method, the sources to the population balance equations must sum to the
total mass transfer rate. To access the sources, you can use the macro C_PB_DISCI_PS
(cell, thread, i).
See UDFs for Population Balance Modeling (p. 447) for more information about macros for population
balance variables.
For the SMM, only a size-independent growth rate is available. Hence, the mass transfer rate can be
written as
(3.5)
(3.6)
For both the SMM and QMOM, mass transfer due to nucleation is negligible, and is not taken into account.
Important
Note that for crystallization, the primary phase has multiple components; at the very least,
there is a solute and a solvent. To define the multicomponent multiphase system, you will
need to activate Species Transport in the Species Model dialog box for the primary phase
after activating the multiphase model. The rest of the procedure for setting up a species
transport problem is identical to setting up species in single phase. The heterogeneous reac-
tion is defined as:
When the population balance model is activated, mass transfer between phases for non-reacting species
(such as boiling) and heterogeneous reactions (such as crystallization) can be done automatically, in
lieu of hooking a UDF.
For simple unidirectional mass transfer between primary and secondary phases due to nucleation and
growth phenomena of non-reacting species, configure the following settings:
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
440 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance Model Setup
1. Open the Phase Interaction dialog box (Figure 3.13: The Phase Interaction Dialog Box for Non-reacting
Species (p. 441)).
Figure 3.13: The Phase Interaction Dialog Box for Non-reacting Species
a. Under the Mass tab, specify the Number of Mass Transfer Mechanisms involved in your case.
b. For each mechanism, specify the phase of the source material under From Phase and the phase of the
destination material phase under To Phase.
c. From the Mechanism drop down list, select one of the mechanisms:
none
if you do not want any mass transfer between the phases.
constant-rate
for a fixed, user-specified rate.
user-defined
if you hooked a UDF describing the mass transfer mechanism.
population-balance
for an automated method of mass transfer, not involving a UDF. The nucleation and the growth
rates calculated by the population balance kernels are used for mass transfer.
Note
For the Inhomogeneous Discrete population balance model, where there is more
than one secondary phase, you can select population-balance as the mechanism
of mass transfer between the solvent phase (say for crystallization) and each of the
solute phases defined under the Inhomogeneous Discrete population balance
model.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 441
Using the ANSYS Fluent Population Balance Model
2. Open the Phase Interaction dialog box (Figure 3.14: The Phase Interaction Dialog Box for a Heterogeneous
Reaction (p. 442)).
3. Under the Reactions tab, specify the stoichiometry for the reactant and the product.
Figure 3.14: The Phase Interaction Dialog Box for a Heterogeneous Reaction
Either this method or the use of the UDF, described in Appendix A (p. 455), will produce the same results.
For the Inhomogeneous Discrete population balance model involving nucleation and growth, you can
select population-balance as the Reaction Rate Function for each heterogeneous reaction you
have set up. To learn how to set up reactions, go to Specifying Heterogeneous Reactions in the User's
Guide.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
442 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4: Postprocessing for the Population Balance Model
ANSYS Fluent provides postprocessing options for displaying, plotting, and reporting various particle
quantities, which include the main solution variables and other auxiliary quantities.
4.1. Population Balance Solution Variables
4.2. Reporting Derived Population Balance Variables
th
Bin-i fraction is the fraction ( ) of the volume fraction for the size bin when using the discrete
th
method. Number density of Bin-i fraction is the number density ( ) in for the size
th
bin. Moment-i is the moment of the distribution when using the standard method of moments or
the quadrature method of moments.
Important
Though the diffusion coefficients of the population variables (for example, Diffusion Coef.
of Bin-i fraction/Moment-i) are available, they are set to zero because the diffusion term is
not present in the population balance equations.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 443
Postprocessing for the Population Balance Model
1. For the discrete method, specify the Number of Moments. For the SMM and QMOM, the number of moments
is set equal to the number of moments that were solved, and therefore cannot be changed.
2. For a surface average, select the surface(s) on which to calculate the moments in the Surfaces list.
3. For a volume average, select the volume(s) in which to calculate the moments in the Cell Zones list.
5. To save the moment calculations to a file, click Write... and enter the appropriate information in the resulting
Select File dialog box. The file extension should be .pb.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
444 of ANSYS, Inc. and its subsidiaries and affiliates.
Reporting Derived Population Balance Variables
The steps for displaying the number density function are as follows:
2. Under Plot Type, specify how you would like to display the number density function data.
Histogram
displays a histogram of the discrete number density ( ). The number of divisions in the histogram is
equal to the number of bins specified in the Population Balance Model dialog box. This option is
available only with the discrete method.
Curve
displays a smooth curve of the number density function.
4. Choose the cell zones on which to plot the number density function data in the Cell Zones list.
6. (optional) Click Print to display the number density function data in the console window.
7. Click Write to save the number density function data to a file. The Select File dialog box will open, where
you can specify a name and save a file containing the plot data. The file extension should be .pbd.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 445
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
446 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 5: UDFs for Population Balance Modeling
This chapter contains the following sections:
5.1. Population Balance Variables
5.2. Population Balance DEFINE Macros
5.3. Hooking a Population Balance UDF to ANSYS Fluent
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 447
UDFs for Population Balance Modeling
5.2.1. DEFINE_PB_BREAK_UP_RATE_FREQ
You can use the DEFINE_PB_BREAK_UP_RATE_FREQ macro if you want to define the breakage fre-
quency using a UDF. The function is executed at the beginning of every time step.
5.2.1.1. Usage
DEFINE_PB_BREAK_UP_RATE_FREQ(name, cell, thread, d_1)
There are four arguments to DEFINE_PB_BREAK_UP_RATE_FREQ: name, cell, thread, and d_1.
You will supply name, the name of the UDF. cell, thread, and d_1 are variables that are passed by
the ANSYS Fluent solver to your UDF.
5.2.1.2. Example
Included below is an example of a UDF that defines a breakage frequency (see Particle Birth and Death
Due to Breakage and Aggregation (p. 404)) that is based on the work of Tavlarides [4] (p. 459), such that
(5.1)
where and are constants, is the dissipation rate, is the parent diameter, is the surface tension,
is the volume fraction of the dispersed phase, and is the density of the primary phase.
/************************************************************************
UDF that computes the particle breakage frequency
*************************************************************************/
#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
448 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance DEFINE Macros
5.2.2. DEFINE_PB_BREAK_UP_RATE_PDF
You can use the DEFINE_PB_BREAK_UP_RATE_PDF macro if you want to define the breakage PDF
using a UDF. The function is executed at the beginning of every time step.
5.2.2.1. Usage
DEFINE_PB_BREAK_UP_RATE_PDF(name, cell, thread, d_1, thread_2, d_2)
Note
thread and thread_2 are the same for the Discrete, QMOM and SMM models. They may
be the same or different depending on whether d_1 and d_2 belong to the same phase or
different phases for the Inhomogeneous model.
5.2.2.2. Example
Included below is an example of a UDF that defines a breakage PDF (see Particle Birth and Death Due
to Breakage and Aggregation (p. 404)) that is parabolic, as defined in Equation 2.20 (p. 408).
/************************************************************************
UDF that computes the particle breakage PDF
*************************************************************************/
#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"
real C = 1.0;
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 449
UDFs for Population Balance Modeling
f_2 = 24.*pow(V/V_prime,2.);
f_3 = -24.*(V/V_prime);
f_4 = 6.;
return 0.5*pdf;
}
5.2.3. DEFINE_PB_COALESCENCE_RATE
You can use the DEFINE_PB_COALESCENCE_RATE macro if you want to define your own particle
aggregation kernel. The function is executed at the beginning of every time step.
5.2.3.1. Usage
DEFINE_PB_COALESCENCE_RATE(name, cell, thread, d_1, thread_2, d_2)
There are six arguments to DEFINE_PB_COALESCENCE_RATE: name, cell, thread, d_1, thread_2,
and d_2. You will supply name, the name of the UDF. cell, thread, d_1, and d_2 are variables that
are passed by the ANSYS Fluent solver to your UDF. Your UDF will need to return the real value of
the aggregation rate.
Note
thread and thread_2 are the same for the Discrete, QMOM and SMM models. They may
be the same or different depending on whether d_1 and d_2 belong to the same phase or
different phases for the Inhomogeneous model.
5.2.3.2. Example
Included below is an example UDF for a Brownian aggregation kernel. In this example, the aggregation
rate is defined as
where .
/************************************************************************
UDF that computes the particle aggregation rate
*************************************************************************/
#include "udf.h"
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
450 of ANSYS, Inc. and its subsidiaries and affiliates.
Population Balance DEFINE Macros
#include "sg_pb.h"
#include "sg_mphase.h"
DEFINE_PB_COALESCENCE_RATE(aggregation_kernel,cell,thread,d_1,thread_2,d_2)
{
real agg_kernel;
real beta_0 = 1.0e-17 /* aggregation rate constant */
agg_kernel = beta_0*pow((d_1+d_2),2.0)/(d_1*d_2);
return agg_kernel;
}
5.2.4. DEFINE_PB_NUCLEATION_RATE
You can use the DEFINE_PB_NUCLEATION_RATE macro if you want to define your own particle
nucleation rate. The function is executed at the beginning of every time step.
5.2.4.1. Usage
DEFINE_PB_NUCLEATION_RATE(name, cell, thread)
There are three arguments to DEFINE_PB_NUCLEATION_RATE: name, cell, and thread. You will
supply name, the name of the UDF. cell and thread are variables that are passed by the ANSYS
Fluent solver to your UDF. Your UDF will need to return the real value of the nucleation rate.
5.2.4.2. Example
Potassium chloride can be crystallized from water by cooling. Its solubility decreases linearly with tem-
perature. Assuming power-law kinetics for the nucleation rate,
where and .
/************************************************************************
UDF that computes the particle nucleation rate
*************************************************************************/
#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"
DEFINE_PB_NUCLEATION_RATE(nuc_rate, cell, thread)
{
real J, S;
real Kn = 4.0e10; /* nucleation rate constant */
real Nn = 2.77; /* nucleation law power index */
real T,solute_mass_frac,solvent_mass_frac, solute_mol_frac,solubility;
real solute_mol_wt, solvent_mol_wt;
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 451
UDFs for Population Balance Modeling
solubility = 0.0005*T-0.0794;
/* Solubility Law relating equilibrium solute mole fraction to Temperature*/
Important
Note that the solubility and the chemistry could be defined in a separate routine and simply
called from the above function.
5.2.5. DEFINE_PB_GROWTH_RATE
You can use the DEFINE_PB_GROWTH_RATE macro if you want to define your own particle growth
rate. The function is executed at the beginning of every time step.
5.2.5.1. Usage
DEFINE_PB_GROWTH_RATE(name, cell, thread,d_i)
There are four arguments to DEFINE_PB_GROWTH_RATE: name, cell, thread, and d_i. You will
supply name, the name of the UDF. cell, thread, and d_i are variables that are passed by the ANSYS
Fluent solver to your UDF. Your UDF will need to return the real value of the growth rate.
5.2.5.2. Example
Potassium chloride can be crystallized from water by cooling. Its solubility decreases linearly with tem-
perature. Assuming power-law kinetics for the growth rate,
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
452 of ANSYS, Inc. and its subsidiaries and affiliates.
Hooking a Population Balance UDF to ANSYS Fluent
#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"
DEFINE_PB_GROWTH_RATE(growth_rate, cell, thread,d_1)
{
/* d_1 can be used if size-dependent growth is needed */
/* When using SMM, only size-independent or linear growth is allowed */
real G, S;
real Kg = 2.8e-8; /* growth constant */
real Ng = 1.; /* growth law power index */
real T,solute_mass_frac,solvent_mass_frac, solute_mol_frac,solubility;
real solute_mol_wt, solvent_mol_wt;
Important
Note that the solubility and the chemistry could be defined in a separate routine and simply
called from the above function.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 453
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
454 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix A. DEFINE_HET_RXN_RATE Macro
This appendix discusses the DEFINE_HET_RXN_RATE macro:
A.1. Description
A.2. Usage
A.3. Example
A.4. Hooking a Heterogeneous Reaction Rate UDF to ANSYS Fluent
A.1. Description
You need to use DEFINE_HET_RXN_RATE to specify reaction rates for heterogeneous reactions. A
heterogeneous reaction is one that involves reactants and products from more than one phase. Unlike
DEFINE_VR_RATE, a DEFINE_HET_RXN_RATE UDF can be specified differently for different hetero-
geneous reactions.
During ANSYS Fluent execution, the DEFINE_HET_RXN_RATE UDF for each heterogeneous reaction
that is defined is called in every fluid cell. ANSYS Fluent will use the reaction rate specified by the UDF
to compute production/destruction of the species participating in the reaction, as well as heat and
momentum transfer across phases due to the reaction.
A heterogeneous reaction is typically used to define reactions involving species of different phases. The
bulk phase can participate in the reaction if the phase does not have any species (that is, the phase
has fluid material instead of mixture material). Heterogeneous reactions are defined in the Phase Inter-
action dialog box.
A.2. Usage
DEFINE_HET_RXN_RATE (name,c,t,r,mw,yi,rr,rr_t)
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 455
DEFINE_HET_RXN_RATE Macro
There are eight arguments to DEFINE_HET_RXN_RATE: name, c, t, r, mw, yi, rr, and rr_t. You
will supply name, the name of the UDF. c, t, r, mw, yi, rr, and rr_t are variables that are passed by
the ANSYS Fluent solver to your UDF. Your UDF will need to set the values referenced by the real
pointer rr.
A.3. Example
The following compiled UDF, named arrh, defines an Arrhenius-type reaction rate. The rate exponents
are assumed to be same as the stoichiometric coefficients.
#include "udf.h"
DEFINE_HET_RXN_RATE(arrh,c,t,hr,mw,yi,rr,rr_t)
{
Domain **domain_reactant = hr->domain_reactant;
real *stoich_reactant = hr->stoich_reactant;
int *reactant = hr->reactant;
int i;
int sp_id;
int dindex;
Thread *t_reactant;
real ci;
real T = 1200.; /* should obtain from cell */
*rr = 0;
for (i=0; i < hr->n_reactants; i++)
{
sp_id = reactant[i]; /* species ID to access mw and yi */
if (sp_id == -1) sp_id = 0; /* if phase does not have species,
mw, etc. will be stored at index 0 */
dindex = DOMAIN_INDEX(domain_reactant[i]);
/* domain index to access mw & yi */
t_reactant = THREAD_SUB_THREAD(t,dindex);
/* get conc. */
ci = yi[dindex][sp_id]*C_R(c,t_reactant)/mw[dindex][sp_id];
ci = MAX(ci,SMALL_S);
*rr += stoich_reactant[i]*log(ci);
}
*rr = exp(*rr);
}
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
456 of ANSYS, Inc. and its subsidiaries and affiliates.
Hooking a Heterogeneous Reaction Rate UDF to ANSYS Fluent
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 457
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
458 of ANSYS, Inc. and its subsidiaries and affiliates.
Bibliography
[1] J. Abrahamson. Collision Rates of Small Particles in a Vigorously Turbulent Fluid. Chemical Engineering
Science. 30. 13711379. 1975.
[2] L. Austin, K. Shoji, V. Bhatia, V. Jindal, K. Savage, and R. Klimpel. Some Results on the Description of
Size Distribution as a Rate Process in Various Mills. Industrial Engineering and Chemical Process
Design Devices. 15(1). 187196. 1976.
[3] J. Baldyga and W. Orciuch. Barium Sulfate Precipitation in a Pipe An Experimental Study and CFD
Modeling. Chemical Engineering Science. 56. 24352444. 2001.
[5] H. Dette and W. J. Studden. The Theory of Canonical Moments with Applications in Statistics, Probability,
and Analysis. John Wiley & Sons. New York, NY1997.
[6] R. B. Diemer and J. H. Olson. A Moment Methodology for Coagulation and Breakage Problems Part
3Generalized Daughter Distribution Functions. Chemical Engineering Science. 57(19). 41874198.
2002.
[7] R. Fan, D.L. Marchisio and R.O. Fox. Application of the Direct Quadrature Method of Moments to Poly-
disperse Gas-solid Fluidized Beds. Power Technology. 139. 720. 2004.
[8] M. Ghadiri and Z. Zhang. Impact Attrition of Particulate Solids Part 1. A Theoretical Model of Chipping.
Chemical Engineering Science. 57. 36593669. 2002.
[9] R. G. Gordon. Error Bounds in Equilibrium Statistical Mechanics. Journal of Mathematical Physics. 56.
655633. 1968.
[10] Hagesaether L., Jakobsen H.A.1, and Svendsen H.F. A Model for Turbulent Binary Breakup of Dispersed
Fluid Particles. Chemical Engineering Science. 57(16). 32513267. 2002.
[11] K. Higashitani, K. Yamauchi, Y. Matsuno, and G. Hosokawa. Turbulent Coagulation of Particles Dispersed
in a Viscous Fluid. Chemical Engineering Journal Japan. 16(4). 299304. 1983.
[12] M. J. Hounslow, R. L. Ryall, and V. R. Marshall. A Discretized Population Balance for Nucleation, Growth,
and Aggregation. AIChE Journal. 34(11). 18211832. 1988.
[13] M. A. Hsia and L. L. Tavlarides. Simulation analysis of drop breakage, coalescence and micro-mixing
in liquidliquid stirred tanks. Chemical Engineering Journal. 26(3). 189199. 1983.
[14] M. Kostoglou, S. Dovas, and A. J. Karabelas. On the Steady-State Size Distribution of Dispersions in
Breakage Processes. Chemical Engineering Science. 52(8). 12851299. 1997.
[15] S. Kumar and D. Ramkrishna. On the Solution of Population Balance Equations by Discretization - I.,
A Fixed Pivot Technique. Chemical Engineering Science. 51(8). 13111332. 1996.
[16] F. Lehr, M. Millies, and D. Mewes. Bubble-Size Distributions and Flow Fields in Bubble Columns. AIChE
Journal. 8(11). 24262443. 2002.
[17] J. D.Litster, D. J.Smit, and M. J.Hounslow. Adjustable Discretization Population Balance for Growth
and Aggregation. AIChE Journal. 41(3). 591603. 1995.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 459
Bibliography
[18] H. Luo. Coalescence, Breakup and Liquid Circulation in Bubble Column Reactors. PhD thesis from the
Norwegian Institute of Technology. Trondheim,Norway1993.
[19] H. Luo and H. F. Svendsen. Theoretical Model for Drop and Bubble Breakup in Turbulent Dispersions.
AIChE Journal. 42(5). 12251233,. 1996.
[20] D. L. Marchisio, R. D. Virgil, and R. O. Fox. Quadrature Method of Moments for Aggregation-Breakage
Processes. Journal of Colloid and Interface Science. 258. 322334. 2003.
[21] B. J. McCoy and M. Wang. Continuous-mixture Fragmentation Kinetics Particle Size Reduction and
Molecular Cracking. Chemical Engineering Science. 49(22). 37733785. 1994.
[22] R. McGraw. Description of Aerosol Dynamics by the Quadrature Method of Moments. Aerosol Science
and Technology. 27. 255265. 1997.
[23] R. Moreno-Atanasio and M. Ghadiri. Mechanistic Analysis and Computer Simulation of Impact
Breakage of Agglomerates Effect of Surface Energy. Chemical Engineering Science. 61(8). 24762481.
2006.
[24] S. B. Pope. Probability Distributions of Scalars in Turbulent Shear Flow. Turbulent Shear Flows. volume
2. pages 716. 1979.
[25] W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery. Numerical Recipes. Cambridge Uni-
versity Press. Cambridge, England,1992.
[26] D. Ramkrishna. Population Balances Theory and Applications to Particulate Systems in Engineering.
Academic Press. San Diego, CA,2000.
[27] A. D. Randolph and M. A. Larson. Theory of Particulate Processes. Analysis and Techniques of Continuous
Crystallization. Academic Press. San Diego, CA1971.
[28] P.G. Saffman and J.S. Turner. On the Collision of Droplets in Turbulent Clouds. Journal of Fluid Mech-
anics,. 1. 1630. 1956.
[29] M. Schmoluchowski. Versuch Einen Mathematischen Theorie der Koagulationstechnik Kolloider Lsungen.
Zeitschrift fr Physikalische Chemie. 92. 129168. 1917.
[30] R. D.Vigil and R. M.Ziff. On the Stability of CoagulationFragmentation Population Balances. Journal
of Colloids and Interface Science. 133(1). 257264. 1989.
Release 17.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
460 of ANSYS, Inc. and its subsidiaries and affiliates.