2012-09-11 15:42:55 +00:00
|
|
|
{
|
|
|
|
Info << "Setting traction on solid patch" << endl;
|
|
|
|
|
|
|
|
// vectorField fluidPatchTraction =
|
|
|
|
// -rhoFluid.value()*nu.value()
|
|
|
|
// *U.boundaryField()[fluidPatchID].snGrad()
|
|
|
|
// + rhoFluid.value()*p.boundaryField()[fluidPatchID]
|
|
|
|
// *mesh.boundary()[fluidPatchID].nf();
|
|
|
|
|
|
|
|
vectorField fluidPatchTraction =
|
|
|
|
-rhoFluid.value()*nu.value()
|
|
|
|
*U.boundaryField()[fluidPatchID].snGrad();
|
|
|
|
|
|
|
|
scalarField fluidPatchPressure =
|
|
|
|
rhoFluid.value()*p.boundaryField()[fluidPatchID];
|
|
|
|
|
|
|
|
vectorField fluidZoneTraction
|
|
|
|
(
|
2013-07-18 01:02:34 +00:00
|
|
|
mesh.faceZones()[fluidZoneID].size(),
|
2012-09-11 15:42:55 +00:00
|
|
|
vector::zero
|
|
|
|
);
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
const label fluidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
mesh.boundaryMesh()[fluidPatchID].start();
|
|
|
|
|
|
|
|
forAll(fluidPatchTraction, i)
|
|
|
|
{
|
|
|
|
fluidZoneTraction
|
|
|
|
[
|
|
|
|
mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
|
2013-07-18 01:02:34 +00:00
|
|
|
] =
|
2012-09-11 15:42:55 +00:00
|
|
|
fluidPatchTraction[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parallel data exchange: collect pressure field on all processors
|
|
|
|
reduce(fluidZoneTraction, sumOp<vectorField>());
|
|
|
|
|
|
|
|
|
|
|
|
scalarField fluidZonePressure
|
|
|
|
(
|
2013-07-18 01:02:34 +00:00
|
|
|
mesh.faceZones()[fluidZoneID].size(),
|
2012-09-11 15:42:55 +00:00
|
|
|
0.0
|
|
|
|
);
|
|
|
|
|
|
|
|
forAll(fluidPatchPressure, i)
|
|
|
|
{
|
|
|
|
fluidZonePressure
|
|
|
|
[
|
|
|
|
mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
|
2013-07-18 01:02:34 +00:00
|
|
|
] =
|
2012-09-11 15:42:55 +00:00
|
|
|
fluidPatchPressure[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Parallel data exchange: collect pressure field on all processors
|
|
|
|
reduce(fluidZonePressure, sumOp<scalarField>());
|
|
|
|
|
|
|
|
vectorField solidZoneTraction =
|
|
|
|
interpolatorFluidSolid.faceInterpolate
|
|
|
|
(
|
|
|
|
fluidZoneTraction
|
|
|
|
);
|
|
|
|
|
|
|
|
scalarField solidZonePressure =
|
|
|
|
interpolatorFluidSolid.faceInterpolate
|
|
|
|
(
|
|
|
|
fluidZonePressure
|
|
|
|
);
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
const label solidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
stressMesh.boundaryMesh()[solidPatchID].start();
|
|
|
|
|
|
|
|
forAll(solidPatchTraction, i)
|
|
|
|
{
|
|
|
|
solidPatchTraction[i] =
|
|
|
|
solidZoneTraction
|
|
|
|
[
|
|
|
|
stressMesh.faceZones()[solidZoneID]
|
|
|
|
.whichFace(solidPatchStart + i)
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
forAll(solidPatchPressure, i)
|
|
|
|
{
|
|
|
|
solidPatchPressure[i] =
|
|
|
|
solidZonePressure
|
|
|
|
[
|
|
|
|
stressMesh.faceZones()[solidZoneID]
|
|
|
|
.whichFace(solidPatchStart + i)
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fsi)
|
|
|
|
{
|
|
|
|
tForce.traction() = solidPatchTraction;
|
|
|
|
tForce.pressure() = solidPatchPressure;
|
|
|
|
}
|
|
|
|
|
|
|
|
vector totalTractionForce =
|
|
|
|
gSum
|
|
|
|
(
|
|
|
|
solidPatchTraction
|
|
|
|
*stressMesh.magSf().boundaryField()[solidPatchID]
|
|
|
|
);
|
|
|
|
|
|
|
|
Info << "Total traction force = "
|
|
|
|
<< totalTractionForce << endl;
|
|
|
|
}
|