CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

In SnappyHexMesh, which external mesher can be usable for background mesh?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2024, 13:52
Default In SnappyHexMesh, which external mesher can be usable for background mesh?
  #1
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Hi everyone.

I am very new in openFoam. I try to do a ventilation project for a room. Inside geometry is okay but room geometry(my background mesh) is hard to make with blockMesh (the room has chamfered like edges).

Do you have any advice about which mesher without blockMesh can I use for the room geometry?

Good day.
Xbrt is offline   Reply With Quote

Old   January 18, 2024, 04:24
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello,

You can use a STL file for your room geometry and use a simple blockMesh encapsulating it.

Regards,
Yann
Yann is offline   Reply With Quote

Old   January 18, 2024, 05:59
Default
  #3
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Thank you for your advice.
But I am afraid I could not express myself properly. The room geometry is encapsulater one. I use STL file for inside furniture but room geometry is hard to be maked by blockmesh.

Regards,
Xbrt.
Xbrt is offline   Reply With Quote

Old   January 18, 2024, 06:07
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Can you elaborate about what you are trying to achieve?
Like a simple drawing?

You can have STL files for the furniture, another STL for the room geometry, and have a bigger blockMesh encapsulating all your stl files to use as background mesh. snappyHexMesh will use the locationInMesh coordinate to know what part of the mesh has to be kept and which ones will be removed.
Yann is offline   Reply With Quote

Old   January 18, 2024, 06:21
Default
  #5
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Yes , my furniture is STL but the bigger geometry that is encapsulate the furniture is room. The room is hard to be maked with blockmesh. I wonder if there is any alternative.
Attached Images
File Type: jpg IMG_20240118_131625.jpg (61.1 KB, 16 views)
Xbrt is offline   Reply With Quote

Old   January 18, 2024, 06:26
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Alright, this is my point: make the room as a STL file too, and use a blockMesh bigger than the room.

Your blockMesh can be made of one single block and the boundaries do not really matter as the blockMesh part outside of the room will be removed by snappy. You will end up with the inside of your room meshed and the boundaries will be the one defined in the room STL.

EDIT: added drawing
Attached Images
File Type: jpg Image1.jpg (156.8 KB, 20 views)
AtoHM likes this.
Yann is offline   Reply With Quote

Old   January 18, 2024, 06:37
Default
  #7
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Ah, I now understand it. I will try to do. Thank you for your time and your information. I will put here the solution that maybe others can find it useful.

Have a nice day.
Yann likes this.
Xbrt is offline   Reply With Quote

Old   January 19, 2024, 08:54
Default
  #8
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Hi again. I run this snappyHexMesh file and computer do not mesh my interior (table and lamps). How can I fix this?

geometry
{
room.stl
{
type triSurfaceMesh;
name room.stl;



regions
{

inlet
{
name inlet.stl;
}

outlets
{
name outlets.stl;
}

sidewalls
{
name sidewalls.stl;
}

upperwall
{
name upperwall.stl;
}
downwall
{
name downwall.stl;
}
}
}
lamps.stl
{
type triSurfaceMesh;
name lamps.stl;
}

table.stl
{
type triSurfaceMesh;
name table.stl;
}




/*
refinementBox1
{
type searchableBox;
min (-2 -2 -2);
max (2 2 2);
}
*/

};


castellatedMeshControls
{


maxLocalCells 100000;


maxGlobalCells 2000000;


minRefinementCells 0;


maxLoadUnbalance 0.10;



nCellsBetweenLevels 2;



features
(
{
file "room.eMesh";
level 0;
}
{
file "lamps.eMesh";
level 0;
}
{
file "table.eMesh";
level 0;
}
);


refinementSurfaces
{
room.stl
{

level (2 2);

regions
{

inlet
{
level (2 4);
patchInfo { type patch; }
}

outlets
{
level (2 4);
patchInfo { type patch; }
}

sidewalls
{
level (2 4);
patchInfo { type wall; }
}

upperwall
{
level (2 4);
patchInfo { type wall; }
}

downwall
{
level (2 4);
patchInfo { type wall; }
}
}
}


}


resolveFeatureAngle 60;



refinementRegions
{

}

locationInMesh (7.5 3 6);


}
Attached Images
File Type: jpg yankesit.JPG (60.1 KB, 12 views)
File Type: jpg geo.JPG (14.1 KB, 13 views)
Xbrt is offline   Reply With Quote

Old   January 19, 2024, 09:32
Default
  #9
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello,

Where is located your locationInMesh point? this is the parameter defining which volume your want to keep in your mesh.

Yann
Yann is offline   Reply With Quote

Old   January 19, 2024, 11:05
Default
  #10
