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/elasticIncrAcpSolidFoam/calculateForceResidual.H

20 lines
486 B
C
Raw Normal View History

{
// force residual is the net force on the model
// this should got to zero in a converged steady state model
// should be altered for parallel runs
vector netForce = vector::zero;
forAll(mesh.boundary(), patchi)
{
netForce +=
sum(
mesh.Sf().boundaryField()[patchi]
&
(
2*mu.boundaryField()[patchi]*symm(gradU.boundaryField()[patchi])
+ lambda*tr(gradU.boundaryField()[patchi])*I
)
);
}
forceResidual = mag(netForce);
}