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

Verifying Mass Flux at Outlet Boundary

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 31, 2017, 19:34
Default Verifying Mass Flux at Outlet Boundary
  #1
New Member
 
Join Date: Nov 2016
Posts: 10
Rep Power: 6
victorious_BIG is on a distinguished road
Hi,

I am verifying the calculation of several key quantities in openfoam.

Specifically, I want to make sure that I understood how "phi" is calculated at the boundary faces.

In the code below I expect phi = dot product of face normal vector with velocity * area (phi = A n_i U_i). I have verified this on inlet boundaries, but I am finding that at outlet boundaries phi ~= A n_i U_i. The numbers are very close, but not exact. Does anyone know why?

Thanks for the help!

Code:

const fvBoundaryMesh& boundaryMesh = mesh.boundary();
forAll(boundaryMesh, patchI)
{
const fvPatch& patch = boundaryMesh[patchI];
const fvsPatchField<scalar> &phiCheck =
patch.lookupPatchField<surfaceScalarField, scalar>("phi");
const fvPatchField<vector> &U2 =
patch.lookupPatchField<volVectorField, vector>("U");


forAll(patch, faceI)
{
vector faceNormal = patch.Sf()[faceI];
scalar phiOut = phiCheck[faceI];
vector vel2 = U2[faceI];

Info << "Face Area vector (A n_i): " << faceNormal << endl;
Info << "Velocity (v_i): " << vel2 << endl;
Info << "Phi: " << phiOut << endl;
Info << "Calculated Phi: A n_i & v_i: " << (faceNormal & vel2) << endl;
Info << endl;

}

}
victorious_BIG is offline   Reply With Quote

Old   August 1, 2017, 17:45
Default
  #2
New Member
 
Join Date: Nov 2016
Posts: 10
Rep Power: 6
victorious_BIG is on a distinguished road
Update:

I am using the icoFoam solver. I find that if I comment out the "U.correctBoundaryConditions();" line at the bottom of the solver, then my code above does lead to exact agreement between phi and A n_i * U_i.

So, a new question, what exactly is "correctBoundaryConditions()" changing and why doesn't the change seem to propagate out to the patch field values?
victorious_BIG is offline   Reply With Quote

Reply

Tags
mass flow, outlet

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Wind turbine simulation Saturn CFX 58 July 3, 2020 02:13
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 18:30
Setting rotating frame of referece. RPFigueiredo CFX 3 October 28, 2014 05:59
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 13:32.