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

Cell removal and addion during simulation

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By Tobi
  • 1 Post By mneben

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2015, 11:06
Default Cell removal and addion during simulation
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Zhiheng Wang and scleakey like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 30, 2015, 12:00
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Tobi is offline   Reply With Quote

Old   October 5, 2015, 16:35
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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;
give the message that the object is not allocated:
Code:
--> FOAM FATAL ERROR: 
object of type N4Foam11mapPolyMeshE is not allocated
.

Kind regards,
Tobi


PS: Foamextend is working
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 5, 2015, 18:29
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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())
        ...
    }
First if calls autoPtr::valid and only if it is (i.e. object is allocated) second if dereference topoChangeMap object and call hasMotionPoints method.

So, yes; I know, it is working
alexeym is offline   Reply With Quote

Old   October 6, 2015, 05:10
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Tobi is offline   Reply With Quote

Old   October 6, 2015, 05:44
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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).
alexeym is offline   Reply With Quote

Old   October 6, 2015, 07:06
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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;
    }
After removing my faceZones and cellZones, it is generating everything itself. My stupid fault.

So it is working

www.holzmann-cfd.de/cfd-online/movingConeTopoChange.flv
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 13, 2015, 10:28
Default
  #8
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Alexey,

did you ever coupled topoChange with mesh motion?
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 13, 2015, 11:18
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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).
alexeym is offline   Reply With Quote

Old   December 7, 2015, 05:49
Default
  #10
New Member
 
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15
mneben is on a distinguished road
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
Attached Files
File Type: zip test.mp4.zip (162.4 KB, 23 views)
File Type: zip test2.mp4.zip (143.7 KB, 13 views)
File Type: zip test6.mp4.zip (172.6 KB, 11 views)
File Type: zip test3.mp4.zip (149.5 KB, 15 views)
mneben is offline   Reply With Quote

Old   December 7, 2015, 10:39
Default
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Tobi is offline   Reply With Quote

Old   December 8, 2015, 04:38
Default
  #12
New Member
 
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15
mneben is on a distinguished road
Something like this?
Attached Images
File Type: png pic.png (89.4 KB, 115 views)
Attached Files
File Type: zip ani.mp4.zip (187.0 KB, 61 views)
mneben is offline   Reply With Quote

Old   December 8, 2015, 08:40
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Tobi is offline   Reply With Quote

Old   December 8, 2015, 08:46
Default
  #14
New Member
 
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15
mneben is on a distinguished road
Take a deeper look: In the horizontal direction there is mesh deformation and in the vertical direction is layer addition/removal
mneben is offline   Reply With Quote

Old   December 8, 2015, 09:13
Default
  #15
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Your movie is to fast for my eyes
Can you share your lib with the community?
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 8, 2015, 09:30
Default
  #16
New Member
 
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15
mneben is on a distinguished road
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.
Attached Files
File Type: zip twoDMovingConeTopoFvMesh.zip (162.5 KB, 94 views)
Zhiheng Wang likes this.
mneben is offline   Reply With Quote

Old   April 9, 2019, 07:55
Default
  #17
New Member
 
Huang, Chiung Shu
Join Date: Nov 2018
Posts: 12
Rep Power: 8
kclement1993 is on a distinguished road
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.
kclement1993 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



All times are GMT -4. The time now is 18:43.