Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / solidMechanics / stressFemFoam / readMechanicalProperties.H
blobabeff6d13b8a43abbef00e4f29fc9010c80b2064
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,
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;
21     dimensionedScalar E = rhoE;
23     Info<< "Calculating Lame's coefficients\n" << endl;
25     dimensionedScalar mu = E/(2.0*(1.0 + nu));
26     dimensionedScalar lambda = nu*E/((1.0 + nu)*(1.0 - 2.0*nu));
28     Switch planeStress(mechanicalProperties.lookup("planeStress"));
30     if (planeStress)
31     {
32         Info<< "Plane Stress\n" << endl;
34         //- change lambda for plane stress
35         lambda = nu*E/((1.0 + nu)*(1.0 - nu));
36     }
37     else
38     {
39         Info<< "Plane Strain\n" << endl;
40     }
41     Info<< "mu = " << mu.value() << " Pa\n";
42     Info<< "lambda = " << lambda.value() << " Pa\n";