db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
if (runTime.outputTime())
|
|
{
|
|
// Displacement gradient
|
|
tetPointTensorField gradU = tetFec::grad(U);
|
|
|
|
// Stress tensor
|
|
tetPointSymmTensorField sigma =
|
|
rho*(2.0*mu*symm(gradU) + lambda*I*tr(gradU));
|
|
|
|
// sigmaXX
|
|
tetPointScalarField sigmaXX
|
|
(
|
|
IOobject
|
|
(
|
|
"sigmaXX",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::NO_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
sigma.component(symmTensor::XX)
|
|
);
|
|
|
|
// sigmaYY
|
|
tetPointScalarField sigmaYY
|
|
(
|
|
IOobject
|
|
(
|
|
"sigmaYY",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::NO_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
sigma.component(symmTensor::YY)
|
|
);
|
|
|
|
// sigmaXY
|
|
tetPointScalarField sigmaXY
|
|
(
|
|
IOobject
|
|
(
|
|
"sigmaXY",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::NO_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
sigma.component(symmTensor::XY)
|
|
);
|
|
|
|
runTime.write();
|
|
}
|