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/elasticThermalSolidFoam/updateLoadingPatch.H
2012-09-11 16:42:55 +01:00

42 lines
1.3 KiB
C

/* ------------------------------------------------------------------------- *\
|| ||
|| Update loading patch ||
|| ||
\* ------------------------------------------------------------------------- */
{
word patchName = "right";
label patchID = mesh.boundaryMesh().findPatchID(patchName);
if(patchID == -1)
{
FatalErrorIn("updateLoadingPatch.H") << "Patch " << patchName << " not found." << endl
<< exit(FatalError);
}
//- update patch
if(
U.boundaryField()[patchID].type()
== fixedValueFvPatchVectorField::typeName
)
{
//- 1 mm every 100 seconds
//- experimental ultimate failure occurred at 0.3 mm
vector disp(0.00001*runTime.value(), 0, 0);
U.boundaryField()[patchID] == disp;
Info << "Patch " << mesh.boundary()[patchID].name() << " has been updated"
<< " to " << disp
<< endl;
}
else
{
SeriousError << "Loading Patch " << patchName << " is type "
<< U.boundaryField()[patchID].type()
<< " and is not updated!" << endl
<< exit(FatalError);
}
}
// ************************************************************************* //