mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: potentialFoam/cylinder: indexing into non-existing patch in parallel
This commit is contained in:
@ -37,8 +37,8 @@ boundaryField
|
|||||||
|
|
||||||
left
|
left
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type uniformFixedValue;
|
||||||
value uniform (1 0 0);
|
uniformValue (1 0 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
cylinder
|
cylinder
|
||||||
|
|||||||
@ -62,19 +62,39 @@ functions
|
|||||||
|
|
||||||
Info<< "Reading inlet velocity uInfX\n" << endl;
|
Info<< "Reading inlet velocity uInfX\n" << endl;
|
||||||
|
|
||||||
|
scalar ULeft = 0.0;
|
||||||
|
label leftI = mesh().boundaryMesh().findPatchID("left");
|
||||||
|
const fvPatchVectorField& fvp = U.boundaryField()[leftI];
|
||||||
|
if (fvp.size())
|
||||||
|
{
|
||||||
|
ULeft = fvp[0].x();
|
||||||
|
}
|
||||||
|
reduce(ULeft, maxOp<scalar>());
|
||||||
|
|
||||||
dimensionedScalar uInfX
|
dimensionedScalar uInfX
|
||||||
(
|
(
|
||||||
"uInfx",
|
"uInfx",
|
||||||
dimensionSet(0, 1, -1, 0, 0),
|
dimensionSet(0, 1, -1, 0, 0),
|
||||||
U.boundaryField()[3][0].x()
|
ULeft
|
||||||
);
|
);
|
||||||
|
|
||||||
Info << "U at inlet = " << uInfX.value() << " m/s" << endl;
|
Info << "U at inlet = " << uInfX.value() << " m/s" << endl;
|
||||||
|
|
||||||
|
|
||||||
|
scalar magCylinder = 0.0;
|
||||||
|
label cylI = mesh().boundaryMesh().findPatchID("cylinder");
|
||||||
|
const fvPatchVectorField& cylFvp = mesh().C().boundaryField()[cylI];
|
||||||
|
if (cylFvp.size())
|
||||||
|
{
|
||||||
|
magCylinder = mag(cylFvp[0]);
|
||||||
|
}
|
||||||
|
reduce(magCylinder, maxOp<scalar>());
|
||||||
|
|
||||||
dimensionedScalar radius
|
dimensionedScalar radius
|
||||||
(
|
(
|
||||||
"radius",
|
"radius",
|
||||||
dimensionSet(0, 1, 0, 0, 0),
|
dimensionSet(0, 1, 0, 0, 0),
|
||||||
mag(U.mesh().boundary()[4].Cf()[0])
|
magCylinder
|
||||||
);
|
);
|
||||||
|
|
||||||
Info << "Cylinder radius = " << radius.value() << " m" << endl;
|
Info << "Cylinder radius = " << radius.value() << " m" << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user