CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Compute local Reynolds number (https://www.cfd-online.com/Forums/openfoam/78081-compute-local-reynolds-number.html)

nuovodna July 12, 2010 12:44

Compute local Reynolds number
 
Hi, i want to compute local Reynolds number (aka Peclet) using interFoam but i have some problems.
PecletX = rho * DeltaX * Ux / mu
PecletY = rho * DeltaY * Uy / mu


I create two fields : one for Peclet along X axis one along Y axis in this way

volScalarField PecletX
(
IOobject
(
"PecletX",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("PecletX", dimensionSet(1,0,-2,0,0),1)
);

volScalarField PecletY
(
IOobject
(
"PecletY",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("PecletY", dimensionSet(1,0,-2,0,0),1)
);


Now i have to compute DeltaX and DeltaY for all of cells

forAll(mesh.cells(), celli)
{
const labelList& cellPts = mesh.cellPoints()[celli];
DeltaX = mesh.points()[cellPts[1]].component(0) - mesh.points()[cellPts[0]].component(0);
DeltaY = mesh.points()[cellPts[4]].component(1) - mesh.points()[cellPts[0]].component(1);
PecletX = (U.component(0) * DeltaX * twoPhaseProperties.mu()) ;
PecletY = (U.component(1) * DeltaY * twoPhaseProperties.mu()) ;
}

The previous way is wrong. I have to make a cycle over whole points of all cells and storage the max and the min value of X (and Y). How can i do this??

Thanks


All times are GMT -4. The time now is 11:23.