You are on page 1of 22

Lecture 11

Transient Flows
14. 5 Release

Introduction to ANSYS
CFX
2012 ANSYS, Inc.

December 17, 2012

Release 14.5

Introduction
Lecture Theme:
Performing a transient calculation is in some ways similar to performing a steadystate calculation, but there are additional considerations. More data is generated
and extra inputs are required. This lecture will explain these inputs and describe
transient data post-processing

Learning Aims you will learn:


How to set up and run transient calculations
How to choose the appropriate time step size for your calculation

Learning Objectives:
Transient flow calculations are becoming increasingly common due to advances in
high performance computing (HPC) and reductions in hardware costs. You will
understand what transient calculations involve and be able to perform them with
confidence

Introduction
2012 ANSYS, Inc.

Initialization
December 17, 2012

Solver
2

Output File

Summary
Release 14.5

Outline
Motivation
Setup

Time step estimation


Output

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
3

Time Steps

Output
Release 14.5

Motivation
Nearly all flows in nature are transient!
Steady-state assumption is possible if we:
Ignore unsteady fluctuations
Employ ensemble/time-averaging to remove unsteadiness (this is what is done
in modeling turbulence)

In CFD, steady-state methods are preferred


Lower computational cost
Easier to post-process and analyze

Many applications require resolution of transient flow:

Aerodynamics (aircraft, land vehicles,etc.) vortex shedding


Rotating Machinery rotor/stator interaction, stall, surge
Multiphase Flows free surfaces, bubble dynamics
Deforming Domains in-cylinder combustion, store separation
Unsteady Heat Transfer transient heating and cooling
Many more
Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
4

Time Steps

Output
Release 14.5

Origins of Transient Flow


Natural unsteadiness
Unsteady flow due to growth of instabilities within the fluid or a non-equilibrium

initial fluid state


Examples: natural convection flows, turbulent eddies of all scales, fluid waves
(gravity waves, shock waves)

Forced unsteadiness
Time-dependent boundary conditions, source terms drive the unsteady flow field
Examples: pulsing flow in a nozzle, rotor-stator interaction in a turbine stage

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
5

Time Steps

Output
Release 14.5

Transient CFD Analysis


Simulate a transient flow field over a specified time period
Solution may approach:

Steady-state solution Flow variables stop changing with time


Time-periodic solution Flow variables fluctuate with repeating pattern
Your goal may also be simply to analyze the flow over a prescribed time interval.
Free surface flows
Moving shock waves
Etc.

Extract quantities of interest


Natural frequencies (e.g. Strouhal Number)
Time-averaged and/or RMS values
Time-related parameters (e.g. time required to cool a hot solid, residence time of

a pollutant)
Spectral data fast Fourier transform (FFT)

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
6

Time Steps

Output
Release 14.5

How to Solve a Transient Case


Transient simulations are solved by

Timestep = 2 s

computing a solution for many


discrete points in time

Initial Time = 0 s

Total Time = 20 s

At each time point we must iterate

Coefficient Loops = 5

to the solution

5 coefficient
Loops

4 6 8 10 12 14 16 18 20

Time (seconds)
Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
7

Time Steps

Output
Release 14.5

How to Solve a Transient Case


Similar setup to steady state
The general workflow is:
Set the Analysis Type to Transient
Specify the transient time duration to solve and the time step size
Set up physical models and boundary conditions as usual

Boundary conditions may change with time


Prescribe initial conditions
Best to use a physically realistic initial condition, such as a steady solution
Assign solver settings
Configure transient results files, transient statistics, monitor points
Run the solver

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
8

Time Steps

Output
Release 14.5

Analysis Type
Edit Analysis Type in the Outline tree and set the Option to Transient

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
9

Time Steps

Output
Release 14.5

Time Duration and Time Step


Set the Time Duration
This controls when the simulation will end

Options are:
Total Time

When restarting, this time carries over


Time per Run
Ignores any time completed in previous runs
Maximum number of Timesteps
The number of timesteps to perform, including
any completed in previous runs
Number of Timesteps per Run
For this run only. Ignores previously completed
timesteps

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
10

Time Steps

Output
Release 14.5

Time Duration and Time Step


Set the Time Step size
This controls the spacing in time between the
solutions points

Options are:
Timesteps / Timesteps for the Run

Various formats accepted, e.g.


0.001
0.001, 0.002, 0.002, 0.003
5*0.001, 10*0.05, 20*0.06
Adaptive
Timestep size will change dynamically within
specified limits depending on specified
convergence criteria or Courant number

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
11

Time Steps

Output
Release 14.5

Time Duration and Time Step


The Time Step size is an important parameter in transient simulations
It must be small enough to resolve time-dependent features
Time step too large to resolve transient
changes. Note the solution points generally
will not lie on the true solution because the
true behaviour has not been resolved.

