CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] mirrorMesh error (https://www.cfd-online.com/Forums/openfoam-meshing/163623-mirrormesh-error.html)

WhiteW December 2, 2015 12:29

mirrorMesh error
 
Hello to everyone, I'm using OpenFoam 2.3.0. I'm facing a problem with the function mirrorMesh that should be simply to solve..
I have make a simple mesh of an half cylinder in Gambit and saved in msh format.
I would like to reconstruct the entire mesh in OpenFoam by mirroring it.
I initialy convert the mesh in the openfoam format using
fluent3DMeshToFoam half_cil.msh
And this creates the polymesh folder.
Then when I try tu run the command
mirrorMesh
But I get the followng error:

--> FOAM FATAL ERROR:

request for objectRegistry region0 from objectRegistry half_cil failed
available objects of type objectRegistry are
0()

From function objectRegistry::lookupObject<Type>(const word&) const
in file db/objectRegistry/objectRegistryTemplates.C at line 198.

FOAM aborting


What could be the cause of this error?
I have set the mirrorMeshDict file as follow:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object mirrorMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

planeType pointAndNormal;

pointAndNormalDict
{
basePoint (0 0 0);
normalVector (0 1 0);
}

planeTolerance 1e-5;

// ************************************************** *********************** //

wyldckat December 2, 2015 15:28

Quick question: Can you please provide a small test case so that we can reproduce this error? Because there isn't enough information in your post to deduce what is the exact error :(
Or at least I don't remember a similar problem ever occurring with me and mirrorMesh.

WhiteW December 3, 2015 08:46

1 Attachment(s)
Thanks for the reply.
I cleaned some files in the folder, and adjusted the boundary condition in the folder 0 and now it works.
I thought the mirrorMesh command wasn't related to the setting in 0 and system folder.
I have some question about the command:
- mirrorMesh mirrors a mesh on a given plane. It also merges the duplicated nodes on the mirror plane and removes the symmetry surfaces from the boundary list right? Other command are not necessary in order to "clean the mesh" right?
- in the case I'm studying (an airplane), one of the symmetry faces on the symmetry plane is not completely planar. Indeed some cells of this face are still present after the mirrorMesh command(as shown in the image). Is there a way to adjust this nodes (they y value has to be y=0)
Thanks!

wyldckat December 6, 2015 11:07

Greetings WhiteW,

Quote:

Originally Posted by WhiteW (Post 576064)
I thought the mirrorMesh command wasn't related to the setting in 0 and system folder.

OpenFOAM is conceived to work as generically as possible. This means that for dynamic meshes, it can have the mesh in time folders for a particular time snapshot. In addition, the field fields in the "0" folder are sometimes taken into account by mesh utilities, for example for adding new boundaries or renaming old boundaries.

Quote:

Originally Posted by WhiteW (Post 576064)
- mirrorMesh mirrors a mesh on a given plane. It also merges the duplicated nodes on the mirror plane and removes the symmetry surfaces from the boundary list right? Other command are not necessary in order to "clean the mesh" right?

It should at least unassign all faces from the shared patch; in other words, the symmetry patch will have 0 faces assigned to it. Nonetheless, the shared patch might still be present in "constant/polyMesh/boundary" after mirrorMesh has done its job. You can use a nearly empty "system/createPatchDict" file and run createPatch for removing patches that have no faces assigned to them. A few tutorials in OpenFOAM demonstrate this (I'm using 3.0.0 as an example):
  • compressible/rhoPimpleDyMFoam/annularThermalMixer
  • incompressible/pimpleDyMFoam/oscillatingInletACMI2D
  • incompressible/simpleFoam/rotorDisk/
  • lagrangian/reactingParcelFilmFoam/rivuletPanel
  • lagrangian/reactingParcelFilmFoam/cylinder
  • multiphase/interDyMFoam/ras/mixerVesselAMI

Quote:

Originally Posted by WhiteW (Post 576064)
- in the case I'm studying (an airplane), one of the symmetry faces on the symmetry plane is not completely planar. Indeed some cells of this face are still present after the mirrorMesh command(as shown in the image). Is there a way to adjust this nodes (they y value has to be y=0)

You can either try using:
  • snappyHexMesh to snap these points onto a plane;
  • or use moveDynamicMesh, as demonstrated in the tutorial "mesh/moveDynamicMesh/SnakeRiverCanyon".
Best regards,
Bruno

WhiteW December 6, 2015 13:18

Thanks wyldckat, it is all more clear now.
I'll study snappyHexMesh commands to modify the node position of the mesh.
Thanks again for your help!

WhiteW


All times are GMT -4. The time now is 05:36.