0% found this document useful (0 votes)
51 views14 pages

Basic Tutorials: Ex. 8. 2D Flow Over A Cylinder Using The ICFD Solver

This tutorial demonstrates how to set up a 2D CFD simulation of flow over a cylinder in LS-DYNA. It describes creating the geometry of a cylinder in a rectangular domain, meshing it with beam elements, converting the mesh to the ICFD format, defining boundary conditions of inlet, outlet and no-slip walls, running the simulation, and post-processing to view the vortex shedding behind the cylinder. Optional exercises are suggested to refine the mesh and turbulence modeling.

Uploaded by

kannan saravanan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views14 pages

Basic Tutorials: Ex. 8. 2D Flow Over A Cylinder Using The ICFD Solver

This tutorial demonstrates how to set up a 2D CFD simulation of flow over a cylinder in LS-DYNA. It describes creating the geometry of a cylinder in a rectangular domain, meshing it with beam elements, converting the mesh to the ICFD format, defining boundary conditions of inlet, outlet and no-slip walls, running the simulation, and post-processing to view the vortex shedding behind the cylinder. Optional exercises are suggested to refine the mesh and turbulence modeling.

Uploaded by

kannan saravanan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Basic Tutorials

LS-DYNA / LS-PrePost
Ex. 8. 2D Flow over a cylinder
using the ICFD solver

Figure 1 Vortex shedding for a Reynolds number of 100.

2017-05-17 LS-DYNA / LS-PrePost


1 Introduction

Contents
1 Introduction ............................................................................................................................2
1.1 Prerequisites...................................................................................................................2
2 Problem description................................................................................................................2
2.1 Files included in the tutorial .............................................................................................3
3 Setting up the CFD simulation ................................................................................................3
3.1 Creating the geometry and meshing it .............................................................................3
3.2 Meshing the geometry ....................................................................................................4
3.3 Converting the mesh to the ICFD mesh format. ...............................................................5
3.4 Create the CFD model ....................................................................................................6
3.4.1 Boundary Conditions...................................................................................................8
3.4.2 Control cards ............................................................................................................ 10
3.4.3 Controlling the boundary layer................................................................................... 11
3.4.4 Outputting the results ................................................................................................ 11
4 Run the simulation................................................................................................................ 12
5 Post-processing ................................................................................................................... 12
5.1 MS-Post ....................................................................................................................... 12
5.2 Basic post processing ................................................................................................... 12
6 Optional exercises ................................................................................................................ 13
7 Summary and where to learn more ....................................................................................... 13

1 LS-DYNA / LS-PrePost
1 Introduction

1 Introduction
The ICFD solver is available from LS-DYNA R7, but we recommend that you use the latest version
(or at least version R9) as the solver performance in the later versions is much improved. The ICFD
solver must always be run using the double precision version of LS-DYNA. The ICFD solver uses a
fully implicit time-stepping and solution method. The ICFD solver is an incompressible CFD solver
based on the Finite Element Method (FEM). Modern FEM based ICFD-solvers of the type used in
LS-DYNA are a fairly recent addition to the CFD-solver market and most other CFD solvers on the
market today are based on the Finite Difference Method (FDM) or Finite Volume Method (FVM).
This tutorial will show you how to setup a 2D CFD simulation using LS-PrePost 4.3. The geometry is
not complicated but the flow is very complex since a laminar von Karman vortex street, see Figure
1, is developed behind the cylinder for Reynolds numbers between 40 and 150. After Reynolds
number 150 does the transition to a turbulent vortex street starts and occurs to Reynolds number
300 where the vortex street is fully turbulent.
The Reynolds number is a dimensionless number that is used to classify flows to get similar flow
conditions. The definition of the Reynolds number is the ratio between inertial forces and viscous
forces and can be written as:
𝑈𝜌𝐿
𝑅𝑒 = 𝜇
U free stream velocity, 𝜌 fluid density, L characteristic length, and 𝜇 the dynamic viscosity. The
characteristic length in this case is the diameter of the cylinder.
If you want to learn more about a specific keyword or if you feel that some information is missing in
this tutorial regarding a keyword look in the keyword manual vol. 3.
1.1 Prerequisites
• Basic knowledge about LS-DYNA and LS-PrePost.
• Basic understanding of FEM and CFD.
• LS-PrePost 4.3 or later and LS-DYNA R8.1 or later.

2 Problem description
It is a 2D example with flow over a circle in a rectangular domain. This example uses a Reynolds
number of 100 and therefore you can say that the units in the example is dimensionless. The mesh
that will be used in the example will be quite coarse since it is a demonstration example. You will see
that you get a Von-Karman vortex street after the cylinder when the flow has stabilized.

