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
2014-06-01 20:12:52 +02:00

46 lines
1.2 KiB
C

{
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]
);
}