Vous êtes sur la page 1sur 44

VERSION 4.

3a
Introduction to
CFD Module
C o n t a c t I n f o r ma t i o n
| i
Visit www.comsol.com/contact for a searchable list of all COMSOL offices and local
representatives. From this web page, search the contacts and find a local sales
representative, go to other COMSOL websites, request information and pricing,
submit technical suppor t queries, subscribe to the monthly eNews email newsletter,
and much more.
If you need to contact Technical Suppor t, an online request form is located at
www.comsol.com/support/contact.
Other useful links include:
Technical Support: www.comsol.com/support
Product downloads: www.comsol.com/support/download
Software updates: www.comsol.com/support/updates
Online community: www.comsol.com/community
Events, conferences, and training: www.comsol.com/events
Tutorials: www.comsol.com/products/tutorials
Knowledge Base: www.comsol.com/support/knowledgebase
Part No. CM021302
I n t r o d u c t i o n t o t h e C F D M o d u l e
19982012 COMSOL
Protected by U.S. Patents 7,519,518; 7,596,474; and 7,623,991. Patents pending.
This Documentation and the Programs described herein are furnished under the COMSOL Software License
Agreement (www.comsol.com/sla) and may be used or copied only under the terms of the license agreement.
COMSOL, COMSOL Desktop, COMSOL Multiphysics, and LiveLink are registered trademarks or trademarks
of COMSOL AB. Other product or brand names are trademarks or registered trademarks of their respective
holders.
Version: October 2012 COMSOL 4.3a
cfd_introduction.book Page i Monday, September 24, 2012 4:07 PM
| ii
Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Aspects of CFD Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
The CFD Module Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
The Physics List by Space Dimension and Study Type . . . . . . . . . 13
The Model Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Tutorial ExampleBackstep . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Model Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Domain Equations and Boundary Conditions . . . . . . . . . . . . . . . . . 19
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Tutorial ExampleWater Purification Reactor . . . . . . . . . . . . . 27
Model Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Domain Equations and Boundary Conditions . . . . . . . . . . . . . . . . . 28
Notes About the Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
cfd_introduction.book Page ii Monday, September 24, 2012 4:07 PM
iii |
cfd_introduction.book Page iii Monday, September 24, 2012 4:07 PM
Introduction | 1
Introduction
The CFD Module is used by engineers and scientists to understand, predict, and
design the flow in closed and open systems. At a given cost, these types of
simulations typically yield new and better products and operation of devices and
processes compared to purely empirical studies involving fluid flow. As a part of
an investigation, simulations give accurate estimates of flow patterns, pressure
losses, forces on surfaces subjected to a flow, temperature distribution, and
variations in fluid composition in a system.
Figure 1: Flow ribbons and velocity field magnitude from the simulation of an Ahmed body. The simulation
yields the flow and pressure fields and calculates the drag coefficient as a benchmark for verification and
validation of turbulence models.
The CFD Modules general capabilities include stationary and time-dependent
flows in two-dimensional and three-dimensional spaces. Formulations of different
types of flow are predefined in a number of fluid flow interfaces, which allow you
to set up and solve fluid flow problems. The fluid flow interfaces use physical
quantities, such as pressure and flow rate, and physical properties, such as viscosity
and density, to define a fluid flow problem. There are different fluid flow interfaces
that cover a wide range of flows, for example, laminar flow, turbulent flow,
single-phase flow, and multiphase flow.
cfd_introduction.book Page 1 Monday, September 24, 2012 4:07 PM
2 | Introduction
The fluid flow interfaces formulate conservation laws for the momentum, mass,
and energy. These laws are expressed in partial differential equations, which are
solved by the module together with the corresponding initial conditions and
boundary conditions. The equations are solved using stabilized finite element
formulations for fluid flow, in combination with damped Newton methods and,
for time-dependent problems, different time-dependent solver algorithms. The
results are presented in the graphics window through predefined plots relevant for
CFD, expressions of the physical quantities that you can define freely, and derived
tabulated quantities (for example, average pressure at a surface and drag
coefficients) obtained from a simulation.
The work flow in the CFD Module is quite straightforward and can be described
by the following steps: define the geometry, select the fluid to be modeled, select
the type of flow, define boundary and initial conditions, define the finite element
mesh, select a solver, and visualize the results. All these steps are accessed from the
COMSOL Desktop. The mesh and solver steps are usually carried out
automatically using default settings, which are tuned for each specific fluid flow
interface.
The CFD Modules Model Library describes the fluid flow interfaces and their
different features through tutorial and benchmark examples for the different types
of flows. Here you find models of industrial equipment and devices, tutorial
models for education, and benchmark models for verification and validation of the
fluid flow interfaces. Go to The Model Library to access these resources.
This introduction is intended to give you an accelerated start-up in CFD model
building. It contains examples of the typical use of the module, a list of all the fluid
flow interfaces including a short description for each interface, and a tutorial
example, Tutorial ExampleWater Purification Reactor, that introduces the
workflow.
cfd_introduction.book Page 2 Monday, September 24, 2012 4:07 PM
Introduction | 3
Aspects of CFD Simulations
The physical nature of a flow field is governed by conservation laws for mass
momentum and energy, supplemented by boundary and initial conditions, and
may be characterized by a set of parameters such as the Reynolds number, the
Mach number and the Grashof number.
The Reynolds number, for example, expresses the ratio of the inertia force to the
friction force. For very small values of the Reynolds number the CFD Module
offers the Creeping Flow interface, for intermediate values, the Laminar Flow
interface, and for very large values, the Turbulent Flow interface. Similarly, the
Mach number expresses the ratio of the speed of the fluid motion to the speed of
sound of the flowing medium. For Mach numbers greater than 0.3, there is the
High Mach Number Flow interface. Temperature variations caused by heat
transfer, compression work or work done by friction forces result in an
inhomogeneous density field. The significance of thermally induced buoyancy
forces in the momentum equation is characterized by the ratio of the Grashof
number, to the square of the Reynolds number for Reynolds numbers greater than
one, or, to the Reynolds number for Reynolds numbers smaller than one. For
non-vanishing values of this ratio, the Non Isothermal Flow interface is available.
You can use the Two-Phase Flow interfaces in the Multiphase Flow branch to
model moving, deformable interfaces separating two different fluids whereas the
other interfaces in this branch mainly are used for modeling suspensions of many
particles, droplets or bubbles. Among the latter, the Euler-Euler Model interface
is able to handle high concentration levels with frequent collisions and transients
in the relative velocity between the phases (non-vanishing ratios of the particle
relaxation time to the macroscopic flow time scale). For reacting flow and flow in
porous media, the Chemical Species Transport and Porous Media and Subsurface
Flow interfaces are available.
Contrary to experimental analyses, most often performed in a laboratory, where
measurements are limited to a small number of points, a CFD simulation gives the
big picture of the flow field. Qualitative interpretation of the flow and pressure
fields is usually the first step towards creating or improving a design.
Figure 2 shows the flow field around a solar panel. The presence of a wake in front
of the panel, caused by another panel in the solar power plant, may cause lift forces
that would not be present if the panel was analyzed alone in a simulation.
Three-dimensional graphics such as surface plots, animations, streamlines,
cfd_introduction.book Page 3 Monday, September 24, 2012 4:07 PM
4 | Introduction
ribbons, arrows, and particle tracing plots are examples of the tools that you can
use for qualitative studies.
Figure 2: Turbulent fluid flow around a solar panel solved using the CFD Module.
In addition to the qualitative big-picture view, simulations performed with the
CFD Module give accurate quantitative estimates of properties of the system, such
as the average flow at a given pressure difference, the drag and lift coefficients of
bodies subjected to a flow or the air quality in a ventilated room.
In Figure 3 and Figure 4, the pressure losses are estimated for a nozzle used in
medical applications. The shear stresses and fluid forces in the nozzle system may
also reveal the risks for causing blood damages in medical equipment, which have
to be accounted for when controlling the flow.
cfd_introduction.book Page 4 Monday, September 24, 2012 4:07 PM
Introduction | 5
Figure 3: Pressure field and flow field in a model of a nozzle relevant for applications in medical design.
Figure 4: Pressure difference between inlet and outlet at different average flow rates through the nozzle.
cfd_introduction.book Page 5 Monday, September 24, 2012 4:07 PM
6 | Introduction
For quantitative studies, the CFD Module has a vast range of tools for evaluating
results. For example, to evaluate surface and volume averages, maximum and
minimum values, and derived values (functions and expressions of the solution) as
well as to generate tables and x-y plots. Derived values such as drag and lift
coefficients and other values relevant for CFD are predefined in the module.
Typically, qualitative studies form the basis for understanding, which in turn can
spark new ideas. These ideas can then lead to significant improvements to products
and processes, often in quantum leaps. Quantitative studies, on the other hand,
form the basis for optimization and control, which can also greatly improve
products and processes but usually in a series of many small steps. Access to
accurate quantitative results will often give a company the necessary technological
edge to beat the competition.
cfd_introduction.book Page 6 Monday, September 24, 2012 4:07 PM
The CFD Module Interfaces | 7
The CFD Module Interfaces
The fluid flow interfaces in this module are based on the laws for conservation of
momentum, mass, and energy in fluids. Different combinations and expressions of
the conservation laws, applicable to the relevant physics of the flow field, result in
the different flow models. These laws of physics are translated into sets of partial
differential equations with corresponding initial and boundary conditions.
A fluid flow interface defines a number of features, comprising specifications for
the fluid properties, boundary conditions, initial conditions and possible
constraints. Each feature represents an operation that describes a term or
condition in the conservation equations. Such a term or condition can be defined
on a geometric entity of the model, such as a domain, boundary, edge (for 3D
models), or point.
Figure 5 shows the Model Builder including a Laminar Flow interface and the
settings window for the selected Fluid Properties 1 feature node. The Fluid
Properties 1 node adds the terms to the model equations to a selected geometrical
domain. Furthermore, the Fluid Properties 1 feature may link to the Materials
feature node to obtain physical properties such as density and dynamic viscosity,
in this case the fluid properties of water. The fluid properties, defined by the
Water, liquid material, can be functions of the modeled physical quantities, such
as pressure and temperature. In the same way, the Wall 1 node adds the boundary
conditions to the walls of the fluid domain.
cfd_introduction.book Page 7 Monday, September 24, 2012 4:07 PM
8 | The CFD Module Interfaces
Figure 5: The Model Builder including a Laminar Flow interface (to the left), and the Fluid Properties
settings window for the selected feature node (to the right).The Equation section in the settings window
shows the model equations and the terms added by the Fluid Properties 1 node to the model equations.
The added terms are underlined with a dotted line. The text also explains the link between the Water,
liquid material node and the values for the fluid properties.
The CFD Module includes a large number of Fluid Flow interfaces for different
types of flow. It also includes Chemical Species Transport interfaces for reacting
flows in multicomponent solutions and interfaces for heat transfer in solids, fluids,
and porous media found under the Heat Transfer branch.
Figure 6 shows the fluid flow interfaces and the other physics interfaces that are
included as displayed in the Model Wizard for a 3D model. Also see The Physics
cfd_introduction.book Page 8 Monday, September 24, 2012 4:07 PM
The CFD Module Interfaces | 9
List by Space Dimension and Study Type on page 13. A short description of the
interfaces follows.
Figure 6: The 3D model physics list for the CFD Module as shown in the Model Wizard.
cfd_introduction.book Page 9 Monday, September 24, 2012 4:07 PM
10 | The CFD Module Interfaces
SINGLE-PHASE FLOW
The Laminar Flow interface ( ) is used primarily to model flows of low to
intermediate Reynolds numbers. The interface solves the Navier-Stokes equations,
for incompressible and weakly compressible flows (up to Mach 0.3). This fluid
flow interface also allows for simulation of non-Newtonian fluid flow.
The interfaces under the Turbulent Flow branch ( ) model flow of high
Reynolds numbers. The interfaces use the Reynolds-averaged Navier-Stokes
(RANS) equations and solve for the averaged velocity field and averaged pressure.
These fluid flow interfaces have different models for the turbulent viscosity. There
are several turbulence models availablea standard k- model, a Low Reynolds
number k- model, a k- model, and the Spalart-Allmaras model. Similarly to the
Laminar Flow interface, compressibility (Mach < 0.3) is selected by default.
The standard k- model is the most widely used turbulence model since it is often
a good compromise between accuracy and computational cost (memory and
CPU-time). The Low Reynolds number k- model is more accurate than the
standard model, especially close to walls, but this accuracy comes at a higher
computational cost. The k- model is an alternative to the standard k- model and
it can often give more accurate results. However, the k- model is also less robust
than the standard k- model. The Spalart-Allmaras model is specifically designed
for aerodynamic applications, such as flow around wing profiles, but is also widely
used for other applications due to its high robustness and decent accuracy.
The Creeping Flow interface ( ) approximates the Navier-Stokes equations for
very low Reynolds numbers. This is often referred to as Stokes flow and is
appropriate for use when viscous flow is dominant, such as in very small channels
or microfluidics applications.
The Rotating Machinery interfaces ( ) are used for modeling flow where one or
more of the boundaries rotate, for example in mixers and propellers. The physics
interfaces support compressibility (Mach < 0.3), laminar non-Newtonian flow,
and turbulent flow using the standard k- model.
THIN-FILM FLOW
The Thin Film Flow interfaces ( ) model the flow of liquids or gases confined in
a thin layer on a surface. Using equations defined on the surface, these interfaces
compute the average velocity and pressure in narrow planar structures. The
interfaces are thus boundary interfaces, which means that the boundary level is the
highest level; they do not have a domain level. The simulation of the flow of a
lubrication oil between two rotating cylinders is an example of a possible use of
this interface.
cfd_introduction.book Page 10 Monday, September 24, 2012 4:07 PM
The CFD Module Interfaces | 11
MULTIPHASE FLOW
The interfaces under the Bubbly Flow branch ( ) model two-phase flow where
the fluids form a gas-liquid homogeneous mixture, and the content of the gas is
less than 10%. There is support for both laminar and turbulent flows using an
extended version of the k- turbulence model which accounts for bubble-induced
turbulence. For laminar flows, the interface supports non-Newtonian liquids. The
Bubbly Flow interfaces also allow for mass transfer between the two phases.
The interfaces under the Mixture Model branch ( ) are similar to the Bubbly
Flow interfaces but assume that the dispersed phase consists of solid particles or
liquid droplets. The continuous phase has to be a liquid. There is support for both
laminar and turbulent flows using the k- turbulence model. For laminar flows,
the interface supports non-Newtonian fluids. The Mixture Model interfaces also
allow for mass transfer between the two phases.
The Euler-Euler Model interface ( ) for two-phase flow is able to handle the
same cases as the Bubbly Flow and Mixture Model interfaces but is not limited to
low concentrations of the dispersed phase. In addition, the Euler-Euler Model
interface can handle large differences in density between the phases, such as the
case of solid particles in air. This makes the model suitable for simulations of
fluidized beds.
The Two-Phase Flow, Level Set interface ( ) and the Two-Phase Flow, Phase
Field interface ( ), are both used primarily to model two fluids separated by a
fluid interface. The moving interface is tracked in detail using the level set method
and the phase field method, respectively. Similar to other fluid flow interfaces,
these interfaces support both compressible (Mach < 0.3) and incompressible flow.
They support laminar flow where one or both fluids can be non-Newtonian. The
interfaces support turbulent flow using the standard k- turbulence model as well
as Stokes flow.
POROUS MEDIA AND SUBSURFACE FLOW
The Brinkman Equations interface ( ) models flow through a porous medium
where the influence of shear stresses are significant. The physics interface supports
both the Stokes-Brinkman formulation, suitable for very low flow velocities, and
Forchheimer drag, which is used to account for effects at higher velocities. The
fluid can be either incompressible or compressible, given that the Mach number is
less than 0.3.
The Darcys Law interface ( ) models relatively slow flows through porous
media for cases where the effects of shear stresses perpendicular to the flow are
small.
cfd_introduction.book Page 11 Monday, September 24, 2012 4:07 PM
12 | The CFD Module Interfaces
The Free and Porous Media Flow interface ( ) models porous media containing
open channels connected to the porous media, such as in fixed-bed reactors and
catalytic converters.
The Two-Phase Darcys Law interface ( ) sets up two Darcy-law equations, one
for each fluid phase in the porous medium, and couples the two, for example using
a capillary expression. It is tailored to model effects such as moisture transport in
porous media.
NONISOTHERMAL FLOW
The Non-Isothermal Flow, Laminar Flow interface ( ) is used primarily to
model slow-moving flow in environments where the temperature and flow fields
have to be coupled. A typical example is natural convection. The physics interface
has predefined functionality to couple heat transfer in fluids and solids.
The Non-Isothermal Flow, Turbulent Flow interfaces ( ) use the
Reynolds-Averaged Navier-Stokes (RANS) equations coupled to heat transfer in
fluids and in solids. There is support for additional RANS turbulence models the
standard k- model, a Low Reynolds number k- model, a k- model, and the
Spalart-Allmaras model.
The Conjugate Heat Transfer interface ( ) is also included in the CFD Module
and is almost identical to the Non-Isothermal Flow interface, since they only differ
in the default settings.
HIGH MACH NUMBER FLOW
The High Mach Number Flow, Laminar Flow interface ( ) solves momentum
and energy equations for fully compressible laminar flow. The physics interface is
typically used to model low-pressure systems, where the flow velocity can be very
large but where the flow stays laminar.
The High Mach Number Flow, Turbulent Flow interfaces ( ) solve momentum
and energy equations for fully compressible turbulent flow coupled to a RANS
turbulence model. There are two versions: one that couples to the k- turbulence
model and one that couples to the Spalart-Allmaras turbulence model.
REACTING FLOW
The Laminar Flow interface ( ) under Reacting Flow combines the functionality
of the Single-Phase Flow and Transport of Concentrated Species interfaces. Using
this interface the mass and momentum transport in a reacting fluid can be
modeled from a single physics interface, with the couplings between the velocity
field and mixture density set up automatically. This interface is applicable flow in
the laminar regime.
cfd_introduction.book Page 12 Monday, September 24, 2012 4:07 PM
The CFD Module Interfaces | 13
The Turbulent Flow interfaces ( ) under Reacting Flow use the
Reynolds-Averaged Navier-Stokes (RANS) equations together with the
functionality in the Transport of Concentrated Species interface to model mass
and momentum transport in turbulent reacting fluid flow. The supported RANS
models comprise of the standard k- model, a Low Reynolds number k- model
and a k- model.
REACTING FLOW IN POROUS MEDIA
The Reacting Flow in Porous Media, Transport of Diluted Species multiphysics
interface ( ) is used to treat diluted reacting mixtures transported by a free and/
or porous media flow. The model coupling for the velocity field is set up
automatically. In addition, effective diffusion coefficients in a porous matrix can
be calculated from the porosity.
The Reacting Flow in Porous Media, Transport of Concentrated Species interface
( ) is a multiphysics interface treating concentrated reacting mixtures
transported by a free and/or porous media flow. The model couplings between
velocity field and mixture density are set up automatically. In addition, effective
diffusion coefficients in a porous matrix can be calculated from the porosity.
The Physics List by Space Dimension and Study Type
The table lists the physics interfaces available with this module in addition to those
included with the COMSOL basic license.
PHYSICS ICON TAG SPACE DIMENSION PRESET STUDY TYPE
Chemical Species Transport
Transport of Diluted
Species*
chds all dimensions stationary; time dependent
Transport of Concentrated
Species
chcs all dimensions stationary; time dependent
Reacting Flow
Laminar Flow rspf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, k- rspf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, k- rspf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Reacting Flow, Turbulent
Flow, Low Re k-
rspf 3D, 2D, 2D
axisymmetric
stationary; time dependent
cfd_introduction.book Page 13 Monday, September 24, 2012 4:07 PM
14 | The CFD Module Interfaces
Reacting Flow in Porous Media
Transport of Diluted
Species
rfds 3D, 2D, 2D
axisymmetric
stationary; time dependent
Transport of Concentrated
Species
rfcs 3D, 2D, 2D
axisymmetric
stationary; time dependent
Fluid Flow
Single-Phase Flow
Single-Phase Flow, Laminar
Flow*
spf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, k- spf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, k- spf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, Low Re k- spf 3D, 2D, 2D
axisymmetric
stationary with initialization;
transient with initialization
Turbulent Flow,
Spalart-Allmaras
spf 3D, 2D, 2D
axisymmetric
stationary with initialization;
transient with initialization
Creeping Flow spf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Rotating Machinery, Laminar
Flow
rmspf 3D, 2D time dependent
Rotating Machinery,
Turbulent Flow, k-
rmspf 3D, 2D time dependent
Thin-Film Flow
Thin-Film Flow, Domain tff 3D, 2D, 2D
axisymmetric
stationary; eigenfrequency;
frequency domain;
frequency domain modal;
time dependent; time
dependent modal;
frequency-domain,
perturbation
PHYSICS ICON TAG SPACE DIMENSION PRESET STUDY TYPE
cfd_introduction.book Page 14 Monday, September 24, 2012 4:07 PM
The CFD Module Interfaces | 15
Thin-Film Flow, Edge tffs 2D stationary; eigenfrequency;
frequency domain;
frequency domain modal;
time dependent; time
dependent modal;
frequency-domain,
perturbation
Multiphase Flow
Bubbly Flow
Laminar Bubbly Flow bf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Bubbly Flow bf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Mixture Model
Mixture Model, Laminar
Flow
mm 3D, 2D, 2D
axisymmetric
stationary; time dependent
Mixture Model, Turbulent
Flow
mm 3D, 2D, 2D
axisymmetric
stationary; time dependent
Euler-Euler Model
Euler-Euler Model, Laminar
Flow
ee 3D, 2D, 2D
axisymmetric
stationary; time dependent
Two-Phase Flow, Level Set
Laminar Two-Phase Flow,
Level Set
tpf 3D, 2D, 2D
axisymmetric
transient with initialization
Turbulent Two-Phase Flow,
Level Set
tpf 3D, 2D, 2D
axisymmetric
transient with initialization
Two-Phase Flow, Phase Field
Laminar Two-Phase Flow,
Phase Field
tpf 3D, 2D, 2D
axisymmetric
transient with initialization
Turbulent Two-Phase Flow,
Phase Field
tpf 3D, 2D, 2D
axisymmetric
transient with initialization
PHYSICS ICON TAG SPACE DIMENSION PRESET STUDY TYPE
cfd_introduction.book Page 15 Monday, September 24, 2012 4:07 PM
16 | The CFD Module Interfaces
Porous Media and Subsurface Flow
Brinkman Equations br 3D, 2D, 2D
axisymmetric
stationary; time dependent
Darcys Law dl all dimensions stationary; time dependent
Free and Porous Media
Flow
fp 3D, 2D, 2D
axisymmetric
stationary; time dependent
Two-Phase Darcys Law tpdl 3D, 2D, 2D
axisymmetric
stationary; time dependent
Non-Isothermal Flow
Laminar Flow nitf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow
Turbulent Flow, k- nitf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, k- nitf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, Low Re k- nitf 3D, 2D, 2D
axisymmetric
stationary with initialization;
transient with initialization
Turbulent Flow,
Spalart-Allmaras
nitf 3D, 2D, 2D
axisymmetric
stationary with initialization;
transient with initialization
High Mach Number Flow
Laminar Flow hmnf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, k- hmnf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow,
Spalart-Allmaras
hmnf 3D, 2D, 2D
axisymmetric
stationary with initialization;
transient with initialization
Heat Transfer
Heat Transfer in Fluids ht 3D, 2D, 2D
axisymmetric
stationary; time dependent
Heat Transfer in Porous
Media
ht 3D, 2D, 2D
axisymmetric
stationary; time dependent
PHYSICS ICON TAG SPACE DIMENSION PRESET STUDY TYPE
cfd_introduction.book Page 16 Monday, September 24, 2012 4:07 PM
The CFD Module Interfaces | 17
Heat Transfer in Solids ht 3D, 2D, 2D
axisymmetric
stationary; time dependent
Conjugate Heat Transfer
Laminar Flow nitf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow
Turbulent Flow, k- nitf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, k- nitf 3D, 2D, 2D
axisymmetric
stationary; time dependent
Turbulent Flow, Low Re k- nitf 3D, 2D, 2D
axisymmetric
stationary with initialization;
transient with initialization
Turbulent Flow,
Spalart-Allmaras
nitf 3D, 2D, 2D
axisymmetric
stationary with initialization;
transient with initialization
Mathematics
Moving Interface
Level Set ls all dimensions transient with initialization
Phase Field pf all dimensions time dependent
* This is an enhanced interface, which is included with the base COMSOL package but has
added functionality for this module.
PHYSICS ICON TAG SPACE DIMENSION PRESET STUDY TYPE
cfd_introduction.book Page 17 Monday, September 24, 2012 4:07 PM
18 | The Model Library
The Model Library
To open a CFD Module Model Library model, select View > Model Library
from the main menu in COMSOL Multiphysics. In the Model Library window
that opens, expand the CFD Module folder and browse or search the contents.
Click Open Model and PDF to open the model in COMSOL Multiphysics and a
PDF to read background theory about the model including the step-by-step
instructions to build it.
The MPH-files in the COMSOL model libraries can have two formatsFull
MPH-files or Compact MPH-files.
Full MPH-files, including all meshes and solutions. In the Model Library
these models appear with the icon. If the MPH-files size exceeds 25MB,
a tip with the text Large file and the file size appears when you position
the cursor at the models node in the Model Library tree.
Compact MPH-files with all settings for the model but without built meshes
and solution data to save space on the DVD (a few MPH-files have no
solutions for other reasons). You can open these models to study the settings
and to mesh and re-solve the models. It is also possible to download the full
versionswith meshes and solutionsof most of these models through
Model Library Update. In the Model Library these models appear with the
icon. If you position the cursor at a compact model in the Model Library
window, a No solutions stored message appears. If a full MPH-file is
available for download, the corresponding nodes context menu includes a
Model Library Update item.
The rest of this guide uses two models from the Model Library. The Tutorial
ExampleBackstep, which starts on the next page, solves a laminar flow problem
and Tutorial ExampleWater Purification Reactor on page 27 examines a
turbulent flow problem using the Turbulent Flow, k- interface.
cfd_introduction.book Page 18 Monday, September 24, 2012 4:07 PM
Tutorial ExampleBackstep | 19
Tutorial ExampleBackstep
This tutorial model solves the incompressible Navier-Stokes equations in a
backstep geometry. A characteristic feature of fluid flow in geometries of this kind
is the recirculation region that forms where the flow exits the narrow inlet region.
The model demonstrates the modeling procedure for laminar flows in the CFD
Module.
Model Geometry
The model consists of a pipe connected to a block-shaped duct (see Figure 7).
Due to symmetry, it is sufficient to model one eighth of the full geometry.
Figure 7: The model geometry showing the symmetry.
Domain Equations and Boundary Conditions
The flow in the system is laminar and therefore the Laminar Flow interface is used.
The inlet flow is fully developed laminar flow, described by the corresponding
inlet boundary condition. This boundary condition computes the flow profile for
fully developed laminar flow in channels of an arbitrary cross section. The
boundary condition at the outlet sets a constant relative pressure. Furthermore,
Wall
Wall
Symmetry
Symmetry
Inlet
Outlet
cfd_introduction.book Page 19 Monday, September 24, 2012 4:07 PM
20 | Tutorial ExampleBackstep
the vertical and inclined boundaries along the length of the geometry are
symmetry boundaries. All other boundaries are solid walls described by a non-slip
boundary condition.
Results
Figure 8 shows a combined surface and arrow plot of the flow velocity. This plot
does not reveal the recirculation region in the duct immediately beyond the inlet
pipes end. For this purpose, a streamline plot is more useful, as shown in Figure 9.
Figure 8: The velocity field in the backstep geometry.
cfd_introduction.book Page 20 Monday, September 24, 2012 4:07 PM
Tutorial ExampleBackstep | 21
Figure 9: The recirculation region visualized using a velocity streamline plot.
The following instructions show how to formulate, solve, and reproduce these
plots.
Model Wi zard
The first step is to select the space dimension and the Laminar Flow interface for
stationary studies.
1 Open COMSOL Multiphysics. In the Model Wizard the Space Dimension
defaults to 3D. Click Next .
2 In the Add physics tree under Fluid Flow>Single-Phase Flow, double-click
Laminar Flow (spf) to add it to the Selected physics list. Click Next .
3 Under Studies>Preset Studies select Stationary .
4 Click Finish .
cfd_introduction.book Page 21 Monday, September 24, 2012 4:07 PM
22 | Tutorial ExampleBackstep
Gl obal Def i ni ti ons - Parameters
The first task is to define a parameter for the inlet velocity then use this parameter
to run parametric studies.
1 In the Model Builder, right-click Global Definitions and choose Parameters
.
2 Go to the Parameters settings window. In
the table, enter the following settings:
- In the Name field, enter v0
- In the Expression field, enter 1[cm/s]
- In the Description field, enter Inlet
velocity
Geometry 1
You can build the backstep geometry from geometric primitives. In order to save
time, a file is available for insertion into the model. This file contains the sequence
of geometry that builds the backstep.
Note: The location of the file used in this exercise varies based on your
installation. For example, if the installation is on your hard drive, the file path
might be similar to C:\Program Files\COMSOL43a\models\.
1 In the Model Builder under the Model 1 (mod1) node, right-click the
Geometry 1 node. From the context menu select Insert Sequence from File
.
2 In the Insert Sequence from File window, browse to the folder
CFD_Module\Single-Phase_Tutorials under the COMSOL installation
directory and double-click the file backstep_geom_sequence.mph.
3 In the Geometry settings window, click the Build All button .
The geometry sequence is now inserted into your model and should look like the
geometry in Figure 7 on page 19.
cfd_introduction.book Page 22 Monday, September 24, 2012 4:07 PM
Tutorial ExampleBackstep | 23
Materi al s
1 From the main menu, select
View>Material Browser .
2 In the Material Browser window, under
Built-In right-click Water, liquid and
choose Add Material to Model from
the menu.
The physical properties are now available
for the CFD simulation. This also defines
the domain settings. The next step is to
specify the boundary conditions.
Lami nar Fl ow
Inlet 1
1 In the Model Builder, right-click Laminar
Flow and choose Inlet .
2 Go to the Inlet settings window. Select
Boundary 1, which represents the inlet.
3 Under Boundary Condition from the
Boundary condition list, select Laminar
inflow.
4 Under Laminar Inflow in the U
av
field,
enter v0 (defined as a Global Parameter).
cfd_introduction.book Page 23 Monday, September 24, 2012 4:07 PM
24 | Tutorial ExampleBackstep
Symmetry 1
1 In the Model Builder, right-click Laminar
Flow and choose Symmetry .
2 Go to the Symmetry settings window.
Select Boundaries 2 and 3 only.
Outlet 1
1 In the Model Builder, right-click Laminar Flow and choose Outlet .
The default outlet condition specifies a zero relative pressure.
2 Go to the Outlet settings window. Select Boundary 7 only.
The sequence of nodes in the Model Builder under
Laminar Flow should match the figure.The D in the
upper left corner of a node means it is a default node.
All other boundaries now have the default wall condition.
Mesh 1
1 In the Model Builder under Model 1, click
Mesh 1 .
2 Go to the Mesh settings window. Under
Mesh Settings from the Element size list,
select Coarse.
The physics induced mesh automatically introduces a mesh that is a bit finer on
the walls compared to the free stream mesh. The following figure shows the
boundary layer mesh at the walls.
cfd_introduction.book Page 24 Monday, September 24, 2012 4:07 PM
Tutorial ExampleBackstep | 25
3 Click the Build All button on the settings window.
Zoom into the mesh in the Graphics window to confirm it matches the figure.
Study 1
1 In the Model Builder, right-click Study 1 and choose Compute .
When Compute is selected, COMSOL automatically uses a suitable solver for
the problem.
cfd_introduction.book Page 25 Monday, September 24, 2012 4:07 PM
26 | Tutorial ExampleBackstep
Resul ts
Two plots are automatically created, one slice plot for the velocity and one
pressure contour plot on the wall.
Velocity (spf)
1 In the Model Builder under Results, expand the Velocity (spf) node.
2 Right-click Slice 1 and choose Delete. Click Yes to confirm.
3 In the Model Builder, right-click Velocity (spf) and choose Surface .
4 Right-click Velocity (spf) and choose Arrow Surface .
5 Go to the Arrow Surface settings window.
- Under Coloring and Style from the
Arrow length list, select Logarithmic.
- From the Color list, select Yellow.
6 Click the Zoom Extents button on the
Graphics window toolbar.
The plot in Figure 8 on page 20 displays in
the Graphics window. To see the
recirculation effects, create a streamline plot
of the velocity field.
3D Plot Group 3
1 In the Model Builder, right-click Results and choose 3D Plot Group .
2 Right-click 3D Plot Group 3 and choose Streamline .
3 In the Graphics window, select Boundary 1 only and right-click it to add this
boundary to the selection list in the Streamline settings window. The
streamlines now start at this boundary.
4 Go to the Streamline settings window. Under Coloring and Style from the Line
type list, select Tube.
5 Right-click Streamline 1 and choose Color
Expression .
The plot in Figure 9 on page 21 displays in the Graphics
window.
cfd_introduction.book Page 26 Monday, September 24, 2012 4:07 PM
Tutorial ExampleWater Purification Reactor | 27
Tutorial ExampleWater Purification Reactor
Water purification for turning natural water into drinking water is a process
constituted of several steps. At least one step must be a disinfectant step. One way
to achieve efficient disinfection in an environmentally friendly way is to use ozone.
A typical ozone purification reactor is about 40 m long and resembles a mace with
partial walls or baffles that divide the space into room-sized compartments (Ref.
1). When water flows through the reactor turbulent flow is created along its
winding path around the baffles towards the exit pipe. The turbulence mixes the
water with ozone gas that enters through diffusers just long enough to inactivate
micro-pollutants. When the water leaves the reactor, the remaining purification
steps filter off or otherwise remove the reacted pollutants.
In analyzing an ozone purification reactor, the first step is to get an overview of
the turbulent flow field. The results from the turbulent-flow simulation can then
be used for further analyses of residence time and chemical species transport and
reactions by adding more physics to the model. The current model solves for
turbulent flow in a water treatment reactor using the Turbulent Flow, k-
interface.
cfd_introduction.book Page 27 Monday, September 24, 2012 4:07 PM
28 | Tutorial ExampleWater Purification Reactor
Model Geometry
The model geometry along with some boundary conditions are shown in
Figure 10. The full reactor has a symmetry plane which is utilized to reduce the
size of the model.
Figure 10: Model geometry. All boundaries except the inlet, outlet and symmetry plane are walls.
Domain Equations and Boundary Conditions
Based on this velocity, which is 0.1 m/s, and a lenght scale L equal to the diameter
of the inlet, the Reynolds number is
Here v is the kinematic viscosity. The high Reynolds number clearly indicates that
the flow will be turbulent. This means that the flow must be modeled using a
turbulence model. In this case, you will use the k- model which is often used in
industrial applications, much because it is both relatively robust and
computationally inexpensive compared to more advanced turbulence models. One
major reason to why the k- model is inexpensive is that it employs wall functions
to describe the flow close to walls instead of resolving the very steep gradients
there. All boundaries in Figure 10 except the inlet, the outlet and the symmetry
plane, are walls.
Inlet
Outlet
Symmetry
Re
U L

