You are on page 1of 25

Fully turbulent flow around a

sphere using StarCCM+


In this tutorial you will simulate a fully turbulent flow around a sphere using a given CAD
geometry. It would be possible to generate the geometry directly in StarCCM+, but one of the
objectives of the tutorial is to get you familiar with the import of a given geometry into the
software. Remember to save the simulation project periodically at the end of each phase. You can
do this either via the disk icon in the toolbar or through the File menu.

Starting StarCCM+
1. Launch StarCCM+. On linux the program starts with the starccm+ command.
2. Choose File → New simulation… from the top menu.

3. Setup the processor and licensing options for the current session.
a) Choose either Serial (single core) or Parallel on local host (multiple cores) option. For
the parallel option choose the number of cores (it is advisable to choose one less than the
number of physical cores, if you intend to do something else while the simulation is
running).
b) Fill in the license details: choose Power-On-Demand option, fill in the Server details as
shown below, unless they are automatically filled and type in the Power-On-Demand
Key that was given on MyCourses.
c) Click OK.

Setting up the geometry


1. Download the STL-file for the geometry from the Tutorial page on MyCourses.
2. Choose File → Import → Import surface mesh… from the top menu.
3. In the window that opens, change Units to mm (the stl-file is saved in mm) and select Open
geometry scene after import option. This should load the geometry and open a scene where
you can see a rendering of the sphere.

4. The tree on the left hand side of the main window is used to control all aspects of your
simulation project. The imported sphere geometry should have appeared in the simulation
tree under Geometry → Parts. You can open the sub-nodes of the hierarchy by clicking on
the circle of the connecting lines. If you click the sphere in the tree, it is highlighted in the
geometry scene on the right.
Setting up the simulation domain
We will specify a cylindrical domain, that covers only one quarter of the cylinder. We will do this
by specifying the profile of the domain and then revolving this profile by 90 degrees around the
longitudinal axis to form the volumetric domain.
1. Right-click 3D-CAD Models in the simulation tree and choose New from the context menu.
This opens up 3D-CAD View.
2. Right-click Features → XY and choose Create sketch in the object tree on the right. This
changes to a sketch view, where we can draw elementary shapes on the XY-plane. You can
rotate (left mouse button), zoom (scroll wheel) and pan (right mouse button) the view.
3. Click the rectangle icon under the Create sketch entitites in the toolbar on the left.
4. Draw a rectangle by clicking first in the lower left hand corner (on the x-axis) and then in
the upper right hand corner of the rectangle. The dimensions can be whatever at this point.
5. Add a reference point inside the rectangle on the y-axis by clicking on the point icon in the
left hand toolbar and clicking at some point on the y-axis. We will use this point to specify
the distance of the inlet and outlet boundaries from the sphere center.
6. Anchor the point by applying a fixation constraint. Right-click the point and choose Apply
fixation constraint.

7. Specify the distance of the inlet boundary from the reference point. Click on both the
reference point and the vertical edge on the left while holding down the Ctrl-key on the
keyboard. Right-click the edge and choose Apply Distance Dimension from the context
menu. Specify the Distance in the window, choose the Expose parameter option and give
the parameter a meaningful Name. Click OK. By giving names to the dimensions, these can
be modified easily afterwards.

