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/viscoElasticSolidFoam/setInterfaceTraction.H

47 lines
1.2 KiB
C
Raw Normal View History

{
volVectorField totTraction
(
IOobject
(
"totTraction",
fluidRunTime.timeName(),
fluidMesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
fluidMesh
);
if
(
DU.boundaryField()[interfacePatchID].type()
!= tractionDisplacementIncrementFvPatchVectorField::typeName
)
{
FatalErrorIn(args.executable())
<< "Bounary condition on " << DU.name()
<< " is "
<< DU.boundaryField()[interfacePatchID].type()
<< "for patch: "
<< mesh.boundaryMesh()[interfacePatchID].name()
<< ", instead "
<< tractionDisplacementIncrementFvPatchVectorField::typeName
<< abort(FatalError);
}
tractionDisplacementIncrementFvPatchVectorField& interfacePatchDU =
refCast<tractionDisplacementIncrementFvPatchVectorField>
(
DU.boundaryField()[interfacePatchID]
);
interfacePatchDU.traction() =
interpolator.faceInterpolate
(
totTraction.boundaryField()[fluidInterfacePatchID]
);
}