Benchmarking OpenFOAM Solver for CFD Applications

Abstract:

The objective of this paper is to build capability in OpenFOAM software. We selected 10 different CFD applications such as internal and external flows – Laminar and turbulence, steady and unsteady simulations, forced convection in laminar and turbulent flows, etc. The selected CFD applications are simulated using OpenFOAM standard solvers & solvers in leading commercial software. The results are compared between softwares for each application separately and correlated with experimental or Theoretical data     

Also the other objective is to use OpenFoam for IN house projects due to cost benefit, the available commercial softwares are very high priced, whereas OpenFOAM software is free of cost and have 80 different solvers to solve variety of problems. Also, the correlation of OpenFOAM results with experimental or Theoretical data is expected to be very close.

Introduction:

OpenFOAM® is free, open source software for Computational Fluid Dynamics, which has a large user base across most areas of engineering and science. It has extensive features to solve from complex fluid flows to solid dynamics and electromagnetics. It includes tools for meshing and pre and post processing. It offers users complete freedom to customize and extend its existing functionality.

CFD applications considered for this paper is taken from learning module in Cornell University courses. Problem definition is modified in some cases based on our requirement.

Methodology:

The methodology shown in Fig 1 is followed to make sure one to one comparison between solutions of OpenFOAM and commercial software. Meshing for CFD applications are done in Ansys Mesher with reference to the learning module meshing guidance and exported in .msh format. Then mesh is imported into OpenFOAM & commercial software and solving is carryout in respective solvers.

Fig.1

1

OpenFOAM solver cannot import 2D Axis-symmetric mesh created in Ansys-Mesher. Therefore BlockMesh tool is used for generating mesh for axis – symmetric applications.

Incompressible and compressible solvers are used in both OpenFOAM and commercial software. OpenFOAM provides different standard solvers for solving incompressible and compressible flows with various turbulence model for steady and unsteady applications. Appropriate OpenFOAM solvers are used based on the type of application.

The Solutions of all CFD applications are post processed in commercial software and Paraview software and results are compared.

 Problem Description, Mesh and Setup:

Laminar Pipe Flow

Consider fluid flowing through a circular pipe of constant radius. The pipe diameter D= 0.2 m and length L = 8 m. The inlet velocity Ūaxial = 1 m/s. Consider the velocity to be constant over the inlet cross-section. The fluid exhausts into the ambient atmosphere which is at a pressure of 1 atm.Take density ρ = 1 kg/ m3 and coefficient of viscosity µ = 2 x 10-3 kg/ (m s).

Steady State incompressible Axis-symmetric fully developed laminar flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherblockMesh
SolverSIMPLEsimpleFoam
Turbulence ModelsLAMINARLAMINAR
Commercial Software ResultOpenFOAM Result
PRESSURE
23
VELOCITY
45
4847
Turbulent Pipe Flow

   Consider fluid flowing through a circular pipe of constant radius. The pipe diameter D= 0.2 m and length L = 8 m. The inlet velocity Ūaxial = 1 m/s. Consider the velocity to be constant over the inlet cross-section. The fluid exhausts into the ambient atmosphere which is at a pressure of 1 atm. Take density ρ = 1 kg/ m3 and coefficient of viscosity µ = 2 x 10-5 kg/ (m s). (Re=100000)

Steady State incompressible Axis-symmetric fully developed turbulent flow
 Commercial SoftwareOpenFOAM
MeshingMesherblockMesh
SolverSIMPLEsimpleFoam
Turbulence Modelsk-epsilonk-epsilon
Commercial SoftwareOpenFOAM Result
PRESSURE
67
VELOCITY
89
4950
Steady Flow Past a Cylinder

   Consider the steady state case of a fluid flowing past a cylinder. The Reynolds number is chosen to be 20. In order to simplify the computation, the diameter of the cylinder is set to 1 m, the x component of the velocity is set to 1 m/s and the density of the fluid is set to 1 kg/m^3. Thus, the dynamic viscosity must be set to 0.05 kg/m*s in order to obtain the desired Reynolds number.

Steady State incompressible 2-D planar laminar flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLEsimpleFoam
Turbulence ModelsLAMINARLAMINAR
Commercial Software ResultOpenFOAM Result
VELOCITY
1011
VORTICITY
1213
Unsteady Flow Past a Cylinder

   Consider the unsteady state case of a fluid flowing past a cylinder. For this application we will use a Reynolds Number of 120. In order to simplify the computation, the diameter of the cylinder is set to 1 m, the x component of the velocity is set to 1 m/s and the density of the fluid is set to 1 kg/m^3. Thus, the dynamic viscosity must be set to 8.333×10^-3 kg/m*s in order to obtain the desired Reynolds number.

