Forward compatibility: flex
[foam-extend-3.2.git] / applications / solvers / solidMechanics / viscoElasticSolidFoam / updateTractionFreePatchTractionIncrement.H
blob3d31b9b68383d22a9ca70a46e9c7ea5ef9158882
3     label patchID = mesh.boundaryMesh().findPatchID("freeSurface");
5     if(patchID == -1)
6     {
7         FatalErrorIn(args.executable())
8             << "Can't find patch with name freeSurface" << abort(FatalError);
9     }
11     if
12     (
13         DU.boundaryField()[patchID].type()
14      != tractionDisplacementIncrementFvPatchVectorField::typeName
15     )
16     {
17         FatalErrorIn(args.executable())
18             << "Bounary condition on " << DU.name()
19                 <<  " is "
20                 << DU.boundaryField()[patchID].type()
21                 << "for patch: " << mesh.boundaryMesh()[patchID].name()
22                 <<  ", instead "
23                 << tractionDisplacementIncrementFvPatchVectorField::typeName
24                 << abort(FatalError);
25     }
27     tractionDisplacementIncrementFvPatchVectorField& tractionPatch =
28         refCast<tractionDisplacementIncrementFvPatchVectorField>
29         (
30             DU.boundaryField()[patchID]
31         );
33     vectorField n = mesh.boundary()[patchID].nf();
35     vector traction = vector::zero;
36     vector DTraction = vector::zero;
38     vectorField relaxedTraction =
39         (
40             n
41           & (
42                 sigma.boundaryField()[patchID]
43               + DSigmaCorr.boundaryField()[patchID]
44             )
45         );
47     tractionPatch.DTraction() = DTraction + (traction - relaxedTraction);
49     tractionPatch.DPressure() = 0.0;