8. Specify the outlet distance similarly, i.e. choose the reference point and the right vertical
edge and apply a distance dimension with a meaningful name. Make sure that the edge is on
the right side of the reference point before you specify the distance dimension. If this is not
the case, you can drag the edge by click-and-drag.
9. Specify the radius of the domain by right-clicking the left vertical edge and choosing Apply
length dimension. Specify the radius, expose the parameter and give a sensible name.
10. Check the domain profile. It should look something like this with the dimension
specifications.
11. Close the sketch view by clicking OK. At the lower left hand corner.
12. Right-click Sketch 1 in the object tree, choose Rename from the menu and give the object a
sensible name (e.g. profile).
13. Right-click the profile object in the tree and choose Revolve from the menu. This opens a
view, where you can modify the options for the operation. The defaults are fine, i.e. we
want to revolve the profile around the x-axis by 90 degrees and generate a solid (rather than
a sheet as this will be the fluid volume). Click OK.
14. This operation generated a body under the Bodies node in the tree. Rename this to
something sensible (e.g. domain).
15. In order to specify appropriate boundary conditions on each face, we should give sensible
names to each face of the body. You can choose faces by clicking them in the 3D-CAD
view (multiple faces can be selected with Ctrl-clicking).
a) Choose the faces on the XY- and XZ-planes simultaneously, right-click one of the faces
and choose Rename under the faces heading in the menu. Give these faces a name
Symmetry.
b) Choose the face with the outer normal in the negative x-direction and rename this to
Inlet.
c) Choose the face with the outer normal in the positive x-direction and call this Outlet.
d) Choose the curved face and call this External.
You can see the named faces in the tree under Bodies → Body name → Named faces.
Setting up refinement volume
Let’s specify an additional volume in the wake of the sphere, in which we will use a higher grid
resolution. This will have a half-ellipse profile and will be generated similarly to the fluid domain
by revolving the profile around the x-axis.
1. Right-click Features → XY in the tree and choose Create sketch. You can change the view
through the camera icon in the top toolbar. Standard views give you easy access to different
projections. Hide the existing model by deselecting Solid bodies in the menu that opens by
clicking the middle icon at the top of the 3D-CAD view.
2. Click the Ellipse icon and specify an ellipse with the centre at the origin.
3. Draw a vertical line and a horizontal line both starting from the origin and reaching outside
the ellipse. You can stop the line drawing operation by pressing ESC key on the keyboard.
4. Choose the ellipse and the two lines by ctrl-clicking on them. Right-click the ellipse and
choose Split for trim. This splits the ellipse into two parts.
5. Right-click the left lower half of the ellipse and choose Delete.

6. Choose the end point of the vertical line and the end point of the ellipse arc below this.
Right-click one of the points and choose Apply coincidence constraint.
7. Repeat this for the right hand end points of the horizontal line and the ellipse arc.
8. Apply length dimension for the horizontal and vertical line and give appropriate names for
the lengths.

9. Close the sketch view.


10. Rename the sketch.
11. Right-click the refinement profile and choose Revolve.
12. Use the defaults, but for the Body interaction option choose None. Otherwise the fluid
domain and the refinement bodies will be merged into a single body, which we do not
want.

13. Rename the refinement body under the Bodies node.


14. Check that you can see the specified lengths under the Design parameters node. You can
play around with these by clicking on a parameter and changing the value in the lower left
hand corner. The design is updated by clicking the Update 3D-CAD button. You can see the
bodies, if you reactivate the Solid bodies option under the middle menu of the 3D view.
15. Close the 3D-CAD view.
16. Rename the 3D-CAD Model 1 under the 3D-CAD Models into something sensible (e.g.
domains)
17. Right click the renamed CAD model and choose New geometry part. Keep the default
options in the window. This generates two new parts under the Parts node.
18. You can include these into the geometry scene. Choose the Scene/Plot tab above the
simulation tree. In the geometry scene tree open up Displayers → Geometry 1 node and
click the Parts node. In the lower left hand corner you have the associated properties. Click
the three dots on the Parts line under the properties. Activate all the parts by clicking on
them. The items are activated, if there are blue marks next to them in the parts selection
window.
19. You can go back to the simulation tree by clicking on the Simulation tab above the tree.

Setting up the fluid domain


The fluid domain should only include the volume occupied by the fluid. Therefore, we need to cut
out the spherical volume from the domain that we have specified. This is a simple operation.
1. Choose both the domain and the sphere under the Parts node in the simulation tree.
2. Right-click either one of these and choose Create mesh operation → Boolean → Subtract.
3. In the window select the domain as the Target part. Click OK.

4. This creates a new operation under the Operations node called Subtract. Right-click this
operation and choose Execute.

