1 //- write force displacement to file
2 if(historyPatchID != -1)
4 Info << "Found patch "<<historyPatchName<<", writing y force and displacement to file"
7 //- calculate force in specified direction on topClamp patch
8 vector direction(0, 1, 0);
10 //- for small strain or moving mesh
14 (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID])
17 //- for large strain total lagrangian
18 // tensorField F = I + gradU.boundaryField()[historyPatchID];
19 // vectorField totalForce = mesh.Sf().boundaryField()[historyPatchID] & (sigma.boundaryField()[historyPatchID] & F);
21 //vector force = sum( totalForce );
23 //scalar force = force[vector::Y];
25 //- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should
26 //- be dotted with the surface normal to give the actual traction/force
27 //- you cannot just take the component of the sigma tensor
28 //scalar forcePatchIntegrateMethod = gSum(
29 // mesh.magSf().boundaryField()[historyPatchID]
30 // *sigma.boundaryField()[historyPatchID].component(symmTensor::XY)
33 scalar disp = max(U.boundaryField()[historyPatchID].component(vector::Y));
38 OFstream& forceDispFile = *filePtr;
39 forceDispFile << disp << "\t" << force << endl;