You are on page 1of 33

STAR-CCM+ User Guide

3756

Simple Flow Tutorials

The two tutorials in this set demonstrate how to set up simple flow problems that do not require one of the more complex physical models available in STAR-CCM+. They are: A Mixing Pipe Flow Tutorial, illustrating the process of simulating a slightly compressible fluid flow problem. A Mesh Comparison Tutorial whose main purpose is to compare the effect of different mesh types on the simulation speed and accuracy of a simple incompressible flow problem.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3757

Mesh Comparison Tutorial


This tutorial describes a steady airflow simulation over an obstacle mounted at the bottom wall of a three-dimensional channel. The problem geometry is shown below.
Wall

300 Inlet

Outlet

40 320 10

Wall 870

All units in mm The depth of the solution domain is 300 mm throughout

The case is based on an investigation conducted by the Danish Maritime Institute whose experimental data are compared with the STAR-CCM+ predictions. In the experimental set-up, the flow velocity and turbulence characteristics were non-uniform across the inlet section. However, to simplify the modeling procedure, the case presented here is based on a parabolic inlet velocity profile with fixed turbulence characteristics. The boundaries consist of an inlet, an outlet, a symmetry plane on one of the two side faces (parallel to the plane of the paper in the Figure above) and default no-slip walls for the remaining boundaries. The fluid is air and its physical properties are assumed constant and equal to the STAR-CCM+ default values. Air enters the solution domain at standard pressure and temperature (1 bar and 293 K) with a free-stream velocity of 1.17 m/s. Based on the height of the obstacle, the Reynolds number is 3,115. The turbulence kinetic energy and dissipation rate at the inlet are set to 0.024 m2/s2 and 0.07 m2/s3, respectively, these values having been derived from experimental data. All fluid mass entering the solution domain exits through the outlet. The flow is isothermal, turbulent and incompressible; turbulence is simulated using the standard linear k- model combined with the Wolfstein two-layer model. The same problem is modelled three times, each variant using a different mesh, as described in: Hexahedral Mesh Tetrahedral Mesh

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3758

Polyhedral Mesh Comparisons are then drawn between the accuracy and computational speed of each type of mesh. All three meshes are based on the same initial shell surface defining the problem geometry but each was generated using a different technique.

Hexahedral Mesh
The first mesh used in this tutorial is hexahedral. All problem conditions and properties are defined through the STAR-CCM+ GUI and a solution obtained via its segregated solver. The results are displayed using the built-in post-processing tools. The first step of this part of the tutorial is Importing the Mesh and Naming the Simulation. Importing the Mesh and Naming the Simulation Start up STAR-CCM+ in a manner that is appropriate to your working environment and select the New Simulation option from the menu bar. Continue by importing the hexahedral mesh and naming the simulation. The grid has been saved in the .ccm file format, which contains all necessary cell, vertex and boundary information for the problem geometry. Select File > Import... from the menu bar In the Open dialog, navigate to the doc/tutorials/hexMesh subdirectory of your STAR-CCM+ installation directory and select file

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3759

hex.ccm.

Click Open to start the import. The Import Mesh Options dialog will appear. Select the Run mesh diagnostics after import and the Open geometry scene after import options. Ensure that the Dont show this dialog during import option is not selected, then click OK. Finally, save the new simulation to disk under file name hexMesh.sim. The tutorial continues with Creating a Macro. Creating a Macro The Tetrahedral Mesh and Polyhedral Mesh parts of this tutorial that follow require exactly the same problem set-up. To avoid having to repeat the steps outlined in the current description, we will record a macro file. This macro will be used to set up the cases for the other two meshes. Begin recording the macro by clicking on the in the Macro toolbar. (Start Recording) button

In the Save dialog enter setup.java as the File Name and click Save.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3760

All actions performed from now until the recording is stopped will be recorded in the macro. Note that you should not save the simulation whilst the macro is being recorded since this will lead to the subsequent simulations being saved under incorrect names. The next step is Renaming the Region. Renaming the Region The boundaries read in from file hex.ccm already have suitable names but we shall rename the region. Open the Regions node, right-click on the Default_Fluid node and then select Rename...

The Rename dialog will appear.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3761

