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

[snappyHexMesh] Multi region snapping doesn't work

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2022, 08:14
Unhappy Multi region snapping doesn't work
  #1
Senior Member
 
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6
Hr_kules is on a distinguished road
Hey all,


i have a geometry of a plate with an angular step and and surrounding fluid volume. The stls were created in python because i exporting them from Ansys led to certain points not matching each other. The stls themself are attached. The result of running snappyHexMesh are also attached. At first they look somewhat okay, but i get 26 wrong faces due to orthogonality.
Also the boundaries are a complete mess after spliting the mesh:
boundaries fluid:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/fluidcold/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

3
(
    wallfluidcold
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          108;
        startFace       3581709;
    }
    wallsolid
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          199224;
        startFace       3581817;
    }
    fluidcold_to_solid
    {
        type            mappedWall;
        inGroups        List<word> 
3
(
wall
mappedPatch
baffles1
)
;
        nFaces          195024;
        startFace       3781041;
        sampleMode      nearestPatchFace;
        sampleRegion    solid;
        samplePatch     solid_to_fluidcold;
    }
)

// ************************************************************************* //
boundaries solid
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/solid/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

4
(
    inletcold
    {
        type            patch;
        nFaces          80283;
        startFace       6892163;
    }
    outletcold
    {
        type            patch;
        nFaces          80284;
        startFace       6972446;
    }
    wallfluidcold
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          217620;
        startFace       7052730;
    }
    solid_to_fluidcold
    {
        type            mappedWall;
        inGroups        List<word> 
3
(
wall
mappedPatch
baffles1
)
;
        nFaces          195024;
        startFace       7270350;
        sampleMode      nearestPatchFace;
        sampleRegion    fluidcold;
        samplePatch     fluidcold_to_solid;
    }
)

// ************************************************************************* //
As you can see the boundaries don't match up at all. This is frustrating as i plan to automatize the stl creation and meshing as well as the calculation and this case, was acutally just a tester. The allrun script looks like this:
Code:
#!/bin/sh
cd "${0%/*}" || exit 1    # run from this directory

#Color for messages
GREEN='\e[0;32m'
NC='\e[0m'

echo "${GREEN}create background mesh$NC"
blockMesh > meshLog
echo "${GREEN}create edge mesh$NC"
surfaceFeatures >> meshLog
echo "${GREEN}run snappyHexMesh$NC"
snappyHexMesh -overwrite >> meshLog
echo "${GREEN}create baffles for interface$NC"
createBaffles -overwrite >> meshLog
echo "${GREEN}split mesh along interface$NC"
splitMeshRegions -cellZones -defaultRegionName solid -overwrite >> meshLog
echo "${GREEN}create singles files for paraFoam$NC"
paraFoam -touchAll
Any help is really appreciated and very well needed, as i tried everything i could think of, but i am still stuck.



Thank you!
Attached Images
File Type: jpg solid.jpg (24.5 KB, 24 views)
File Type: jpg fluidcold_to_solid.jpg (26.3 KB, 21 views)
File Type: jpg fluidcold.jpg (24.7 KB, 20 views)
File Type: jpg meshfluid.jpg (187.2 KB, 24 views)
File Type: jpg meshsolid.jpg (123.6 KB, 21 views)
Hr_kules is offline   Reply With Quote

Old   May 13, 2022, 05:09
Default
  #2
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 15
Antimony is on a distinguished road
Hi,

Can you explain what you mean by
Quote:
As you can see the boundaries don't match up at all
?

If you see the interface, they seem to have the same number of faces. So in that sense they match up.

Also, you mention that the mesh quality is not good? Can you post the output of checkMesh as well as the snappyHexMeshDict that you used?

Hope this helps.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   May 13, 2022, 05:26
Default
  #3
Senior Member
 
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6
Hr_kules is on a distinguished road
Hey,


