CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

checkMesh Erros after refineMesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By roenby

Reply
 
LinkBack Thread Tools Display Modes
Old   July 26, 2012, 23:42
Default checkMesh Errors after refineMesh
  #1
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 131
Rep Power: 6
mgdenno is on a distinguished road
Hello,

I have a mesh that was created using snappyHexMesh that I am trying to refine using refineMesh, but after running refineMesh, checkMesh gives me errors. I am running an interFoam simulation and am trying to refine the mesh near the air/water interface. In order to use refineMesh, I first created a cellSet using topoSet based on the value of alpha and then used that to define which cells need to be refined. refineMesh completes without errors and based on visual inspection the correct locations seem to be refined. However, when I run checkMesh I get errors. My refineMeshDict and checkMesh output are below.

I have tried to use patchLocal coordinates and geometricCut instead, but neither fixed the problem (although the results were different). If I change the directions so that it doesn't refine in the normal direction, checkMesh does not give errors but the refinement is not what I need (i.e. not refined in the z direction).

I have also tried to visualize were the problems might be using foamToVTK but don't seem to be able to see the faces in paraFoam, I am guessing because maybe they are too small and spreadout.

At this point I am stuck. There don't seem to be very many input parameters to change for refineMesh, so I am not sure what to do next. Thoughts?

I have tried it in both 2.1.0 and 2.1.x with the same results.

refineMeshDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      refineMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
// Cells to refine; name of cell set
set c0;
 
// Type of coordinate system:
// - global : coordinate system same for every cell. Usually aligned with
//   x,y,z axis. Specify in globalCoeffs section below.
// - patchLocal : coordinate system different for every cell. Specify in
//   patchLocalCoeffs section below.
coordinateSystem global;
//coordinateSystem patchLocal;
 
// .. and its coefficients. x,y in this case. (normal direction is calculated
// as tan1^tan2)
globalCoeffs
{
    tan1 (1 0 0);
    tan2 (0 1 0);
}
 
patchLocalCoeffs
{
    patch outside;  // Normal direction is facenormal of zero'th face of patch
    tan1 (1 0 0);
}
 
// List of directions to refine
directions
(
    tan1   //x
    tan2   //y
    normal //z
);
 
// Whether to use hex topology. This will
// - if patchLocal: all cells on selected patch should be hex
// - split all hexes in 2x2x2 through the middle of edges.
useHexTopology  true;
 
// Cut purely geometric (will cut hexes through vertices) or take topology
// into account. Incompatible with useHexTopology
geometricCut    false;
 
// Write meshes from intermediate steps
writeMesh       false;
 
// ************************************************************************* //
checkMesh output:
Code:
hydro@Bass:rasWES-WithPier-Refined2$ checkMesh -time 0.001
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.1.x-2ddb0f183f86
Exec   : checkMesh -time 0.001
Date   : Jul 26 2012
Time   : 22:16:52
Host   : "Bass"
PID    : 5559
Case   : /home/hydro/OpenFOAM/hydro-2.1.0/run/wes/rasWES-WithPier-Refined2
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations
 
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
 
Create polyMesh for time = 0.001
 
Time = 0.001
 
Mesh stats
    points:           221480
    faces:            597334
    internal faces:   560780
    cells:            188271
    boundary patches: 6
    point zones:      0
    face zones:       0
    cell zones:       0
 
Overall number of cells of each type:
    hexahedra:     176891
    prisms:        1590
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     9790
 
Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).
 
Checking patch topology for multiply connected surfaces ...
    Patch               Faces    Points   Surface topology                  
    top                 2050     2271     ok (non-closed singly connected)  
    walls               19801    20838    ok (non-closed singly connected)  
    outlet              960      1055     ok (non-closed singly connected)  
    inlet               819      907      ok (non-closed singly connected)  
    bottom              1586     1757     ok (non-closed singly connected)  
    wes                 11338    11835    ok (non-closed singly connected)  
 
