2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
zoneToZoneInterpolation* interpolatorFluidSolidPtr = NULL;
|
|
|
|
zoneToZoneInterpolation* interpolatorSolidFluidPtr = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if(!interpolatorFluidSolidPtr || !interpolatorSolidFluidPtr)
|
|
|
|
{
|
|
|
|
deleteDemandDrivenData(interpolatorFluidSolidPtr);
|
|
|
|
deleteDemandDrivenData(interpolatorSolidFluidPtr);
|
|
|
|
|
|
|
|
Info << "Create fluid-to-solid and solid-to-fluid interpolators" << endl;
|
|
|
|
|
|
|
|
interpolatorFluidSolidPtr = new zoneToZoneInterpolation
|
|
|
|
(
|
|
|
|
mesh.faceZones()[fluidZoneID](),
|
|
|
|
stressMesh.faceZones()[solidZoneID](),
|
|
|
|
intersection::VISIBLE
|
|
|
|
);
|
|
|
|
|
|
|
|
interpolatorSolidFluidPtr = new zoneToZoneInterpolation
|
|
|
|
(
|
|
|
|
stressMesh.faceZones()[solidZoneID](),
|
|
|
|
mesh.faceZones()[fluidZoneID](),
|
|
|
|
intersection::VISIBLE
|
|
|
|
);
|
|
|
|
|
|
|
|
Info << "Check fluid-to-solid and solid-to-fluid interpolators" << endl;
|
|
|
|
|
|
|
|
{
|
2013-10-11 13:31:14 +00:00
|
|
|
vectorField fluidPatchFaceCentres =
|
2012-09-11 15:42:55 +00:00
|
|
|
vectorField(mesh.boundaryMesh()[fluidPatchID].faceCentres());
|
|
|
|
|
|
|
|
vectorField fluidZoneFaceCentres
|
|
|
|
(
|
2013-10-11 13:31:14 +00:00
|
|
|
mesh.faceZones()[fluidZoneID].size(),
|
2012-09-11 15:42:55 +00:00
|
|
|
vector::zero
|
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
|
|
|
|
const label fluidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
mesh.boundaryMesh()[fluidPatchID].start();
|
|
|
|
|
|
|
|
forAll (fluidPatchFaceCentres, i)
|
|
|
|
{
|
|
|
|
fluidZoneFaceCentres
|
|
|
|
[
|
|
|
|
mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
|
2013-10-11 13:31:14 +00:00
|
|
|
] =
|
2012-09-11 15:42:55 +00:00
|
|
|
fluidPatchFaceCentres[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parallel data exchange: collect faceCentres field on all processors
|
|
|
|
reduce(fluidZoneFaceCentres, sumOp<vectorField>());
|
|
|
|
|
|
|
|
vectorField solidZoneFaceCentres =
|
|
|
|
interpolatorFluidSolidPtr->faceInterpolate
|
|
|
|
(
|
|
|
|
fluidZoneFaceCentres
|
|
|
|
);
|
|
|
|
|
|
|
|
vectorField solidPatchFaceCentres
|
|
|
|
(
|
2013-10-11 13:31:14 +00:00
|
|
|
stressMesh.boundaryMesh()[solidPatchID].size(),
|
2012-09-11 15:42:55 +00:00
|
|
|
vector::zero
|
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
const label solidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
stressMesh.boundaryMesh()[solidPatchID].start();
|
|
|
|
|
|
|
|
forAll(solidPatchFaceCentres, i)
|
|
|
|
{
|
|
|
|
solidPatchFaceCentres[i] =
|
|
|
|
solidZoneFaceCentres
|
|
|
|
[
|
|
|
|
stressMesh.faceZones()[solidZoneID]
|
|
|
|
.whichFace(solidPatchStart + i)
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
scalar maxDist = gMax
|
|
|
|
(
|
|
|
|
mag
|
|
|
|
(
|
|
|
|
solidPatchFaceCentres
|
|
|
|
- stressMesh.boundaryMesh()[solidPatchID].faceCentres()
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
Info << "Fluid-to-solid face interpolation error: " << maxDist
|
2012-09-11 15:42:55 +00:00
|
|
|
<< endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2013-10-11 13:31:14 +00:00
|
|
|
vectorField solidPatchFaceCentres =
|
2012-09-11 15:42:55 +00:00
|
|
|
vectorField(stressMesh.boundaryMesh()[solidPatchID].faceCentres());
|
|
|
|
|
|
|
|
vectorField solidZoneFaceCentres
|
|
|
|
(
|
2013-10-11 13:31:14 +00:00
|
|
|
stressMesh.faceZones()[solidZoneID].size(),
|
2012-09-11 15:42:55 +00:00
|
|
|
vector::zero
|
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
const label solidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
stressMesh.boundaryMesh()[solidPatchID].start();
|
|
|
|
|
|
|
|
forAll (solidPatchFaceCentres, i)
|
|
|
|
{
|
|
|
|
solidZoneFaceCentres
|
|
|
|
[
|
|
|
|
stressMesh.faceZones()[solidZoneID]
|
|
|
|
.whichFace(solidPatchStart + i)
|
2013-10-11 13:31:14 +00:00
|
|
|
] =
|
2012-09-11 15:42:55 +00:00
|
|
|
solidPatchFaceCentres[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parallel data exchange: collect faceCentres field on all processors
|
|
|
|
reduce(solidZoneFaceCentres, sumOp<vectorField>());
|
|
|
|
|
|
|
|
vectorField fluidZoneFaceCentres =
|
|
|
|
interpolatorSolidFluidPtr->faceInterpolate
|
|
|
|
(
|
|
|
|
solidZoneFaceCentres
|
|
|
|
);
|
|
|
|
|
|
|
|
vectorField fluidPatchFaceCentres
|
|
|
|
(
|
2013-10-11 13:31:14 +00:00
|
|
|
mesh.boundaryMesh()[fluidPatchID].size(),
|
2012-09-11 15:42:55 +00:00
|
|
|
vector::zero
|
|
|
|
);
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
const label fluidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
mesh.boundaryMesh()[fluidPatchID].start();
|
|
|
|
|
|
|
|
forAll(fluidPatchFaceCentres, i)
|
|
|
|
{
|
|
|
|
fluidPatchFaceCentres[i] =
|
|
|
|
fluidZoneFaceCentres
|
|
|
|
[
|
|
|
|
mesh.faceZones()[fluidZoneID]
|
|
|
|
.whichFace(fluidPatchStart + i)
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
scalar maxDist = gMax
|
|
|
|
(
|
|
|
|
mag
|
|
|
|
(
|
|
|
|
fluidPatchFaceCentres
|
|
|
|
- mesh.boundaryMesh()[fluidPatchID].faceCentres()
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
Info << "Solid-to-fluid face interpolation error: " << maxDist
|
|
|
|
<< endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
zoneToZoneInterpolation& interpolatorFluidSolid =
|
2012-09-11 15:42:55 +00:00
|
|
|
*interpolatorFluidSolidPtr;
|
|
|
|
|
2013-10-11 13:31:14 +00:00
|
|
|
zoneToZoneInterpolation& interpolatorSolidFluid =
|
2012-09-11 15:42:55 +00:00
|
|
|
*interpolatorSolidFluidPtr;
|
|
|
|
|