yes i can explain; so for the region fluidcold i want following boundaries as specified in my stl:
-inletcold
-outletcold
-wallfluidcold
-fluidcold_to_solid
and for the solid region:
-wallsolid
-solid_to_fluidcold
in the code snippets the boundaries appear more then once for each region as well as that in and outlet are somehow in the solid region.


I have attached the snappyhexmeshdict and the log of all mesh operations. The checkMesh run is the last entry in the log.


Thank you!
Attached Files
File Type: zip forum.zip (16.0 KB, 1 views)
Hr_kules is offline   Reply With Quote

Old   May 17, 2022, 06:33
Default
  #4
Senior Member
 
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6
Hr_kules is on a distinguished road
Hi Antimony,


have you had any chance to llok in the uploaded files? I would really appreciate some guidance considering my problems.


Thank you and have a nice day,


Nico
Hr_kules is offline   Reply With Quote

Old   May 18, 2022, 04:17
Default
  #5
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 15
Antimony is on a distinguished road
Hi,

I took a quick look. Seems like you are getting 2 regions which is inline with what you want. And the mesh quality is fine. The 26 faces are marginally beyond the default value of 65 deg, so that really should not be causing any issues.

Unfortunately, at the moment it isn't clear where the issue is. Given that you have multiple STLs + baffles, it is difficult to pinpoint without being able to see the case...

Have you looked at the conjugate heat transfer tutorial cases as a guide to setting up multiple region simulations?

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   May 18, 2022, 04:53
Default
  #6
Senior Member
 
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6
Hr_kules is on a distinguished road
Hey,


if it helps, i have attached to full case. My main concern is the assignment of the boundaries after spliting the mesh.


I have looked up the tutorials before starting this case, especially the shell and tube heat exchanger example. I am somewhat confused why the assignment of the boundaries works there considering the geometry of a shell and tube heat exchanger is quite a bit more complex then two blocks with a chevron step on it.



Thank you and have a nice day!
Attached Files
File Type: zip singlePlate.zip (47.3 KB, 1 views)
Hr_kules is offline   Reply With Quote

Old   June 21, 2022, 06:26
Default
  #7
Senior Member
 
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6
Hr_kules is on a distinguished road
Hi,
i know this is a bit late, but i could pin point the problem considering the multiregion meshing. It seems like the cellZones are not assigned to right region. However i have no idea how to fix this..
Maybe you see this and can enlighten me?
Hr_kules is offline   Reply With Quote

Old   January 19, 2024, 07:11
Default
  #8
New Member
 
Join Date: Apr 2023
Posts: 1
Rep Power: 0
vittoria is on a distinguished road
Quote:
Originally Posted by Hr_kules View Post
Hey,


yes i can explain; so for the region fluidcold i want following boundaries as specified in my stl:
-inletcold
-outletcold
-wallfluidcold
-fluidcold_to_solid
and for the solid region:
-wallsolid
-solid_to_fluidcold
in the code snippets the boundaries appear more then once for each region as well as that in and outlet are somehow in the solid region.


I have attached the snappyhexmeshdict and the log of all mesh operations. The checkMesh run is the last entry in the log.


Thank you!





I'm currently facing the same problem with the boundaries, were you able to fix it, and if yes how did you do it?


Thanks you
vittoria is offline   Reply With Quote

Old   January 19, 2024, 07:13
Default
  #9
Senior Member
 
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6
Hr_kules is on a distinguished road
Hi, i was unfortunately never able to solve the problem. My conclusion was to not use snappyHexMesh for multi region meshes ever again. I changed to Salome for more complex meshes; easy meshes i have done with GMSH.
Hr_kules 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
Negative initial temperature error (chtMultiRegionFoam) jebin OpenFOAM Pre-Processing 60 July 17, 2022 05:10
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
[snappyHexMesh] Multi Region Meshing bruce OpenFOAM Meshing & Mesh Conversion 12 July 31, 2013 10:09
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04
[snappyHexMesh] multi region with snappyHexMesh vikthor OpenFOAM Meshing & Mesh Conversion 0 August 24, 2012 03:47


All times are GMT -4. The time now is 19:39.