True solution

Variable of
interest

Dt
Time
Variable of
interest

A smaller time step can


resolve the true solution

Dt
Time
Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
12

Time Steps

Output
Release 14.5

Time Duration and Time Step


and it must be small enough to maintain solver stability
The quantity of interest may be changing very slowly (e.g. temperature in a solid),
but you may not be able to use a large timestep if other quantities (e.g. velocity)
have smaller timescales

The Courant Number is often used to estimate a time step:

Velocity Dt
Courant Number
Element Size
This gives the number of mesh elements the fluid passes through in one timestep
Typical values are 2 10, but in some cases higher values are acceptable
The average and maximum Courant number is reported in the Solver out file each
timestep

A smaller timestep will typically improve convergence


Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
13

Time Steps

Output
Release 14.5

Boundary Conditions
If required, boundary conditions can be functions of time instead of constant
values

Velocities, Mass flows, pressure conditions, temperatures, etc. can all be expressed

as functions
In CEL expressions use t or Time
Can read in time varying experimental data through User FORTRAN

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
14

Time Steps

Output
Release 14.5

Initialization
Physically realistic initial conditions
should be used

A converged steady state solution is often


used as the starting point

If a transient simulation is started from


Residuals

an approximate initial guess, the early


timesteps will not be accurate

The first few timesteps may not

converge
A smaller time step may be needed
initially to maintain solver stability
For cyclic behavior the first few cycles
can be ignored until a repeatable
pattern is obtained

4 6 8 10 12 14 16

Time (seconds)

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
15

Time Steps

Output
Release 14.5

Solver Control
The transient scheme defines the numerical
algorithm for the transient term

Two implicit time-stepping schemes are


available:

First Order Backward Euler (more stable)


Second Order Backward Euler (more accurate)

The default Second Order Backward Euler

scheme is generally recommended for most


transient runs

Timestep Initialisation controls the way the


previous timestep is used as the starting
point for the next timestep

Can use the last solution as is


Or the solver can extrapolate the previous

solution to try to provide a better starting point


Not recommended at high Courant numbers
Automatic (default) switches between the two
depending on the Courant number
Introduction

2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
16

Time Steps

Output
Release 14.5

Solver Control
The Min. and Max. Coeff. Loops set limits on
the number of iterations to use within each
timestep

Should aim to converge each timestep within


about 3-5 loops

Complex physics may need more loops

If convergence is not achieved in the

maximum number of loops, it is generally


better to reduce the timestep size rather than
increase the number of loops

The solution will proceed to the next timestep

regardless of whether the convergence criteria


was met
Important to monitor the solution

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
17

Time Steps

Output
Release 14.5

Output Control
Transient Results
By default only a final res file is written

No information about the transient solution


Need to define the Transient Results under
Output Control

Transient Results Option


Standard
Like a full results file
Can take up a lot of disk space

Smallest
Writes the smallest file which can still be used for a
restart (still quite large)

Selected Variables

Pick only the variables of interest to give smaller files


Specify whether or not to Include Mesh
Boundary Only

Output Frequency
Controls how often results are written
Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
18

Time Steps

Output
Release 14.5

Output Control
Transient Statistics
Used to generate running statistics for solution
variables

Arithmetic Average, RMS, Minimum,

Maximum, Standard Deviation and Full


(everything) are available options

Pick the variables of interest


Start and Stop Iteration List defines when to
begin and end collecting the statistics

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
19

Time Steps

Output
Release 14.5

Output Control
Monitor Points are generally used as in
steady-state simulations

Monitor Coefficient Loop Convergence

creates monitor history for each iteration


within a timestep

Useful to see if quantities of interest are

converging within a timestep


By default only the monitor values from the end
of the timestep are displayed

Tip: Monitoring an expression will create a

transient history chart in the Solver Manager.


This can be easier than creating the chart
from transient results files after-the-fact, and
it doesnt require transient results files to be
written

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
20

Time Steps

Output
Release 14.5

Solver Output
Output differs from steady

state in that each time step


now contains coefficient loop
output onitor Points are
generally used as in steadystate simulations

Courant number information


shown at the start of each
timestep

Make sure convergence has

been achieved by the end of


the timestep by monitoring the
RMS and MAX residual plots

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
21

Time Steps

Output
Release 14.5

Workshop 09 Tank Flush


A water tank filling and then emptying
through a siphon
Setting up and post-processing a transient
simulation

Multiphase flow
Initialization of liquid level using logical if
statements

Transient simulations generally take a


long time to run. A full set of results
files are provided for post-processing.

Introduction
2012 ANSYS, Inc.

Motivation
December 17, 2012

Setup
22

Time Steps

Output
Release 14.5

You might also like