CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Basic problem with OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Andre1742
  • 1 Post By Andre1742

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2024, 11:47
Default Basic problem with OpenFOAM
  #1
New Member
 
Andrea
Join Date: Apr 2024
Posts: 6
Rep Power: 2
Andre1742 is on a distinguished road
Hy everybody,
I am a new user of OpenFOAM, trying to run my first case based on the tutorial motorbike. I created the triSurface folder in the constant directory, placed my CAD.stl and run surfaceFeatureExtract, blockMesh and snappyHexMesh. My cad is an assembly composed by many parts. I am not able to obtain the mesh of my entire assembly, just one part or another get meshed depending on the locationInMesh value I provide. I attach some pictures of my stl assembly and result obtained.
Anyone please can help me?
Thank you all
Attached Images
File Type: jpg motrice.jpg (11.3 KB, 11 views)
File Type: jpg stl.jpg (18.9 KB, 12 views)
File Type: jpg macchina.jpg (19.9 KB, 11 views)
Andre1742 is offline   Reply With Quote

Old   April 15, 2024, 11:52
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Hello,

I guess you want to solve the flow in the air surrounding your geometry, so the locationInMesh you are providing should be inside the domain (defined with blockMesh), but outside your geometry (defined by your STL files).

Regards,
Yann
Yann is offline   Reply With Quote

Old   April 15, 2024, 13:55
Default
  #3
New Member
 
Andrea
Join Date: Apr 2024
Posts: 6
Rep Power: 2
Andre1742 is on a distinguished road
Thank you for answering.
I tried to select a point outside my stl and inside the domain. I attached the result.
Best regards
Attached Images
File Type: jpg mesh.jpg (90.6 KB, 13 views)
Andre1742 is offline   Reply With Quote

Old   April 16, 2024, 03:15
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
What are you displaying here? the internalMesh or your domain boundaries?

When loading the internalMesh in ParaView, you can use the slice filter to slice your domain and see the mesh inside.

Regards,
Yann
Yann is offline   Reply With Quote

Old   April 17, 2024, 10:14
Default
  #5
New Member
 
Andrea
Join Date: Apr 2024
Posts: 6
Rep Power: 2
Andre1742 is on a distinguished road
You were right. I managed to see my internal mesh.
Thank you for your answer again!
just another question: if sHM gets display killed, does it mean I have a memory problem?I am running on wsl, my pc has 8 cores and 16 gbs of RAM.
Yann likes this.
Andre1742 is offline   Reply With Quote

Old   April 17, 2024, 11:11
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by Andre1742 View Post
just another question: if sHM gets display killed, does it mean I have a memory problem?I am running on wsl, my pc has 8 cores and 16 gbs of RAM.
Most likely a memory issue yes. As a rough estimate, with 16GB of memory you should be able to mesh up to 8 millions cells.
Probably less since windows should already use a good junk of those 16GB.
Yann is offline   Reply With Quote

Old   April 17, 2024, 11:19
Default
  #7
New Member
 
Andrea
Join Date: Apr 2024
Posts: 6
Rep Power: 2
Andre1742 is on a distinguished road
Clear, that was I thought. So do you have any suggestion to create a good quality mesh for my case (a 23x3.25x7 meters car carrier)?
like box and sHM values.

Thank you again
Attached Files
File Type: txt blockMeshDict.txt (1.6 KB, 2 views)
File Type: txt snappyHexMeshDict.txt (9.4 KB, 1 views)
Andre1742 is offline   Reply With Quote

Old   April 18, 2024, 03:31
Default
  #8
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Hello,

It would be useful to have few screenshots of your mesh to see what can be improved, even if it's a coarse one. And the number of cells you have in this mesh.

General advices:

Code:
    maxLocalCells 1000000;
    maxGlobalCells 2000000;