Checking geometry...
    Overall domain bounding box (-40 0 0) (40 6.33 30)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (5.55089e-16 -9.55142e-16 -1.45354e-15) OK.
    Max cell openness = 4.41608e-16 OK.
    Max aspect ratio = 4.53029 OK.
 ***Zero or negative face area detected.  Minimum area: 0
  <<Writing 4 zero area faces to set zeroAreaFaces
    Min volume = 0.000624369. Max volume = 0.13697.  Total volume = 12956.9.  Cell volumes OK.
    Mesh non-orthogonality Max: 149.508 average: 6.90896
   *Number of severely non-orthogonal faces: 2.
 ***Number of non-orthogonality errors: 46.
  <<Writing 48 non-orthogonal faces to set nonOrthoFaces
 ***Error in face pyramids: 66 faces are incorrectly oriented.
  <<Writing 33 faces with incorrect orientation to set wrongOrientedFaces
    Max skewness = 2.66863 OK.
    Coupled point location match (average 0) OK.
 
Failed 3 mesh checks.
 
End

Last edited by mgdenno; July 30, 2012 at 13:43.
mgdenno is offline   Reply With Quote

Old   August 17, 2012, 12:31
Default
  #2
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 5
ic3wall is on a distinguished road
I would also be interested in the solution regarding this. I'm trying to refine a structured purely hex mesh, and when refining in the z-direction checkMesh complains about non-ortho faces.

The smallest cells I'm trying to cut in the normal direction are 1-2m, which is not that small ...
ic3wall is offline   Reply With Quote

Old   August 17, 2012, 12:41
Default
  #3
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 131
Rep Power: 6
mgdenno is on a distinguished road
Unfortunately I have not been able to figure out what is happening or what is causing the problem.

As a workaround, since I am using snappyHexMesh to generate my mesh, I defined refinement regions in my SHM dictionary. The results in more cells being refined than really need to be but it worked OK.

I would definitely still be interested in knowing how to resolve this if you figure it out.
mgdenno is offline   Reply With Quote

Old   August 17, 2012, 13:10
Default
  #4
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 5
ic3wall is on a distinguished road
But snappy refinement region's feature does the same thing as refineMesh, so it's weird you're not getting errors also with SHM. It splits cells 2x2x2...
ic3wall is offline   Reply With Quote

Old   August 17, 2012, 14:24
Default
  #5
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 131
Rep Power: 6
mgdenno is on a distinguished road
I agree that it is weird. The extent of the areas being refined are different between SHM and refineMesh because when using refinedMesh I selected my cells using topoSet to select the ones that had alpha1 between 0.001 and 0.999. When using SHM I made a series of boxes that encompass those same cells, which results in many cells more being refined. Could you try and use SHM without an stl file, or an stl file that is outside your mesh? How were you creating your cellSet for refineMesh?
mgdenno is offline   Reply With Quote

Old   August 17, 2012, 15:11
Default
  #6
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 5
ic3wall is on a distinguished road
I'm using SHM without STL file:

// Which of the steps to run
castellatedMesh true;
snap false;
addLayers false;

When using refineMesh, I select the cells with cellSet using the cellSetDict:

boxToCell (400 400 40) (600 600 120)

which is exactly the same principle in SHM with

geometry
{
box
{
type searchableBox;
min (400 400 40);
max (600 600 120);
}
};
ic3wall is offline   Reply With Quote

Old   August 17, 2012, 15:19
Default
  #7
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 131
Rep Power: 6
mgdenno is on a distinguished road
I am not 100% sure as I have an STL file in mine. I am actually running my analysis on my unrefined mesh that was generated using SHM, then running SHM again to generate a new mesh that has refinement regions specified, then mapping the first results to the refined mesh and running again. However, I would guess that what you have "castellatedMesh true;" would be fine - I don't expect that it will do anything as you aren't specifying a surface...hopefully it will still refine the refinement regions.
mgdenno is offline   Reply With Quote

