This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/correctDirectionMixedTL.H

36 lines
1.5 KiB
C
Raw Normal View History

2012-09-11 15:42:55 +00:00
{
forAll(mesh.boundary(), patchID)
2012-09-11 15:42:55 +00:00
{
if
(
U.boundaryField()[patchID].type()
== solidDirectionMixedFvPatchVectorField::typeName
)
{
solidDirectionMixedFvPatchVectorField& loadingPatch =
refCast<solidDirectionMixedFvPatchVectorField>
(
U.boundaryField()[patchID]
);
tensorField Finv = inv(I + gradU);
vectorField newN = Finv & n.boundaryField()[patchID];
newN /= mag(newN);
loadingPatch.valueFraction() = sqr(newN);
2012-09-11 15:42:55 +00:00
//- set gradient
loadingPatch.refGrad() =
(
//Traction
( (mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]) * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID]) )
- ( mu.boundaryField()[patchID] * (n.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) )
- ( mu.boundaryField()[patchID] * ( n.boundaryField()[patchID] & (gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) ) )
- ( lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID]) * n.boundaryField()[patchID] )
- ( 0.5 * lambda.boundaryField()[patchID] * tr(gradU.boundaryField()[patchID] & gradU.boundaryField()[patchID].T()) * n.boundaryField()[patchID] )
)
/
(2.0*mu.boundaryField()[patchID] + lambda.boundaryField()[patchID]);
}
2012-09-11 15:42:55 +00:00
}
}