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 p_rgh\n" << endl;
00002     volScalarField p_rgh
00003     (
00004         IOobject
00005         (
00006             "p_rgh",
00007             runTime.timeName(),
00008             mesh,
00009             IOobject::MUST_READ,
00010             IOobject::AUTO_WRITE
00011         ),
00012         mesh
00013     );
00014 
00015     Info<< "Reading field alpha\n" << endl;
00016     volScalarField alpha
00017     (
00018         IOobject
00019         (
00020             "alpha",
00021             runTime.timeName(),
00022             mesh,
00023             IOobject::MUST_READ,
00024             IOobject::AUTO_WRITE
00025         ),
00026         mesh
00027     );
00028 
00029     Info<< "Reading field U\n" << endl;
00030     volVectorField U
00031     (
00032         IOobject
00033         (
00034             "U",
00035             runTime.timeName(),
00036             mesh,
00037             IOobject::MUST_READ,
00038             IOobject::AUTO_WRITE
00039         ),
00040         mesh
00041     );
00042 
00043 
00044     Info<< "Reading transportProperties\n" << endl;
00045 
00046     IOdictionary transportProperties
00047     (
00048         IOobject
00049         (
00050             "transportProperties",
00051             runTime.constant(),
00052             mesh,
00053             IOobject::MUST_READ,
00054             IOobject::NO_WRITE
00055         )
00056     );
00057 
00058 
00059     dimensionedScalar rhoc
00060     (
00061         transportProperties.lookup("rhoc")
00062     );
00063 
00064     dimensionedScalar rhod
00065     (
00066         transportProperties.lookup("rhod")
00067     );
00068 
00069     dimensionedScalar muc
00070     (
00071         transportProperties.lookup("muc")
00072     );
00073 
00074     dimensionedScalar plasticViscosityCoeff
00075     (
00076         transportProperties.lookup("plasticViscosityCoeff")
00077     );
00078 
00079     dimensionedScalar plasticViscosityExponent
00080     (
00081         transportProperties.lookup("plasticViscosityExponent")
00082     );
00083 
00084     dimensionedScalar yieldStressCoeff
00085     (
00086         transportProperties.lookup("yieldStressCoeff")
00087     );
00088 
00089     dimensionedScalar yieldStressExponent
00090     (
00091         transportProperties.lookup("yieldStressExponent")
00092     );
00093 
00094     dimensionedScalar yieldStressOffset
00095     (
00096         transportProperties.lookup("yieldStressOffset")
00097     );
00098 
00099     Switch BinghamPlastic
00100     (
00101         transportProperties.lookup("BinghamPlastic")
00102     );
00103 
00104     volScalarField rho
00105     (
00106         IOobject
00107         (
00108             "rho",
00109             runTime.timeName(),
00110             mesh,
00111             IOobject::NO_READ,
00112             IOobject::NO_WRITE
00113         ),
00114         (scalar(1) - alpha)*rhoc + alpha*rhod
00115     );
00116 
00117     volScalarField Alpha
00118     (
00119         IOobject
00120         (
00121             "Alpha",
00122             runTime.timeName(),
00123             mesh,
00124             IOobject::NO_READ,
00125             IOobject::AUTO_WRITE
00126         ),
00127         alpha*rhod/rho,
00128         alpha.boundaryField().types()
00129     );
00130 
00131     #include <finiteVolume/compressibleCreatePhi.H>
00132 
00133 
00134     Info<< "Calculating field mul\n" << endl;
00135     volScalarField mul
00136     (
00137         IOobject
00138         (
00139             "mul",
00140             runTime.timeName(),
00141             mesh,
00142             IOobject::NO_READ,
00143             IOobject::AUTO_WRITE
00144         ),
00145         muc +
00146         plasticViscosity
00147         (
00148             plasticViscosityCoeff,
00149             plasticViscosityExponent,
00150             Alpha
00151         )
00152     );
00153 
00154 
00155     Info<< "Initialising field Vdj\n" << endl;
00156     volVectorField Vdj
00157     (
00158         IOobject
00159         (
00160             "Vdj",
00161             runTime.timeName(),
00162             mesh,
00163             IOobject::NO_READ,
00164             IOobject::AUTO_WRITE
00165         ),
00166         mesh,
00167         dimensionedVector("0.0", U.dimensions(), vector::zero),
00168         U.boundaryField().types()
00169     );
00170 
00171 
00172     Info<< "Selecting Drift-Flux model " << endl;
00173 
00174     word VdjModel
00175     (
00176         transportProperties.lookup("VdjModel")
00177     );
00178 
00179     Info<< tab << VdjModel << " selected\n" << endl;
00180 
00181     const dictionary& VdjModelCoeffs
00182     (
00183         transportProperties.subDict(VdjModel + "Coeffs")
00184     );
00185 
00186     dimensionedVector V0
00187     (
00188         VdjModelCoeffs.lookup("V0")
00189     );
00190 
00191     dimensionedScalar a
00192     (
00193         VdjModelCoeffs.lookup("a")
00194     );
00195 
00196     dimensionedScalar a1
00197     (
00198         VdjModelCoeffs.lookup("a1")
00199     );
00200 
00201     dimensionedScalar alphaMin
00202     (
00203         VdjModelCoeffs.lookup("alphaMin")
00204     );
00205 
00206 
00207 
00208     IOdictionary RASProperties
00209     (
00210         IOobject
00211         (
00212             "RASProperties",
00213             runTime.constant(),
00214             mesh,
00215             IOobject::MUST_READ,
00216             IOobject::NO_WRITE
00217         )
00218     );
00219 
00220 
00221     Switch turbulence
00222     (
00223         RASProperties.lookup("turbulence")
00224     );
00225 
00226     dictionary kEpsilonDict
00227     (
00228         RASProperties.subDictPtr("kEpsilonCoeffs")
00229     );
00230 
00231     dimensionedScalar Cmu
00232     (
00233         dimensionedScalar::lookupOrAddToDict
00234         (
00235             "Cmu",
00236             kEpsilonDict,
00237             0.09
00238         )
00239     );
00240 
00241     dimensionedScalar C1
00242     (
00243         dimensionedScalar::lookupOrAddToDict
00244         (
00245             "C1",
00246             kEpsilonDict,
00247             1.44
00248         )
00249     );
00250 
00251     dimensionedScalar C2
00252     (
00253         dimensionedScalar::lookupOrAddToDict
00254         (
00255             "C2",
00256             kEpsilonDict,
00257             1.92
00258         )
00259     );
00260 
00261     dimensionedScalar C3
00262     (
00263         dimensionedScalar::lookupOrAddToDict
00264         (
00265             "C3",
00266             kEpsilonDict,
00267             0.85
00268         )
00269     );
00270 
00271     dimensionedScalar alphak
00272     (
00273         dimensionedScalar::lookupOrAddToDict
00274         (
00275             "alphaEps",
00276             kEpsilonDict,
00277             1.0
00278         )
00279     );
00280 
00281     dimensionedScalar alphaEps
00282     (
00283         dimensionedScalar::lookupOrAddToDict
00284         (
00285             "alphaEps",
00286             kEpsilonDict,
00287             0.76923
00288         )
00289     );
00290 
00291     dictionary wallFunctionDict
00292     (
00293         RASProperties.subDictPtr("wallFunctionCoeffs")
00294     );
00295 
00296     dimensionedScalar kappa
00297     (
00298         dimensionedScalar::lookupOrAddToDict
00299         (
00300             "kappa",
00301             wallFunctionDict,
00302             0.41
00303         )
00304     );
00305 
00306     dimensionedScalar E
00307     (
00308         dimensionedScalar::lookupOrAddToDict
00309         (
00310             "E",
00311             wallFunctionDict,
00312             9.0
00313         )
00314     );
00315 
00316     if (RASProperties.lookupOrDefault<Switch>("printCoeffs", false))
00317     {
00318         Info<< "kEpsilonCoeffs" << kEpsilonDict << nl
00319             << "wallFunctionCoeffs" << wallFunctionDict << endl;
00320     }
00321 
00322 
00323     nearWallDist y(mesh);
00324 
00325     Info<< "Reading field k\n" << endl;
00326     volScalarField k
00327     (
00328         IOobject
00329         (
00330             "k",
00331             runTime.timeName(),
00332             mesh,
00333             IOobject::MUST_READ,
00334             IOobject::AUTO_WRITE
00335         ),
00336         mesh
00337     );
00338 
00339     Info<< "Reading field epsilon\n" << endl;
00340     volScalarField epsilon
00341     (
00342         IOobject
00343         (
00344             "epsilon",
00345             runTime.timeName(),
00346             mesh,
00347             IOobject::MUST_READ,
00348             IOobject::AUTO_WRITE
00349         ),
00350         mesh
00351     );
00352 
00353     Info<< "Calculating field mut\n" << endl;
00354     volScalarField mut
00355     (
00356         IOobject
00357         (
00358             "mut",
00359             runTime.timeName(),
00360             mesh,
00361             IOobject::NO_READ,
00362             IOobject::AUTO_WRITE
00363         ),
00364         Cmu*rho*sqr(k)/epsilon
00365     );
00366 
00367 
00368     Info<< "Calculating field mu\n" << endl;
00369     volScalarField mu
00370     (
00371         IOobject
00372         (
00373             "mu",
00374             runTime.timeName(),
00375             mesh,
00376             IOobject::NO_READ,
00377             IOobject::AUTO_WRITE
00378         ),
00379         mut + mul
00380     );
00381 
00382 
00383     Info<< "Calculating field (g.h)f\n" << endl;
00384     volScalarField gh("gh", g & mesh.C());
00385     surfaceScalarField ghf = surfaceScalarField("gh", g & mesh.Cf());
00386 
00387     volScalarField p
00388     (
00389         IOobject
00390         (
00391             "p",
00392             runTime.timeName(),
00393             mesh,
00394             IOobject::NO_READ,
00395             IOobject::AUTO_WRITE
00396         ),
00397         p_rgh + rho*gh
00398     );
00399 
00400     label pRefCell = 0;
00401     scalar pRefValue = 0.0;
00402     setRefCell
00403     (
00404         p,
00405         p_rgh,
00406         mesh.solutionDict().subDict("PISO"),
00407         pRefCell,
00408         pRefValue
00409     );
00410 
00411     if (p_rgh.needReference())
00412     {
00413         p += dimensionedScalar
00414         (
00415             "p",
00416             p.dimensions(),
00417             pRefValue - getRefCellValue(p, pRefCell)
00418         );
00419         p_rgh = p - rho*gh;
00420     }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines