CFD 9 – 1 David Apsley
9. PRE- AND POST-PROCESSING SPRING 2018
9.1 Stages of a CFD analysis
9.2 The computational mesh
9.3 Boundary conditions
9.4 Flow visualisation
Appendix: Summary of vector calculus
Examples
9.1 Stages of a CFD Analysis
Pre-Processing
This stage includes:
creating geometry;
generating a grid;
specifying the equations to be solved;
specifying boundary conditions.
It may depend upon:
the desired outputs (e.g. force coefficients, heat transfer, ...);
the capabilities of the solver.
Solving
With commercial CFD codes the solver is often operated as a “black box”. Nevertheless, user
intervention is needed to specify models, input boundary conditions and choose discretisation
methods. Convergence must be checked and under-relaxation factors changed if necessary.
Post-Processing
The raw output of the solver is the set of values of each field variable (u, v, w, p, …) at each
node. Relevant data must be extracted and manipulated to obtain the desired output. For
example, a subset of surface pressures, shear stresses and cell-face areas is required in order
to compute a drag coefficient.
Most commercial CFD vendors supplement their flow solvers with grid-generation and flow-
visualisation tools, all operated from a graphical user interface (GUI), which simplifies the
setting-up of a CFD simulation and the subsequent extraction and manipulation of data.
Popular commercial CFD codes include:
STAR-CCM+ (now owned by Siemens)
Fluent (ANSYS)
FLOW-3D (Flow Science)
PowerFLOW (EXA)
COMSOL (part of the COMSOL multiphysics suite)
CFD 9 – 2 David Apsley
Popular non-commercial CFD solvers include
OpenFOAM (http://www.openfoam.com/)
CodeSaturne (http://code-saturne.org/cms/)
An excellent web portal for all things CFD is http://www.cfd-online.com/.
9.2 The Computational Mesh
9.2.1 Mesh Structure
The purpose of the grid generator is to decompose the flow domain into control volumes.
The primary outputs are:
cell vertices;
connectivity information.
Various arrangements of nodes and vertices may be employed.
u p
v
cell-centred storage cell-vertex storage staggered velocity mesh
The shapes of control volumes depend on the capabilities of the solver. Structured-grid codes
use quadrilaterals in 2-d and hexahedra in 3-d flows. Unstructured-grid solvers often use
triangles (2D) or tetrahedra (3D), but newer codes can use arbitrary polyhedra.
hexahedron tetrahedron
In all cases it is necessary to specify connectivity: that is, which cells are adjacent to each
other, and which faces and vertices they share. For structured grids with (i,j,k) numbering this
is straightforward, but for unstructured grids advanced data structures are required.
CFD 9 – 3 David Apsley
9.2.2 Areas and Volumes
To calculate a flux requires the vector area A of a cell face. This has magnitude equal to the
area and direction normal to it. Its orientation also distinguishes the outward direction.
Au ρfluxmass (1)
A Γfluxdiffusive (2)
To find the total amount of some property in a cell requires its volume V:
Vamount ρ (3)
Vector geometry is very useful for computing areas and volumes of non-Cartesian cells.
Areas
The fundamental unit from which areas are obtained is a triangle.
Triangles.
The vector area of a triangle with side vectors s1 and s2 is the cross product
2121 ssA (4)
The orientation depends on the order of vectors in the cross product.
Quadrilaterals
4 (or more) points do not, in general, lie in a plane. However, since the sum of the outward
vector areas from any closed surface is zero, i.e.
0d
V
A or 0faces
fA , (5)
any surface spanning the same set of points has the same vector area. Hence,
it can be divided into planar triangles and their vector areas summed.
By adding vector areas of, e.g., triangles 123 and 134, the vector area of any
surface spanned by these points and bounded by the side vectors is found (see
the Examples) to be half the cross product of the diagonals:
)()( 241321
241321 rrrrddA (6)
General polygons
The vector area of an arbitrary polygonal face may be found by breaking
it up into triangles and summing the individual vector areas. Because it
spans the same set of vertices, the overall vector area is independent of
how it is decomposed.
s1
s2
A
A
A
r3
4r
1r2r
CFD 9 – 4 David Apsley
Volumes
If ),,( zyxr is the position vector, then 3
z
z
y
y
x
xr . Integrating over an
arbitrary control volume:
VVV
3d
r
Dividing by 3 and using the divergence theorem (see Appendix) gives the volume of a cell:
V
V Ar d3
1 (7)
If a polyhedral cell has plane faces this can be evaluated as
faces
ffV Ar3
1 (8)
where Af is the vector area of face f and rf the position vector of any point on that face. It
doesn’t matter which point is chosen since, for any other two vectors r1 and r2 on that face,
0)( 1212 fff ArrArAr
The last scalar product vanishes because r2 – r1 lies in the plane and Af is perpendicular to it.
If the cell faces are not planar, then the volume depends on how each face
is broken down into triangles. A consistent approach is to connect the
vertices surrounding a particular face with a common central reference
point; for example, the average of the vertices:
vertices
ifN
rr1
(9)
The (possibly non-planar) face is then the assemblage of triangles connecting to rf.
Using the general formula, it is readily shown that the volume of a
tetrahedron formed from side vectors s1, s2, s3 (taken in a right-handed
sense) is
32161 sss V (10)
2-d Cases
In 2-d cases consider 3-d cells to be of unit depth. The “volume” of the cell is
then numerically equal to its planar area.
The side “area” vectors are most easily obtained from their Cartesian projections:
x
y
Δ
ΔA (11)
where, to obtain an outward-directed vector area, the edge increments (Δx, Δy)
are taken anticlockwise around the cell.
s3
1s
2s
rf
V
s
A
y
x0
-x
y0
CFD 9 – 5 David Apsley
9.2.3 Cell-Averaged Derivatives
The average value of any function f over a cell is defined by
V
av VfV
f d1
(12)
By applying the divergence theorem to xe )0,0,( , where ex is the unit vector in the x
direction, the volume-averaged x-derivative of a scalar field is
V
x
V
x
V
x
V
Vav
AVV
VV
VV
VxVx
d1
d1
d)(1
d)(1
d1
Aee
Considering all three derivatives, and assuming polyhedral cells:
faces
ff
av
Vz
y
x
A1
/
/
/
(13)
e.g. for hexahedra:
)(1
/
/
/
ttbbnnsseeww
av
Vz
y
x
AAAAAA
If the cell happens to be Cartesian this reduces to the expected form
since
V
ΑΑ
xA
ΑΑ
xx
wxwexewewe
ΔΔ
Here, the only outward area vectors with non-zero x component are
)0,0,(Ae A , )0,0,( Aw A . As, An, Ab, At all have x component
equal to zero.
e
n
w
s
Aw
An
Ae
As
Vare
a A
x
CFD 9 – 6 David Apsley
Classroom Example 1
A tetrahedral cell has vertices at A(2, –1, 0), B(0, 1, 0), C(2, 1, 1) and D(0, –1, 1).
(a) Find the outward vector areas of all faces. Check that they sum to zero.
(b) Find the volume of the cell.
(c) If the values of at the centroids of the faces (indicated by their vertices) are
BCD = 5, ACD = 3, ABD = 4, ABC = 2,
find the volume-averaged derivatives avx
,
avy
,
avz
.
Classroom Example 2
In a 2-dimensional unstructured mesh, one cell has the form of a pentagon. The coordinates
of the vertices are as shown in the figure, whilst the average values of a scalar on edges a to
e are:
a = –7, b = 8, c = –2, d = 5, e = 0
(2,-4)
(5,1)
(1,3)
(-3,0)
(-2,-3)
a
bc
d
e
Find:
(a) the area of the pentagon;
(b) the cell-averaged derivatives avx
and
avy
.
CFD 9 – 7 David Apsley
Classroom Example 3 (Exam 2016)
The figure shows the vertices of a single triangular cell in a 2-d unstructured finite-volume
mesh. The accompanying table shows the pressure p and velocity (u,v) on the faces marked
a,b,c at the end of a steady, incompressible flow simulation.
Find:
(a) the area of the triangle;
(b) the net pressure force (per unit depth) on the cell;
(c) the outward volume flow rate (per unit depth) for all faces;
(d) the missing velocity component uc;
(e) the cell-averaged velocity gradients u/x, u/y, v/x, v/y.
(f) Define, mathematically, the acceleration (material derivative) Du/Dt. If the velocity at
the centre of the cell is u = (16/3,–4), use this and the gradients from part (e) to
calculate the acceleration.
Data. The cell-averaged derivative of in volume V is given by
ffaces
iff
avi
AVx
,
1
(4,0)
(3,5)
(1,1)
bc
ax, u
y, v
edge p u v
a 3 5 –1
b 5 7 –5
c 2 uc –6
CFD 9 – 8 David Apsley
9.2.4 Classification of Meshes
Structured meshes are those whose control volumes can be indexed by (i,j,k) for i = 1,..., ni,
j = 1,.., nj, k = 1,..., nk, or by a group of such blocks (multi-block structured meshes).
Structured grids can be Cartesian (lines parallel to coordinate axes) or curvilinear (usually
curved to fit boundaries). The grid is orthogonal if all grid lines cross at 90; examples
include Cartesian, cylindrical-polar or spherical-polar grids. Some flows can be treated as
axisymmetric, and in these cases, the flow equations can be expressed in terms of polar
coordinates (r,θ), rather than Cartesian coordinates (x,y), with minor modifications.
Cartesian mesh Curvilinear mesh
Unstructured meshes are useful for complex geometries. However, data structures, solution
algorithms, grid generators and plotting routines for such meshes are very complex.
Unstructured Cartesian mesh Unstructured triangle mesh
9.2.5 Fitting Complex Boundaries With Structured Meshes
Blocking Out Cells
Some bluff-body flows can be computed on single-block
Cartesian meshes by blocking out cells. Solid-surface
boundary conditions are applied to cell faces abutting the
blocked-out region, whilst values of flow variables are
forced to zero within the blocked-out region by a modification of the source term for those
cells. If the scalar-transport equations for a single cell are discretised as
PPPFFPP sbaa
then the source-term coefficients are modified:
)(,0 numberlargesb PP (14)
Rearranging for P, this gives
numberlargea
a
P
FF
P
(15)
ensuring that the computational variable P is effectively forced to zero in these cells.
However, the computer still stores values and carries out operations for these points, so that it
is essentially performing a lot of redundant work. A better approach is to fit several
structured-mesh blocks around the body. Multi-block grids are discussed below.
CFD 9 – 9 David Apsley
Volume-of-Fluid (VOF) Approach
In the volume-of-fluid approach the fraction f of each cell
filled with fluid is stored: f = 0 for cells with no fluid in,
f = 1 for cells completely within the interior of the fluid
and 0 < f < 1 for cells which are cut by a boundary. At
solid boundaries f is determined by the surface contour. At
moving free surfaces a (time-dependent) equation is solved
for f, with the surface being reconstructed from its values.
A related technique is the level-set method where each phase-change surface (e.g. free surface
or solid bed) is a contour of an indicator variable f, which changes smoothly rather than
discontinuously as in the VOF approach. For example, f might change smoothly between 0 at
the bed and 1 at the free surface.
Body-Fitted Meshes
The majority of general-purpose codes allow body-fitted
curvilinear grids. The mesh lines are distorted so as to fit curved
boundaries. Accuracy in turbulent-flow calculations demands a
high density of grid cells close to solid surfaces, but often the
grid need only be refined in the direction normal to the surface.
However, the use of body-fitted meshes has important
consequences.
It is necessary to store a lot of geometric data for each control volume; for example, in
our multi-block-structured code STREAM we need to store (x,y,z) components of the
cell-face-area vectors for “east”, “north” and “top” faces of each cell, plus the volume
of the cell itself – a total of 10 arrays.
Unless the mesh is orthogonal, the diffusive flux is no longer
dependent only on the nodes immediately on either side of a face;
e.g. for the east face:
AAn PE
PE
ΔΓΓ
The derivative of normal to the face involves cross-derivative
terms parallel to the cell face and nodes other than P and E. These
extra terms are usually transferred to the source term and have to
be treated explicitly, which tends to reduce stability.
Interpolated values of all three velocity components are needed
to evaluate the mass flux through a single face. This requires
approximations in the pressure-correction equation that can slow
down convergence.
f = 0
f = 1
f = 0
0 < f < 1
P
E = const.
=const.
u
v
CFD 9 – 10 David Apsley
Multi-Block Structured Meshes
In multi-block structured meshes the domain is decomposed into a small number of regions,
in each of which the mesh is structured.
Grid lines may match at the interfaces between blocks, so that the
edge vertices are common to two blocks. Alternatively, arbitrary
interfaces permit block boundaries where vertices do not match
and interpolation is required. An important example is a sliding
interface, used in rotating machinery such as pumps or turbines.
On each iteration of a scalar-transport equation the discretised equations are solved implicitly
within each block, with values from the adjacent blocks providing internal boundary
conditions which are updated explicitly at the end of the iteration. (In an arrangement where
cell vertices match at block boundaries and blocks also meet “whole-face to whole-face”, this
can be done more accurately by extending and overlapping adjacent blocks.)
It is generally desirable to avoid sharp changes in grid
direction and/or non-orthogonality (which lead to lower
accuracy and stability problems) in rapidly-changing regions
of the flow.
Simpler parallel-processing CFD implementations (e.g. STREAM) use blockwise domain
decomposition, with one or more blocks assigned to each processor. The distribution of
blocks amongst processors tries to:
share load (roughly, cell count) as equally as possible; otherwise some processors will
be idly waiting for others to catch up at the end of an iteration;
minimise the transfer of information between processors (which is inherently much
slower than transferring between memory on the same chip).
Chimera (or Overset) Meshes
Some solvers, e.g. STAR-CCM+, allow overlapping blocks
(chimera, or overset, meshes). Here, there is a simple
background mesh with one or more overset meshes that
exchange information with it. These are particularly useful for
moving objects, since the overset mesh can move with the object
to which it is attached, whilst the background mesh is stationary.
9.2.6 Disposition of Grid Cells
To resolve detail, more points are needed in rapidly-changing regions of the flow such as:
solid boundaries;
shear layers;
separation, reattachment and impingement points;
flow discontinuities (shocks, hydraulic jumps).
2 3 4
587
61
2 3 4
51
CFD 9 – 11 David Apsley
Simulations must demonstrate grid-independence; i.e. that a finer-resolution grid would not
significantly change the numerical solution. This usually requires a sequence of calculations
on successively finer grids.
Boundary conditions for turbulence models impose limitations on cell size near walls. Low-
Reynolds-number models (resolving the near-wall viscous sublayer) ideally require that
y+ < 1 for the near-wall node, whilst high-Reynolds-number models relying on wall functions
require the near-wall node to lie in the log-law region, ideally 30 < y+
< 150.
9.2.7 Multiple Grids
Multiple grids – combining cells so that there are 1, 1/2, 1/4, 1/8, ... times the number of cells
in each direction compared with a reference fine grid – are used in multigrid methods. A
moderately accurate solution is obtained quickly on the coarsest grid, where the number of
cells is small and changes propagate rapidly across the domain. This is then interpolated and
iterated to solution on successively finer grids.
If two levels of grid are used then Richardson extrapolation may be used both to estimate the
error and refine the solution. If the basic discretisation is known to be of order n and the exact
(but unknown) solution of some property is denoted *, then the error – * may be taken
as proportional to Δn, where Δ is the mesh spacing. For solutions Δ and 2Δ respectively on
two grids with mesh spacing Δ and 2Δ,
n
n
C
C
)Δ2(*
Δ*
Δ2
Δ
These two equations for two unknowns, * and C, can be solved to get a better estimate of
the exact solution:
12
2* Δ2Δ
n
n
(16)
and the error in the fine-grid solution:
12
Δ ΔΔ2
n
nC (17)
Classroom Example 4 (Exam 2010 – part)
A numerical scheme known to be second-order accurate is used to calculate a steady-state
solution on two regular Cartesian meshes A and B, where the finer mesh A has half the grid
spacing of mesh B. The values of the solution at a particular point are found to be 0.74
using mesh A and 0.78 using mesh B. Use Richardson extrapolation to:
(a) estimate an improved value of the solution at this point;
(b) estimate the error at this point using the mesh-A solution.
CFD 9 – 12 David Apsley
9.3 Boundary Conditions
INLET
Velocity inlet
the values of transported variables are specified on the boundary, either by a
predefined profile or by doing an initial fully-developed-flow calculation.
Stagnation (or reservoir) boundary
total pressure and total temperature (in compressible flow) or total head (in
incompressible flow) fixed; this is a common inlet condition in compressible flow.
OUTLET
Standard outlet
zero normal gradient (/n = 0) for all variables.
Pressure boundary
as for standard outlet, except fixed value of pressure; this is the usual outlet
condition in compressible flow if the exit flow is subsonic (Ma < 1) and in free-
surface flow if the exit flow is subcritical (Fr < 1).
Radiation
prevent reflection of wave-like motions at outflow boundaries by solving a
simplified first-order wave equation 0
xc
t with wave velocity c.
WALL
Non-slip wall
the default case for solid boundaries (zero velocity relative to the wall; wall stress
computed by viscous law or wall functions).
Slip wall
only the velocity component normal to the wall vanishes; used if it is not
necessary to resolve a thin boundary layer on an unimportant wall boundary.
SYMMETRY PLANE
/n = 0, except for the velocity component normal to the boundary, which is zero.
Used where there is a geometric plane of symmetry.
Used also as a far-field boundary condition, because it ensures that there is no flow
through, nor viscous stresses on, the boundary.
PERIODIC
Used in repeating flow; e.g. rotating machinery, regular arrays.
FREE SURFACE
Pressure fixed (dynamic boundary condition);
No net mass flux through the surface (kinematic boundary condition).
CFD 9 – 13 David Apsley
9.4 Flow Visualisation
CFD has a reputation for producing colourful output and, whilst some of it is promotional,
the ability to display results effectively may be an invaluable design tool.
9.4.1 Available Packages
Visualisation tools are often packaged with commercial CFD products. However, many
excellent stand-alone applications or libraries are available, including the following.
TECPLOT (http://www.tecplot.com)
EnSight ( http://www.ensight.com)
ParaView (http://www.paraview.org)
AVS (http://www.avs.com)
Dislin (http://www.mps.mpg.de/dislin)
Gnuplot (http://www.gnuplot.info)
9.4.2 Types of Plot
x-y plots
Simple two-dimensional graphs can be drawn by hand or by many
plotting packages. They are the most precise and quantitative way
to present numerical data and, since laboratory data is often
gathered by straight-line traverses, they are a common way of
comparing experimental and computational data. Logarithmic
scales allow the identification of important effects occurring at
very small scales, particularly near solid boundaries. Line graphs
are widely used for profiles of flow variables and for plots of
surface quantities such as pressure or skin-friction coefficients.
One way of visualising flow development is to
use several successive profiles.
Line Contour Plots
A contour line (isoline) is a curve in 2D along which
some property is constant. The equivalent in 3D is an
isosurface. Any field variable may be contoured. In
contrast to line graphs, contour plots give a global view
of the flow field, but are less useful for reading off
precise numerical values. If the domain is linearly scaled
then detail occurring in small regions is often obscured.
If contour intervals are equal then clustering of lines
indicates rapid changes in flow quantities (e.g. shocks and discontinuities).
CFD 9 – 14 David Apsley
Shaded Contour Plots
Colour is an excellent medium for conveying
information and good for on-screen and
presentational analysis of data. Simple packages
flood the region between isolines with a fixed
colour for that interval. More advanced packages
allow a pixel-by-pixel gradation of colour between
isolines.
Vector Plots
Vector plots display vector quantities (usually velocity, occasionally stress) with arrows
whose orientation indicates direction and whose size (and/or colour) indicates magnitude.
They are a popular and informative
means of illustrating the flow field in
two dimensions, although if grid
densities are high then either
interpolation to a uniform grid or a
reduced set of output positions is
necessary to prevent large localised
numbers of arrows obscuring plots. It
can be difficult to select a scale for
arrow lengths when large velocity
differences are present, especially in
recirculation zones where the mean
flow speed is low. In three dimensions,
vector plots can be deceptive because
of the angle from which they are
viewed.
Streamline Plots
Streamlines are everywhere parallel to the local mean velocity vector. In 3D they must be
obtained by integration:
ux
td
d
CFD 9 – 15 David Apsley
In 2-d incompressible flow a more accurate method is to contour
the streamfunction ψ. This function is defined by fixing ψ
arbitrarily at one point and then setting the change in ψ between
two points as the volume flow rate (per unit depth) across any
curve joining them:
2
1
12 dψψ snu
(The sense used here is clockwise about the start point, although the opposite sign convention
is equally valid). ψ is well-defined in incompressible flow because, by continuity, the flow
rate across any curve connecting two points must be the same. Contouring ψ produces
streamlines because a curve of constant ψ is, by definition, one across which there is no flow.
For a short path consisting of small increments dx and dy parallel to the
coordinate axes,
xvyu ddψd (18)
Conversely, the velocity components are related to ψ by
y
u
ψ,
xv
ψ (19)
Computationally, ψ is stored at cell vertices. This is convenient
because the flow rates across cell edges are already stored as part
of the calculation. In the Cartesian cell shown:
xvQ ss Δψψψ 112
yuQ ee Δψψψ 223
If isolines are at equal ψ increments, then clustering of
lines corresponds to high speed, whilst regions where
streamlines are further apart signify low velocities. As
with vector plots, this makes it difficult to visualise the
flow pattern in low-velocity regions such as recirculation
zones and a smaller increment in ψ is needed here,
Classroom Example 5
(a) Two adjacent cells in a 2-dimensional Cartesian mesh are shown below, along with
the cell dimensions and some of the velocity vectors (in m s–1
) normal to cell faces.
The value of the stream function ψ at the bottom left corner is ψA = 0. Find the value
of the stream function at the other vertices B – F. (You may use either sign
convention for the stream function).
A
D F
C
0.3 m 0.2 m
0.1 m
E
B
5
2
12 3
(b) Sketch the pattern of streamlines across the two cells in part (a).
1
2
volume flux
1
2
dy
dx-v
u
-vs
ue
1
2
3
CFD 9 – 16 David Apsley
Mesh Plots
The computational mesh is usually visualised by plotting the edges of control volumes. It can
be difficult to visualise fully-unstructured 3-d meshes, and usually only surface meshes or
mesh projections onto a plane section are portrayed.
Composite Plots
To maximise information it is common to combine plots of the above types, emphasising the
behaviour of several important quantities in a single scene. (In STAR-CCM+ parlance this is
multiple “Displayers” in a single “Scene”.)
Complicated 3-d plots are often enhanced by the use of perspective, together with lighting
and other special effects such as translucency.
CFD 9 – 17 David Apsley
Appendix: Summary of Vector Calculus (Optional)
This is not examinable; it is here so that you can see where some of the notation and results
of earlier sections come from. IMHO it is an absolute travesty that this has been removed
from the engineering curriculum at the University of Manchester.
The operator
),,(zyx
(called del or nabla) is both a vector and a differential operator.
It is used to define:
gradient: ),,(gradzyx
acting on scalar field
divergence: z
f
y
f
x
f zyx
ffdiv acting on vector field f = (fx, fy, fz)
curl:
zyx fff
zyx
kji
ffcurl acting on vector field f = (fx, fy, fz)
2
2
2
2
2
22)grad(div
zyx
is called the Laplacian.
Integral Theorems
Gauss’s Divergence Theorem
For arbitrary closed volume V, with bounding surface V:
VV
V Aff dd
Stokes’s Theorem
For arbitrary open surface A, with bounding curve A:
AA
sfAf dd
VV
dA
A
dsA
CFD 9 – 18 David Apsley
Examples
Q1.
(a) Explain what is meant, in the context of computational meshes, by:
(i) structured;
(ii) multi-block structured;
(iii) unstructured;
(iv) chimera meshes.
(b) Define the following terms when applied to structured meshes:
(i) Cartesian;
(ii) curvilinear;
(iii) orthogonal.
Q2. (Exam 2011 – part)
(a) For wind-loading calculations a CFD calculation of
airflow is to be performed about the building complex
shown. Sketch a suitable computational domain,
indicating the specific types of boundary condition that
are applied at each boundary of the fluid domain. For each
boundary type summarise the mathematical conditions
that are applied to each flow variable (velocity, pressure,
turbulent scalar).
(b) Define the drag coefficient for an object and explain how it would be calculated from
the raw data obtained in a CFD simulation.
Q3.
Show that the vector area of a (possibly non-planar) quadrilateral is half
the cross product of its diagonals; i.e.
)()( 241321
241321 rrrrddA
Q4.
Use Gauss’s Divergence Theorem to derive the following formulae for the volume of a cell
and the cell-averaged derivative of a scalar field:
(a)
V
V Ar d3
1;
(b)
V
x
av
AVx
d1
;
where r is a position vector and dA a small element of (outward-directed) area on the closed
surface ∂V.
A
r3
4r
1r2r
CFD 9 – 19 David Apsley
Q5.
The figure shows part of a non-Cartesian 2-d mesh. A single
quadrilateral cell is highlighted and the coordinates of the corners
marked. The values of a variable at the cell-centre nodes (labelled
geographically) are:
P = 2, E = 5, W = 0, N = 3, S = 1.
Find:
(a) the area of the cell;
(b) the cell-averaged derivatives (/x)av and (/y)av, assuming that cell-face values
are the average of those at the nodes either side of that cell face.
Q6.
One quadrilateral face of a hexahedral cell in a finite-volume mesh has vertices at
(2, 0, 1), (2, 2, –1), (0, 3, 1), (–1, 0, 2)
(a) Find the vector area of this face (in either direction).
(b) Determine whether or not the vertices are coplanar.
Q7.
(a) The vertices of a particular tetrahedral cell in a finite-volume mesh are
(0,0,0), (4,0,0), (1,4,0), (1,2,4)
Find:
(i) the outward vector area of each face;
(ii) the volume of the cell.
(b) For this cell a scalar has value 6 on the largest face, 2 on the smallest face and 3 on
the other two faces. Find the cell-averaged derivatives (/x, /y, /z)av.
(c) (*** Advanced ***) Determine whether the point (1,2,1) lies inside, outside or on the
boundary of the cell.
P
N
E
S
W
(3,3)
(0,4)
(2,0)
(-2,2)
CFD 9 – 20 David Apsley
Q8. (Exam 2015)
A tetrahedral cell has vertices A(2, 2, 0), B(1, 5, 3), C(4, –1, 3), D(–1, –1, 4), as shown.
A(2,2,0)
B(1,5,3)C(4,-1,3)
D(-1,-1,4)
x y
z
(a) Find the four outward face-area vectors and the volume of the cell.
(b) The average pressures on the four faces of the cell (indicated by vertices) are:
PBCD = 1, PACD = 3, PABD = 3, PABC = 4
Find the net pressure force vector on the cell.
(c) The average velocity vectors on three of the faces are
0
2
4
ACDu ,
1
0
6
ABDu ,
1
1
4
ABCu
Assuming incompressible flow, find the outward volume flux on all cell faces.
(d) The average velocity vector on the last face is
w
BCD 0
5
u
Find the unknown velocity component w.
Data. The volume V of a polyhedral cell with plane faces is given by
f
ffV Ar3
1
where rf is any position vector on cell face f and Af is the vector area of cell face f.
CFD 9 – 21 David Apsley
Q9. (Exam 2009 – part)
The figure below shows a quadrilateral cell, together with the coordinates of its vertices and
the velocity components on each face. If the value of the stream function at the bottom left
corner is ψ = 0, find:
(a) the values of ψ at the other vertices;
(b) the unknown velocity component vn.
(4,5)
(3,1)(1,1)
(1,3)
s
e
n
w
Q10. (Exam 2012)
The figure right shows a region of a 2-d structured mesh. The
coordinates of the vertices of one cell are marked, together with
the pressure at nearby nodes.
(a) Assuming that pressure on an edge is the average of that
at nodes on either side of the edge, find the (x,y)
components of the pressure force (per unit depth) on
each edge of the shaded cell and hence the net pressure
force vector on the cell.
(b) Find the area of the cell and the cell-averaged pressure gradients p/x and p/y.
(c) The figure right shows the velocity components on each
edge of the same cell. Find the outward volume flow rate
(per unit depth) from each edge and the missing velocity
component u.
(d) If the value of the streamfunction ψ at vertex A is 3,
calculate the streamfunction at the other vertices. (You may
use either sign convention.)
face velocity
u v
w 3 –3
s 0 2
e 3 1
n 1 vn
B
A
C
D
(8,4)
(u,2)(7,2)
(9,0)
(5,6)(1,5)
(1,2) (6,1)
10 16
12
4
14
CFD 9 – 22 David Apsley
Q11. (Exam 2017)
The figure shows a single quadrilateral cell in a 2-d finite-volume mesh. Coordinates of the
vertices are given in the figure, whilst edge-averaged values of velocity (u, v) and pressure p
(in consistent units) are given in the adjacent table. The flow is incompressible.
(3,-1)
(5,3)
(0,0)
e
n(-1,4)
w
s
Find (in consistent units):
(a) the area of the cell;
(b) the net pressure force (per unit depth) on the cell;
(c) the outward volume flow rate (per unit depth) for all faces;
(d) the missing velocity component vs;
(e) the value of the stream function ψ at all vertices, assuming it to be zero at the vertex
(0,0). (You may use either sign convention.)
Q12. (*** Advanced ***)
(a) Give a physical definition of the stream function ψ in a 2-d incompressible flow, and
show how it is related to the velocity components.
(b) Show that if the flow is irrotational then ψ satisfies Laplace’s equation. If the flow is
not irrotational how is 2ψ related to the vorticity?
The figure below and accompanying table show a 2-d quadrilateral cell, with coordinates at
the vertices and velocity components on the cell edges. The flow is incompressible.
(1,1)
e
n
w
s
x
y
(3,1)
(4,4)
(0,3)
(c) If the value of the stream function at the bottom left (sw) corner is 0, calculate the
stream function at the other vertices.
(d) Find the y-velocity component vn, whose value is not given in the table.
(e) By calculating
su d for the quadrilateral cell estimate the cell vorticity.
edge p u v
e 1 9 2
n 5 7 –5
w 19 1 –4
s 21 2 ?
face velocity
u v
w 3 2
s 0 2
e 3 –1
n 1 vn
CFD 9 – 23 David Apsley
Q13. (*** Advanced ***)
A quadrilateral cell in a 2-d finite-volume mesh is shown in the figure below. The coordinates
of the vertices are marked in the figure; the velocities on the edges are given in the table.
(a) Find the area A of the quadrilateral.
(b) Find the cell-averaged derivatives avx
u
,
avy
u
,
avx
v
,
avy
v
.
(c) By calculating the line integral from the velocity and geometric data, confirm that
both the cell-averaged velocity derivatives and the discrete form of Stokes’s Theorem,
Aavz
Asu d
1)ω( ,
give the same cell-averaged vorticity, avz )ω( . (This is, in fact, true in general.)
(0,-1)
(2.5,2)
(-1,3)
(-2,0)e
n
w
s
x
y
edge u v
w 9 –6
s 1 0
e 10 12
n 13 6