67ab0b5abd
- in FOAM library updated containers backported PackedBoolList, hashedWordList, nullObject, wordRe, backported functions to backported int32 support backported tableReaders backported Function1, TimeFunction1 backported dynamicCode (for codedBCs, ...) -- needs to be mapped out advanced error macros (FatalIOErrorInFunction, ...) -- needs to be mapped out backported IOobject::MUST_READ_IF_MODIFIED and added IOobject::READ_IF_PRESENT_IF_MODIFIED (only in FO) - in postProcessing backported IO FOs (partialWrite, removeRegisteredObject, writeDictionary, writeRegisteredObject) backported field FOs (fieldCoordinateSystemTransform, fieldValues, nearWallFields, processorField, readFields, regionSizeDistribution, streamLine, wallBoundedStreamLine) backported fvTools FOs (calcFvcDiv, calcFvcGrad, calcMag) backported jobControl FOs (abortCalculation) backported utilities FOs (ourantNo, Lambda2, Peclet, Q, codedFunctionObject, pressureTools, residuals, scalarTransport, setTimeStep, timeActivatedFileUpdate, turbulenceFields, vorticity, wallShearStress)
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
Info<< "Reading mechanical properties\n" << endl;
|
|
|
|
IOdictionary mechanicalProperties
|
|
(
|
|
IOobject
|
|
(
|
|
"mechanicalProperties",
|
|
runTime.constant(),
|
|
mesh,
|
|
IOobject::MUST_READ_IF_MODIFIED,
|
|
IOobject::NO_WRITE
|
|
)
|
|
);
|
|
|
|
dimensionedScalar rho(mechanicalProperties.lookup("rho"));
|
|
dimensionedScalar rhoE(mechanicalProperties.lookup("E"));
|
|
dimensionedScalar nu(mechanicalProperties.lookup("nu"));
|
|
|
|
Info<< "Normalising E : E/rho\n" << endl;
|
|
dimensionedScalar E = rhoE/rho;
|
|
|
|
Info<< "Calculating Lame's coefficients\n" << endl;
|
|
|
|
dimensionedScalar mu = E/(2.0*(1.0 + nu));
|
|
dimensionedScalar lambda = nu*E/((1.0 + nu)*(1.0 - 2.0*nu));
|
|
dimensionedScalar threeK = E/(1.0 - 2.0*nu);
|
|
|
|
Switch planeStress(mechanicalProperties.lookup("planeStress"));
|
|
|
|
if (planeStress)
|
|
{
|
|
Info<< "Plane Stress\n" << endl;
|
|
|
|
lambda = nu*E/((1.0 + nu)*(1.0 - nu));
|
|
threeK = E/(1.0 - nu);
|
|
}
|
|
else
|
|
{
|
|
Info<< "Plane Strain\n" << endl;
|
|
}
|
|
|
|
Info<< "mu = " << mu.value() << " Pa/rho\n";
|
|
Info<< "lambda = " << lambda.value() << " Pa/rho\n";
|
|
Info<< "threeK = " << threeK.value() << " Pa/rho\n";
|