|
[Sponsors] |
February 22, 2021, 06:31 |
Insert protectedCells manually
|
#1 |
Member
Lorenzo
Join Date: Apr 2020
Location: Italy
Posts: 46
Rep Power: 6 |
Hi everyone!
I'm working on OpenFOAM v2012 with the solver interFoam and I'm struggling with a feature of dynamicRefineFvMesh. I'd like to tell the solver not to refine a certain number of cells. For example, let's say there is a two phase flow (liquid-vapour) inside a circular pipe, and the dynamic refinement is done at the interface. I want the solver to exclude the cells near the wall from refinement. I know that dynamicRefineFvMesh automatically finds "non-hex" cells and collocates them inside the folder "constant/polymesh/sets" in a file called "protectedCells", so that it doesn't refine these cells during the simulation. So, trying to adapt my request to the solver behaviour, I created a topoSetDict where I define a cellSet called "protectedCells" that includes all the cells I want to protect. This process gives me exactly the same file protectedCells inside the folder constant/polymesh/sets. By the way, when I run the simulation (interFoam) it refines even inside the protectedCells! It seems that he doesn't read the protectedCells file if it is not created by the dynamic solver itself. This can be seen in any DyM tutorial available by adding the topoSetDict and running the simulation. I tried to look at some forum threads, but it seems that everyone had the opposite problem (they had protectedCells where they actually wanted refinement). I gave a look at the source code, but it is not clear to me if actually he sees the definition of the cell regions inside the folder polymesh. I hope someone could help me with this, if you knew what I can do to implement this feature it would be really helpful. Regards, Lorenzo |
|
February 22, 2021, 13:00 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
To hazard a guess, unless you tell the mesh/AMR about the protected cells created by topoSet, it won't do anything. The PDRFoamAutoRefine solver does something similar to what you are looking for, I think, with the following code :
Code:
// Test : disable refinement for some cells bitSet& protectedCell = refCast<dynamicRefineFvMesh>(mesh).protectedCell(); if (protectedCell.empty()) { protectedCell.setSize(mesh.nCells()); protectedCell = false; } forAll(betav, celli) { if (betav[celli] < 0.99) { protectedCell.set(celli); } } Caelan |
|
February 23, 2021, 05:42 |
|
#3 |
Member
Lorenzo
Join Date: Apr 2020
Location: Italy
Posts: 46
Rep Power: 6 |
Dear clapointe,
Thank you for answering so quickly. Your guess is really helpful and I'm grateful for that. My intent was to undestand how dynamicRefineFvMesh manages this set of cells, and I didn't think to look for examples of settings like you've shown. I modified the solver and made little change so that it takes into account the distance of cell centres from the patch, and I managed to obtain the protection of cells near the wall. Thank you again for helping me, have a nice day. Lorenzo |
|
September 11, 2021, 14:15 |
|
#4 |
Member
Jairo A. Gutiérrez S
Join Date: Nov 2014
Posts: 60
Rep Power: 11 |
Check this out: dynamicRefineFvMesh - Protect cells from refinement (boundary)
|
|
Tags |
dynamic, interfoam, mesh, protectedcells, refinement |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Insert particle tracking | Dshing | CFX | 2 | May 20, 2019 04:57 |
[Other] How to Create and mesh a pipe with a porous tube insert | mizzou | OpenFOAM Meshing & Mesh Conversion | 0 | June 6, 2017 23:38 |
Insert Points in CFD-Post | Supersonic | ANSYS | 3 | August 26, 2016 02:45 |
[ICEM] Tips dealing with problem tets/tri manually without complete remesh | FreeFall79 | ANSYS Meshing & Geometry | 5 | November 19, 2013 18:52 |
3D Insert modelling in Mold Flow | Dan Rößler | Main CFD Forum | 0 | December 20, 2005 07:37 |