|
[Sponsors] |
September 30, 2015, 11:06 |
Cell removal and addion during simulation
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Dear all,
I am simulating a squeezed case like in a cylinder. Due to the squeezing the cells get extremly deformed. I know that there is a way to add and remove layers in such kind of simulations during run time. I also found this link: http://www.cfd-online.com/Forums/ope...esh-print.html but unfortunately the links of Niklas are not working anymore (for the videos). Are there any tutorials for adding / removing cells? As far as I remind myself, I found something a time ago but I am not being able to find it now. Any hint is appreciated. Kind regards, Tobi
__________________
Keep foaming, Tobias Holzmann |
|
September 30, 2015, 12:00 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
I am sorry for the post. I got the point I think. Thanks to Hrv.
Useful threads: http://www.cfd-online.com/Forums/ope...modifiers.html http://www.cfd-online.com/Forums/ope...gconetopo.html
__________________
Keep foaming, Tobias Holzmann |
|
October 5, 2015, 16:35 |
|
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi all,
does anybody know if the moveConeTopoFvMesh library in OF-2.3.1 is working? It seems that the library is not working as expected or better, how it the topoChangeMap.valid() changed? Also the output of: Code:
Info<< topoChangeMap().hasMotionPoints() << endl; Code:
--> FOAM FATAL ERROR: object of type N4Foam11mapPolyMeshE is not allocated Kind regards, Tobi PS: Foamextend is working
__________________
Keep foaming, Tobias Holzmann |
|
October 5, 2015, 18:29 |
|
#4 |
Senior Member
|
Hi Tobi,
Before topoChangeMap().hasMotionPoints() you have to check if topoChangeMap is valid pointer. In 2.3.x it is like this (sorry, do not have exactly 2.3.1 nearby): Code:
if (topoChangeMap.valid()) { Info<< "Topology change. Calculating motion points" << endl; if (topoChangeMap().hasMotionPoints()) ... } So, yes; I know, it is working |
|
October 6, 2015, 05:10 |
|
#5 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Alex,
thanks for your replay. I know that the code checks if topoChangeMap is valid due to the code. What I did at the moment. I used the movingConeTopoFvMesh Lib and implemented it into pimpleDyMFoam and moveDynamicMesh. Due to the code itself I think it is generated only for the movingCone tutorial due to the fact that the coordinates in the library match the obstacle position. If I run the case, the cells are not removed due to the fact that topopChangeMap.valid() is always false. www.holzmann-cfd.de/cfd-online/movingConeTopo.flv So at least there is something wrong in my setup, I guess. I will investigate a bit more time into the code. If you have some information, it is kindly welcomed. Maybe I did something wrong with the faceZones etc. Edit. Markup is working, curRight and curLeft also working. Only the topoChangeMap.valid() function returns always false. I think I have to go to the next library to understand why I get false
__________________
Keep foaming, Tobias Holzmann |
|
October 6, 2015, 05:44 |
|
#6 |
Senior Member
|
Hi,
It is quite difficult to guess setup from movie. But since mesh is moving, guess at least partly your setup is correct. movingConeTopoFvMesh class is surely just an example (since it has hard-coded coordinate values in addZonesAndModifiers method). It is not surprising that curLeft, curRight, and vertexMarkup are working since first two are just averaging of zones x-coordinates and vertexMarkup just creates temporary volume field of moving points. You can go further with debugger into topoChanger_.changeMesh to learn why it always returns NULL pointer. When I was dealing with mesh layer addition/removal main problem was to restore physically correct field values in the new cells after mesh reconstruction (by default OpenFOAM uses geometrically-weighted interpolation). |
|
October 6, 2015, 07:06 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Alex,
its working now. Thanks for the advice. I found out that the NULL pointer is returned due to the fact that changeMesh(true) will lead at least to a function called topologyChange(). This will check if a topoModifier is set and in my case it was not set because I already added cellZones and faceZones in my tutorial so that no topoChanger was generated: Code:
if ( pointZones().size() || faceZones().size() || cellZones().size() || topoChanger_.size() ) { Info<< "void movingConeTopoFvMesh::addZonesAndModifiers() : " << "Zones and modifiers already present. Skipping." << endl; return; } So it is working www.holzmann-cfd.de/cfd-online/movingConeTopoChange.flv
__________________
Keep foaming, Tobias Holzmann |
|
October 13, 2015, 11:18 |
|
#9 |
Senior Member
|
Dear Tobi,
Just simple cases like mesh growth in certain direction. I.e. one boundary moves with prescribed velocity and layers of cells are added as cell size exceeds certain threshold (see my last workshop presentation at https://sourceforge.net/projects/ope...t-OFW10-59.pdf). |
|
December 7, 2015, 05:49 |
|
#10 |
New Member
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15 |
Hi Tobi,
did you managed to run your simulations in parallel? Do you have some general hints? I had some difficulties in a similar setup (see test.mp4) and I've only managed to get this working with two different mesh decomposition techniques (see test2.mp4 and test6.mp4). The colors corresponds to the used processors. What I've found out is that each addition/removal layer has to be on a single processor, else you will have troubles with the layer removal (see test3.mp4) Matthias |
|
December 7, 2015, 10:39 |
|
#11 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Matthias,
I did not investigate into parallel solution due to the fact that I am interested in the coupling of mesh-motion and adding/removing cells. But till now I had no time to investigate further. But interesting fact. I think the library is more/less (still) not able to handle these parallel stuff (its just a assumption)
__________________
Keep foaming, Tobias Holzmann |
|
December 8, 2015, 04:38 |
|
#12 |
New Member
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15 |
Something like this?
|
|
December 8, 2015, 08:40 |
|
#13 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi Matthias,
nice video but that is only mesh motion without adding cells and remove cells. I want to do both,... mesh motion like in your video (is very simple) and then check the topo and change if some cells get too small.
__________________
Keep foaming, Tobias Holzmann |
|
December 8, 2015, 08:46 |
|
#14 |
New Member
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15 |
Take a deeper look: In the horizontal direction there is mesh deformation and in the vertical direction is layer addition/removal
|
|
December 8, 2015, 09:30 |
|
#16 |
New Member
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15 |
Unfortunately the attachments have to be quite small
The zip folder consists of a library and an example simulation. At first you have to compile the code within "twoDMovingConeTopoFvMesh_primaryRefinement_second aryStretching_v2" afterwards you can run the simulation via using the Allrun-script. |
|
April 9, 2019, 07:55 |
|
#17 |
New Member
Huang, Chiung Shu
Join Date: Nov 2018
Posts: 12
Rep Power: 8 |
Hi Tobi,
I am doing a simulation about a mass slide down along with a slope. And because of large of displacement when I am using only dynamicfvmesh motion, and cause a large deformation of mesh, and then cause the cell becoming a bad shape then simulation blew up. So I have noticed that I should using topochange utility, but I don't have a good example to let me understand how to use it, and I am using OF4. After google for these kind of info. for a long time, I found some post, but as you know, there are so many OF version, the dynamicTopoFvMesh utility change in terms of different version, and because I am new to OF, less knowledge of programing also, I come here for help if you have any idea to deal with the problem I am facing. Thanks a lot ! regards, James. |
|
|
|