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

createFields.H

Go to the documentation of this file.
00001 Info<< nl << "Reading thermophysicalProperties" << 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 rho
00017 (
00018     IOobject
00019     (
00020         "rho",
00021         runTime.timeName(),
00022         mesh
00023     ),
00024     thermo.rho()
00025 );
00026 
00027 Info<< "Reading field U\n" << endl;
00028 volVectorField U
00029 (
00030     IOobject
00031     (
00032         "U",
00033         runTime.timeName(),
00034         mesh,
00035         IOobject::MUST_READ,
00036         IOobject::AUTO_WRITE
00037     ),
00038     mesh
00039 );
00040 
00041 
00042 volScalarField& p = thermo.p();
00043 const volScalarField& psi = thermo.psi();
00044 const volScalarField& T = thermo.T();
00045 volScalarField& h = thermo.h();
00046 
00047 
00048 #include "compressibleCreatePhi.H"
00049 
00050 volScalarField 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" << nl;
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     fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
00079 
00080 
00081 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
00082 
00083 forAll (Y, i)
00084 {
00085     fields.add(Y[i]);
00086 }
00087 fields.add(h);
Copyright © 2000-2009 OpenCFD Ltd