FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

createFields.H

Go to the documentation of this file.
00001 Info<< "Reading field D\n" << endl;
00002 volVectorField D
00003 (
00004     IOobject
00005     (
00006         "D",
00007         runTime.timeName(),
00008         mesh,
00009         IOobject::MUST_READ,
00010         IOobject::AUTO_WRITE
00011     ),
00012     mesh
00013 );
00014 
00015 
00016 autoPtr<volScalarField> Tptr(NULL);
00017 
00018 if (thermalStress)
00019 {
00020     Info<< "Reading field T\n" << endl;
00021     Tptr.reset
00022     (
00023         new volScalarField
00024         (
00025             IOobject
00026             (
00027                 "T",
00028                 runTime.timeName(),
00029                 mesh,
00030                 IOobject::MUST_READ,
00031                 IOobject::AUTO_WRITE
00032             ),
00033             mesh
00034         )
00035     );
00036 }
00037 
00038 
00039 Info<< "Calculating stress field sigmaD\n" << endl;
00040 volSymmTensorField sigmaD
00041 (
00042     IOobject
00043     (
00044         "sigmaD",
00045         runTime.timeName(),
00046         mesh,
00047         IOobject::NO_READ,
00048         IOobject::NO_WRITE
00049     ),
00050     mu*twoSymm(fvc::grad(D)) + lambda*(I*tr(fvc::grad(D)))
00051 );
00052 
00053 Info<< "Calculating explicit part of div(sigma) divSigmaExp\n" << endl;
00054 volVectorField divSigmaExp
00055 (
00056     IOobject
00057     (
00058         "divSigmaExp",
00059         runTime.timeName(),
00060         mesh,
00061         IOobject::NO_READ,
00062         IOobject::NO_WRITE
00063     ),
00064     fvc::div(sigmaD)
00065 );
00066 
00067 if (compactNormalStress)
00068 {
00069     divSigmaExp -= fvc::laplacian(2*mu + lambda, D, "laplacian(DD,D)");
00070 }
00071 else
00072 {
00073     divSigmaExp -= fvc::div((2*mu + lambda)*fvc::grad(D), "div(sigmaD)");
00074 }
00075 
00076 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines