|
[Sponsors] |
[mesh manipulation] dynamic removal of mesh cells |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 11, 2018, 10:39 |
dynamic removal of mesh cells
|
#1 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
Hi,
I new to OpenFoam . I am solving a case in which i am heating a piece of ice , and I need to remove the portion which melts. So I need to remove cells whose temp is higher than 273K. Please suggest me some utility to delete/remove those cells. Anything helpful is greatly appreciated. Thank You |
|
January 11, 2018, 12:00 |
|
#2 |
Senior Member
|
Hi,
Would you like to remove those cells: - Using post-processing utility? - During solver run? - Using pre-processing utility before running another case? Are these cells located near the boundary of the mesh? Are they located somewhere in the middle? Your question has LOTS of DoF, so it has LOTS of solutions. |
|
January 11, 2018, 13:29 |
|
#3 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
Hi Alexey Matveichev,
Thanks for replying I need to remove those cells during run time calculations |
|
January 12, 2018, 03:41 |
|
#4 |
Senior Member
|
Hi,
OK. You modify solver: add cycle over temperature field, collect melted cell IDs, then use polyRemoveCell (https://cpp.openfoam.org/v5/classFoa...emoveCell.html) to get rid of cells. You can take a look at $FOAM_SRC/dynamicMesh/layerAdditionRemoval for example of cells removal. Yet you have to answer several questions: - What is water freezes, you plan to recreate mesh? - After cell removal you get new boundary. What BC do you plan to impose on the boundary? Especially if boundary is created inside calculation domain. |
|
January 12, 2018, 06:17 |
|
#5 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
Hi Alexey Matveichev ,
Thanks for your reply. Can you please tell how to use polyremovecell and how to get cell id? As for your questions In my case water wouldn't freeze back so no need to recreate mesh. And I need to impose the same bc as for previous boundary |
|
January 12, 2018, 17:00 |
|
#6 |
Senior Member
|
Hi,
I can but I do not want to, since it is you, who needs to remove cells. You have documentation, you have working example (layerAdditionRemoval). I (and other users on the Forum) can help you to resolve problems during implementation. Last edited by alexeym; January 13, 2018 at 11:12. |
|
January 13, 2018, 07:59 |
|
#7 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
Thnx,
For ur support |
|
January 13, 2018, 08:23 |
|
#8 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
Alexey Matveichev
can u suGGest where i can find working example of layerAdditionRemoval |
|
January 13, 2018, 11:16 |
|
#9 |
Senior Member
|
You can find it in OpenFOAM source tree: https://github.com/OpenFOAM/OpenFOAM...dditionRemoval (or you can look at your local copy).
Here is a code to remove cell layer: https://github.com/OpenFOAM/OpenFOAM...oveCellLayer.C. It removes cells depending on size, you need to remove them according to temperature. |
|
January 27, 2018, 09:41 |
|
#10 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
Alexey Matveichev
I came across removeCells class , which uses polyRemoveCell as a header file , but I am haviG trouble to call it . How to I call the function(constructor for removeCells ) ? I entered cell ID as forAll(del.internalField(),i) { if(T.internalField()[i]<273.13)del[i]=0.; else if( T.internalField()[i]>=273.14) { del[i]=0; Ei[i]=0; removeCells(i); } else del[i]=1.0; } but it Gives error that i is of type label but the function expects an arGument of type polyMesh. So please Guide me on how to proceed |
|
January 28, 2018, 06:25 |
|
#11 |
Senior Member
|
Hi,
You see, official OpenFOAM API documentation is better, than person on a forum. Take a look at https://cpp.openfoam.org/v5/classFoa...moveCells.html. removeCells is a class. It is constructed from a mesh. After construction it can perform topological changes to the mesh. |
|
January 28, 2018, 06:46 |
|
#12 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
thnx for ur reply
|
|
February 3, 2018, 09:33 |
|
#13 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
hi,
Alexey Matveichev I am using class polyTopoChange and its member function removeCell , my code has compiled but now I am having problem to run my case . I haven't setup any dynamicmesh case before so I don't know how to do it. I am unable to set dynamicmeshDict and don't know if any thing else in needed as well . So I would appreciate if some guidance can come from ur side. Thnx |
|
February 4, 2018, 08:48 |
|
#14 |
Senior Member
|
Hi,
You need dynamicMeshDict, if you plan to run simulation with standard mesh modifiers. Since you are doing mesh modifications yourself, there is no need in this dictionary. So, you set up your case as usual and run it. |
|
February 4, 2018, 15:30 |
|
#15 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
hi,
thnx for ur reply I ran it usual way , the simulation began but as soon as it reached the cell to be deleted the solver crashed displaying error --> FOAM FATAL ERROR: cell 5399 already marked for removal From function void Foam polyTopoChange::removeCell(Foam::label, Foam::label) in file polyTopoChange/polyTopoChange/polyTopoChange.C at line 3001. FOAM aborting |
|
February 5, 2018, 06:15 |
|
#16 |
Senior Member
|
Error message is quite clear: you mark the same cell for removal twice. It is not allowed.
|
|
February 6, 2018, 04:42 |
|
#17 |
New Member
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 9 |
hi,
can u help me deal with this error --> FOAM FATAL ERROR: illegal cell label -1 Valid cell labels are 0 .. 6299 From function void Foam: polyTopoChange::removeCell(Foam::label, Foam::label) |
|
February 6, 2018, 11:30 |
|
#18 |
Senior Member
|
Hi,
What kind of help do you have in mind? Error message is VERY clear. Do you want me to read it again for you? Do you want to talk about the error? OK. This is error. Errors happen. Do not worry. I think this thread is counter-productive and has 0 value for the community. Maybe we should stop it. |
|
Tags |
dynamic mesh removal, layering method, mesh modify, remove cell, topology change |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface | Kryo | OpenFOAM Meshing & Mesh Conversion | 13 | February 17, 2022 08:34 |
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! | divergence | OpenFOAM Meshing & Mesh Conversion | 0 | January 23, 2019 05:17 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
snappyhexmesh remove blockmesh geometry | philipp1 | OpenFOAM Running, Solving & CFD | 2 | December 12, 2014 11:58 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |