|
[Sponsors] |
[mesh manipulation] Details on setSet/topoSet usage |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 8, 2023, 11:37 |
Details on setSet/topoSet usage
|
#1 |
New Member
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3 |
Hello everyone!
TL;DR: I'm not very experienced with openFoam. I'm searching for pointers on how to create cellZones in v2112. Can anyone point me to an explanation/tutorial/video on how to create a cellZone from my own geometry? What I've done: In snappyHexMeshDict, I've created a geometry like this: Code:
geometry Dam { type distributedTriSurfaceMesh; file "dam.stl"; } refinementSurfaces { Dam { level (6 7); patchInfo { type wall; } } } Code:
dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs (fvMotionSolvers); motionSolver solidBody; cellZone Dam; solidBodyMotionFunction linearMotion; velocity (0.0 0.0 -100); Code:
Create time Create mesh for time = 0 Selecting dynamicFvMesh dynamicMotionSolverFvMesh Selecting motion solver: solidBody Applying solid body motion to cellZone Dam --> FOAM FATAL ERROR: (openfoam-2112) Unable to find cellZone Dam. Valid cellZones are:0() From Foam::zoneMotion::zoneMotion(const Foam::dictionary &, const Foam::polyMesh &) in file motionSolvers/displacement/displacement/zoneMotion.C at line 70. FOAM exiting Code:
setSet readline>cellSet fluidSet Dam Set:fluidSet Size:0 Action:new Bad token - could not get word What I have looked at: The wiki articles seem to mainly concern v2.1, and the advice there is not compatible with 2112. I've looked at this, too, but they work with preexisting geometries and don't show how to implement my own https://www.cfdsupport.com/OpenFOAM-...t/node161.html On this forum, there are some unanswered questions dealing with this. Also, this post sounded promising, but there are no details on how it worked ways to create cellZones and faceZones |
|
August 8, 2023, 12:09 |
|
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hello Florian,
You can define a cellZone directly into snappyHexMeshDict: Code:
faceZone sphere; cellZone sphere; cellZoneInside inside; // outside/insidePoint insidePoint (1 1 1); // if (cellZoneInside == insidePoint) You can also define it afterward using topoSet: https://doc.openfoam.com/2306/tools/...ation/topoSet/ Note: OpenCFD recently reworked its OpenFOAM documentation, so only v2212 and v2306 are available in the new documentation. But it should work for v2112 too, I don't think there were major changes on the specific point you are looking for. I hope this helps, Yann |
|
August 8, 2023, 13:26 |
|
#3 |
New Member
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3 |
Hi Yann,
thanks a lot for your answer, but I'm not sure I understand. Should my snappyHexMeshDict look like this: Code:
geometry { dam { type distributedTriSurfaceMesh; file "dam.stl"; } refinementSurfaces { dam { level (6 7); patchInfo { type wall; } faceZone sphere; cellZone sphere; cellZoneInside inside; insidePoint (4000 3455 4671); } } Code:
--> FOAM FATAL IO ERROR: (openfoam-2112) Entry 'type' has 2 excess tokens in stream 3(distributedTriSurfaceMesh file "dam.stl") file: system/snappyHexMeshDict.geometry.dam at line 41. FOAM exiting Could you maybe take my hand a little more through this jungle? Best regards - Wilhelm |
|
August 9, 2023, 04:28 |
|
#4 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hello Wilhelm,
sphere is just the example in the documentation. It defines the name of the faceZone and cellZone. But you can name it dam or whatever name you like. You will just have to update your dynamicMeshDict with the name of the cellZone you defined in snappyHexMeshDict. Regarding your error, it seems you are missing a closing bracket in the geometry section: Code:
geometry { dam { type distributedTriSurfaceMesh; file "dam.stl"; } } Yann Last edited by Yann; August 10, 2023 at 04:04. Reason: typo |
|
August 10, 2023, 04:24 |
|
#5 |
New Member
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3 |
Hi Yann,
thank you so much for guiding me a bit further!! Unfortunately, the error message stays the same - the missing closing bracket just got lost during copy and paste, in the file is was correct. From googling I know that this means that there are errors in my dict files, but I have no idea on how to solve them, because line 41 in my snappyHexMeshDict seems okay to me: Code:
40 { 41 type distributedTriSurfaceMesh 42 file "dam.stl"; 43 } Thanks! Last edited by Florian Mlehliw; August 10, 2023 at 04:24. Reason: visual clarity of code part |
|
August 10, 2023, 04:49 |
|
#6 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hello Wilhelm,
It looks like there is a semicolon missing: Code:
40 { 41 type distributedTriSurfaceMesh; 42 file "dam.stl"; 43 } |
|
August 10, 2023, 05:04 |
That was it!
|
#7 |
New Member
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3 |
Thank you! That was a bit embarrassing^^
But now snappy is running. It still does not produce what I want but I need to understand the problem first. Thanks again! |
|
Tags |
cellzones, toposetdict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CPUs vs GPUs for CFD? | hami11 | Hardware | 22 | July 23, 2024 16:59 |
OpenFOAM Solver/BC usage description | murrayjc | OpenFOAM | 3 | August 25, 2009 05:48 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |
user defined function | cfduser | CFX | 0 | April 29, 2006 11:58 |
Fluent 5.5. What the differences with fluent 5.3?? | confused | FLUENT | 2 | July 29, 2001 22:58 |