OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

createFields.H

Go to the documentation of this file.
00001     Info<< "Reading thermophysical properties\n" << endl;
00002 
00003     autoPtr<psiChemistryModel> pChemistry
00004     (
00005         psiChemistryModel::New(mesh)
00006     );
00007     psiChemistryModel& chemistry = pChemistry();
00008 
00009     hCombustionThermo& thermo = chemistry.thermo();
00010 
00011     basicMultiComponentMixture& composition = thermo.composition();
00012     PtrList<volScalarField>& Y = composition.Y();
00013 
00014     word inertSpecie(thermo.lookup("inertSpecie"));
00015 
00016     volScalarField& p = thermo.p();
00017     volScalarField& h = thermo.h();
00018     const volScalarField& T = thermo.T();
00019     const volScalarField& psi = thermo.psi();
00020 
00021     volScalarField rho
00022     (
00023         IOobject
00024         (
00025             "rho",
00026             runTime.timeName(),
00027             mesh,
00028             IOobject::NO_READ,
00029             IOobject::AUTO_WRITE
00030         ),
00031         thermo.rho()
00032     );
00033 
00034     Info<< "\nReading field U\n" << endl;
00035     volVectorField U
00036     (
00037         IOobject
00038         (
00039             "U",
00040             runTime.timeName(),
00041             mesh,
00042             IOobject::MUST_READ,
00043             IOobject::AUTO_WRITE
00044         ),
00045         mesh
00046     );
00047 
00048     #include "compressibleCreatePhi.H"
00049 
00050     DimensionedField<scalar, volMesh> kappa
00051     (
00052         IOobject
00053         (
00054             "kappa",
00055             runTime.timeName(),
00056             mesh,
00057             IOobject::NO_READ,
00058             IOobject::AUTO_WRITE
00059         ),
00060         mesh,
00061         dimensionedScalar("zero", dimless, 0.0)
00062     );
00063 
00064     Info<< "Creating turbulence model\n" << endl;
00065     autoPtr<compressible::turbulenceModel> turbulence
00066     (
00067         compressible::turbulenceModel::New
00068         (
00069             rho,
00070             U,
00071             phi,
00072             thermo
00073         )
00074     );
00075 
00076     Info<< "Creating field DpDt\n" << endl;
00077     volScalarField DpDt
00078     (
00079         "DpDt",
00080         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
00081     );
00082 
00083     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
00084 
00085     forAll (Y, i)
00086     {
00087         fields.add(Y[i]);
00088     }
00089     fields.add(h);
Copyright © 2000-2009 OpenCFD Ltd