Senior Member
 
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13
AtoHM is on a distinguished road
As Yann points out, locationInMesh must be set correctly.
Some additional hints:
1) usually we set the locationInMesh with some double components like (0.212 -11.991 2.2188). The reason is, that, if it lands on a cell node, snappy potentially makes strange things. This is probably not causing your isssue, just FYI.
2) Snappy works best with a uniform background mesh. Yours is very flat already, it is going to have a hard time creating a good quality mesh with this as an input. You need to really know what you are doing to use that kind of anisotropy.
3) I recommend not setting the min/max level for a region greater than 1 apart. The best would be to use one specific level for your region like (3 3) or (4 4).
4) Your global settings for maxGlobal and maxLocal cells might cause snappy to stop refining midway through the process and that might lead to some things missing. Make sure you are below these levels or increase these values if your computer can handle it.
Yann likes this.
AtoHM is offline   Reply With Quote

Old   January 19, 2024, 11:06
Default
  #11
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
It was 1st. point. After your answer I change it to 2nd. location. But now it does not run even.
Attached Images
File Type: jpg geo2.JPG (15.7 KB, 11 views)
Xbrt is offline   Reply With Quote

Old   January 19, 2024, 11:25
Default
  #12
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
2nd location is the way to go.

Quote:
Originally Posted by Xbrt View Post
IBut now it does not run even.
This does not give any useful information to help you. What error do you get? Do you have the snappyHexMesh log?

Yann
Yann is offline   Reply With Quote

Old   January 19, 2024, 12:00
Default
  #13
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
I correct the error but my outer mesh and interiors gone.
Attached Images
File Type: jpg geo4.JPG (37.1 KB, 9 views)
Xbrt is offline   Reply With Quote

Old   January 19, 2024, 12:01
Smile
  #14
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Quote:
Originally Posted by AtoHM View Post
As Yann points out, locationInMesh must be set correctly.
Some additional hints:
1) usually we set the locationInMesh with some double components like (0.212 -11.991 2.2188). The reason is, that, if it lands on a cell node, snappy potentially makes strange things. This is probably not causing your isssue, just FYI.
2) Snappy works best with a uniform background mesh. Yours is very flat already, it is going to have a hard time creating a good quality mesh with this as an input. You need to really know what you are doing to use that kind of anisotropy.
3) I recommend not setting the min/max level for a region greater than 1 apart. The best would be to use one specific level for your region like (3 3) or (4 4).
4) Your global settings for maxGlobal and maxLocal cells might cause snappy to stop refining midway through the process and that might lead to some things missing. Make sure you are below these levels or increase these values if your computer can handle it.
Thank you for advices
Xbrt is offline   Reply With Quote

Old   January 19, 2024, 12:04
Default
  #15
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Well, outer mesh gone was pretty much the point since you want to simulate the flow inside the room right?

What do you mean by "interiors gone" ? No furniture at all or no mesh inside furniture?
Yann is offline   Reply With Quote

Old   January 19, 2024, 12:20
Default
  #16
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
in solutions I plan to see flow around table and lamps. But my STL files that located in triSurfacedMesh do not be meshed
Xbrt is offline   Reply With Quote

Old   January 19, 2024, 12:32
Default
  #17
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
OK then. Can you post your snappyHexMeshDict and your snappyHexMesh log?
Yann is offline   Reply With Quote

Old   January 19, 2024, 14:52
Default
  #18
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Sorry for late answer. I cannot enter the forum for a gap
Attached Files
File Type: txt log.txt (35.5 KB, 3 views)
File Type: txt snappy.txt (16.6 KB, 4 views)
Xbrt is offline   Reply With Quote

Old   January 19, 2024, 17:30
Default
  #19
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Thanks for the files.

You need to define surface refinement for your lamps and table in the refinementSurfaces section. For now only room is defined and this is why only room is meshed.

Yann
Yann is offline   Reply With Quote

Old   January 20, 2024, 08:29
Default
  #20
New Member
 
Xbrt
Join Date: Jan 2024
Posts: 18
Rep Power: 2
Xbrt is on a distinguished road
Quote:
Originally Posted by Yann View Post
Thanks for the files.

You need to define surface refinement for your lamps and table in the refinementSurfaces section. For now only room is defined and this is why only room is meshed.

Yann
Thank you very much. Would you consider mentoring me on this project for fee?
I have very limited time until deadine and I am stucked.
Xbrt 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
flow over cylinder in openFoam saeed jamshidi OpenFOAM Pre-Processing 3 August 11, 2023 16:16
[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] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 08:05
CGNS Compiling Diego Main CFD Forum 17 December 21, 2014 02:40
[snappyHexMesh] How to Do External Mesh for Airfoil sHM msuaeronautics OpenFOAM Meshing & Mesh Conversion 1 September 23, 2012 05:00


All times are GMT -4. The time now is 12:33.