CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] Mass flow rate through faceSet using swak4foam

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 3, 2012, 12:41
Default Mass flow rate through faceSet using swak4foam
  #1
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 16
CedricVH is on a distinguished road
It is not possible to calculate the mass flow rate through a faceSet in standard OpenFOAM. This is because the normal vectors of the faces have a random position, giving a result close to 0. Even after converting the set to cyclic patches using createBaffles, this problems persists as the normal vectors of the created patches do not have the same direction, unlike normal boundary patches.

However, I have read that swak4foam can help by using the flip() function:

Code:
    flow_pipe                    
    {                
        type    swakExpression;            
        valueType    faceSet;            
        setName    pipe_plane_faces;            
        expression    "phi*flip()";            
        accumulations    (            
                        sum
        );                
        verbose    true;    
        autoInterpolate true;            
    }
The flip() function however needs slaveCells, and this gives some problems.

My workflow is:
  • Create a mesh using snappyHexMesh
  • Create a cutting plane using a graphical package, and export as stl
  • Start setSet
  • Create a cellSet using surfaceToCell with that stl and keep the cells that are cut by the stl
  • Convert cellSet to faceSet, keep all faces
  • The stl plane has a thickness, so it cuts through multiple cells, leaving me with n layers of faces. If I would perform sum(phi) on these faces, the result would be n times to high. That's why I can only keep one layer of connected faces.
  • Invert the cellSet and take a subSet of the faceSet using that cellSet leaves me with only the boundary faces
  • Create a second cellSet using surfaceToCell with the stl and keep the cells inside
  • Take a subSet of the faceSet using that cellSet leaves me with only one layer of faces that is connected to that cellSet
The result is now a faceSet consisting of one layer of faces. Now I have to create slaveCells. As I onderstand correctly, this should be a set of cells that enclose the faces at both directions. The simplest way would be creating a cellSet from this faceSet as every face would then connect to two cells.

Code:
cellSet pipe_plane_facesSlaveCells new faceToCell pipe_plane_faces all
However, when running my case, I get this error

Code:
--> FOAM FATAL ERROR: 
One of owner or neighbour of internal face 108712 should be in cellSet pipe_plane_facesSlaveCells to be able to determine orientation.
Face:108712 own:38634 OwnInCellSet:1 nei:39797 NeiInCellSet:1

    From function scalarField *FaceSetValueExpressionDriver::makeFaceFlipField()
    in file FaceSetValueExpressionDriver.C at line 233.
It seems that the slaveCells are not correctly defined.

Is my workflow correct or is there a much better workflow to correctly measure the mass flow rate through a faceSet/faceZone? If my workflow is correct, how can I manage to make the case run and get correct results?
CedricVH is offline   Reply With Quote

 


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
Mass flow rate boundary condition with negative values hebe2u. CFX 1 December 27, 2016 03:53
Pressure Outlet Targeted Mass Flow Rate LuckyTran FLUENT 1 November 23, 2016 10:40
Mass Flow rate in DPM model tohidtkz FLUENT 0 November 7, 2015 04:13
Mass flow rate boundary condition with negative values ashtonJ CFX 3 November 26, 2014 05:21
Mass flow rate sepidecent CFX 0 August 9, 2011 00:15


All times are GMT -4. The time now is 12:28.