|
[Sponsors] |
[swak4Foam] Massflow Conservation Error through faceSet using swakExpression |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 28, 2014, 15:30 |
Massflow Conservation Error through faceSet using swakExpression
|
#1 |
New Member
Luke Weaver
Join Date: Apr 2013
Posts: 4
Rep Power: 13 |
I'm trying to use an arbitrary "box" to calculate the flux around an actuator disc (reduced-order wind turbine model). However, the calculation for massflow over each surface is not being conserved.
The domain is a rectangular box with axial flow over a plane. The solver is simpleFoam. The interior box is 80 x 160 x 160 m, and the surfaces are selected using the topoSet with slave cells and faceset as follows: Code:
{ name north1SlaveCells; type cellSet; action new; source expressionToCell; sourceInfo { expression "(pos().x<=60 && pos().y>=20 && pos().y<=180 && pos().z>=20 && pos().z<=180)"; } } { name north1; type faceSet; action new; source expressionToFace; sourceInfo { expression "(pos().x<=60 && pos().y>=20 && pos().y<=180 && pos().z>=20 && pos().z<=180)"; } } faceSet.jpg Imagine the box fitting inside these three with the other three faceSets filling in the open space. In the controlDict, I calculate the massflow: Code:
PhiNorth1 { type swakExpression; valueType faceSet; variables "direction=vector(0,1,0);dir=direction/mag(direction);"; setName north1; //expression "U & Sf()"; //expression "phi * flip()"; expression "(U & direction) * area()"; autoInterpolate true; accumulations ( sum min //just for reference max //just for reference ); outputControlMode timeStep; outputInterval 10; verbose true; } I calculated the mass flow on each faceSet, and summing them should give Phi_In - Phi_Out = 0. After summing up the phi values on all faceSets, the values were Phi_In = 203,860 and sumPhi_Out 206,270, for a total difference of -2410.7 kg/s. Any help/tips/explanations for this error? EDIT: For the upstream and downstream faces, I use the U & Sf(). The phi*flip() condition didn't seem to work. |
|
July 28, 2014, 18:34 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
July 29, 2014, 13:13 |
|
#3 |
New Member
Luke Weaver
Join Date: Apr 2013
Posts: 4
Rep Power: 13 |
Bernard, thanks for the reply. It turned out that was the issue. I fixed it by using (U & dir) * (Sf() & dir), which gave the correct mass flow from each side (confirmed using Paraview calculators). Now for another question: can you think of a reason that phi * flip() doesn't work?
|
|
July 29, 2014, 18:28 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Check how many faces are flipped by evaluating "flip()" with accumulations "min", "max" and "average"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
August 1, 2014, 16:01 |
|
#5 |
New Member
Luke Weaver
Join Date: Apr 2013
Posts: 4
Rep Power: 13 |
I'm now running into issues with different mesh configurations. When the cell size is something like (4.0 2.0 2.0), the massflow conservation calculation is fine. However, when the cell size isn't an integer, like (4.1667 2.6667 2.6667) or something similar, I'm getting some weird results in the massflow and area calculations. The attached image shows the faceSets that have misplaced cell faces.
error_faceset.jpg It seems that this is an issue of the faceSet boundaries that are defined in the topoSetDict not landing evenly on the cell boundaries. So, a) is there a way to change the topoSetDict so that the faceSet moves until it can read the faces evenly, and/or b) is there a way to manipulate the swakExpression so that the cell irregularities don't affect the massflow calculations? |
|
August 4, 2014, 07:33 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
One way to be sure that they are consistent is to first create the cell-zone and instead of duplicating the rather complicated logical expression use it to create the face-zone with the simple expression "set(mySlaveZone)" (set is true if a cell belongs to the cellSet)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
Tags |
faceset, massflow, swak, toposet |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with massflow BC at inlet | MrNavierStokes | CFX | 3 | November 7, 2016 03:55 |
How to use "translation" in solidBodyMotionFunction in OpenFOAM | rupesh_w | OpenFOAM Running, Solving & CFD | 5 | August 16, 2016 05:27 |
Massflow rate at inlet and outlet different | conservation of mass | manoj_nav | OpenFOAM Verification & Validation | 0 | March 22, 2016 01:07 |
Massflow rate at inlet and outlet different | conservation of mass | manoj_nav | OpenFOAM Post-Processing | 0 | March 18, 2016 04:26 |
MassFlow Function? Absolute MassFlow? Failure in Caclulation | eRzBeNgEl | CFX | 0 | May 5, 2011 10:46 |