
- •Why CFD is Important for Modeling
- •How the CFD Module Helps Improve Your Modeling
- •Model Builder Options for Physics Feature Node Settings Windows
- •Where Do I Access the Documentation and Model Library?
- •Typographical Conventions
- •Quick Start Guide
- •Modeling Strategy
- •Geometrical Complexities
- •Material Properties
- •Defining the Physics
- •Meshing
- •The Choice of Solver and Solver Settings
- •Coupling to Other Physics Interfaces
- •Adding a Chemical Species Transport Interface
- •Equation
- •Discretization
- •Transport Feature
- •Migration in Electric Field
- •Reactions
- •Reactions
- •Initial Values
- •Initial Values
- •Boundary Conditions for the Transport of Concentrated Species Interface
- •Mass Fraction
- •Mass Fraction
- •Flux
- •Inflow
- •Inflow
- •No Flux
- •Outflow
- •Flux Discontinuity
- •Flux Discontinuity
- •Symmetry
- •Open Boundary
- •Physical Model
- •Transport Properties
- •Model Inputs
- •Fluid Properties
- •Diffusion
- •Migration in Electric Field
- •Diffusion
- •Model Inputs
- •Density
- •Diffusion
- •Porous Matrix Properties
- •Porous Matrix Properties
- •Initial Values
- •Initial Values
- •Domain Features for the Reacting Flow, Concentrated Species Interface
- •Boundary Conditions for the Reacting Flow, Concentrated Species Interface
- •Reacting Boundary
- •Inward Flux
- •Physical Model
- •Transport Properties
- •Fluid Properties
- •Migration in Electric Field
- •Porous Matrix Properties
- •Initial Values
- •Domain Features for the Reacting Flow, Diluted Species Interface
- •Boundary Conditions for the Reacting Flow, Diluted Species Interface
- •Pair and Point Conditions for the Reacting Flow, Diluted Species Interface
- •Multicomponent Mass Transport
- •Multicomponent Diffusion: Mixture-Average Approximation
- •Multispecies Diffusion: Fick’s Law Approximation
- •Multicomponent Thermal Diffusion
- •References for the Transport of Concentrated Species Interface
- •Domain Equations
- •Combined Boundary Conditions
- •Effective Mass Transport Parameters in Porous Media
- •Selecting the Right Interface
- •The Single-Phase Flow Interface Options
- •Laminar Flow
- •Coupling to Other Physics Interfaces
- •The Laminar Flow Interface
- •Discretization
- •The Creeping Flow Interface
- •Discretization
- •Fluid Properties
- •Fluid Properties
- •Mixing Length Limit
- •Volume Force
- •Volume Force
- •Initial Values
- •Initial Values
- •The Turbulent Flow, Spalart-Allmaras Interface
- •The Rotating Machinery, Laminar Flow Interface
- •Rotating Domain
- •Rotating Domain
- •Initial Values
- •Initial Values
- •Rotating Wall
- •Wall
- •Boundary Condition
- •Interior Wall
- •Boundary Condition
- •Inlet
- •Boundary Condition
- •Velocity
- •Pressure, No Viscous Stress
- •Normal Stress
- •Outlet
- •Boundary Condition
- •Pressure
- •Laminar Outflow
- •No Viscous Stress
- •Vacuum Pump
- •Symmetry
- •Open Boundary
- •Boundary Stress
- •Boundary Condition
- •Periodic Flow Condition
- •Flow Continuity
- •Pressure Point Constraint
- •Non-Newtonian Flow—The Power Law and the Carreau Model
- •Theory for the Pressure, No Viscous Stress Boundary Condition
- •Theory for the Laminar Inflow Condition
- •Theory for the Laminar Outflow Condition
- •Theory for the Slip Velocity Wall Boundary Condition
- •Theory for the Vacuum Pump Outlet Condition
- •Theory for the No Viscous Stress Condition
- •Theory for the Mass Flow Inlet Condition
- •Turbulence Modeling
- •Eddy Viscosity
- •Wall Functions
- •Initial Values
- •Wall Distance
- •Inlet Values for the Turbulence Length Scale and Intensity
- •Initial Values
- •The Spalart-Allmaras Turbulence Model
- •Inlet Values for the Turbulence Length Scale and Intensity
- •Pseudo Time Stepping for Turbulent Flow Models
- •References for the Single-Phase Flow, Turbulent Flow Interfaces
- •Selecting the Right Interface
- •Coupling to Other Physics Interfaces
- •Discretization
- •Fluid-Film Properties
- •Initial Values
- •Initial Values
- •Inlet
- •Outlet
- •Wall
- •Symmetry
- •Discretization
- •Initial Values
- •Initial Values
- •Fluid-Film Properties
- •Border
- •Inlet
- •Outlet
- •Conditions for Film Damping
- •The Reynolds Equation
- •Structural Loads
- •Gas Outflow Conditions
- •Rarefaction and Slip Effects
- •Geometry Orientations
- •References for the Thin-Film Flow Interfaces
- •Selecting the Right Interface
- •The Multiphase Flow Interface Options
- •The Relationship Between the Interfaces
- •Bubbly Flow
- •Coupling to Other Physics Interfaces
- •The Laminar Two-Phase Flow, Level Set Interface
- •Discretization
- •The Laminar Two-Phase Flow, Phase Field Interface
- •Domain Level Settings for the Level Set and Phase Field Interfaces
- •Fluid Properties
- •Mixing Length Limit
- •Initial Values
- •Initial Values
- •Volume Force
- •Volume Force
- •Gravity
- •Boundary Conditions for the Level Set and Phase Field Interfaces
- •Wall
- •Boundary Condition
- •Initial Interface
- •The Turbulent Flow, Two-Phase Flow, Level Set Interface
- •The Turbulent Two-Phase Flow, Phase Field Interface
- •Wall Distance Interface and the Distance Equation
- •Level Set and Phase Field Equations
- •Conservative and Non-Conservative Formulations
- •Phase Initialization
- •Numerical Stabilization
- •References for the Level Set and Phase Field Interfaces
- •Stabilization
- •Discretization
- •Level Set Model
- •Initial Values
- •Initial Values
- •Boundary Conditions for the Level Set Function
- •Inlet
- •Initial Interface
- •No Flow
- •Outlet
- •Symmetry
- •Discretization
- •Initial Values
- •Initial Values
- •Phase Field Model
- •Boundary Conditions for the Phase Field Function
- •Initial Interface
- •Inlet
- •Wetted Wall
- •Wetted Wall
- •Outlet
- •The Level Set Method
- •Conservative and Non-Conservative Form
- •Initializing the Level Set Function
- •Variables For Geometric Properties of the Interface
- •Reference for the Level Set Interface
- •About the Phase Field Method
- •The Equations for the Phase Field Method
- •Conservative and Non-Conservative Forms
- •Additional Sources of Free Energy
- •Variables and Expressions
- •Reference For the Phase Field Interface
- •The Laminar Bubbly Flow Interface
- •Reference Pressure
- •Discretization
- •The Turbulent Bubbly Flow Interface
- •Reference Pressure
- •Discretization
- •Fluid Properties
- •Slip Model
- •Initial Values
- •Initial Values
- •Volume Force
- •Volume Force
- •Gravity
- •Gravity
- •Mass Transfer
- •Mass Transfer
- •Boundary Conditions for the Bubbly Flow Interfaces
- •Wall
- •Liquid Boundary Condition
- •Gas Boundary Condition
- •Inlet
- •Liquid Boundary Condition
- •Gas Boundary Condition
- •Outlet
- •Liquid Boundary Condition
- •Gas Boundary Condition
- •Symmetry
- •Gas Boundary Conditions Equations
- •The Mixture Model, Laminar Flow Interface
- •Stabilization
- •Discretization
- •The Mixture Model, Turbulent Flow Interface
- •Stabilization
- •Mixture Properties
- •Mass Transfer
- •Mass Transfer
- •Initial Values
- •Initial Values
- •Volume Force
- •Volume Force
- •Gravity
- •Gravity
- •Boundary Conditions for the Mixture Model Interfaces
- •Wall
- •Mixture Boundary Condition
- •Dispersed Phase Boundary Condition
- •Inlet
- •Mixture Boundary Condition
- •Dispersed Phase Boundary Condition
- •Outlet
- •Mixture Boundary Condition
- •Symmetry
- •The Bubbly Flow Equations
- •Turbulence Modeling in Bubbly Flow Applications
- •References for the Bubbly Flow Interfaces
- •The Mixture Model Equations
- •Dispersed Phase Boundary Conditions Equations
- •Turbulence Modeling in Mixture Models
- •Slip Velocity Models
- •References for the Mixture Model Interfaces
- •Dispersed Phase
- •Discretization
- •Domain Conditions for the Euler-Euler Model, Laminar Flow Interface
- •Phase Properties
- •Solid Viscosity Model
- •Drag Model
- •Solid Pressure Model
- •Initial Values
- •Boundary, Point, and Pair Conditions for the Euler-Euler Model, Laminar Flow Interface
- •Wall
- •Dispersed Phase Boundary Condition
- •Inlet
- •Two-Phase Inlet Type
- •Continuous Phase
- •Dispersed Phase
- •Outlet
- •Mixture Boundary Condition
- •The Euler-Euler Model Equations
- •References for the Euler-Euler Model, Laminar Flow Interface
- •Selecting the Right Interface
- •The Porous Media Flow Interface Options
- •Coupling to Other Physics Interfaces
- •Discretization
- •Fluid and Matrix Properties
- •Mass Source
- •Mass Source
- •Initial Values
- •Initial Values
- •Boundary Conditions for the Darcy’s Law Interface
- •Pressure
- •Pressure
- •Mass Flux
- •Mass Flux
- •Inflow Boundary
- •Inflow Boundary
- •Symmetry
- •No Flow
- •Discretization
- •Fluid and Matrix Properties
- •Volume Force
- •Volume Force
- •Forchheimer Drag
- •Forchheimer Drag
- •Initial Values
- •Initial Values
- •Mass Source
- •Boundary Conditions for the Brinkman Equations Interface
- •Discretization
- •Fluid Properties
- •Porous Matrix Properties
- •Porous Matrix Properties
- •Forchheimer Drag
- •Forchheimer Drag
- •Volume Force
- •Volume Force
- •Initial Values
- •Initial Values
- •Boundary Conditions for the Free and Porous Media Flow Interface
- •Microfluidic Wall Conditions
- •Boundary Condition
- •Discretization
- •Domain, Boundary, and Pair Conditions for the Two-Phase Darcy’s Law Interface
- •Fluid and Matrix Properties
- •Initial Values
- •Initial Values
- •No Flux
- •Pressure and Saturation
- •Pressure and Saturation
- •Mass Flux
- •Inflow Boundary
- •Inflow Boundary
- •Outflow
- •Pressure
- •Darcy’s Law—Equation Formulation
- •About the Brinkman Equations
- •Brinkman Equations Theory
- •References for the Brinkman Equations Interface
- •Reference for the Free and Porous Media Flow Interface
- •Darcy’s Law—Equation Formulation
- •The High Mach Number Flow, Laminar Flow Interface
- •Surface-to-Surface Radiation
- •Discretization
- •Initial Values
- •Initial Values
- •Shared Interface Features
- •Fluid
- •Dynamic Viscosity
- •Inlet
- •Outlet
- •Consistent Inlet and Outlet Conditions
- •Pseudo Time Stepping for High Mach Number Flow Models
- •References for the High Mach Number Flow Interfaces
- •Selecting the Right Interface
- •The Non-Isothermal Flow Interface Options
- •Coupling to Other Physics Interfaces
- •The Non-Isothermal Flow, Laminar Flow Interface
- •Discretization
- •The Conjugate Heat Transfer, Laminar Flow Interface
- •The Turbulent Flow, Spalart-Allmaras Interface
- •Fluid
- •Dynamic Viscosity
- •Wall
- •Boundary Condition
- •Initial Values
- •Pressure Work
- •Viscous Heating
- •Dynamic Viscosity
- •Turbulent Non-Isothermal Flow Theory
- •References for the Non-Isothermal Flow and Conjugate Heat Transfer Interfaces
- •Selecting the Right Interface
- •The Heat Transfer Interface Options
- •Conjugate Heat Transfer, Laminar Flow
- •Conjugate Heat Transfer, Turbulent Flow
- •Coupling to Other Physics Interfaces
- •Accessing the Heat Transfer Interfaces via the Model Wizard
- •Discretization
- •Heat Transfer in Solids
- •Translational Motion
- •Translational Motion
- •Pressure Work
- •Heat Transfer in Fluids
- •Viscous Heating
- •Dynamic Viscosity
- •Heat Source
- •Heat Source
- •Initial Values
- •Initial Values
- •Boundary Conditions for the Heat Transfer Interfaces
- •Temperature
- •Temperature
- •Thermal Insulation
- •Outflow
- •Symmetry
- •Heat Flux
- •Heat Flux
- •Inflow Heat Flux
- •Inflow Heat Flux
- •Open Boundary
- •Periodic Heat Condition
- •Surface-to-Ambient Radiation
- •Boundary Heat Source
- •Boundary Heat Source
- •Heat Continuity
- •Pair Thin Thermally Resistive Layer
- •Pair Thin Thermally Resistive Layer
- •Thin Thermally Resistive Layer
- •Thin Thermally Resistive Layer
- •Line Heat Source
- •Line Heat Source
- •Point Heat Source
- •Convective Cooling
- •Out-of-Plane Convective Cooling
- •Upside Heat Flux
- •Out-of-Plane Radiation
- •Upside Parameters
- •Out-of-Plane Heat Flux
- •Domain Selection
- •Upside Inward Heat Flux
- •Change Thickness
- •Change Thickness
- •Porous Matrix
- •Heat Transfer in Fluids
- •Thermal Dispersion
- •Dispersivities
- •Heat Source
- •Equation Formulation
- •Activating Out-of-Plane Heat Transfer and Thickness

