CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Refinement regions with complex geometry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 7, 2016, 04:16
Default Refinement regions with complex geometry
  #1
Member
 
Federica Biano
Join Date: Feb 2016
Location: Genova, Italy
Posts: 39
Rep Power: 10
federicabi is on a distinguished road
Hi everyone!

I'm trying to create a mesh with snappyHexMesh in OF 3.0.1 and I need to insert a refinement searchable box rotated around z-axis. So I used searchableSurfaceCollection in this way

Code:
/*--------------------------------*- 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      snappyHexMeshDict;
}

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

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


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
    scafo.stl
    {
        type triSurfaceMesh;
        name scafo;

        patchInfo
        {
            type wall;
        }
    }

    refinementBox1
    {
        type searchableBox;
        min (-0.4 0 -2.4);
        max (27.2 3.8 4.8);
    }

    refinementBoxI1
    {
        type searchableBox;
        min (0 0 -0.4);
        max (60 5 0.4);  
    }

    refinementBoxS
    {
        type searchableBox;
        min (-10 0 -1.5);
        max (1 5 0.5);
    }
    refinementBoxM
    {
        type searchableSurfaceCollection;
    mergeSubRegions true;
    
    refinementBoxM
    {
      surface box;
      scale (80 24 2);
      transform
      {
        type cartesian;
        origin (0 0 0);
        e1 (0.9847835588179368 -0.17378533390904768 0);
        e3 (0 0 1);
      }
    }
    }
        

};
Unfortunately it doesn't work and OF returns this error
Code:
--> FOAM FATAL IO ERROR: 
keyword coordinateSystem is undefined in dictionary "/home/jolly/OpenFOAM/Stage_Federica/AZ95rph/AZ95rph_snappyHexMesh/AZ95rph_snappyHexMesh_Fisso_26kn_1/system/snappyHexMeshDict.geometry.refinementBoxM.refinementBoxM.transform"

file: /home/jolly/OpenFOAM/Stage_Federica/AZ95rph/AZ95rph_snappyHexMesh/AZ95rph_snappyHexMesh_Fisso_26kn_1/system/snappyHexMeshDict.geometry.refinementBoxM.refinementBoxM.transform from line 75 to line 77.

    From function dictionary::subDict(const word& keyword) const
    in file db/dictionary/dictionary.C at line 648.

FOAM exiting
I think that this error can be due to the different OF version of the searchableSurfaceCollection subdictionary, that I found for OF 2.1.x, but I can't find anything for OF 3.0.x.

Can you help me please?

Best regards

Federica
federicabi is offline   Reply With Quote

Old   July 7, 2016, 05:03
Default
  #2
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 12
TobM is on a distinguished road
Hi,
a good way to start are the tutorials. Use something like this:
find $FOAM_TUTORIALS -name snappyHexMeshDict | xargs grep coordinateSystem
to search for keywords.
There you will find an example:
tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict
TobM is offline   Reply With Quote

Old   July 7, 2016, 05:07
Default
  #3
Member
 
Federica Biano
Join Date: Feb 2016
Location: Genova, Italy
Posts: 39
Rep Power: 10
federicabi is on a distinguished road
Hi TobM!
Thank you very much for your quickly reply, I've just found that tutorial and it is exactly what I need.
Thanks for your help!

Best regards

Federica
federicabi is offline   Reply With Quote

Old   July 7, 2016, 05:37
Default
  #4
Member
 
Federica Biano
Join Date: Feb 2016
Location: Genova, Italy
Posts: 39
Rep Power: 10
federicabi is on a distinguished road
I have another question about it. I use the subdictionary found into the tutorial that you have mentioned before and it worked, the box is generated, but when snappy starts the region-wise refinement, it returns me the following error
Code:
--> FOAM FATAL ERROR: 
Shell refinementBoxM does not support testing for inside
Probably it is not closed.

    From function shellSurfaces::shellSurfaces(const searchableSurfaces&, const PtrList<dictionary>&)
    in file autoHexMesh/shellSurfaces/shellSurfaces.C at line 134.

FOAM exiting
My question is: how can a box created by snappy be open? it is quite strange to me.
Do you have any suggestion?
federicabi is offline   Reply With Quote

Old   July 7, 2016, 05:49
Default
  #5
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 12
TobM is on a distinguished road
Just an idea:
Are your boxes inside your geometry, or are they overlapping?
Does sHM run without this refinement zone?

I haven't worked with this functionality, so I can't help you any futher.
TobM is offline   Reply With Quote

Old   July 7, 2016, 06:00
Default
  #6
Member
 
Federica Biano
Join Date: Feb 2016
Location: Genova, Italy
Posts: 39
Rep Power: 10
federicabi is on a distinguished road
Actually the box has one vertex outside the mesh, maybe that is the problem, I didn't notice it because of the rotation. Also it overlaps with the other refinement boxes.
Without that box sHM runs without errors.

I'll try to find a solution.
Maybe an stl file that recreate the same geometry of the rotated box could be a way. what do you think?
Thanks a lot for your help.
federicabi is offline   Reply With Quote

Old   July 7, 2016, 06:03
Default
  #7
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 12
TobM is on a distinguished road
The overlapping with other refinement boxes shouldn't be a problem.
In a first try, make the box smaller and see if it works.
TobM is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] FOAM Warnings leading to no geometry, yet OpenFOAM says meshing finished w/o error edomalley1 OpenFOAM Meshing & Mesh Conversion 2 October 28, 2024 03:21
[snappyHexMesh] No satisfying result with feature edge refinement Krapf OpenFOAM Meshing & Mesh Conversion 5 December 13, 2019 07:59
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 18:16
[snappyHexMesh] addLayers in limited regions of geometry Chia OpenFOAM Meshing & Mesh Conversion 2 January 10, 2013 05:33
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 04:23


All times are GMT -4. The time now is 21:03.