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

[snappyHexMesh] addLayers for a multiRegion mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By julieng
  • 3 Post By aendres

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2020, 03:30
Default addLayers for a multiRegion mesh
  #1
New Member
 
Francesca Mangani
Join Date: Oct 2019
Posts: 7
Rep Power: 6
FrancescaMangani is on a distinguished road
Hi everybody,


I would like to understand if it is possible to add layers on a surface which is internal to the mesh.
Infact I'm doing a mesh in order to use chtMultiRegionFoam, splitting it with splitMeshRegions.
Therefore my boundaries are those of the block produced by the blockMesh, but I would like to add layers on the surface of my object, which is cointained in this block.


I would be really grateful to those who can give me any hint!
FrancescaMangani is offline   Reply With Quote

Old   August 5, 2020, 12:49
Default
  #2
New Member
 
Sammy Breen
Join Date: Jul 2020
Posts: 4
Rep Power: 5
SBreen is on a distinguished road
Greetings,

I have the same problem, did you find a solution?

Thank you very much!
SBreen is offline   Reply With Quote

Old   August 5, 2020, 13:15
Default
  #3
New Member
 
Sammy Breen
Join Date: Jul 2020
Posts: 4
Rep Power: 5
SBreen is on a distinguished road
Nevermind I found the solution.

You can use the region0_to_region1 patches. So for example if you have the regions heater and air you can use heater_to_air as a patch for addLayers.
SBreen is offline   Reply With Quote

Old   December 24, 2020, 07:59
Default
  #4
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Hello,

I try to mesh the interface between 2 regions with sHM.
I try to do your way. But snappy told me that the interface fluid_to_solid is not defined in the log file.

I tried to mesh only castellation and snap first, do a
splitMeshRegions -cellZones -overwrite
And mesh layers after that with no success.

I see on the forum that one solution is to copy paste each mesh obtained with castellation and snap = true and mesh it again in constant/polymesh with layers = true. Repeat it for each regions.
It is not very attractive, is there a more trivial way to do this?

Best regards
Attached Files
File Type: txt snappyHexMeshDict.txt (10.8 KB, 33 views)
julieng is offline   Reply With Quote

Old   December 24, 2020, 08:20
Default
  #5
New Member
 
Sammy Breen
Join Date: Jul 2020
Posts: 4
Rep Power: 5
SBreen is on a distinguished road
Hello,

I think you might have used the wrong patch name in your layers definition. I used the name of the patch interface between the fluid and solid region. Try looking up the name in paraview maybe.

Hope i could help you and have nice holidays.
Attached Files
File Type: txt snappyHexMeshDict.txt (9.1 KB, 38 views)
SBreen is offline   Reply With Quote

Old   December 27, 2020, 15:58
Default
  #6
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Hello,

Thank you for your answer. I am stuck since severals days on this.

Why don't you use the standard refinementSurface ? You don't specify faceZone and faceZone?

