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/solidModels/rheologyModel/rheologyLaws/elasticPlastic/elasticPlastic.C

174 lines
4 KiB
C
Raw Normal View History

2012-09-11 15:42:55 +00:00
// The FOAM Project // File: elasticPlastic.C
/*
-------------------------------------------------------------------------------
========= | Class Implementation
\\ / |
\\ / | Name: elasticPlastic
\\ / | Family: rheologyLaw
\\/ |
F ield | FOAM version: 2.3
O peration |
A and | Copyright (C) 1991-2004 Nabla Ltd.
M anipulation | All Rights Reserved.
-------------------------------------------------------------------------------
DESCRIPTION
AUTHOR
Hrvoje Jasak.
-------------------------------------------------------------------------------
*/
#include "elasticPlastic.H"
#include "addToRunTimeSelectionTable.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(elasticPlastic, 0);
addToRunTimeSelectionTable(rheologyLaw, elasticPlastic, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from dictionary
Foam::elasticPlastic::elasticPlastic
(
const word& name,
const volSymmTensorField& sigma,
const dictionary& dict
)
:
rheologyLaw(name, sigma, dict),
rho_(dict.lookup("rho")),
E_(dict.lookup("E")),
nu_(dict.lookup("nu")),
sigmaY_(dict.lookup("sigmaY")),
Ep_(dict.lookup("Ep"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::elasticPlastic::~elasticPlastic()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::elasticPlastic::rho() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"rho",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
rho_,
zeroGradientFvPatchScalarField::typeName
)
);
}
Foam::tmp<Foam::volScalarField> Foam::elasticPlastic::E() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"E",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
E_,
zeroGradientFvPatchScalarField::typeName
)
);
}
Foam::tmp<Foam::volScalarField> Foam::elasticPlastic::nu() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"nu",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
nu_,
zeroGradientFvPatchScalarField::typeName
)
);
}
Foam::tmp<Foam::volScalarField> Foam::elasticPlastic::sigmaY() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"sigmaY",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
sigmaY_,
zeroGradientFvPatchScalarField::typeName
)
);
}
Foam::tmp<Foam::volScalarField> Foam::elasticPlastic::Ep() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"Ep",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
Ep_,
zeroGradientFvPatchScalarField::typeName
)
);
}
// ************************************************************************* //