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

43 lines
1.4 KiB
C++
Raw Normal View History

2012-09-11 15:42:55 +00:00
/* ------------------------------------------------------------------------- *\
|| ||
|| Update loading patch ||
|| ||
\* ------------------------------------------------------------------------- */
{
word patchName = "right";
label patchID = mesh.boundaryMesh().findPatchID(patchName);
if(patchID == -1)
2012-09-11 15:42:55 +00:00
{
FatalErrorIn("updateLoadingPatch.H") << "Patch " << patchName << " not found." << endl
<< exit(FatalError);
2012-09-11 15:42:55 +00:00
}
//- update patch
if
(
U.boundaryField()[patchID].type()
== fixedValueFvPatchVectorField::typeName
)
2012-09-11 15:42:55 +00:00
{
//- 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;
2012-09-11 15:42:55 +00:00
Info << "Patch " << mesh.boundary()[patchID].name() << " has been updated"
<< " to " << disp
<< endl;
2012-09-11 15:42:55 +00:00
}
else
2012-09-11 15:42:55 +00:00
{
SeriousError << "Loading Patch " << patchName << " is type "
<< U.boundaryField()[patchID].type()
<< " and is not updated!" << endl
<< exit(FatalError);
2012-09-11 15:42:55 +00:00
}
}
// ************************************************************************* //