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

[mesh manipulation] dynamic removal of mesh cells

Register Blogs Community New Posts Updated Threads Search

Like Tree10Likes
  • 1 Post By alexeym
  • 2 Post By alexeym
  • 1 Post By sonGoku
  • 1 Post By alexeym
  • 1 Post By alexeym
  • 1 Post By sonGoku
  • 1 Post By alexeym
  • 1 Post By alexeym
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2018, 09:39
Lightbulb dynamic removal of mesh cells
  #1
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
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
sonGoku is offline   Reply With Quote

Old   January 11, 2018, 11:00
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
sonGoku likes this.
alexeym is offline   Reply With Quote

Old   January 11, 2018, 12:29
Lightbulb
  #3
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
Hi Alexey Matveichev,
Thanks for replying
I need to remove those cells during run time calculations
sonGoku is offline   Reply With Quote

Old   January 12, 2018, 02:41
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
Zhiheng Wang and sonGoku like this.
alexeym is offline   Reply With Quote

Old   January 12, 2018, 05:17
Lightbulb
  #5
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
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
Zhiheng Wang likes this.
sonGoku is offline   Reply With Quote

Old   January 12, 2018, 16:00
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
sonGoku likes this.

Last edited by alexeym; January 13, 2018 at 10:12.
alexeym is offline   Reply With Quote

Old   January 13, 2018, 06:59
Lightbulb
  #7
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
Thnx,
For ur support
sonGoku is offline   Reply With Quote

Old   January 13, 2018, 07:23
Lightbulb
  #8
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
Alexey Matveichev
can u suGGest where i can find working example of layerAdditionRemoval
sonGoku is offline   Reply With Quote

Old   January 13, 2018, 10:16
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
sonGoku likes this.
alexeym is offline   Reply With Quote

Old   January 27, 2018, 08:41
Lightbulb
  #10
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
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
Zhiheng Wang likes this.
sonGoku is offline   Reply With Quote

Old   January 28, 2018, 05:25
Default
  #11
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
sonGoku likes this.
alexeym is offline   Reply With Quote

Old   January 28, 2018, 05:46
Lightbulb
  #12
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
thnx for ur reply
sonGoku is offline   Reply With Quote

Old   February 3, 2018, 08:33
Lightbulb
  #13
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
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
sonGoku is offline   Reply With Quote

Old   February 4, 2018, 07:48
Default
  #14
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
sonGoku likes this.
alexeym is offline   Reply With Quote

Old   February 4, 2018, 14:30
Post
  #15
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
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
sonGoku is offline   Reply With Quote

Old   February 5, 2018, 05:15
Default
  #16
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Error message is quite clear: you mark the same cell for removal twice. It is not allowed.
sonGoku likes this.
alexeym is offline   Reply With Quote

Old   February 6, 2018, 03:42
Post
  #17
New Member
 
Anshul
Join Date: Dec 2017
Location: India
Posts: 25
Rep Power: 8
sonGoku is on a distinguished road
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)
sonGoku is offline   Reply With Quote

Old   February 6, 2018, 10:30
Default
  #18
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
alexeym is offline   Reply With Quote

Reply

Tags
dynamic mesh removal, layering method, mesh modify, remove cell, topology change


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
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 07:34
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 04:17
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
snappyhexmesh remove blockmesh geometry philipp1 OpenFOAM Running, Solving & CFD 2 December 12, 2014 10:58
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20


All times are GMT -4. The time now is 14:49.