1 Info<<
"Reading mechanical properties\n" <<
endl;
3 IOdictionary mechanicalProperties
7 "mechanicalProperties",
10 IOobject::MUST_READ_IF_MODIFIED,
15 const dictionary& rhoDict(mechanicalProperties.subDict(
"rho"));
16 word rhoType(rhoDict.get<word>(
"type"));
29 if (rhoType ==
"uniform")
31 scalar rhoValue(rhoDict.get<scalar>(
"value"));
48 else if (rhoType ==
"field")
50 rhoIO.readOpt(IOobject::MUST_READ);
64 <<
"Valid type entries are uniform or field for rho"
70 const dictionary&
EDict(mechanicalProperties.subDict(
"E"));
73 autoPtr<volScalarField>
EPtr;
86 scalar rhoEValue(
EDict.get<scalar>(
"value"));
97 dimMass/dimLength/sqr(dimTime),
103 else if (
EType ==
"field")
105 EHeader.readOpt(IOobject::MUST_READ);
119 <<
"Valid type entries are uniform or field for E"
120 <<
abort(FatalError);
136 const dictionary&
nuDict(mechanicalProperties.subDict(
"nu"));
141 scalar nuValue(
nuDict.get<scalar>(
"value"));
157 else if (
nuType ==
"field")
159 nuIO.readOpt(IOobject::MUST_READ);
172 <<
"Valid type entries are uniform or field for nu"
173 <<
abort(FatalError);
178 Info<<
"Normalising E : E/rho\n" << endl;
181 Info<<
"Calculating Lame's coefficients\n" << endl;
183 volScalarField
mu(E/(2.0*(1.0 +
nu)));
184 volScalarField
lambda(
nu*E/((1.0 +
nu)*(1.0 - 2.0*
nu)));
185 volScalarField threeK(E/(1.0 - 2.0*
nu));
187 if (mechanicalProperties.get<
bool>(
"planeStress"))
189 Info<<
"Plane Stress\n" << endl;
192 threeK = E/(1.0 -
nu);
const volScalarField & mu
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
const dictionary & EDict(mechanicalProperties.subDict("E"))
const dictionary & nuDict(mechanicalProperties.subDict("nu"))
Info<< "Reading mechanical properties\n"<< endl;IOdictionary mechanicalProperties(IOobject("mechanicalProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE));const dictionary &rhoDict(mechanicalProperties.subDict("rho"));word rhoType(rhoDict.get< word >("type"));autoPtr< volScalarField > rhoPtr
IOobject EHeader("E", runTime.timeName(0), mesh, IOobject::NO_READ, IOobject::NO_WRITE)
autoPtr< volScalarField > EPtr
word EType(EDict.get< word >("type"))
autoPtr< volScalarField > nuPtr
IOobject rhoIO("rho", runTime.timeName(0), mesh, IOobject::NO_READ, IOobject::NO_WRITE)
IOobject nuIO("nu", runTime.timeName(0), mesh, IOobject::NO_READ, IOobject::NO_WRITE)
word nuType(nuDict.get< word >("type"))
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)