CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Some question about the adjustPhi function (http://www.cfd-online.com/Forums/openfoam-solving/68121-some-question-about-adjustphi-function.html)

liuhuafei September 7, 2009 20:10

Some question about the adjustPhi function
 
Hi,Foamers
I have some questions about the adjustPhi function.

1) At the beginning of the adjustPhi, the value of p.NeedReference determines whether we need adjust the mass flux of boundaries. why?
If pressure field doesn't need the reference level, the adjustion of the boundary flux can be neglected?

2)what is meaning of Up.fixesValue()&& !isA<inletOutletFvPatchVectorField>(Up) ?
What type of boundary is fixedMassOut?


Thanks in advance!





bool Foam::adjustPhi (
surfaceScalarField& phi,
const volVectorField& U,
volScalarField& p
)
{
if (p.needReference())
{
p.boundaryField().updateCoeffs();

scalar massIn = 0.0;
scalar fixedMassOut = 0.0;
scalar adjustableMassOut = 0.0;

forAll (phi.boundaryField(), patchi)
{
const fvPatchVectorField& Up = U.boundaryField()[patchi];
const fvPatchScalarField& phip = phi.boundaryField()[patchi];

if (!isType<processorFvPatchScalarField>(phip))
{
if
(
Up.fixesValue()
&& !isA<inletOutletFvPatchVectorField>(Up)
)
{
forAll(phip, i)
{
if (phip[i] < 0.0)
{
massIn -= phip[i];
}
else
{
fixedMassOut += phip[i];
}
}
}
........................
}
else
{
return false;
}
}


All times are GMT -4. The time now is 15:18.