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

snappyHexMesh doesn't see stl/eMesh file and splitMeshregions doesn't detect regions

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By raptor333

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2024, 14:48
Default snappyHexMesh doesn't see stl/eMesh file and splitMeshregions doesn't detect regions
  #1
New Member
 
stijn
Join Date: Feb 2024
Posts: 7
Rep Power: 2
raptor333 is on a distinguished road
Hi
i am a new openfoam user, i am stuck with a simulation of the temperature evolution of a fluid in a pipe exposed to air, but every time i try to make the mesh for it splitmeshregions says only one region, doing nothing, i think that is caused by snappyhexmesh doen't detect my stl file or emesh file, there are no errors given at any stage of creating the mesh, the only thing that it gives is a warning:
FOAM Warning :
From Foam::treeBoundBox::treeBoundBox(const Foam::UList<Foam::Vector<double> >&)
in file meshes/treeBoundBox/treeBoundBox.C at line 70
No bounding box for zero-sized pointField

i am trying for weeks now to get splitMeshregions to work i have tried toposetdict, changing locationsInMesh ( because i do not know of the coordinates you chouse must be in the middle of the region or just in the region), i tried to find anything on the internet that could help, but either they didn't give the solution or i didn't understand it, does anyone know how to solve this ?

i set the files of the case in this link: https://1drv.ms/f/s!Agflt1nDTyHxhlNo...BjJ-I?e=ktYuwb
raptor333 is offline   Reply With Quote

Old   February 23, 2024, 03:53
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,078
Rep Power: 26
Yann will become famous soon enough
Hello,

This is your STL bounding box, in meters:
Code:
boundingBox : (-200 -1000 -200) (200 1000 200)
Your locationsInMesh don't match at all the dimensions of your STL file:
Code:
    locationsInMesh
    (
        ((0  0  0) pipe)
        ((0.195  0  0.195) air)
        ((-0.05 -0.015  0.005) internalfluid)
    );
I feel like your exported a STL file in millimeter and forgot to scale it to meters. (since OpenFOAM works with meters)
You can use surfaceTransformPoints for that.

About the locationsInMesh: the coordinates must be anywhere inside the volume your want to mesh. The coordinates for your pipe look wrong.

Regards,
Yann
Yann is offline   Reply With Quote

Old   February 23, 2024, 04:44
Default
  #3
New Member
 
stijn
Join Date: Feb 2024
Posts: 7
Rep Power: 2
raptor333 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello,

This is your STL bounding box, in meters:
Code:
boundingBox : (-200 -1000 -200) (200 1000 200)
Your locationsInMesh don't match at all the dimensions of your STL file:
Code:
    locationsInMesh
    (
        ((0  0  0) pipe)
        ((0.195  0  0.195) air)
        ((-0.05 -0.015  0.005) internalfluid)
    );
I feel like your exported a STL file in millimeter and forgot to scale it to meters. (since OpenFOAM works with meters)
You can use surfaceTransformPoints for that.

About the locationsInMesh: the coordinates must be anywhere inside the volume your want to mesh. The coordinates for your pipe look wrong.

Regards,
Yann
unfortunaly that's not the cause of my problem, that was just a problem with what i submitted to the forum, i have changed it now but i still get the same problem but thanks to put my attention to the fact i forgot to scale the stl and even if i set the location of the pipe on a place the pipe should be it gives still the same problem
raptor333 is offline   Reply With Quote

Old   February 23, 2024, 04:48
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,078
Rep Power: 26
Yann will become famous soon enough
Can you post your fixed case then?
Yann is offline   Reply With Quote

Old   February 23, 2024, 05:14
Default
  #5
New Member
 
stijn
Join Date: Feb 2024
Posts: 7
Rep Power: 2
raptor333 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Can you post your fixed case then?
here is the link: https://1drv.ms/f/s!Agflt1nDTyHxhlNo...BjJ-I?e=ceDinr

but with the previous link you now get the fixed cases to, because i simply changed what is in that folder where that link refers to
Yann likes this.
raptor333 is offline   Reply With Quote

Old   February 23, 2024, 05:40
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,078
Rep Power: 26
Yann will become famous soon enough
Your corrected case works fine.
Re-run the meshing from scratch using:

Code:
// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       false;
Yann
Yann is offline   Reply With Quote

Old   February 24, 2024, 08:41
Default
  #7
New Member
 
stijn
Join Date: Feb 2024
Posts: 7
Rep Power: 2
raptor333 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Your corrected case works fine.
Re-run the meshing from scratch using:

Code:
// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       false;
Yann
thanks a lot now splitmeshregions works, but when i tried to run the case with manual commands i got a warning at changedictonary and a error with chtMultiRegionFoam:

warning at changedictonary:
Merging entries from 6(minX maxX minY maxY minZ maxZ)
--> FOAM Warning :
From bool merge(bool, Foam::dictionary&, const Foam::dictionary&, bool, const Foam::HashTable<Foam::List<Foam::word> >&)
in file changeDictionary.C at line 304
Reading "/home/stijn/OpenFOAM/OpenFOAM-v2012/tutorials/own_cases/pipe_heat_loss_test/system/air/changeDictionaryDict.boundary" at line 21 to 41
Ignoring non-existing entry minY
--> FOAM Warning :
From bool merge(bool, Foam::dictionary&, const Foam::dictionary&, bool, const Foam::HashTable<Foam::List<Foam::word> >&)
in file changeDictionary.C at line 304
Reading "/home/stijn/OpenFOAM/OpenFOAM-v2012/tutorials/own_cases/pipe_heat_loss_test/system/air/changeDictionaryDict.boundary" at line 21 to 41
Ignoring non-existing entry maxY