These parameters mean you are limiting snappy to a 2 millions cells mesh, 1 millions cells per core (if meshing in parallel).
If snappy hits the 2 millions cells limit, it will stop refining the mesh and proceed with the next steps of the meshing process. (you can look at the log file to see if it's happening)
It means it will not necessarily respect the refinement parameters you defined.

Code:
nCellsBetweenLevels 3;
This parameter defines how many buffer layers of cells you keep when changing the refinement level.
Lets say you have a refinement level of 6 on your surface, and no volume refinement. With nCellsBetweenLevels 3, you will have a level 6 refinement on your surface + 3 layers of level 6 cells around your surface before switching to level 5, then 3 layers of level 5 cells before switching to level 4, etc...
More information here: https://openfoamwiki.net/index.php/S...sBetweenLevels

If you are tight on memory, it can be interesting to reduce the nCellsBetweenLevels value since bigger values means more cells on transitions between refinement levels.
Of course it also means you will get rougher transitions between refinement levels, but if you lack memory you will have to compromise.

Yann
Yann is offline   Reply With Quote

Old   Yesterday, 06:23
Default
  #9
New Member
 
Andrea
Join Date: Apr 2024
Posts: 6
Rep Power: 2
Andre1742 is on a distinguished road
Thank you for your detailed answer. It was very helpful!
I shared some details of my mesh, which is characterized by a
#cells: 4.256.315. I also shared my snappyhexdict, if you may need it.
Any suggestions is appreciated.
Thank you again,
Regards
You can find everything here:

https://polimi365-my.sharepoint.com/...Wd2PQ?e=rMiIzX
Andre1742 is offline   Reply With Quote

Old   Yesterday, 08:45
Default
  #10
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Hello Andrea,

Your surfaces are very coarse while your region refinement is already pretty fine. In my opinion it is useless to have a fine mesh in the volume if your surfaces are too coarse.

I would advise to increase surface refinement and decrease volume refinement.
For instance :
Code:
refinementSurfaces
    {
        Bisarca
        {
            // Surface-wise min and max refinement level
            level (4 6);

            // Optional specification of patch type (default is wall). No
            // constraint types (cyclic, symmetry) etc. are allowed.
            patchInfo
            {
                type wall;
                inGroups (BisarcaGroup);
            }
        }
    }

resolveFeatureAngle 30;
And

Code:
refinementRegions
    {
        refinementBox
        {
            mode inside;
            levels ((1E15 2));
        }
    }
This will refine all surfaces at least to level 4, but up to level 6 on the curved parts of the surfaces, with a coarser refinement box around your geometry.
But in order to do this you will have to reset resolveFeatureAngle to something close to the default setting.
(Check this for more details: https://doc.openfoam.com/2306/tools/...veFeatureAngle)

This is just an example, you will have to test it for yourself and see what works best on your geometry.

To efficiently setup your mesh I would recommend to follow these steps:
  1. Focus on surface refinement, try different level refinement until you are satisfied with the surface mesh
  2. Once you are satisfied with surface mesh, add a refinement box in the refinementRegions section to control the volume refinement around your object
  3. Finally when you are satisfied with surface and volume refinement, you can take care of the layers

This will allow to quickly iterate on a lighter mesh on the first steps. To do so, for step 1 you can deactivate layer addition:

Code:
castellatedMesh true;
snap            true;
addLayers       false;
And remove the refinementBox in the refinementRegions section.

Then proceed to define your refinementBox on step 2, adjust the refinement level, and finally reactivate layer addition on step 3.

Keep in mind, each step will increase mesh size, so you need to find the best compromise at each step.

Have fun,
Yann
Yann is offline   Reply With Quote

Old   Yesterday, 08:49
Default
  #11
New Member
 
Andrea
Join Date: Apr 2024
Posts: 6
Rep Power: 2
Andre1742 is on a distinguished road
thank you Yann,
your suggestions will help me a lot!
Yann likes this.
Andre1742 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
Problem in transferring flameletFoam to OpenFOAM 5.x anjul OpenFOAM Community Contributions 5 February 7, 2021 23:32
[Other] Openfoam for windows 16.02 [CFD support] -problem with paraview ditmeyer OpenFOAM Installation 3 May 15, 2017 12:04
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 03:18
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 13:36
OpenFOAM 1.7.1 installation problem on Fedora 14 armonica OpenFOAM Installation 16 March 31, 2011 13:16


All times are GMT -4. The time now is 10:02.