1 Info <<
"Reading mechanical properties\n"
4 IOdictionary mechanicalProperties(
6 "mechanicalProperties",
12 const dictionary& rhoDict(mechanicalProperties.subDict(
"rho"));
13 word rhoType(rhoDict.lookup(
"type"));
22 if (rhoType ==
"uniform")
24 scalar rhoValue(readScalar(rhoDict.lookup(
"value")));
35 else if (rhoType ==
"field")
37 rhoIO.readOpt() = IOobject::MUST_READ;
47 <<
"Valid type entries are uniform or field for rho"
51 volScalarField&
rho = rhoPtr_();
53 const dictionary& EDict(mechanicalProperties.subDict(
"E"));
54 word EType(EDict.lookup(
"type"));
63 if (EType ==
"uniform")
65 scalar rhoEValue(readScalar(EDict.lookup(
"value")));
73 dimMass / dimLength / sqr(dimTime),
76 else if (EType ==
"field")
78 EHeader.readOpt() = IOobject::MUST_READ;
88 <<
"Valid type entries are uniform or field for E"
92 volScalarField& rhoE = EPtr_();
101 const dictionary& nuDict(mechanicalProperties.subDict(
"nu"));
102 word nuType(nuDict.lookup(
"type"));
104 if (nuType ==
"uniform")
106 scalar nuValue(readScalar(nuDict.lookup(
"value")));
116 else if (nuType ==
"field")
118 nuIO.readOpt() = IOobject::MUST_READ;
127 <<
"Valid type entries are uniform or field for nu"
128 << abort(FatalError);
131 volScalarField& nu = nuPtr_();
133 Info <<
"Normalising E : E/rho\n"
135 volScalarField E(rhoE /
rho);
137 Info <<
"Calculating Lame's coefficients\n"
143 E / (2.0 * (1.0 + nu))));
144 lambdaPtr_.reset(
new volScalarField(
146 nu* E / ((1.0 + nu) * (1.0 - 2.0 * nu))));
148 Switch planeStress(mechanicalProperties.lookup(
"planeStress"));
152 Info <<
"Plane Stress\n"
155 lambdaPtr_() = nu * E / ((1.0 + nu) * (1.0 - nu));
159 Info <<
"Plane Strain\n"