Old   August 17, 2012, 16:44
Default
  #8
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 5
ic3wall is on a distinguished road
Quote:
Originally Posted by mgdenno View Post
I am not 100% sure as I have an STL file in mine. I am actually running my analysis on my unrefined mesh that was generated using SHM, then running SHM again to generate a new mesh that has refinement regions specified, then mapping the first results to the refined mesh and running again. However, I would guess that what you have "castellatedMesh true;" would be fine - I don't expect that it will do anything as you aren't specifying a surface...hopefully it will still refine the refinement regions.
It does refine correctly, there is no problem using SHM for refinement only as long as you put false to snapping and addLayers.

The problem is that when it refines normally (z-direction), checkMesh complains about non ortho faces. Samething happens with refineMesh, which I dont understand since it's only cutting hex in 2x2x2 and it uses polyhedra for the transition between refinement levels.

In refineMesh, when normal direction is commented, no problem in checkMesh!
ic3wall is offline   Reply With Quote

Old   August 19, 2012, 12:30
Default
  #9
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 131
Rep Power: 6
mgdenno is on a distinguished road
Just to follow-up on this, I have come up with a slightly better work around using SHM that doesn't result in refining more cells than needed as was the case when using refinement boxes. First create a cell set as if you were going to use refineMesh. Next, convert the cellSet to VTK using foamToVTK, then convert that to STL using the script in the post linked below. This STL can then be added to the SHM dict and used as a refinement region using mode inside.

http://www.cfd-online.com/Forums/ope...-openfoam.html

Hope this helps someone else.
mgdenno is offline   Reply With Quote

Old   August 25, 2013, 12:10
Default What writePrecision do you have in system/controlDict?
  #10
New Member
 
Johan Roenby
Join Date: May 2011
Location: Denmark
Posts: 4
Rep Power: 5
roenby is on a distinguished road
I got similar errors after doing topoSet and refineMesh on a simple blockMesh.
Turned out I was running with too low writePrecision (= 3 because I need to write out A LOT of data and don't need all those decimals) in system/controlDict.

Changing writePrecision to 4 removed all errors in the checkMesh.

Hope this helped.
sina.s likes this.
roenby is offline   Reply With Quote

Old   October 14, 2014, 06:16
Default
  #11
Member
 
sandy
Join Date: Mar 2013
Location: Cardiff, UK
Posts: 70
Rep Power: 3
sandy13 is on a distinguished road
Quote:
Originally Posted by roenby View Post
I got similar errors after doing topoSet and refineMesh on a simple blockMesh.
Turned out I was running with too low writePrecision (= 3 because I need to write out A LOT of data and don't need all those decimals) in system/controlDict.

Changing writePrecision to 4 removed all errors in the checkMesh.

Hope this helped.
Dear roenby,
I saw your post and wish if you can help me. I want to refine a specific region(small box shape) inside my original region(big box). I am using OpenFOAM 2.1.1. I used toposet dict to set up the cellSet as a box. so basically I ran blockMesh, topoSet, then refineMesh. But the problem now I get all the domain refined including the small box which I want to just refine it. couled you please direct me? do I need to use another utility?
Regards,
Sandy13,
sandy13 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkmesh shows fault in snappyhexmeshed pipe senol OpenFOAM 2 July 13, 2012 15:12
How to delete cells in OF based on CheckMesh? AndTen OpenFOAM 12 March 23, 2011 19:21
refineMesh -parallel crashes (in cavity tutorial) andras OpenFOAM Mesh Utilities 0 August 8, 2010 15:52
Cannot refineMesh with useHexTopology true ver141 naoki OpenFOAM Bugs 5 June 11, 2008 05:07
CheckMesh for mesh quality gdbaldw OpenFOAM Meshing & Mesh Conversion 2 October 18, 2007 01:11


All times are GMT -4. The time now is 04:40.