February 26, 2015

Convection and diffusion, transport equations in OpenFOAM

26.2.15 Posted by Florin 1 comment
In the CFDPython series I showed the components of the Navier-Stokes equations and I've solved them one by one; this helped a lot in understanding the complexity of the momentum equations.
In this post I will show the effects of diffusion and convection in a passive scalar transport problem solved with OpenFOAM. The domain and mesh is taken from the shock tube problem.
The scalar is initiated with zero everywhere but for a 1 m strip at the middle of the domain, where the scalar has value 1; initialization is made with the setFields dictionary.
The required files for this type of analysis can be copied from the scalarTransportFoam tutorial, but need some editing.

February 11, 2015

Solving the Poisson equation using Python

11.2.15 Posted by Florin No comments
This  post is part of the CFDPython series that shows how to solve the Navier Stokes equations with finite difference method by use of Python. This is the last step to the small solver we want to create. The Poisson equation is actually the Laplace equation to which we add a source term to the right hand side:

2px2+2py2=b

2D Poisson equation solve for 4 source terms
To better understand how this appears, we must return at the Navier Stokes equations; for a incompressible fluid we must resolve the continuity and the momentum equations; the continuity equation creates a kinematic constraint which implies that div(U) should be zero everywhere in the domain and is not coupled with the pressure; that is why we cannot use the continuity directly in the developing a solving procedure.

February 04, 2015

Solving the pressure pulse traveling in a tube with sonicFoam

4.2.15 Posted by Florin No comments
This is the shock tube problem solved 1D using OpenFOAM.
Problem description: a cylindrical tube is separated at the middle with a non-deformable membrane; in right hand side chamber the pressure is 10 000 Pa and temperature is 248 K; in the left hand side chamber the pressure is 100 000 Pa and temperature 402 K. These are the initial conditions.
The membrane disappears suddenly and the gas starts to move; compute the distributions for pressure, temperature and velocity 7 milliseconds after the membrane is removed.
Velocity field after 7 milliseconds

February 01, 2015

Creating grids with blockMesh

1.2.15 Posted by Florin No comments
OpenFOAM, like any other CFD package that uses the finite volume method, needs a mesh on which to solve the NS equations.
There are a lot of tools to make meshes these days, free or commercial.
Today I will focus on one of the tools provided with OpenFOAM: the blockMesh; this is mainly a dictionary in which the user types in vertices, edges, blocks and settings for the mesh and afterwards defines the boundary conditions.