FreeFOAM The Cross-Platform CFD Toolkit
readMechanicalProperties.H
Go to the documentation of this file.
1  Info<< "Reading mechanical properties\n" << endl;
2 
3  IOdictionary mechanicalProperties
4  (
5  IOobject
6  (
7  "mechanicalProperties",
8  runTime.constant(),
9  mesh,
10  IOobject::MUST_READ,
11  IOobject::NO_WRITE
12  )
13  );
14 
15  dimensionedScalar rho(mechanicalProperties.lookup("rho"));
16  dimensionedScalar rhoE(mechanicalProperties.lookup("E"));
17  dimensionedScalar nu(mechanicalProperties.lookup("nu"));
18 
19  Info<< "Normalising E : E/rho\n" << endl;
20  dimensionedScalar E = rhoE/rho;
21 
22  Info<< "Calculating Lame's coefficients\n" << endl;
23 
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);
27 
28  Switch planeStress(mechanicalProperties.lookup("planeStress"));
29 
30  if (planeStress)
31  {
32  Info<< "Plane Stress\n" << endl;
33 
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  }
41 
42  Info<< "mu = " << mu.value() << " Pa/rho\n";
43  Info<< "lambda = " << lambda.value() << " Pa/rho\n";
44  Info<< "threeK = " << threeK.value() << " Pa/rho\n";
45 
46 // ************************ vim: set sw=4 sts=4 et: ************************ //