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/elasticOrthoNonLinULSolidFoam/createFields.H

118 lines
2.8 KiB
C

Info<< "Reading incremental displacement field DU\n" << endl;
volVectorField DU
(
IOobject
(
"DU",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volTensorField gradDU = fvc::grad(DU);
Info<< "Reading accumulated displacement field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimLength, vector::zero)
);
Info << "Reading accumulated strain field epsilon\n" << endl;
volSymmTensorField epsilon
(
IOobject
(
"epsilon",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero)
);
volSymmTensorField DEpsilon
(
IOobject
(
"DEpsilon",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedSymmTensor("zero", dimless, symmTensor::zero)
);
Info << "Reading accumulated stress field sigma\n" << endl;
volSymmTensorField sigma
(
IOobject
(
"sigma",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
);
Info << "Reading incremental stress field DSigma\n" << endl;
volSymmTensorField DSigma
(
IOobject
(
"DSigma",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedSymmTensor("zero", dimForce/dimArea, symmTensor::zero)
);
//- material properties
constitutiveModel rheology(sigma, DU);
volSymmTensor4thOrderField C = rheology.C();
volDiagTensorField K = rheology.K();
//surfaceSymmTensor4thOrderField Cf = fvc::interpolate(C);
//surfaceDiagTensorField Kf = fvc::interpolate(K);
surfaceVectorField n = mesh.Sf()/mesh.magSf();
//volScalarField rho = rheology.rho();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
rheology.rho()
);
// if(rheology.planeStress())
// {
// Info << nl << "Plane stress is set to yes -> the zz stress will be zero" << nl << endl;
// }