2 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

Figure 2 Geometry of the example.


2.1 Files included in the tutorial
• The solution to the exercise can is found in 2Dcylinder_main.k.
• The mesh created in Section 3.3 is found in mesh_2Dcylinder.k.

3 Setting up the CFD simulation


Before we can start defining the model we must define the geometry and mesh it. You can skip this
step by importing the finished mesh in the file mesh_2Dcylinder.k.
3.1 Creating the geometry and meshing it
Start by opening LS-PrePost 4.3 or a later version, first create the geometry in the 2D Mesh
Generation.
1. Click on Mesh.
2. In the left menu click on 2DMesh.
3. Now you will get a popup window where you will create the geometry of the model.
The toolbar is in the top right corner with all the available tools and to the left is the drawing
area.
4. Click on the Line tool to create the rectangular
boundary of the fluid domain.

Figure 3 2D Mesh Generation popup


window.

3 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

5. Now you will see the control options for the line tool below the toolbar,
click the KeyIn option to enter the coordinates for the first line.
6. Enter zero in the x1 and y1 field.
7. Enter zero in the x2 field and 10 in the y2 field.
8. Now press Create and you will see the line in the drawing area.
9. Create the next line by changing the x1 and x2 fields to 15, keep the y-
values.
10. You should now have two vertical lines in the drawing area and to connect
them change to the Pick option.
11. Connect the lines by clicking on the top points in the drawing area.
12. Do the same for the bottom points.
13. To create the circle, press the circle tool in the toolbar.
14. Use the KeyIn option.
15. Enter a x1 value of 4 and a y1 value of 5.
16. Click the Radius option and enter a value of 0.25.
17. Then press Create to create the circle and view it in the drawing area.
18. If the geometry looks like Figure 2 press Exit in the 2D Mesh Generation
window.

3.2 Meshing the geometry


The ICFD solver uses a new type of mesh called *MESH, the format is the same but the heading has
changed. Start by creating a regular LS-DYNA mesh and then convert it, the same applies if you are
using a different pre-processor than LS-PrePost output it in a LS-DYNA format and then convert the
mesh with LS-PrePost or a text editor. The ICFD solver has an automatic mesh generator and for it
to work, the boundaries must be meshed with beam elements in 2D and shell elements in 3D. When
creating the mesh use one part for each boundary condition that you will use in the simulation.
1. To generate the Mesh, use the Element generation tool. Click on Mesh and
then EleGen in the left menu.
2. Click on the Beam option in the Element Generation popup window.
3. Change ‘Beam By:’ to Curve.
4. Select the Num and enter 10, this means that you will get 10 elements
across the curve.
5. Select the curve that corresponds to Part 1 the
Inlet and press Create and Accept.
6. Now change the ‘Part ID:’ to 2 and select the line
that corresponds to Part 2, then press Create and
Accept.
7. Now change the ‘Part ID:’ to 3 and use a Num
value of 15, repeat step 5 but select the lines for
Part 3.
8. For the Circle change to the option Size and enter
0.01.
9. Change the ‘Part ID:’ to 4 and select the curves for the
circle, press Create and Accept.

4 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

10. Now click on EleTol in the menu and then DupNod.


11. In the popup window press ‘Show Dup Nodes’ and then press ‘Merge
Dup Nodes’.
12. Now press Accept to approve the modification, the reason why this step is
needed is that the ICFD mesh cannot have two nodes in the same location
and the domain needs to be water tight.
13. Save the file as fluid_mesh.k for example.

3.3 Converting the mesh to the ICFD mesh format.


The first option is to use a text editor and change the heading of the keywords *NODE and
*ELEMENT_BEAM to *MESH_NODE and *MESH_SURFACE_ELEMENT respectively. Only keep
the nodes and elements remove all other keywords like *PART.
Second option is to use LS-PrePost.
Click on Mesh in the menu and then MSMesh in the left menu, the file that
contains the mesh should be open in LS-PrePost.

1. In the MSMesh window change Starting PID, Starting EID, and Starting NID to one.
2. In the Sel. Parts window select ByPart.
3. Press Whole to select all active parts in the current model.
4. Press Apply in the MSMesh window and if you are satisfied with the result press Accept.
5. Save the file as fluid_mesh.k for example, by clicking on File/Save/Save Keyword.

5 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

3.4 Create the CFD model


