Verifying Mass Flux at Outlet Boundary
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; } } |
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? |
All times are GMT -4. The time now is 14:08. |