Change the name to Fluid. Click OK. Open the Fluid > Boundaries node. Select each boundary node in turn. The corresponding boundary location will be shown in the geometry scene. The next step is Setting up the Models. Setting up the Models Suitable models must be chosen for the simulation, as follows: Open the Continua node. Right-click on the Physics 1 node and then select item Select models...

In the Physics Model Selection dialog, select the Stationary radio button in

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3764

within that node.

Check that the default material properties for air and the reference values are suitable for this simulation. The next step is Setting Initial Conditions. Setting Initial Conditions Some initial conditions will need to be changed for this simulation. Open the Continua > Physics 1 > Initial Conditions node.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3768

In the Properties window, change the Method property to Table (x,y,z).

Select the Table (x,y,z) node under the Velocity Magnitude node. In the Properties window, change the Table property to inlet and the Table: Data property to U.

This completes the boundary condition definition. The next step is Setting Stopping Criteria. Setting Stopping Criteria The default stopping criterion is set to end the calculation after 1000 iterations. Such a value is excessive for this case, so we will reduce the maximum number of iterations.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3772

The next step is Setting up Line Surfaces for Plotting. Setting up Line Surfaces for Plotting Velocity and wall shear stress data will be plotted on parts created by intersecting a plane with the bottom wall and symmetry plane boundary surfaces, resulting in the two line segments shown below.

The wall shear stress will be monitored along the line where the BottomWall and Symplane boundaries intersect. To create a section for this: Right-click on the Derived Parts node and select
New Part > Section > Plane...

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3774

For a second time, right-click on the Derived Parts node and select
New Part > Section > Plane...

The in-place dialog will appear again. In the Input Parts group box, select Fluid: Symplane. Change the Origin to 0.38, 0.0, 0.0. Change the Normal to 1.0, 0.0, 0.0. Click Create, then click Close. Rename the new plane section node X = 0.38. These two sections will be used to create plots in the next step, Plotting Simulation Data. Plotting Simulation Data This part of the tutorial produces plots of velocity and wall shear stress. In the case of the velocity plot, experimental data will also be imported from a file and plotted alongside the numerical data. The development of the solution can be observed throughout the run by viewing these plots. To create the wall shear stress plot: Right-click on the Plots node and select New Plot > XY Plot. A new node named XY Plot 1 will appear. Rename the XY Plot 1 node WSS Plot. In the Properties window, add the Z = 0 section to the Parts list. Select the WSS Plot > Y Types > Y Type 1 > Scalar node.

Select Wall Shear Stress > Laboratory > i for the Scalar property.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3778

This completes the pre-processing set-up for the case. Stop the macro recording by clicking the (Stop Recording) button in the Macro toolbar. Save the simulation and then proceed to Initializing and Running the Simulation. Initializing and Running the Simulation To initialize the solution and run the analysis: Click on the (Initialize Solution) button in the Solution toolbar or use the Solution > Initialize Solution menu item. The initial zero velocity condition will be shown in the Velocity Plot at X = 0.38 display. Click on the (Run) button in the Solution toolbar to run the analysis.

The Residuals display will automatically be created and will show the solvers progress. The tabs at the top of the Graphics window make it possible to select any active display for viewing. Select the Velocity Plot at X = 0.38 display if you wish to observe the numerical solution development. During the run it is possible to stop the process by clicking the (Stop) button in the toolbar. If you do halt the simulation, it can be continued again later by clicking on the (Run) button. If left alone, the simulation will continue until the stopping criteria are satisfied.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3780

Visualizing the Results Activate the Vector Scene 1 display to view the velocity vector field:

Click on the tab for the Scalar Scene 1 display to see the y+ distribution

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3783

The plot should now appear as shown below:

The above result shows that the downstream recirculation zone extends from approximately X = 0.38 m to X = 0.825 m and hence is roughly 0.445 m in length. Save the simulation. The next step is Exporting Simulation Data. Exporting Simulation Data We will now export velocity plot data to a file for comparison with similar data produced using the other two meshes. To do this: Open the Plots > Velocity Plot at X = 0.38 > Y Types > Y Type 1 node.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3785

subdirectory of your STAR-CCM+ installation directory and select file tet.ccm.