Open a new LS-PrePost window since it is recommended to have your mesh in one file and all other
keywords in another file.
1. Click on Model in the menu and then Keywrd in the left menu to open the
keyword manager.

2. Locate the keyword *INCLUDE in the Keyword Manager and double click on it.
3. Locate the mesh file, fluid_mesh.k, if you have all files in the same folder you only need the
filename and not the path to the file.
4. Then press Insert and then Accept before pressing Done. If you do not press Accept the
changes made on the keyword is not saved.
5. To view the mesh, you must save the model and open it again. Save it as main_fluid.k and
open it in a new LS-PrePost window.
6. Locate the keyword *ICFD_SECTION and double click on it.
7. The keyword *ICFD_SECTION needs to be defined but currently it has no purpose.
8. Press Accept and then Done.

6 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

9. The next keyword defines the fluid properties, locate and double click on the keyword
*ICFD_MAT in the Keyword Manager.
10. Enter a density of one on the parameter RO and a dynamic viscosity of 0.005 the parameter
VIS.
11. Press Accept and Done.
12. Now locate the keyword *ICFD_PART if you did not have it defined in the mesh file it is
automatically created. Double click it and make sure that the MID and SECID are the same
as we defined previously, they should have the ID one if you did not change the ID value
when defining the section and material keywords.

13. Either you enter the ID value on the parameters SECID and MID or click on the black circle
next to the parameter.
14. Make this change for all four parts and remember to press Accept before changing part
otherwise will the change not be saved.
15. Open the keyword *ICFD_PART_VOL.

16. This keyword is used to tell the solver which material the volume nodes will have. Enter the
correct SECID and MID and enter all four parts before pressing Insert and then Accept. If
you have more than eight parts, define the first eight and then enter a new row with the rest
of the parts.

7 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

3.4.1 Boundary Conditions


This problem will use four different types of boundary conditions, one for each part see Figure 4. The
inlet will have a prescribed velocity of one, the outlet will have a prescribed pressure of zero. The
circle will have a no-slip condition which means that the velocity will be zero at the wall. The domain
boundaries part 3 will have a free-slip condition which means that the normal velocity is zero but not
the tangential velocity.

Figure 4 Boundary conditions.


1. The keywords that we will use to prescribe the velocity and the pressure uses a load curve
so start by clicking on the keyword *DEFINE_CURVE to create two load curves one for the
pressure and one for the velocity.

2. In the field O1 enter the value 1 and press Insert, now change the A1 value to 10000 and
press Insert. This creates a curve that has a constant value of one during the whole
simulation. Press Accept to save the curve.
3. Press NewID in the top left corner to create a new curve, change value of the O1 parameter
for both points to zero by clicking on them and changing the value and then pressing
Replace. Then press accept, if you want you can add a title to the curves.

8 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

4. Now press Done and locate the keyword *ICFD_BOUNDARY_PRESCRIBED_VEL in the


Keyword Manager.

5. Enter part one in the parameter PID, this defines where the velocity will be applied.
6. Set the DOF to one which means that the x-velocity will be prescribed, the VAD parameter
describes the velocity profile use the default option one a linear profile.
7. Select load curve 1, that had a constant value of one in the parameter LCID, press Insert
and Accept.
8. Press NewID change the DOF parameter to 2, meaning y-velocity and change the load curve
to number 2 that had a constant value of zero.
9. Press Replace, Accept and Done.
10. Open the keyword *ICFD_BOUNDARY_PRESCRIBED_PRE.

11. Enter part 2 which is the outlet in the PID parameter and use load curve 2 in the LCID
parameter.
12. Press Insert, Accept and Done.

9 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

13. Locate the keyword *ICFD_BOUNDARY_NONSLIP that will be applied on the circle, part 4.

14. Enter Part 4 and press Insert, Accept and Done.


15. Open the keyword *ICFD_BOUNDARY_FREESLIP.

16. Enter Part 3 and press Insert, Accept and Done.

3.4.2 Control cards


That was all boundary conditions. What is left to define is the time step and end time. This is done
with the control cards.
1. Find the keyword *ICFD_CONTROL_TIME and open it.

10 LS-DYNA / LS-PrePost
3 Setting up the CFD simulation

2. Set the end time to 100 on the parameter TTM and use the default values on the rest of the
parameters. Click Accept and Done. A zero time-step size means that the solver uses an
automatic time step based on the CFL criterion.
3. An optional keyword is the *ICFD_CONTROL_OUTPUT that controls the message level and
output format.

