CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Meshing & Mesh Conversion (
-   -   mirrorMesh (

megacrout June 7, 2011 08:32

Hi everyone,

I am completely new to OpenFOAM and (thus?) struggle trying to get the geometric shape I want.
I am trying to simulate a pipe (i.e. an EMPTY cylinder). I did manage to create a 16th of it and would like to get the complete shape using mirrorMesh/mirrorMeshDict.

1) how does it work? I could not find one single page that gives an entire, detailed example. Where do these functions have to be called from and what is the syntax that has to be used?
2) where can I find detailed documentation about how to use OpenFOAM functions (so that I avoid asking questions like 1) in the near future)?

Thanks in advance.


megacrout June 8, 2011 04:53

Ok, so I figured some of it out on my own.
This page: actually helped quite a lot.

For the people interested in the solution:
1) copy the mirrorMeshDict-file into the system-folder of your case (find it first using locate)
2) define your normal vector in mirrorMeshDict
3) create the mirrored mesh by typing mirrorMesh from your case folder (NOT from the system folder)

Two more questions came out of that solution:
- how can I let the computer repeat this action automatically to complete my shape? I defined a 5°-element, so I donīt want to compute manually 71 (or even 36) normal vectors to get my cylinder...
- how can I get back to my initial shape (5°-element instead of 10°)? Typing blockMesh with no subsequent mirrorMesh still leads to the 10°-element...

Thanks in advance to any reply.

megacrout June 9, 2011 05:56

I did figure it out on my own again... Am I posting at the wrong place or donīt Foamers - for some reason - want to reply my messages?

Anyway: it seems like the computer canīt do it automatically so I defined a 45° element instead. With it, I can get the whole shape quickly, simply by running mirrorMesh twice. All it requires is changing the normal vectorīs sign in the mirrorMeshDict file...

As for the initial shape, delete the polyMesh folder in the 0 folder and rerun blockMesh in the Terminal to get it back.

kmoukiss June 21, 2011 05:59

Dear megacrout,

I have the same problem. Although I am trying to model the tutorial wedge15Ma5
and mirror it about the x axis

I did follow your instructions. The following is when I run mirrorMesh:
Build : 1.7.x-3776603e4c6c
Exec : mirrorMesh
Date : Jun 21 2011
Time : 11:50:14
Host : basrf03
PID : 20871
Case : /home/rfuser/camille/dsmcFoam/wedge15Ma5
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Mirroring points. Old points: 79402 New points: 158762
Mirroring faces. Old faces: 155040 New faces: 310080
Mirroring patches. Old patches: 3 New patches: 3
Mirroring cells. Old cells: 38400 New cells: 76800
Mirroring cell shapes.

Creating new mesh
Writing mirrored mesh

After that, there is no new mesh file, and when I go in Paraview, there is no mirrored geometry.
Can you help?
Thank you very much,


chegdan September 7, 2011 18:33


I'm sure you already figure this out, but the mirrorMesh utility puts a polyMesh folder in your 0 folder. just copy that polyMesh folder into your constant/ folder in the case directory.


kmoukiss September 8, 2011 05:30

Thank you, but I did indeed figured this out in the end with a friend :)
It is weird i doesn't appear in the manual though.
Thanks again for taking the time to reply!

All times are GMT -4. The time now is 13:31.