Click Open to start the import. The Import Mesh Options dialog will appear. Select the Run mesh diagnostics after import and the Open geometry scene after import options. Ensure that the Dont show this dialog during import option is not selected, then click OK. Finally, save the new simulation to disk under file name tetMesh.sim. The tutorial continues with Running the Macro. Running the Macro Replay a previously-created macro to set up the entire problem and generate the necessary scenes and plots. Only a few plot settings will need to be changed before running the simulation. To replay the macro: Click on the (Play Macro) button in the Macro toolbar. In the Open dialog find and select file setup.java created for the Hexahedral Mesh, then click Open.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3787

WSS Plot

Double-click on the following scene nodes:


Scalar Scene 1 Vector Scene 1

This completes the pre-processing setup for the case. Save the simulation. The next step is Initializing and Running the Simulation. Initializing and Running the Simulation To initialize and run the analysis: Click the (Initialize Solution) button in the toolbar or use the Solution > Initialize Solution menu item. The initial zero velocity condition will be shown in the Velocity Plot at X = 0.38 display. (Run) button in the toolbar to run the analysis.

Click the

The Residuals display will automatically be created and will show the solvers progress. The tabs at the top of the Graphics window make it possible to select any active display for viewing. Select the Velocity Plot at X = 0.38 display if you wish to observe the numerical solution development. During the run, it is possible to stop the process by clicking the (Stop) button in the toolbar. If you do halt the simulation, it can be continued again later by clicking the (Run) button. If left alone, the simulation will continue until the stopping criteria are satisfied.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3789

Visualizing the Results Activate the Vector Scene 1 display to view the velocity vector field.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3792

The plot should now appear as shown below.

The above plot shows that the downstream recirculation zone extends from approximately X = 0.37 m to X = 0.82 m and hence is roughly 0.45 m in length. Save the simulation. The last step in the tetrahedral mesh part of this tutorial is Exporting Simulation Data. Exporting Simulation Data We will now export data from the velocity plot to a file for comparison with similar data produced in the other parts of this tutorial. To do this: Select the Plots > Velocity Plot at X = 0.38 > Y Types > Y Type 1 > X = 0.38 node. Enable the Sort Plot Data option in the Properties window.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3794

poly.ccm.

Click Open to start the import. The Import Mesh Options dialog will appear. Select the Run mesh diagnostics after import and the Open geometry scene after import options. Ensure that the Dont show this dialog during import option is not selected, then click OK. Finally, save the new simulation to disk under file name polyMesh.sim. The tutorial continues with Running the Macro. Running the Macro Replay a previously-created macro to set up the entire problem and generate the necessary scenes and plots. Only a few plot settings will need to be changed before running the simulation. To replay the macro: Clicking on the (Play Macro) button in the Macro toolbar. In the Open dialog find and select file setup.java created in the Hexahedral Mesh, and click Open. The macro will take a few minutes to run. When finished, you may proceed to Setting Plotting Options.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3796

Vector Scene 1

This completes the pre-processing set-up for the case. Save the simulation and proceed to Initializing and Running the Simulation. Initializing and Running the Simulation To initialize and run the analysis: Click the (Initialize Solution) button in the toolbar or use the Solution > Initialize Solution menu item. The initial zero velocity condition will be shown in the Velocity Plot at X = 0.38 display. (Run) button in the toolbar to run the analysis.

Click the

The Residuals display will automatically be created and will show the solvers progress. The tabs at the top of the Graphics window make it possible to select any active display for viewing. Select the Velocity Plot at X = 0.38 display if you wish to observe the numerical solution development. During the run, it is possible to stop the process by clicking the (Stop) button in the toolbar. If you do halt the simulation, it can be continued again later by clicking the (Run) button. If left alone, the simulation will continue until the stopping criteria are satisfied.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3798

Visualizing the Results Activate the Vector Scene 1 display to view the velocity vector field.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3801

The plot should now appear as shown below.

The above plot shows that the downstream recirculation zone extends from approximately X = 0.37 m to X = 0.73 m and hence is roughly 0.36 m in length. This is the same as the value predicted by the tetrahedral mesh analysis but about 20% shorter than that predicted by the hexahedral mesh analysis. The final section of this tutorial, Comparing Mesh Types, will consider which mesh has produced the most accurate solution. Comparing Mesh Types We have already examined the velocity plot and seen that the numerical solution compares well with the experimental data. We will now compare the velocity data produced on this mesh with those produced on the Hexahedral Mesh and the Tetrahedral Mesh. First, import the data saved for the previous two cases: Open the Tools node.