5. This cuts the spherical volume out of the domain. The resulting volume can be found under
the Parts node. Rename the resulting part into something sensible (e.g. fluid). Go to the
Scene/Plot tab and activate only the fluid domain under the Parts node. Go back to the
Simulation tab.
6. Turn the fluid part into a region, i.e. right-click fluid part under the Parts node and choose
Assign parts to regions… from the menu.
7. In the window change the second pull-down menu option to Create a boundary for each
part surface. This will produce one boundary for each of the named faces defined above.
Close the window.

Setting up the models and boundary conditions


1. Right-click Continua in the simulation tree and choose New → Physics continuum.
2. Right-click the Physics 1 node and choose Select models. Make the following choices. Close
the window.
3. Open the Regions → Region → Boundaries node. Click each boundary one by one and set
the Type under the properties according to the following table.

External Velocity inlet


Symmetry Symmetry plane
Inlet Velocity inlet
Outlet Pressure outlet
Sphere Wall

4. Open the Tools node, right-click Field functions and choose New → Scalar
5. Rename the field function under the tree as Radius and under the Properties part in the
lower left hand corner specify the Function name as Radius. Click the three points next to
the Dimension field and set the Length option as 1 (i.e. this has units of length). For the
function Definition set the constant value 0.1 (the radius of the sphere). This function can
now be used in any of the numeric fields related to length.
6. We will set-up the velocity according to the Reynolds number referred to the sphere
diameter. In order to do this we need to specify some additional variables. Under the Tools
→ Field functions node, specify the following new scalars.

Field function Function name Definition


Fluid density rho 1000
Fluid dynamic viscosity mu 1E-3
Reynolds number Re 1.14E6
Inlet velocity V_inf ${Re}*${mu}/(${rho}*2*${Radius})

7. Go through the boundary conditions under the Physics conditions and Physics values nodes
under the Regions → Region → Boundaries node for each boundary. The default values for
the turbulent quantities and pressure are OK. The velocity should be changed to refer to the
Inlet velocity variable specified above. Velocity is used for both the inlet and the external
boundary.
a) For the inlet boundary check that the Velocity specification under the Physics conditions
node is set as Magnitude + Direction and that the Flow direction specification is set as
Boundary-Normal. This means that the velocity is normal to the boundary and you will
only give the magnitude of the velocity. Under the Physics values node set the Value for
the Velocity Magnitude as $V_inf.
b) For the external boundary set the Velocity specification as Components and under the
Physics values node set the Value for the Velocity as [$V_inf, 0.0, 0.0].
8. Check that the initial conditions for pressure and turbulent quantities under the Continua →
Physics 1 → Initial conditions node match the boundary conditions. Set the initial condition
for Velocity as [$V_inf, 0.0, 0.0].
9. Set the Density and Dynamic viscosity for the fluid under the Continua → Physics 1 →
Models → Liquid → H2O → Material properties node using the variables $rho and $mu
above.

Setting up the mesh


1. Right-click Continua in the simulation tree and choose New → Mesh continuum. This will
generate a new mesh node under the Continua node.
2. Right-click Models under the Mesh 1 node and choose Select meshing models.
3. In the window choose the following options in this order: Surface remesher, Trimmer, Prism
layer mesher. We will use the surface remesher to remesh the sphere surface (stl-surface is
already a mesh, but we do not want to use this). Trimmer will generate and unstructured cut-
hexahedra mesh for majority of the volume. Prism layer mesher will be used to generate a
boundary layer mesh close to the sphere surface.

4. Adjust the domain and refinement zone size based on the radius of the sphere. Find the
Design parameters node under the Geometry → 3D-CAD models node. In the properties
section of each parameter give the following Values.

Domain radius 60*$Radius


