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/)
-   -   Why my code is ok with single processor but doesnbt work in openmpi (http://www.cfd-online.com/Forums/openfoam-solving/59316-why-my-code-ok-single-processor-but-doesnbt-work-openmpi.html)

xiuying November 23, 2007 14:44

Hi, I need compute wallshe
 
Hi,

I need compute wallshearstress and wrote a code as followings. when I use single processor, it worked well. But if I use openmpi and multiprocessor, it couldn't work and there was not wallshearstress data written. Could you inform me how to deal with the problem? Thanks.

volSymmTensorField R(turbulence->R());

volVectorField wallShearStress
(
IOobject
(
"wallShearStress",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("wallShearStress", R.dimensions(), vector::zero)
);

//label patchA = mesh.boundaryMesh().findPatchID("lowerWall");

//patchID=0;
// Info<< "End2\n" << endl;


forAll(wallShearStress.boundaryField(), patchi)
{
wallShearStress.boundaryField()[3] =
(
-mesh.Sf().boundaryField()[3]
/mesh.magSf().boundaryField()[3]
) & R.boundaryField()[3];
}

if(runTime.outputTime())
{

wallShearStress.write();
}

kang


All times are GMT -4. The time now is 19:37.