-------------
0.1 0.4
1 10
6

---------------------- 4 10
5
= = =
cfd_introduction.book Page 28 Monday, September 24, 2012 4:07 PM
Tutorial ExampleWater Purification Reactor | 29
The inlet velocity is prescribed as a plug flow profile. The turbulent intensity is set
to 5 % and the turbulent length scale is specified according to Table 3-3 in
Theory for the Turbulent Flow Interfaces in CFD Module Users Guide. A
constant pressure is prescribed on the outlet.
Notes About the Implementation
Three-dimensional turbulent flows can take a rather long time to solve, even when
using a turbulence models with wall functions. To make this tutorial feasible, the
mesh is deliberately selected to be relatively coarse and the results are hence not
mesh-independent. In any model, the effect or refining the mesh should be
investigated in order to ensure that the model is well-resolved.
Results
The velocity field in the symmetry plane is shown in Figure 11. The jet from the
inlet hits the top of the first baffle which splits the jet. One half creates a strong
recirculation zone in the first chamber. The other half continues down into the
reactor and gradually spreads out. The velocity magnitude decreases as more fluid
is entrained into the jet.
Figure 11: Velocity field in the symmetry plane.
cfd_introduction.book Page 29 Monday, September 24, 2012 4:07 PM
30 | Tutorial ExampleWater Purification Reactor
Figure 12 gives a more complete picture of the mixing process in the reactor. The
streamlines are colored by the velocity magnitude, and their width are
proportional to the turbulent viscosity. Wide lines hence indicate high degree of
mixing. The turbulence in this model is mainly produced in the shear layers
between the central jet and the recirculation zones. The mixing can be seen to be
relatively weak in the beginning of the reactor and that it increases further
downstream.
Figure 12: Streamlines colored by velocity. The width of the streamlines are proportional to the turbulent
viscosity.
Reference
1. http://www.comsol.com/stories/hofman_water_purification/full/
cfd_introduction.book Page 30 Monday, September 24, 2012 4:07 PM
Tutorial ExampleWater Purification Reactor | 31
Model Wi zard
The first step is to select the space dimension and the Turbulent Flow, k- interface
for stationary studies.
1 Open COMSOL Multiphysics. In the Model Wizard the Space Dimension
defaults to 3D. Click Next .
2 In the Add physics tree, select Fluid Flow>Single-Phase Flow>Turbulent
Flow>Turbulent Flow, k- (spf) .
3 Click Next .
4 Under Studies>Preset Studies select Stationary .
5 Click Finish .
Gl obal Def i ni ti ons - Parameters
The first task is to define a parameter for the inlet velocity. Parameters can be used
to run parametric studies.
1 In the Model Builder window, right-click Global Definitions and choose
Parameters .
2 Go to the Parameters
settings window. In the
table, enter the following
settings:
- In the Name field, enter
u_in
- In the Expression field,
enter 0.1[m/s]
- In the Description field,
enter Inlet velocity
cfd_introduction.book Page 31 Monday, September 24, 2012 4:07 PM
32 | Tutorial ExampleWater Purification Reactor
Geometry 1
You can build the reactor geometry from geometric primitives. In order to save
time, a file is available for insertion into the model. This file contains the sequence
of geometry that builds the reactor.
The location of the file used in this exercise varies based on your installation. For
example, if the installation is on your hard drive, the file path might be similar to
C:\Program Files\COMSOL43a\models\.
1 In the Model Builder under the Model 1 (mod1) node, right-click the
Geometry 1 node. From the context menu select Insert Sequence from File
.
2 In the Insert Sequence from File window, browse to the folder
CFD_Module\Single-Phase_Tutorials under the COMSOL installation
directory and double-click the file
water_purification_reactor_geom_sequence.mph.
3 In the Geometry settings window, click the Build All button .
The geometry sequence is now inserted into your model and should look like the
figure below.
cfd_introduction.book Page 32 Monday, September 24, 2012 4:07 PM
Tutorial ExampleWater Purification Reactor | 33
Materi al s
1 From the main menu, select View>Material Browser .
2 In the Material Browser window, under Built-In right-click Water, liquid and
choose Add Material to Model from the menu.
The physical properties are now available for the CFD simulation. This also defines
the domain settings. The next step is to specify the boundary conditions.
cfd_introduction.book Page 33 Monday, September 24, 2012 4:07 PM
34 | Tutorial ExampleWater Purification Reactor
Turbul ent Fl ow, k-
Inlet 1
1 In the Model Builder window, under
Model 1 right-click Turbulent Flow, k-
and choose Inlet .
2 Select Boundary 1, which represents the
inlet.
3 In the Inlet settings window, locate the
Boundary Condition section.
4 In the L
T
edit field, type 0.07*0.2[m].
5 Locate the Velocity section. In the U
0
edit
field, type u_in.
Symmetry 1
1 In the Model Builder window, right-click Model 1>Turbulent Flow, k- and
choose Symmetry .
2 Select Boundary 3 only.
Outlet 1
1 Right-click right-click Turbulent Flow, k- and choose Outlet .
2 Select Boundary 28 only.
The sequence of nodes in the Model Builder under
Turbulent Flow, k- should match the figure.The D in the
upper left corner of a node means it is a default node.
All boundaries not selected in Inlet 1, Symmetry 1 or Outlet
1 now have the default wall condition.
cfd_introduction.book Page 34 Monday, September 24, 2012 4:07 PM
Tutorial ExampleWater Purification Reactor | 35
Mesh 1
The physics induced mesh automatically introduces a mesh that is a bit finer on
the walls compared to the free stream mesh and it also refines the mesh at sharp
corners and adds a boundary layer mesh.
The finer mesh on the walls are not critical in this model since most of the
turbulence is produced in the shear layers between the jet and the recirculation
zones. The boundary layer mesh can also be coarsened in order to save
computational time.
1 In the Model Builder window, under Model 1 click Mesh 1 .
2 In the Mesh settings window, locate the Mesh Settings section.
3 From the Element size list, choose Coarser.
Size 1
1 Right-click Model 1>Mesh 1 and choose Edit
Physics-Induced Sequence . A mesh sequence as
depicted here to the right will appear. It contains
suggestions made by the physics interface. The asterisk
on each of the mesh features indicate that the features
are not yet built.
2 In the Model Builder window, under Model 1>Mesh 1
right-click Size 1 and choose Disable .
cfd_introduction.book Page 35 Monday, September 24, 2012 4:07 PM
36 | Tutorial ExampleWater Purification Reactor
Boundary Layer Properties 1
1 In the Model Builder window,
expand the Model 1>Mesh
1>Boundary Layers 1 node,
then click Boundary Layer
Properties 1 .
2 In the Boundary Layer Properties
settings window, locate the
Boundary Layer Properties section.
3 In the Number of boundary layers
edit field, type 2.
4 In the Thickness adjustment factor
edit field, type 6.
5 In the Model Builder window,
collapse the Mesh 1 node.
6 Click the Build All button.
The mesh is now complete and should match the figure below. The mesh can
differ slightly depending on which computer architecture that you use. The mesh
in the figure is built on a Windows computer, and will look similar, but not
identical, if instead built on, for example, a Linux computer.
cfd_introduction.book Page 36 Monday, September 24, 2012 4:07 PM
Tutorial ExampleWater Purification Reactor | 37
Study 1
Next, solve for the flow field. This takes approximately 15 minutes on a quad-core
desktop computer.
1 In the Model Builder, right-click Study 1 and choose Compute .
When Compute is selected, COMSOL automatically uses a suitable solver for the
problem.
Resul ts
Three plots are automatically created, one slice plot for the velocity, one pressure
contour plot on the wall and one boundary plot of the wall lift-off in viscous units
for the wall functions. The last one is important since it gives an indication on how
well resolved the flow is at the walls. See Theory for the Turbulent Flow
Interfaces in CFD Module Users Guide for further details on the wall functions.
The following steps reproduce Figure 11 on page 29.
First, create a data set that corresponds to the non-wall boundaries.
Data Sets
1 In the Model Builder window, under Results
right-click Data Sets and choose Surface .
2 Select Boundaries 1, 3, and 28 only.
Velocity (spf)
1 In the Model Builder window, expand the Results>Velocity (spf) node.
2 Right-click Slice 1 and choose Disable .
3 In the Model Builder window, click Velocity (spf) .
4 In the 3D Plot Group settings window, locate the Data section.
5 From the Data set list, choose Surface 3.
6 Right-click Velocity (spf) and choose Surface .
7 In the Surface settings window, locate the Data section.
8 From the Data set list, choose Surface 2.
9 Locate the Coloring and Style section. From the Coloring list, choose Uniform.
cfd_introduction.book Page 37 Monday, September 24, 2012 4:07 PM
38 | Tutorial ExampleWater Purification Reactor
10From the Color list, choose Gray.
11Right-click Velocity (spf) and choose Surface .
12Right-click Velocity (spf) and choose
Arrow Surface .
13In the Arrow Surface settings window,
locate the Coloring and Style section.
14From the Arrow length list, choose
Logarithmic.
15Select the Scale factor check box.
16In the associated edit field, type 1.4.
17In the Number of arrows edit field, type
300.
18From the Color list, choose White.
19In the Model Builder window, under
Results click Velocity (spf) .
20In the 3D Plot Group settings window,
click to expand the Title section.
21From the Title type list, choose Manual.
22In the Title text area, type Velocity
field.
23Click the Plot button .
cfd_introduction.book Page 38 Monday, September 24, 2012 4:07 PM
Tutorial ExampleWater Purification Reactor | 39
Proceed to reproduce Figure 12 on page 30 as follows.
1 In the Model Builder window, under Results>Velocity (spf) right-click Surface
1 and choose Copy .
3D Plot Group 4
1 Right-click Results and choose 3D Plot Group .
2 In the Model Builder window, under Results right-click 3D Plot Group 4
and choose Paste Surface .
3 Right-click 3D Plot Group 4
and choose Streamline .
4 In the Graphics window, select
Boundary 1 only and right-click it
to add this boundary to the
selection list in the Streamline
settings window. The streamlines
now start at this boundary.
5 In the Streamline settings window,
locate the Streamline Positioning
section.
6 In the Number edit field, type 45.
7 Locate the Coloring and Style
section. From the Line type list,
choose Ribbon.
8 In the Width expression edit field,
type spf.nuT*1[s/m].
9 Select the Width scale factor check
box.
10In the associated edit field, type
100.
11Right-click Results>3D Plot
Group 4>Streamline 1 and
choose Color Expression .
cfd_introduction.book Page 39 Monday, September 24, 2012 4:07 PM
40 | Tutorial ExampleWater Purification Reactor
12In the Color Expression settings
window, click to expand the Range
section.
13Select the Manual color range
check box.
14In the Minimum edit field, type 0.
15In the Maximum edit field, type
0.1.
16In the Model Builder window,
click 3D Plot Group 4 .
17In the 3D Plot Group settings window, click to expand the Title section.
18From the Title type list, choose Manual.
19In the Title text area, type Streamlines colored by velocity. Width
proportional to turbulent viscosity.
20Click the Plot button .
cfd_introduction.book Page 40 Monday, September 24, 2012 4:07 PM

Vous aimerez peut-être aussi