mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: rotorDiskSource - updated calculation of co-ord sys for parallel running
This commit is contained in:
@ -252,7 +252,7 @@ void Foam::rotorDiskSource::createCoordinateSystem()
|
|||||||
{
|
{
|
||||||
case gmAuto:
|
case gmAuto:
|
||||||
{
|
{
|
||||||
// determine rotation origin
|
// determine rotation origin (cell volume weighted)
|
||||||
scalar sumV = 0.0;
|
scalar sumV = 0.0;
|
||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
const vectorField& C = mesh_.C();
|
const vectorField& C = mesh_.C();
|
||||||
@ -262,6 +262,8 @@ void Foam::rotorDiskSource::createCoordinateSystem()
|
|||||||
sumV += V[cellI];
|
sumV += V[cellI];
|
||||||
origin += V[cellI]*C[cellI];
|
origin += V[cellI]*C[cellI];
|
||||||
}
|
}
|
||||||
|
reduce(origin, sumOp<vector>());
|
||||||
|
reduce(sumV, sumOp<scalar>());
|
||||||
origin /= sumV;
|
origin /= sumV;
|
||||||
|
|
||||||
// determine first radial vector
|
// determine first radial vector
|
||||||
@ -277,6 +279,8 @@ void Foam::rotorDiskSource::createCoordinateSystem()
|
|||||||
magR = mag(test);
|
magR = mag(test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
reduce(dx1, maxMagSqrOp<vector>());
|
||||||
|
magR = mag(dx1);
|
||||||
|
|
||||||
// determine second radial vector and cross to determine axis
|
// determine second radial vector and cross to determine axis
|
||||||
forAll(cells_, i)
|
forAll(cells_, i)
|
||||||
@ -292,6 +296,7 @@ void Foam::rotorDiskSource::createCoordinateSystem()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
reduce(axis, maxMagSqrOp<vector>());
|
||||||
axis /= mag(axis);
|
axis /= mag(axis);
|
||||||
|
|
||||||
// axis direction is somewhat arbitrary - check if user needs
|
// axis direction is somewhat arbitrary - check if user needs
|
||||||
|
|||||||
Reference in New Issue
Block a user