Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / combustion / dieselEngineFoam / createFields.H
blob37aeca4c091586b1a6c852afa1228d04d9264a93
1 Info<< nl << "Reading thermophysicalProperties" << endl;
3 autoPtr<psiChemistryModel> pChemistry
5     psiChemistryModel::New(mesh)
6 );
7 psiChemistryModel& chemistry = pChemistry();
9 hsCombustionThermo& thermo = chemistry.thermo();
11 basicMultiComponentMixture& composition = thermo.composition();
12 PtrList<volScalarField>& Y = composition.Y();
14 word inertSpecie(thermo.lookup("inertSpecie"));
16 if (!composition.contains(inertSpecie))
18     FatalErrorIn(args.executable())
19         << "Specified inert specie '" << inertSpecie << "' not found in "
20         << "species list. Available species:" << composition.species()
21         << exit(FatalError);
24 volScalarField rho
26     IOobject
27     (
28         "rho",
29         runTime.timeName(),
30         mesh
31     ),
32     thermo.rho()
35 Info<< "Reading field U\n" << endl;
36 volVectorField U
38     IOobject
39     (
40         "U",
41         runTime.timeName(),
42         mesh,
43         IOobject::MUST_READ,
44         IOobject::AUTO_WRITE
45     ),
46     mesh
50 volScalarField& p = thermo.p();
51 const volScalarField& psi = thermo.psi();
52 const volScalarField& T = thermo.T();
53 volScalarField& hs = thermo.hs();
56 #include "compressibleCreatePhi.H"
58 volScalarField kappa
60     IOobject
61     (
62         "kappa",
63         runTime.timeName(),
64         mesh,
65         IOobject::NO_READ,
66         IOobject::AUTO_WRITE
67     ),
68     mesh,
69     dimensionedScalar("zero", dimless, 0.0)
72 Info << "Creating turbulence model.\n" << nl;
73 autoPtr<compressible::turbulenceModel> turbulence
75     compressible::turbulenceModel::New
76     (
77         rho,
78         U,
79         phi,
80         thermo
81     )
84 Info<< "Creating field DpDt\n" << endl;
85 volScalarField DpDt =
86     fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
89 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
91 forAll(Y, i)
93     fields.add(Y[i]);
95 fields.add(hs);
97 DimensionedField<scalar, volMesh> chemistrySh
99     IOobject
100     (
101         "chemistry::Sh",
102         runTime.timeName(),
103         mesh,
104         IOobject::NO_READ,
105         IOobject::NO_WRITE
106     ),
107     mesh,
108     dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)