M o d e l i n g a n d S i m u l a t i o n s o f F l u i d F l o w
In this section:
•Modeling Strategy
•Geometrical Complexities
•Material Properties
•Defining the Physics
•Meshing
•The Choice of Solver and Solver Settings
•Overview of the Physics Interfaces and Building a COMSOL Model in
the COMSOL Multiphysics User’s Guide
See Also
Modeling Strategy
Modeling and simulating fluid-flow is a cost-effective way for engineers and scientists to understand, develop, optimize, and control designs and processes.
One of the most important considerations that have to be done before setting up a model is the accuracy that will be required in the simulation results. This consideration determines the level of complexity of the model.
Since fluid flow simulations are often computationally demanding, a multi-stage modeling strategy is usually required. This implies using simplified models as a starting point in a modeling project. Complexities can then be introduced gradually so that the influence of each refinement of the model description is well understood before introducing new complexities.
Complexities in the modeling process can be introduced at different stages in order to achieve the desired accuracy. They may be introduced in the description of the geometry, the physical properties, and in the description of the governing equations. The Model Builder, which shows the model set-up as a sequence of operations in the Model Tree, is designed with this modeling strategy in mind.
32 | C H A P T E R 2 : Q U I C K S T A R T G U I D E

In addition to fluid flow, COMSOL Multiphysics and the CFD Module provide predefined couplings of fluid flow and other phenomena. Example of these couplings are heat transfer for free convection and structural mechanics for fluid-structure interaction simulations. Set up your own couplings by defining mathematical expressions of the dependent variables (velocity, pressure, temperature, etc) in the physics interfaces for arbitrary multiphysics combinations.
Geometrical Complexities
A complicated 3D CAD drawing is usually not the best place to start the modeling process. A 2D representation of a cross-section of the geometry may give valuable initial estimates of the flow field that can be used in setting up the full 3D model. For example, you may be able to determine the pressure variations and the nature of the flow, if a turbulence model is needed or not. This provides information on where in the final geometry the most amount of ‘change’ occurs, and require more concentration or resolution, or what parts of the modeling process is more sensitive than others.
Simplifying the geometry itself can also help immensely. Making use of planes of symmetry and reducing the size of the geometry by half or even more is a great first step. Rounding-off corners is another. Small geometric parts require large amounts of mesh to fully resolve them, but the parts themselves probably have negligible effects on the fluid-flow of a system. They can be removed or modified in either the CAD tool or using the CAD Import Module. See the CAD Import Module User’s Guide for more information.
Material Properties
Depending of the accuracy required in a simulation, the effort in obtaining data for fluid properties may also vary. In many cases, the dependency of the fluid properties on pressure and temperature has to be taken into account.
For pressure-driven flow, it is usually a good approach to set up a first model using constant density and viscosity, to get a first estimate of the flow and pressure fields. Once the model works with constant properties, it can be extended by adding the accurate expressions for density and viscosity.
For free convections, the density variations drive the flow and the fluid properties’ dependency of the modeled variables, for example temperature, has to be accounted for from the beginning. In difficult cases, with large temperature variations, it may be
M O D E L I N G A N D S I M U L A T I O N S O F F L U I D F L O W | 33