Version 4.04.011

STAR-CCM+ User Guide

Mesh Comparison Tutorial 3805

The plot should now appear as shown below.

There is little difference in the quality of the results obtained from the three meshes, although the result from the polyhedral mesh is slightly better than the other two in the recirculation zone. This is despite the polyhedral mesh having only 60,838 cells compared to 67,699 cells for the hexahedral mesh and 140,141 cells for the tetrahedral mesh. Furthermore, the analysis on the polyhedral mesh required only 121 iterations to reach convergence compared to 221 for the hexahedral mesh and 181 for the tetrahedral mesh. The results therefore demonstrate the ability of polyhedral meshes to produce good quality results with lower cell counts and shorter run times than other mesh types. This tutorial is now complete. Save the simulation. A Summary of the steps performed in this tutorial follows.

Summary
This tutorial introduced the following STAR-CCM+ features:

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3807

Mixing Pipe Flow Tutorial


This tutorial describes in detail how to set up, run and post-process a simple CFD problem involving flow through a mixing pipe. The problem geometry is shown below:

The assembly has two inlet pipes, located on the left and center of the above figure, through which air at different temperatures flows into the interior. There is also an outlet pipe on the right-hand side through which the fluid exits. The air stream entering the solution domain at each inlet has a specified velocity, temperature, turbulence intensity and turbulence length scale. These properties vary throughout the pipe as the two streams mix. Adiabatic and no-slip conditions are assumed at the pipe walls. The tutorials Objectives are outlined in the next section.

Objectives
The tutorial gives a detailed account of how to: Initiate a STAR-CCM+ session that builds a CFD model for a simple problem Specify turbulence and physical property models Specify fluid properties Apply boundary conditions Perform a CFD analysis using one of the STAR-CCM+ solvers

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3809

Click the Open button to start the import. The Import Mesh Options dialog will appear. Select the following options:
Run mesh diagnostics after import

Ensure that the Open geometry scene after import and the Dont show this dialog during import options are not selected and then click OK. STAR-CCM+ will give a summary of all data imported from this file in the Output window (for example, that the mesh contains 82,339 cells). At the end of the import process, it will also create an initial (default) simulation tree in the Star 1 window. To create a file for the simulation and give it a proper name: Select File > Save from the menu bar Type mixing_pipe in the File Name text box then click Save Note that the title of the simulation window also changes to mixing_pipe. The tutorial continues with Checking the Mesh.

Checking the Mesh


A simple but effective method of checking the mesh is to display it on screen and examine it visually. Right-click on the Scenes node and select New Scene > Geometry. This will create a new node, Geometry Scene 1, in the simulation tree.

The Graphics window will initially show all parts of the mesh as solid, colored surfaces. To turn on the mesh display:

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3814

The Graphics window will display the mesh structure on the cross section, as shown below. The varying cell size within the trimmed-cell mesh is now clearly visible.

The next stage in the tutorial is Setting up the Models.

Setting up the Models


This tutorial describes a steady-state problem in which: A stationary, three-dimensional grid is employed The fluid is a slightly compressible gas (air) that obeys the ideal gas equation of state The flow is turbulent and non-isothermal The k- model is used for representing turbulence effects The problem is to be solved using the segregated flow solver To specify the above conditions: Open the Continua node in the simulation tree, right-click on the

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3816

The remaining modeling options in the dialog are optional and not required for this problem so click Close to complete the model selection. Open the Models node under Physics 1 to verify that it contains nodes corresponding to each selection made above. These can now be inspected and edited as necessary to complete the model definitions. The next step is Setting Material Properties.

Setting Material Properties


To check the currently assigned values for the fluid physical properties Open the Physics 1 > Models > Gas > Air > Material Properties node Select the Constant node for each of the five physical properties present

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3819

In the Properties window, change the initial temperature to 293 K.

Open node Turbulent Dissipation Rate and then select node Constant Check the default value displayed in the Properties window, which is suitable for this case Repeat this check for node Turbulent Kinetic Energy whose default value is also suitable for this case. This completes the specification of physical properties and models for the fluid. The next step is to locate the boundary regions and specify boundary conditions. The next step is Checking Boundary Locations.

Checking Boundary Locations


Meshes such as the one used in this tutorial normally include boundary definitions for all boundary surfaces. To display and check the location of these boundaries:

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3821

