|
[Sponsors] |
November 10, 2018, 10:08 |
VoF Volume detection
|
#1 |
Member
Join Date: Jun 2012
Posts: 76
Rep Power: 13 |
Hello,
I am implementing a solver for the conversion of VoF droplets to Lagrangian particles. Therefore I need to identify all enclosed VoF droplets in order to convert them to particles with equal size / mass / momentum. Beginning with a certain cell, I recursively iterate over every neighbouring cell until I find no more liquid cell (marker_ functions as a variable to distinguish between gas and liquid). The recursive function looks like the following: Code:
// cellI - label of starting cell // volID - ID for the resulting enclosed VoF droplet // marker_ - volScalarField to check for gas (= 0) and liquid (= 1) // volumeID_ - volScalarField, where connecting liquid cells have the same ID void checkRecursive(label cellI, const scalar& volID) { // get neighbours of cellI const labelList& neighbours = mesh_.cellCells()[cellI]; // loop over all neighbouring cells of cellI forAll(neighbours,i) { // neighbour cell ID label neighbourI = neighbours[i]; // check if neighbour cell is liquid if (marker_[neighbourI] > 0.5) { // set volume ID volumeID_[neighbourI] = volID; // reset marker to avoid infinite loop marker_[neighbourI] = 0.0; // repeat check for all neighbours recursively checkConnection(neighbourI, volID); } } } Does someone has any advise to get rid of that error? Regards Martin |
|
November 13, 2018, 06:19 |
|
#2 | |
Member
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
[blockMesh] blockMesh error - Negative Volume Block | adoledin | OpenFOAM Meshing & Mesh Conversion | 2 | June 22, 2016 10:44 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 07:09 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 13:06 |
Fluent VOF Volume of Fluid Realistic Solution Problem | wormik | FLUENT | 3 | June 21, 2009 07:04 |