4. The MSGL parameter controls how much information that is printed from the solver, the
OUTL parameter controls if the results should be outputted in another format than the d3plot
format. The DTOUT parameter controls how often these results should be printed and the
last parameter controls if the fluid volume mesh should be printed to a separate file.
3.4.3 Controlling the boundary layer
To control and generate the boundary layer of Part 4, the circle, use the keyword *MESH_BL. This
keyword tells the solver to generate a boundary layer mesh. You as a user have several ways to
control how the boundary layer is created, for more information see the Keyword Manual Vol. III.
1. Open the keyword *MESH_BL.

2. The first parameter PID tells the solver from which part the boundary layer will grow, enter
part 4 which is the circle.
3. The NELTH parameter controls the number of nodes between the wall and the last node in
the boundary layer. Enter two which means that a boundary layer with three elements will
be generated, keep the default values for the other parameters.
3.4.4 Outputting the results
To output the results, use the keyword *DATABASE_BINARY_D3PLOT.

11 LS-DYNA / LS-PrePost
4 Run the simulation

1. Find the keyword in the Keyword Manager and open it.

2. Enter one in the parameter DT which means that you will get one hundred states since the
end time was 100.

4 Run the simulation


ICFD analyses must be run using the double precision version of LS-DYNA. Use the latest version
of LS-DYNA available, at least R9.1. You do not need to allocate that much memory using the
memory command line option of LS-DYNA since the ICFD solver allocates most of the memory
required for the solution automatically. The MPP version of LS-DYNA runs much faster than the SMP
version if more than about 4-8 cores are used for the simulation.
On Linux, see the LS-DYNA Keywords User’s Manual Vol. I for information about how to start LS-
DYNA.
On Windows, run the simulation using LS-Run, see exercise 1. Getting Started for more information
on how to do this. To use the double precision version, make sure to use the “SMP double” or “MPP
double” Preset in LS-Run.

5 Post-processing
Use LS-PrePost 4.3 or a later version. For the most recently features, use LS-PrePost 4.5 which is
the current beta version. To view the results, open the d3plot file with LS-PrePost. From version 4.2
a new GUI is available for multi-physics located under MS/MS-Post.

5.1 MS-Post

When opening a d3plot file containing ICFD results the ICFD menu will automatically be
opened. If you have closed it and need to open it again, click on the MS button and then
on the MS-Post button. In the current beta version 4.5 of LS-PrePost, the post window is
attached to the left side of the graphical window and it is displayed when a d3plot file
contains data from a CFD simulation or a multi-physics simulation.

5.2 Basic post processing


The window is divided into three parts, Objects window, Objects Properties, and Display Options.
The Objects window controls the visibility of objects and it is here that you create new objects by
right clicking on an object.

12 LS-DYNA / LS-PrePost
6 Optional exercises

1. Since this is a 2D case you can display the results directly on


the fluid domain by clicking on MS_SHELL_1.
2. In the Display Options change the Color by to Fluid velocity
for example.
3. Then use the Animate bar to change the state or press play
to see how the flow develops over time.
4. If you scroll down in the Display option you will find different
ways to control the legend. Click on the Keep Min/Max box to
keep the current max and min values of the legend for all
states.
5. Notice also that if you click on the legend and drag it you can
change the position of the legend.
6. To change the name of the legend, click on the corresponding
object and then click one more time on the name. Now you
can type a name of that object and press enter, the heading
of the legend will also be updated.
7. To create streamlines right click on MS_SHELL_1 and select
streamlines, make sure that the streamline object is selected
in the Objects window.
8. In the Object Properties set P0 to (3,6,0) and P1 to (3,4,0).
9. Set the parameter NumXpt to 20 for example, this controls the
number of stremlines that is generated.
10. Notice that the streamline object has a * in front of the name,
this means that it needs to be updated. Right click on the
streamline object in the Object window and pres update.

6 Optional exercises
Play around with the different options and see how it affects the results, here is some suggestions
that you can test.
1. Refine the mesh especially the boundary mesh.
2. Change the time step size.
3. Change the boundary layer and test the other methods that are available.
4. Add a refinement zone with the keyword *MESH_SIZE_SHAPE.

7 Summary and where to learn more


Now you can set up a basic 2D CFD case and a 3D case is set up in a similar way. If you want more
tutorials go to the YouTube channel LS-DYNA Corporate Tutorial & Content. It contains several
tutorials and at www.dynaexamples.com you can download several examples of different types of
simulations. If you have any questions please contact your local distributor of LS-DYNA for support
or suggestions of available courses.

13 LS-DYNA / LS-PrePost

You might also like