Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticNonLinTLSolidFoam / correctDirectionMixedTL.H
blobab2be6b76dce90cb02bfa92043403fc985c8f9a3
2     forAll(mesh.boundary(), patchID)
3     {
4         if(U.boundaryField()[patchID].type()
5      == solidDirectionMixedFvPatchVectorField::typeName
6     )
7     {
8         solidDirectionMixedFvPatchVectorField& loadingPatch =
9             refCast<solidDirectionMixedFvPatchVectorField>
10             (
11                 U.boundaryField()[patchID]
12             );
14             tensorField Finv = inv(I + gradU);
15             vectorField newN = Finv & n.boundaryField()[patchID];
16             newN /= mag(newN);
17             loadingPatch.valueFraction() = sqr(newN);
19             //- set gradient
20             loadingPatch.refGrad() =
21             (
22                 //Traction
23                 ( (mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]) * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID]) )
24               - ( mu.boundaryField()[patchID] * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) )
25               - ( mu.boundaryField()[patchID] * ( n.boundaryField()[patchID] & (gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) ) )
26               - ( lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID]) * n.boundaryField()[patchID] )
27               - ( 0.5 * lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) * n.boundaryField()[patchID] )
28             )
29             /
30             (2.0*mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]);
31         }
32     }