Distance of inlet 10*$Radius
Distance of outlet 40*$Radius
Length of refinement zone 10*$Radius
Radius of refinement zone $Radius
5. You will notice that there are exclamation marks next to several of the geometry objects.
This means that the specification has been changed, but has not been applied yet. Right-click
the fluid domain node under Geometry → Parts node and choose Update.
6. Under Continua → Mesh 1 → Reference values node set the Base size value equal to
$Radius. This will specify the base size of the cells in the volume grid. We will modify this
with refinements on the sphere surface and inside the refinement zone in the wake.
7. The mesh generator will use the boundary condition information, when deciding which
method to use on different surfaces. Surface remeshing and prism layer generation will be
done only on wall type boundaries. Because we have just one wall type boundary, we could
specify the options for these tools under the mesh continuum node. However, in the
following we will specify the meshing options directly for the sphere surface. Under the
Regions → Region → Boundaries node set the following options for the sphere boundary.
You can modify everything at once by right-clicking the boundary and choosing Edit. You
might get warnings, that the expressions using the sphere radius cannot be evaluated, but
these can be ignored.
8. Right-click the Continua → Mesh 1 → Volumetric controls node and choose New from the
menu.
9. In the Properties choose the refinement part as Part.
10. Under the Mesh conditions → Trimmer node check Customize isotropic size.
11. Under Mesh values → Custom size choose Absolute as the Size type and set the Absolute
size as 0.05*$Radius.
12. Generate the mesh by clicking the Generate Volume Mesh icon on the toolbar or by
choosing the same option from the Mesh menu at the top of the window.
13. You can visualise the mesh by right-clicking on the Scenes node and by choosing New scene
→ Mesh. The result should look something like this.

Running the simulation


We are now almost ready to run the simulation. The software has set default values for the
discretisation operators, solvers for the linear systems and under-relaxation factors. You can find
these under the Continua → Physics 1 → Models and Solvers nodes.
1. Set the number Maximum steps under the Stopping criteria node to 2000.
2. Right-click the Scenes node and choose New scene → Scalar.
3. Go to the Scene/Plot tab.
4. Click the Outline 1 node and deactivate the Outline.
5. Open the Scalar 1 node and choose the fluid region for the Parts property.
6. Click Scalar field under the Scalar 1 node and set Function as Velocity → Magnitude.
7. Go to the Simulation tab.
8. Right-click the Reports node and choose New report → Force coefficient.
9. Rename the Force coefficient 1 report as C_D.
10. Click the report and set the Reference density and Reference velocity using the specified
variables $rho and $V_inf. Set the Reference area as acos(-1)*pow($Radius,2)/4. This is the
frontal area of the sphere. The acos-function gives pi and the division by four is required as
we have only one quarter of the sphere in our simulation. For the Parts choose the sphere
surface under the Regions → Region → Boundaries node in the window that opens.
11. In order to monitor the evolution of the drag coefficient during the simulation right-click the
C_D report and choose Create monitor and plot from report.
12. This opens a new tab for the monitoring of the drag coefficient. Click the Scene/Plot tab and
set the Maximum for the Left axis property as 0.3. The drag coefficient is very large at the
beginning of the simulation and by default the axis is scaled based on the minimum and
maximum values of the history, which will mask the evolution of the drag coefficient
towards the end of the simulation.
13. Click the Run icon in the top toolbar (looks like a running man) to start the simulation. As
the simulation starts, a new tab opens up showing the convergence of the residuals of the
different equations. You can study the evolution of the solution by changing between the
tabs. You can also stop the simulation at any point by clicking the Stop icon in the top
toolbar. While the simulation is not running, you can save the simulation project and this
will also store the current state of the solution and the convergence histories. The
convergence histories for the residuals and the drag coefficient should look something like
this.
The field for the velocity magnitude should look like this with a large area of separated flow
behind the sphere. You can play around with the plotting options under the Scalar 1 node in
the Scene/Plot view.

Analysing the results


There are various options to analyse the results within StarCCM+. You can study e.g. scalar and
vector fields by generating additional scenes by right-clicking the Scenes node. Cross-sections and
e.g. streamlines can be produced under the Derived parts node. As an example we will produce
streamlines on the sphere surface (limiting streamlines) and plots of the pressure and shear stress
distribution on the surface.
1. In the simulation view right-click the Derived parts node and choose New part →
Constrained streamline. Select the sphere under the Regions node as both the Input parts
and Seed parts. You can choose to produce a New streamline displayer, but this is not
necessary as you can also include the new part in existing scenes. We will choose the latter
option, so choose the No displayer option, click Create and Close.
2. You can modify the options of the streamline part under the Derived parts → Constrained
streamline node. Click the Source seed node and change the N grid points option to [10,10].
3. Let’s make the streamlines visible in the existing scalar scene. Go to the scalar scene view
and click the Scene/Plot tab. Right-click the Displayers node and choose New displayer →
Streamline.
4. Under the properties of the Streamlines 1 node set the Color mode property as Constant.
This will use a constant colour for the streamlines rather than colouring them based on a
field function.
5. Under the Streamlines 1 → Parts node select the constrained streamline part. The results
should look like this.