a good approach to run a time-dependent simulation even if the purpose of the simulation is to get the results at steady-state.
Defining the Physics
The CFD Module contains a number of physics interfaces for single-phase flow, multiphase flow, laminar flow, nonisothermal flow, turbulent flow, and porous media flow.
Also the definition of the physics depends on the accuracy required in a simulation. A fluid may be weakly compressible but could be approximated as incompressible if the required accuracy allows for that. A complex turbulence model may be replaced by a much simpler one, again if the required accuracy is comparably low. A first step in setting up the physics is to consider the simplest possible set-up as the initial step. The results from such a simulation may reveal difficulties that could be useful to be aware of when adding complexities to the physics.
In addition to fluid flow, the fluid flow interfaces may also be coupled to any other physics interface in a multiphysics model.
When setting up a complex multiphysics model involving fluid flow and other coupled physics, it is a good strategy to define and solve one physics at the time first. This allows for verification of the model set-up, for example to check if the intended domain and boundary settings are reflected in the solution of each decoupled physics. The alternative of debugging the model set-up with several coupled physics interfaces could be very time-consuming.
In steady-state multiphysics simulations, it may also be a good strategy to solve the model for each physics in a decoupled set-up as a first step. The solution of the decoupled model can then be used as the initial guess for the fully coupled model. This is specially recommended for highly nonlinear models. The Study node in the Model Tree is designed for this modeling strategy.
Meshing
The mesh used in a fluid flow simulation depends on the fluid flow model and on the accuracy required in the simulation. A fluid flow model may inherently required a dense resolution in order to yield convergence, even though the results may not require a high accuracy. In such case, it may be a good idea to change the fluid model. In other cases, the requirements of the accuracy in the results may set a limit of the maximum element size.
34 | C H A P T E R 2 : Q U I C K S T A R T G U I D E
There are a number of different elements for fluid flow modeling in COMSOL and these are shortly described below:
•Free-meshing techniques generate unstructured meshes that can be used for most types of geometries. The mesh generating algorithms are highly automated, often creating a good quality mesh from minimal user input. This mesh type is therefore a good choice when the geometry of the domain is evident but the behavior of the mathematical model in a it is unknown. Yet, unstructured meshes tend to be isotropic or homogenous in nature, so that they fail to consider the geometry’s size and direction on the behavior of the mathematical model.
•In many ways, the properties of structured meshes complement those of the unstructured type. Structured meshes provide high quality meshes with few elements for sufficiently simple geometries. The properties of a structured mesh can furthermore be used to create very efficient numerical methods. Finally, it is often easier to control the mesh when high anisotropy or large variations in mesh size and distribution is required, as the size of a structured mesh can be easily increased linearly or geometrically with geometric dimensions.
•Swept meshes are generated in 3D by creating a mesh at a source face and then sweeping it along the domain to a destination face, such as from a cut in the cylindrical part of the polymerization reactor to the outlet face. A swept mesh is structured in the sweep direction, while the mesh at the source and destination faces can be either structured or unstructured. As is the case for structured meshes, the model geometry determines if a swept mesh is applicable. Swept meshes are typically ideal when the cross section in the sweep direction is constant, which is the case for channels and pipes, for instance. Revolving a mesh around symmetry axes is another useful sweep operation.
•A boundary layer mesh is a mesh with an element distribution that is stacked or dense in the normal direction of a boundary. It is created by inserting structured layers of elements along specific boundaries that integrate into a surrounding structured or unstructured mesh. This type of mesh is very useful for many applications in fluid-flow applications coupled to mass and energy transfer, where thin boundary layers need to be resolved. This is also the default physics-induced mesh for fluid flow.
Ideally, a mesh convergence analysis should be run in order to estimate the accuracy of a simulation. This means that the mesh should be made twice as fine in each spatial direction and the simulation carried out once again on the refined mesh. If the change in a critical solution parameter for the original mesh and the finer mesh are within the required accuracy, then the solution can be regarded as being mesh-converged. For
M O D E L I N G A N D S I M U L A T I O N S O F F L U I D F L O W | 35