as shown in the example below for the outlet boundary:

Now that we have checked the boundary locations, we can proceed to Setting Boundary Conditions.

Setting Boundary Conditions


This section describes how to check the current boundary condition defaults and make adjustments where necessary. Select the inlet node in the tree and check that the boundary condition

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3823

Turbulence Specification method Intensity + Length Scale Static Temperature value 373 K Turbulence Intensity value 0.1 Turbulent Length Scale value 0.001 m Velocity Magnitude 10 m/s Check the condition on the outlet node and accept the default boundary Type (Flow-Split Outlet) Finally, select the Default_Boundary_Region node and rename it wall. Confirm that the default boundary conditions are appropriate for this problem: Shear Stress Specification No-slip Tangential Velocity Specification None Thermal Specification Adiabatic Wall Surface Specification Smooth The Blended Wall Function values under the Physics Values node (E, Kappa) are also acceptable. The last step before running the analysis is Setting Solver Parameters and Stopping Criteria.

Setting Solver Parameters and Stopping Criteria


For this simple case, it is reasonable to increase the velocity under-relaxation factor to speed up convergence.

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3825

If this is not displayed, use the Solution > Run menu item. You may also activate the Solution toolbar by selecting Tools > Toolbars > Solution and then clicking the toolbar button. The Residuals display will be created automatically and will show the solvers progress. If necessary, click on the Residuals tab to bring the Residuals plot into view. An example of a residual plot is shown in a separate part of the User Guide. This example will look different from your residuals, since the plot depends on the models selected. During the run, it is also possible to stop the process by clicking the (Stop) button on the toolbar. If you do halt the simulation, it can be continued again later by clicking the (Run) button. If left alone, the simulation will continue until 500 iterations are complete. Save the simulation. The first post-processing task is Plotting Contours.

Plotting Contours
The remaining sections of this tutorial cover the definition and display of various plots that help to visualize the solution just obtained. The first plot to be drawn is a contour plot of temperature on the surface of the mixing pipe. To create this plot: Right-click on the Scenes node and select New Scene > Scalar.

A new node called Scalar Scene 1 will be created in the simulation tree. Select the Scalar Scene 1 > Displayers > Scalar 1 > Parts node In the Properties window, click on the right half of the Parts property to display the Select Objects dialog

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3830

Select only the plane section 2 part created above and then click Close Click on the right half of the Contour Style property and select Smooth Filled from the pop-up menu Right-click on the scalar bar that appears in the Graphics window and select Velocity: Magnitude in the pop-up menu displayed After some rotation and repositioning of the mesh, the results should appear as shown below.

Post-processing continues with Plotting Velocity Vectors.

Plotting Velocity Vectors


Velocity vectors will first be plotted on the mesh surface. Right-click on the Scenes node and select New Scene > Vector A new node called Vector Scene 1 will be created in the simulation tree.

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3837

Note that a new node, presentation grid, will now appear as an additional Derived Parts constituent. A second node, Presentation Grid Geometry 1, will also appear under the Displayers node belonging to Vector Scene 2. Select the Parts node in the Vector 1 displayer node of Vector Scene 2 In the Properties window, click on the right half of the Parts property and then select the presentation grid part Deselect the plane section 2 part, then click Close. Select the displayer node Presentation Grid Geometry 1 In the Properties window, clear the Surface checkbox to produce a plot similar to the one shown below.

The final stage of this tutorial is Plotting Streamlines.

Plotting Streamlines
An effective way of visualizing a flow pattern is to draw streamlines, i.e. tracks of imaginary massless particles introduced into the flow at specified points. Here we will draw streamlines originating at the smaller inlet.

Version 4.04.011

STAR-CCM+ User Guide

Mixing Pipe Flow Tutorial 3842

streamlines more clearly.

Note that the streamlines are colored according to the local temperature along their path. This completes the post-processing part of the tutorial. Descriptions of more complex post-processing operations may be found in some of the other tutorials in the STAR-CCM+ Training Guide. A Summary of the steps followed in this tutorial is given next.

Summary
This STAR-CCM+ tutorial introduced the following steps: Starting the code and creating a new simulation Importing a mesh Visualizing and checking the mesh Defining the simulation models Defining material properties for the selected models Visualizing and checking the boundary locations

Version 4.04.011

You might also like