Unsteady State incompressible 2-D planar laminar flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLEpimpleFoam
Turbulence ModelsLAMINARLAMINAR
Commercial Software ResultOpenFOAM Result
VELOCITY
1415
VORTICITY
1617
Flow Over a Flat Plate

   Consider a fluid flowing across a flat plate. The Reynolds number based on the plate length is 10,000. This Reynolds number is obtained by using the following settings. The plate length is 1 m. The incoming fluid is flowing in the x-direction with a velocity of 1 m/s. The density of the fluid is 1 kg/m^3 and the viscosity is 1 x 10 ^ (-4) kg/ (m-s). Note that these values are not necessarily physical. They have been picked to yield the desired Reynolds number.

63

Steady State incompressible 2-D planar laminar flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLEsimpleFoam
Turbulence ModelsLAMINARLAMINAR
Commercial Software ResultOpenFOAM Result
PRESSURE
1819
VELOCITY VECTOR
2021
2223
Flow Over an Airfoil

    In this application, NACA 0012 Airfoil at 6 degree angle of attack was simulated. X-velocity=.9945 m/s, Y-velocity=.1045m/s, Gauge pressure = 0.

Steady State incompressible 2-D planar laminar flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLEsimpleFoam
Turbulence ModelsInviscidInviscid
Commercial Software ResultOpenFOAM Result
PRESSURE
2425
VELOCITY
2627
Laminar Forced Convection

A fluid enters a pipe of radius 0.06 meters at a constant velocity of 0.1 m/s. The fluid has a density of 1.2 kg/m^3, a thermal conductivity of 0.02 W/m K , a specific heat of 1000 J/kg K , and a viscosity of 1.8e-5 kg/m s . The first 5.76 meters of the pipe are isothermal, held at 300 K. The remaining 2.88 meters of the pipe have a constant heat flux of 37.5 W/m^2 added at the wall.

64

Steady State 2-D planar forced convection laminar flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLErhoSimpleFoam
Turbulence ModelsLAMINARLAMINAR
Commercial Software ResultOpenFOAM Result
TEMPERATURE
2829
VELOCITY
3031
3233
 34 35
Turbulent Forced Convection

    The following diagram shows a pipe with a heated section in the middle where constant heat flux is added at the wall. The ambient air is flowing into the pipe from the left with a uniform velocity. The relevant boundary-value problem is solved to obtain the velocity, temperature and pressure distribution in the pipe. Pipe radius=2.94e-2m, Pipe length=6.045m, Cp=1005 J/kg K, mu=1.787e-5kg/m s, k=.0266W/m K, Molecular weight=28.97 g/mole, Uaxial=30.06m/s, T=298.15 K, Heat Flux = 5210.85 W/m2 (1.83 to 4.27m). Pout = 98338.2Pa

65

Steady State 2-D planar forced convection turbulent flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLErhoSimpleFoam
Turbulence Modelsk-epsilonk-epsilon
Commercial Software ResultOpenFOAM Result
PRESSURE
3637
VELOCTY
3839
TEMPERATURE
4041
4243
4445
Compressible Flow in Nozzle

    Consider air flowing at high-speed through a convergent-divergent nozzle having a circular cross-sectional area, A, that varies with axial distance from the throat, x, according to the formula

A = 0.1 + x2;    -0.5 < x < 0.5

Where A is in square meters and x is in meters. The stagnation pressure po at the inlet is 101,325 Pa. The stagnation temperature To at the inlet is 300 K. The static pressure p at the exit is 3,738.9 Pa. The Reynolds number for this high-speed flow is large. So we expect viscous effects to be confined to a small region close to the wall. So it is reasonable to model the flow as inviscid.

66

Steady State compressible 2-D planar inviscid flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLErhoCentralFoam
Turbulence Modelsinviscidinviscid
Commercial Software ResultOpenFOAM Result
PRESSURE
5152
VELOCITY
5354
TEMPERATURE
5556
Supersonic Flow over Wedge

A uniform supersonic stream encounters a wedge with a half-angle of 15 degrees as shown in the figure below

6768

Steady State compressible 2-D planar inviscid flow
 Commercial SoftwareOpenFOAM
MeshingANSYS MesherANSYS Mesher
SolverSIMPLErhoCentralFoam
Turbulence Modelsinviscidinviscid
Commercial Software ResultOpenFOAM Result
PRESSURE
5758
VELOCITY
5960
MACH
6162

Conclusion:

   The wide range of CFD applications such as steady state and unsteady state, incompressible and compressible flow, laminar and turbulent flow, etc. were solved in OpenFOAM and Commercial software. The results for all the applications were compared between OpenFOAM & Commercial software and correlated against experimental or Theoretical data. It has been observed that OpenFOAM results are matching with Commercial software results for the applications. OpenFOAM results are also matching with experimental or Theoretical data very closely.

OpenFOAM offers wide range of solvers for different application. So, the selection of appropriate solver in OpenFOAM is most important for any application. OpenFOAM also allows user to create their own solvers based on the requirement. But to develop new solver, knowledge of programing and deep understanding of the CFD are very important.

Future Work:

In continuation to this paper, next work will be focused on solving individual applications with practical scenarios and much more complexities. The application will be solved in both OpenFOAM & Commercial software and the results will be compared against each other. Also, OpenFOAM results will be benchmarked against experimental or Theoretical data.