You can clearly see separated flow with streamlines curving up for the top part and curving
down for the lower part. We can see that the symmetry conditions are affecting the results,
as the condition is forcing the flow to be parallel to the plane, whereas the separation pattern
indicates that there could be a flow component normal to the plane. In effect we are
enforcing some periodicity to the separation pattern and the influence of this could be
studied by changing the flow domain.
6. In order to plot the pressure and skin friction coefficients on the sphere surface, let’s first
produce the following cross-sections through the sphere surface.
Right-click the Derived parts node and choose New part → Section → Plane.
7. Click the plane and in the properties set the Normal as [0, 1, 0] and for the Parts property
select the sphere surface under the Regions node.
8. Having the section run exactly at the boundary does not necessarily produce correct data, so
let’s move the section slightly to guarantee that it is running through the data. Click the
Single section node under the section and set the Offset property as 1E-10.
9. Rename the section as 0 deg.
10. Repeat the procedure for two more sections using Normal values of [0, -1.732, 1] and [0, -1,
1] and renaming the sections as 30 deg and 45 deg. For these you do not need to set an offset
as these sections run through the data in any case.
11. Specify a new scalar field function called Angle with a Definition of
acos(-$${Position}[0]/$Radius)/acos(-1)*180. This gives the angle of the point on the
surface of the sphere, measured from the stagnation point.
12. Click the Tools → Field functions → Pressure coefficient node and set Reference density
and Reference velocity using $rho and $V_inf.
13. Click the Tools → Field functions → Skin friction coefficient node and set Reference density
as 2*$rho/sqrt($Re) and Reference velocity as $V_inf.
14. Right-click the Plots node and choose New plot → XY plot.
15. Click the Scene/Plot tab.
16. Under the XY plot 1 node set the Parts to include all three cross-sections.
17. Click the X type node and set Type property as Scalar.
18. Click the Scalar function node and choose Angle as the Scalar function.
19. Set the Scalar function under Y types → Y type 1 → Scalar function as Pressure coefficient.
20. Right-click the Y types node and choose New.
21. Set the Scalar function under Y types → Y type 2 → Scalar function as Skin friction
coefficient.
22. Right-click the Axes node and choose New axis → Right.
23. Click the Y types → Y type 2 node and set the Y-Axis property as Right axis. The resulting
plot should look like this.

The pressure distribution agrees quite nicely with the results presented in Constantinescu
and Squires (2004), Numerical investigations of flow over a sphere in the subcritical and
supercritical regimes, Physics of Fluids, Vol. 16, No. 5 shown below. The skin friction
distribution is closer to the numerical fully turbulent curve of the same reference, which is
understandable as the simulation does not include transition modelling. Based on the
experimental results transition seems to occur at around 90 degrees and therefore the
simulations are overpredicting the shear stress for the front half of the sphere.
Constantinescu and Squires (2004) report that the separation angle for the fully turbulent
condition should be 117 ± 2 degrees. The simulation results show that depending on the
cross-section, the separation occurs between 107 and 117 degrees. Thus, the separation
angle is slightly underestimated. The simulated drag coefficient is 0.1470 (right-click the
C_D report and choose Run report), which is overestimating the reference value of
0.102±0.011 reported in Constantinescu and Squires (2004). This might be explained by the
underestimation of the separation angle and the consequent overestimation of the separation
zone.
The study should then be extended with a grid resolution study, study on the influence of the
choice of the turbulence model and study on the influence of the domain size and boundary
conditions.

You might also like