Remove trailing whitespace systematically
[foam-extend-3.2.git] / applications / solvers / solidMechanics / viscoElasticSolidFoam / updateLoadingPatchTraction.H
blobbe664b14d5ac08f8db67930d972f813d5f1ff4ec
1 // Loading patch
3     label patchID = mesh.boundaryMesh().findPatchID("loading");
5     if(patchID == -1)
6     {
7         FatalErrorIn(args.executable())
8             << "Can't find patch with name loading" << abort(FatalError);
9     }
11     if
12     (
13         DU.boundaryField()[patchID].type()
14      == directionMixedFvPatchVectorField::typeName
15     )
16     {
17         directionMixedFvPatchVectorField& loadingPatchU =
18             refCast<directionMixedFvPatchVectorField>
19             (
20                 DU.boundaryField()[patchID]
21             );
23         vectorField n = mesh.boundary()[patchID].nf();
25         vectorField traction = n*(n&(n&DSigma));
27         scalarField lpMu = mu.boundaryField()[patchID];
28         scalarField lpLambda = lambda.boundaryField()[patchID];
30         tensorField lpGradDU = gradDU.boundaryField()[patchID];
32         loadingPatchU.refGrad() =
33         (
34             traction
35           - (n & (lpMu*lpGradDU.T() - (lpMu + lpLambda)*lpGradDU))
36           - n*lpLambda*tr(lpGradDU)
37         )
38        /(2.0*lpMu + lpLambda);
39     }
42 // Bottom patch
44     label patchID = mesh.boundaryMesh().findPatchID("bottom");
46     if(patchID == -1)
47     {
48         FatalErrorIn(args.executable())
49             << "Can't find patch with name bottom" << abort(FatalError);
50     }
52     if
53     (
54         DU.boundaryField()[patchID].type()
55      == directionMixedFvPatchVectorField::typeName
56     )
57     {
58         directionMixedFvPatchVectorField& bottomPatchU =
59             refCast<directionMixedFvPatchVectorField>
60             (
61                 DU.boundaryField()[patchID]
62             );
64         vectorField n = mesh.boundary()[patchID].nf();
66         vectorField traction = n*(n&(n&DSigma));
68         scalarField bpMu = mu.boundaryField()[patchID];
69         scalarField bpLambda = lambda.boundaryField()[patchID];
71         tensorField bpGradDU = gradDU.boundaryField()[patchID];
73         bottomPatchU.refGrad() =
74         (
75             traction
76           - (n & (bpMu*bpGradDU.T() - (bpMu + bpLambda)*bpGradDU))
77           - n*bpLambda*tr(bpGradDU)
78         )
79        /(2.0*bpMu + bpLambda);
80     }