and the error at chtMultiRegionFoam:

--> FOAM FATAL ERROR: (openfoam-2012)
cannot be called for a calculatedFvPatchField
on patch pipeenclosed_internalfluid of field U in file "/home/stijn/OpenFOAM/OpenFOAM-v2012/tutorials/own_cases/pipe_heat_loss_test/0/internalfluid/U"
You are probably trying to solve for a field with a default boundary condition.

From Foam::tmp<Foam::Field<Type> > Foam::calculatedFvPatchField<Type>::gradientIntern alCoeffs() const [with Type = Foam::Vector<double>]
in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 188.

but when i tried to run my case with the Allrun-serial-pre script (just a adapted Allrun-serial script) to get log files of all commands ( i didn't have one for splitmeshregions) then itr suddenly appeared to run fine, but i thougth the simulation would take a few hours, and i was thinking of seeing how it ran and then if nessary ask it here, but that simulation is now already running for more than half a day ( about 15 hours) and i have checked of it was not running in loops and unfortenaly it was running in loops, does anyone know why the case loops around without doing anything, you can see all files of the case in the link i have previously shared
raptor333 is offline   Reply With Quote

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

Have you tried cleaning up your case (Allclean) and running it again?
Your case works for me when running Allrun-parallel.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   February 26, 2024, 08:03
Default
  #9
New Member
 
stijn
Join Date: Feb 2024
Posts: 7
Rep Power: 2
raptor333 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello,

Have you tried cleaning up your case (Allclean) and running it again?
Your case works for me when running Allrun-parallel.

Cheers,
Yann
yes i tried that but i did it with Allrun-serial-pre (copy of Allrun-serial you can find it under the link that i posted with my previous post at splitmesregions work but running case doesn't work) and i just tried with Allrun-parallel and i got this error:

--> FOAM FATAL ERROR: (openfoam-2012)
[3] On patch procBoundary3to4 trying to access out of range neighbour processor 4. This can happen if
trying to run on an incorrect number of processors
[3]
[3] From virtual void Foam:rocessorPolyPatch::initUpdateMesh(Foam::Pst reamBuffers&)
[3] in file meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C at line 368.

and i have a i7-8750H proccesor with 6 cores, and how long dit the case take to run?, and with wat proccessor did you do it ? ( i am asking this because if you have a faster proccesor it is possible that your computer did it faster, and i want a estimation of how long it would take)
raptor333 is offline   Reply With Quote

Old   February 26, 2024, 08:51
Default
  #10
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,078
Rep Power: 26
Yann will become famous soon enough
I used 4 cores and I don't know how long the case run, I just checked if it was running.

The Allrun-parallel script originally meshes on 6 cores and runs on 4 cores. This is why it uses redistributePar and also why you have 2 decomposeParDict files in system.

This could be simplified if you just intend to mesh and run on 6 cores.
Yann is offline   Reply With Quote

Old   February 26, 2024, 10:10
Default
  #11
New Member
 
stijn
Join Date: Feb 2024
Posts: 7
Rep Power: 2
raptor333 is on a distinguished road
Quote:
Originally Posted by Yann View Post
I used 4 cores and I don't know how long the case run, I just checked if it was running.

The Allrun-parallel script originally meshes on 6 cores and runs on 4 cores. This is why it uses redistributePar and also why you have 2 decomposeParDict files in system.

This could be simplified if you just intend to mesh and run on 6 cores.
it does not matter of it runs on 6 cores or 4 cores i just want to get the case running, but with Allrun serial it appears to run but even after 15 hours it doesn't get anywhere, and with Allrun-parallel it gets a error ( the error i had in my previous post, and it looks that it is running but it get stuck on that error, you don't see that there is anything wrong with it until you look to the log files, i think it has to do with the boundry's, that het doesn't reconise the boundry and that openfoam tries to calculate it, but it trying for a infinite length, but i do not know for sure, it is possible that this would give a much bigger spike in ram usage, i think that because it is running far longer than i expected and somethimes i saw that it said that there are continuity erors and combine that with the fact that it hasn't even got its first timestep after 15 hours of continuos calculations lets me think that it is running in a never ending loop

ps is it better to just open another thread for this or not ?
raptor333 is offline   Reply With Quote

Old   February 26, 2024, 10:33
Default
  #12
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,078
Rep Power: 26
Yann will become famous soon enough
Alright, use the Allrun-parallel script attached. This will run on 4 cores. If you want to run on 6 cores, update the numberOfSubdomains parameter in system/decomposeParDict file.

I only checked if the solver is running, it would indeed probably be better to open a new thread if you can't manage to run it, or if you have another issue with the case.
Attached Files
File Type: zip Allrun-parallel.zip (663 Bytes, 2 views)
Yann 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
[Other] splitMeshRegions does not create interface patch between regions fsan OpenFOAM Meshing & Mesh Conversion 10 June 6, 2022 05:56
[snappyHexMesh] snappyHexMesh for multiregion mehsing CRI_CFD OpenFOAM Meshing & Mesh Conversion 3 May 11, 2022 09:07
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
[snappyHexMesh] SnappyHexMesh and MultiRegion - get regions from Salome to OF dzi OpenFOAM Meshing & Mesh Conversion 2 September 4, 2014 10:04
splitMeshRegions doesn't find my regions. GPesch OpenFOAM Pre-Processing 2 November 14, 2013 05:20


All times are GMT -4. The time now is 07:50.