CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   How to create multiple-block geometries? (

afaizm October 22, 2012 23:43

How to create multiple-block geometries?
Hi guys,

I'm doing a research that simulates airflow over urban buildings, therefore I need to create geometries of those buildings with certain spacing.

Does anyone know the effective way of setting this up in OpenFOAM?

The figure below is the example of the simulation model I need to set up:

GerhardHolzinger October 23, 2012 02:42

1 Attachment(s)

have a look at the m4 programming language. With the help of this language you can create parametric meshes.

I attached a zip-archive with a m4 file and a screenshot from paraView to give you an idea what this script creates.

To use this script change type something like this:


m4 cuboidMesh_BlaBla > blockMeshDict
This command lets m4 parse the first file (cuboidMesh_BlaBla) and stores the result into blockMeshDict.

After that you simply run blockMesh.

You can play with the mesh generated by my script and place a single block in the flow.

afaizm October 28, 2012 22:29

Thanks man will have a look. It seems reasonable.

newmancfd September 11, 2013 12:35


Originally Posted by afaizm (Post 388997)
Thanks man will have a look. It seems reasonable.

Hello, I'm doing research about shock waves in urban area. I konw it's been a long time, but please tell me if you have succesfully run your simulation or not. What I'm doing now doesn't work......... So maybe I can use openfoam to do my simulation. Thanks in advance.

All times are GMT -4. The time now is 20:43.