0% found this document useful (0 votes)
275 views

CFD Tutorial 3 - Boundary Layer Meshing and Turbulent Flow

This document provides instructions for performing boundary layer meshing and turbulent flow simulations using the FreeCAD-CFD workbench. It describes how to generate a boundary layer mesh around tube bundles, set up a RANS simulation with the k-ω SST turbulence model, apply boundary conditions including turbulence specifications, run the OpenFOAM solver, and view results in Paraview. The tutorial aims to demonstrate modeling of viscous flow over a tube bundle to calculate pressure drop.

Uploaded by

Michal Nocon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
275 views

CFD Tutorial 3 - Boundary Layer Meshing and Turbulent Flow

This document provides instructions for performing boundary layer meshing and turbulent flow simulations using the FreeCAD-CFD workbench. It describes how to generate a boundary layer mesh around tube bundles, set up a RANS simulation with the k-ω SST turbulence model, apply boundary conditions including turbulence specifications, run the OpenFOAM solver, and view results in Paraview. The tutorial aims to demonstrate modeling of viscous flow over a tube bundle to calculate pressure drop.

Uploaded by

Michal Nocon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

FreeCAD-CFD Workbench

Tutorial 3: Boundary layer meshing and turbulent


flow
CFD Workbench
WORKBENCH
This workbench aims to help users set up and run CFD analysis. It guides the user in selecting the relevant physics, specifying the
material properties, generating a mesh, assigning boundary conditions and setting the solver settings before running the
simulation. Where possible best practices are included to improve the stability of the solvers.

INSTALLATION

WINDOWS: LINUX:
● https://www.freecadweb.org/wiki/Download ● https://www.freecadweb.org/wiki/Install_on_Unix
● Install CfdOF from Tools | Addon manager ● Install CfdOF from Tools | Addon manager
● Go to Edit | Preferences | CFD to check and ● Install OpenFOAM (https://openfoam.com/download/)
install dependencies ● Install Paraview
● Go to Edit | Preferences | CFD to check dependencies and install cfMesh

LATEST INFORMATION
Please see the CfdOF README file for up-to-date information.

LEAD DEVELOPERS
Johan Heyns (CSIR, 2016-2018) [email protected],
Oliver Oxtoby (CSIR, 2016-2018) [email protected],
Alfred Bogaers (CSIR, 2016-2018) [email protected],
Part Design
Tube bundle
● To demonstrate how to model
viscous flow, the pressure drop over
a tube bundle is calculated.
● Bundle parameters Inlet Outlet

○ Tube diameter: 100 mm


○ Tube pitch: 200 mm
● Assuming symmetric conditions we
model the flow through one of the
channels.
Create channel
● Activate the “Part” workbench
● Create a cube
○ Length: 3000 mm
○ Width: 200 mm
○ Height: 25 mm
● Create 10 cylinders
○ Diameter: 100 mm
○ Spacing: 200 mm
● For the channel cut the cylinders
away from the cube
Boundary layer
meshing
Initialise CFD analysis
● Activate the CFD WB by clicking on the
dropdown menu in the taskbar and select
“CFD”
● Create a CFD analysis which will
automatically generate:
○ Physics model
○ Fluid properties
○ Initialise fields
○ OpenFOAM solver
Create an initial mesh 1
2

● To create a preliminary mesh select the


‘Cut’ object.
● Click on the cut-cell Cartesian icon
● Select the ‘cfMesh’ utility which allows for 5
boundary layer meshing.
● Set the maximum element characteristic
length to 10 mm and mesh. 3
● You should now have a uniformly spaced 4
cut-cell Cartesian mesh.

NOTE: Currently, only the ‘cfMesh’ utility supports boundary


layer meshing.

NOTE: See Tutorial 1 for information on how to create a 2D


mesh
Adding boundary layers
● Highlight the mesh object to activate the
mesh region icon 1
● Create a mesh region by clicking on the 2
icon .
● A mesh region object will now have been
created (if not visible expand
“Cut_CartesianMesh”).
3
● Double click it to open the task panel.
● In this task panel, we can now edit the
refinement and boundary layer
parameters.
Mesh region parameters
● The refinement parameters ‘Relative element size’ 1
and ‘Thickness’ are respectively used to set the cell 2
size relative to the base mesh and the absolute
3
thickness of the refinement region.
○ Relative element size: 0.5
4
○ Refinement thickness: 20 mm
● Check the “Boundary Layer” box
● The user can set the number of layers, the expansion
ratio that governs the growth of the layers and,
optionally, the maximum first cell height (The default
0 mm will be ignored).
○ Number of layers: 15
○ Expansion ratio: 1.2
● Next, the reference faces need to be added.
NOTE: The expansion ratio is limited to be greater than 1.0 and less than
1.2.
Update mesh
● Once the mesh region parameters are updated
1
the user can go back to the mesh task panel and
3
click on ‘Mesh’ to recompute.
● The message console shows the progress and
once meshing is completed a tetrahedral
representation of the mesh is displayed.
● For a more accurate representation of the mesh 2
click on “Paraview” to open the viewer.

FreeCAD Paraview
Viscous analysis
RANS analysis
● In the “PhysicsModel” task panel under “Turbulence”,
select the RANS checkbox which will automatically
select the k-ѡ SST model.

NOTE: Currently the CFD WB only supports the k-ѡ SST model. 1

● Activate the “InitialiseFields” task panel and ensure


the “Potential flow” checkbox is selected. The high
aspect ratio boundary layer cells require a well
initialised velocity field.
● The k and ѡ can be initialised using the values from 2
the inlet or specified by the user.
3
Boundary conditions
● In addition to entering the velocity at the inlet
boundary, the user is required to specify the
turbulence quantities.
● The user can either specify the Turbulence intensity
and Length scale or the Kinetic energy (k) and
Dissipation rate (ѡ).

NOTE: The following links might be useful in guiding the user in


specifying the inlet turbulent quantities:
https://turbmodels.larc.nasa.gov/sst.html
https://www.cfd-online.com/Wiki/Turbulence_intensity
https://www.cfd-online.com/Wiki/Turbulence_length_scale

● For the test problem, we will use turbulent intensity


○ Turbulent intensity: 5 %
○ Length scale: 2 mm
Boundary conditions
● Viscous/no-slip boundaries should be applied to
the tube walls.
● For no-slip walls, wall functions are used for the
turbulent quantities. This requires the y+ of the first
cell to be between 30 and 150.
NOTE: The following links might be useful in guiding the user to compute
the non-dimensional y+ value:
https://www.cfd-online.com/Wiki/Dimensionless_wall_distance_(y_plus)
https://www.cfd-online.com/Wiki/Law_of_the_wall

● The remainder of the walls may be treated as either


“Slip” or “Symmetric” and “Static pressure” is
prescribed at the outlet.

NOTE: An undefined boundary patch will default to slip/inviscid wall.


Running the simulation
Simulation
● In the “CfdSolver” data panel, the parallel setting
can be set to true to run over multiple cores.
● The solver Task panel may then be activated, from
which the case is written and simulation run.
● The residual plot is automatically created and the
results can be viewed in Paraview.

NOTE: The incompressible solver in OpenFOAM stores the kinematic


pressure, p = P/density.

Velocity Pressure
Paraview:

● “Slice” to show the pressure


contours.
● “StreamTracer” to show the
streamlines
● “Tube” to apply thickness to the
streamlines

Velocity
The End

You might also like