Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / solvers / stressAnalysis / solidDisplacementFoam / readMechanicalProperties.H
blob9f256bd6891346da0be3844abc2882fb2079bb46
1     Info<< "Reading mechanical properties\n" << endl;
3     IOdictionary mechanicalProperties
4     (
5         IOobject
6         (
7             "mechanicalProperties",
8             runTime.constant(),
9             mesh,
10             IOobject::MUST_READ_IF_MODIFIED,
11             IOobject::NO_WRITE
12         )
13     );
15     dimensionedScalar rho(mechanicalProperties.lookup("rho"));
16     dimensionedScalar rhoE(mechanicalProperties.lookup("E"));
17     dimensionedScalar nu(mechanicalProperties.lookup("nu"));
19     Info<< "Normalising E : E/rho\n" << endl;
20     dimensionedScalar E = rhoE/rho;
22     Info<< "Calculating Lame's coefficients\n" << endl;
24     dimensionedScalar mu = E/(2.0*(1.0 + nu));
25     dimensionedScalar lambda = nu*E/((1.0 + nu)*(1.0 - 2.0*nu));
26     dimensionedScalar threeK = E/(1.0 - 2.0*nu);
28     Switch planeStress(mechanicalProperties.lookup("planeStress"));
30     if (planeStress)
31     {
32         Info<< "Plane Stress\n" << endl;
34         lambda = nu*E/((1.0 + nu)*(1.0 - nu));
35         threeK = E/(1.0 - nu);
36     }
37     else
38     {
39         Info<< "Plane Strain\n" << endl;
40     }
42     Info<< "mu = " << mu.value() << " Pa/rho\n";
43     Info<< "lambda = " << lambda.value() << " Pa/rho\n";
44     Info<< "threeK = " << threeK.value() << " Pa/rho\n";