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/elasticPlasticNonLinTLSolidFoam/writeFields.H

96 lines
2.1 KiB
C
Raw Normal View History

if (runTime.outputTime())
2014-04-10 16:45:26 +00:00
{
volScalarField epsilonEq
2014-04-10 16:45:26 +00:00
(
IOobject
(
"epsilonEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt((2.0/3.0)*magSqr(dev(epsilon)))
);
Info<< "Max epsilonEq = " << max(epsilonEq).value() << endl;
volScalarField epsilonPEq
2014-04-10 16:45:26 +00:00
(
IOobject
(
"epsilonPEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
2014-04-10 16:45:26 +00:00
sqrt((2.0/3.0)*magSqr(dev(epsilonP)))
);
Info<< "Max epsilonPEq = " << max(epsilonPEq).value()<< endl;
volScalarField sigmaEq
2014-04-10 16:45:26 +00:00
(
IOobject
(
"sigmaEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt((3.0/2.0)*magSqr(dev(sigma)))
);
Info<< "Max sigmaEq = " << max(sigmaEq).value() << endl;
2014-04-10 16:45:26 +00:00
// Deformation gradient
volTensorField F = I + gradU;
volScalarField J = det(F);
2014-04-10 16:45:26 +00:00
// Calculate Cauchy stress
volSymmTensorField sigmaCauchy
2014-04-10 16:45:26 +00:00
(
IOobject
(
"sigmaCauchy",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
(1/J)*symm(F.T() & sigma & F)
);
2014-04-10 16:45:26 +00:00
// Cauchy von Mises stress
volScalarField sigmaCauchyEq
2014-04-10 16:45:26 +00:00
(
IOobject
(
"sigmaCauchyEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt((3.0/2.0)*magSqr(dev(sigmaCauchy)))
);
2014-04-10 16:45:26 +00:00
Info<< "Max sigmaCauchyEq = " << max(sigmaCauchyEq).value() << endl;
2014-04-10 16:45:26 +00:00
// volTensorField Finv = inv(F);
// volSymmTensorField epsilonAlmansi
// (
// IOobject
// (
// "epsilonAlmansi",
// runTime.timeName(),
// mesh,
// IOobject::NO_READ,
// IOobject::AUTO_WRITE
// ),
// symm(Finv & epsilon & Finv.T())
// );
runTime.write();
2014-04-10 16:45:26 +00:00
}