db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
45 lines
1.1 KiB
C
45 lines
1.1 KiB
C
mkDir(runTime.path()/"positions"/runTime.timeName());
|
|
|
|
OFstream positionsFile
|
|
(
|
|
runTime.path()
|
|
/"positions"
|
|
/runTime.timeName()
|
|
/"leftAndRightPosition"
|
|
);
|
|
|
|
positionsFile << "Time" << tab;
|
|
|
|
positionsFile << "Left" << tab << "Right" << endl;
|
|
|
|
|
|
// Find left and right point label in the patch localPoints field
|
|
|
|
const pointField& locPoints =
|
|
mesh.boundaryMesh()[interface.aPatchID()].localPoints();
|
|
|
|
label leftPointLabel = -1;
|
|
label rightPointLabel = -1;
|
|
|
|
forAll(locPoints, pointI)
|
|
{
|
|
if(leftPointLabel == -1 || rightPointLabel == -1)
|
|
{
|
|
if(mag(locPoints[pointI].x()) < SMALL)
|
|
{
|
|
leftPointLabel = pointI;
|
|
}
|
|
else if(mag(locPoints[pointI].x() - 1.0) < SMALL)
|
|
{
|
|
rightPointLabel = pointI;
|
|
}
|
|
}
|
|
}
|
|
|
|
if(leftPointLabel == -1 || rightPointLabel == -1)
|
|
{
|
|
Info << "Can't find left and right points labels!";
|
|
return 0;
|
|
}
|
|
|
|
// scalar dissipation = 0.0;
|