HTML Code:
 refinementSurfaces
    {
        solid
        {
            // Surface-wise min and max refinement level
            level (2 2);
             regions
            {
                solid_fluid 
                  {
                  level (3 3);
                  }
            }
            faceZone solid; //insideFaces
            cellZone solid; //insideZone
            cellZoneInside inside;
          
         }  
         
          fluid
        {
            // Surface-wise min and max refinement level
            level (0 0);
            faceZone fluid;//insideFaces
            cellZone fluid; //outsideZone
            cellZoneInside inside;
        
         }
Why don't you snap the surfaces? Maybe you have only straight lines and 90° corners.
In my case I have a curved interface between solid and fluid regions, so I need to snap. I use the correct patch name fluid_to solid (patch name that it would be created with the splitMeshRegions -cellZones command.

HTML Code:
addLayersControls
{
    relativeSizes false;

    // Per final patch (so not geometry!) the layer information
    layers
    {
        fluid_to_solid
            {
            nSurfaceLayers 6;
            finalLayerThickness 1.05;
            }
            
          wall
        {
        nSurfaceLayers 6;
        finalLayerThickness 1.05;
        }
    }
The patch wall is layered but not the interface between solid and fluid.
It seems that the mesh at the interface is not conform. The stl files are generated with Salome and are watertight and conform.

Quote:
Originally Posted by julieng View Post
Hello,

Thank you for your answer. I am stuck since severals days on this.

Why don't you use the standard refinementSurface ? You don't specify faceZone and faceZone?

HTML Code:
 refinementSurfaces
    {
        solid
        {
            // Surface-wise min and max refinement level
            level (2 2);
             regions
            {
                solid_fluid 
                  {
                  level (3 3);
                  }
            }
            faceZone solid; //insideFaces
            cellZone solid; //insideZone
            cellZoneInside inside;
          
         }  
         
          fluid
        {
            // Surface-wise min and max refinement level
            level (0 0);
            faceZone fluid;//insideFaces
            cellZone fluid; //outsideZone
            cellZoneInside inside;
        
         }
Why don't you snap the surfaces? Maybe you have only straight lines and 90° corners.
In my case I have a curved interface between solid and fluid regions, so I need to snap. I use the correct patch name fluid_to solid (patch name that it would be created with the splitMeshRegions -cellZones command.

HTML Code:
addLayersControls
{
    relativeSizes false;

    // Per final patch (so not geometry!) the layer information
    layers
    {
        fluid_to_solid
            {
            nSurfaceLayers 6;
            finalLayerThickness 1.05;
            }
            
          wall
        {
        nSurfaceLayers 6;
        finalLayerThickness 1.05;
        }
    }
The patch wall is layered but not the interface between solid and fluid.
It seems that the mesh at the interface is not conform. The stl files are generated with Salome and are watertight and conform.



Maybe add layers on a curved interface in not an easy task.

Have a nice Christmas

Julien
Maybe add layers on a curved interface in not an easy task.

Have a nice Christmas

Julien

Last edited by julieng; December 27, 2020 at 16:02. Reason: bad image insertion
julieng is offline   Reply With Quote

Old   December 27, 2020, 16:10
Default
  #7
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
This is the mesh after addlayers operation



No layers added at the interface...
julieng is offline   Reply With Quote

Old   December 28, 2020, 03:59
Default
  #8
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Hello,

I found this post very close of mine.
Trouble with snappy and boundary layers

As in your example it is used a typo like this one to define the location in mesh without faceZone, cellZone, cellZoneInside, features

locationsInMesh
(
((1.4 0.05 0.05) fluid)
((1.6 0.05 0.05) solid)
);

The problem is that I have an error when I try this way:

HTML Code:
--> FOAM FATAL IO ERROR:
keyword locationInMesh is undefined in dictionary "C:/PROGRA~1/BLUECF~1/OFUSER~1/run/SNAPPY~1/CHCD7B~1/system/snappyHexMeshDict.castellatedMeshControls"

file: C:/PROGRA~1/BLUECF~1/OFUSER~1/run/SNAPPY~1/CHCD7B~1/system/snappyHexMeshDict.castellatedMeshControls from line 98 to line 271.

    From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
    in file db/dictionary/dictionary.C at line 566.

FOAM exiting
Maybe my version of OpenFoam is out of date to support this typo?
bluecfdcore Openfoam 5.

What do you think?

Julien
julieng is offline   Reply With Quote

Old   December 28, 2020, 04:08
Default
  #9
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
I see that this function is not implemented in the Openfoam fundation versions !!

Multiple meshed components missing

Is there a possibility toadd layers at the interface solid-fluid with the foundation version of Openfoam ?

Last edited by julieng; December 28, 2020 at 04:09. Reason: add link
julieng is offline   Reply With Quote

Old   December 29, 2020, 03:28
Default
  #10
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 723
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Does the extrudeMesh utility helps here?
dlahaye is online now   Reply With Quote

Old   December 29, 2020, 07:51
Default
  #11
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Hello,

Thank you for your answer. I am looking for a "standard" procedure being able to mesh every cases I will test. Not only this geometry.

Best regards
julieng is offline   Reply With Quote

Old   December 29, 2020, 08:02
Default
  #12
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Can anyone tell me what is wrong with my typo of layer section, for calling the interface between fluid and solid in my snappyHexMeshDict file?
Attached Files
File Type: txt snappyHexMeshDict.txt (11.6 KB, 31 views)

Last edited by julieng; December 29, 2020 at 08:03. Reason: bad wording
julieng is offline   Reply With Quote

Old   December 29, 2020, 15:04
Default
  #13
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Ok, the solution was to do the operation:
splitMeshRegions -cellZones -overwrite

And after that it is possible to create BL at the interface

wht likes this.
julieng is offline   Reply With Quote

Old   February 22, 2021, 14:43
Default
  #14
New Member
 
Christian
Join Date: Dec 2019
Posts: 3
Rep Power: 6
CFD_Freiberg is on a distinguished road
Quote:
Originally Posted by julieng View Post
Ok, the solution was to do the operation:
splitMeshRegions -cellZones -overwrite

And after that it is possible to create BL at the interface




Hello julieng,
nice to hear you could solve the problem.
Could you sum up the successful workflow?


Because i'm in the same position like you at the beginning and i followed your steps but still can't get layers at the interface area.


Here's my workflow.
1. use sHM with castellatedMesh and snap both "true", addLayers is "false"
2. use "splitMeshRegions -cellZones -overwrite"
3. use sHM with castellatedMesh and snap both "false" and addLayers "true"


but there're still no layers at the interface. I'm using OpenFoam 8.



With kind regards
Christian
CFD_Freiberg is offline   Reply With Quote

Old   May 26, 2021, 14:15
Default
  #15
New Member
 
Milton Keynes
Join Date: Feb 2021
Posts: 1
Rep Power: 0
Mfebbo is on a distinguished road
I am having same issue and still no success copying files from fluid region to contact/polymesh and setting addlayers to true and the other two to false. I have given the right name of the created interface patch to the addlayercontrols section of snappyhexmesh, but still nothing. Someone could explain the right steps to solve it? Many thanks
Mfebbo is offline   Reply With Quote

Old   September 8, 2021, 07:14
Default Workflow
  #16
New Member
 
Aaron Endres
Join Date: Jun 2016
Posts: 12
Rep Power: 9
aendres is on a distinguished road
Hi,

this is a workflow, which worked for me in OpenFoam 9:

Code:
blockMesh

foamDictionary -entry "castellatedMesh" -set "true" system/snappyHexMeshDict
foamDictionary -entry "snap" -set "true" system/snappyHexMeshDict
foamDictionary -entry "addLayers" -set "false" system/snappyHexMeshDict
snappyHexMesh -overwrite

splitMeshRegions -cellZones -overwrite

rm -r constant/polyMesh

foamDictionary -entry "castellatedMesh" -set "false" system/snappyHexMeshDict
foamDictionary -entry "snap" -set "false" system/snappyHexMeshDict
foamDictionary -entry "addLayers" -set "true" system/snappyHexMeshDict

echo 'snappyHexMesh: coolant layers'
mv constant/coolant/polyMesh constant
snappyHexMesh -overwrite
mv constant/polyMesh constant/coolant

echo 'snappyHexMesh: metal layers'
mv constant/metal/polyMesh constant
snappyHexMesh -overwrite
mv constant/polyMesh constant/metal
The case I used was an altered 'heatedDuct' tutorial case with only two regions: coolant and metal. splitMeshRegions creates the two patches metal_to_coolant and coolant_to_metal, which is why I put the following layer definition in system/snappyHexMeshDict:

Code:
addLayersControls
{
    relativeSizes   true;
    minThickness    1e-10;
    finalLayerThickness 0.67;
    expansionRatio  1.5;
    layers
    {
        metal_to_coolant
        {
            nSurfaceLayers  2;
        }
        coolant_to_metal
        {
            nSurfaceLayers  2;
        }
    }
}
DaveD!, altinel and wht like this.
aendres 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] SnappyHexMesh/splitMeshRegion : region1 in zone "-1" GuiMagyar OpenFOAM Meshing & Mesh Conversion 3 August 4, 2023 12:38
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 07:34
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 17:16
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 04:17
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 07:05


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