2 Info << "Setting traction on solid patch" << endl;
4 // vectorField fluidPatchTraction =
5 // -rhoFluid.value()*nu.value()
6 // *U.boundaryField()[fluidPatchID].snGrad()
7 // + rhoFluid.value()*p.boundaryField()[fluidPatchID]
8 // *mesh.boundary()[fluidPatchID].nf();
10 vectorField fluidPatchTraction =
11 -rhoFluid.value()*nu.value()
12 *U.boundaryField()[fluidPatchID].snGrad();
14 scalarField fluidPatchPressure =
15 rhoFluid.value()*p.boundaryField()[fluidPatchID];
17 vectorField fluidZoneTraction
19 mesh.faceZones()[fluidZoneID].size(),
23 const label fluidPatchStart =
24 mesh.boundaryMesh()[fluidPatchID].start();
26 forAll(fluidPatchTraction, i)
30 mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
32 fluidPatchTraction[i];
35 // Parallel data exchange: collect pressure field on all processors
36 reduce(fluidZoneTraction, sumOp<vectorField>());
39 scalarField fluidZonePressure
41 mesh.faceZones()[fluidZoneID].size(),
45 forAll(fluidPatchPressure, i)
49 mesh.faceZones()[fluidZoneID].whichFace(fluidPatchStart + i)
51 fluidPatchPressure[i];
54 // Parallel data exchange: collect pressure field on all processors
55 reduce(fluidZonePressure, sumOp<scalarField>());
57 vectorField solidZoneTraction =
58 interpolatorFluidSolid.faceInterpolate
63 scalarField solidZonePressure =
64 interpolatorFluidSolid.faceInterpolate
69 const label solidPatchStart =
70 stressMesh.boundaryMesh()[solidPatchID].start();
72 forAll(solidPatchTraction, i)
74 solidPatchTraction[i] =
77 stressMesh.faceZones()[solidZoneID]
78 .whichFace(solidPatchStart + i)
82 forAll(solidPatchPressure, i)
84 solidPatchPressure[i] =
87 stressMesh.faceZones()[solidZoneID]
88 .whichFace(solidPatchStart + i)
94 tForce.traction() = solidPatchTraction;
95 tForce.pressure() = solidPatchPressure;
98 vector totalTractionForce =
102 *stressMesh.magSf().boundaryField()[solidPatchID]
105 Info << "Total traction force = "
106 << totalTractionForce << endl;