FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1 Info<< nl << "Reading thermophysicalProperties" << endl;
2 
3 autoPtr<psiChemistryModel> pChemistry
4 (
5  psiChemistryModel::New(mesh)
6 );
7 psiChemistryModel& chemistry = pChemistry();
8 
9 hsCombustionThermo& thermo = chemistry.thermo();
10 
11 basicMultiComponentMixture& composition = thermo.composition();
12 PtrList<volScalarField>& Y = composition.Y();
13 
14 word inertSpecie(thermo.lookup("inertSpecie"));
15 
16 if (!composition.contains(inertSpecie))
17 {
19  << "Specified inert specie '" << inertSpecie << "' not found in "
20  << "species list. Available species:" << composition.species()
21  << exit(FatalError);
22 }
23 
25 (
26  IOobject
27  (
28  "rho",
29  runTime.timeName(),
30  mesh
31  ),
32  thermo.rho()
33 );
34 
35 Info<< "Reading field U\n" << endl;
37 (
38  IOobject
39  (
40  "U",
41  runTime.timeName(),
42  mesh,
43  IOobject::MUST_READ,
44  IOobject::AUTO_WRITE
45  ),
46  mesh
47 );
48 
49 
50 volScalarField& p = thermo.p();
51 const volScalarField& psi = thermo.psi();
52 const volScalarField& T = thermo.T();
53 volScalarField& hs = thermo.hs();
54 
55 
57 
59 (
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)
70 );
71 
72 Info << "Creating turbulence model.\n" << nl;
73 autoPtr<compressible::turbulenceModel> turbulence
74 (
75  compressible::turbulenceModel::New
76  (
77  rho,
78  U,
79  phi,
80  thermo
81  )
82 );
83 
84 Info<< "Creating field DpDt\n" << endl;
87 
88 
89 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
90 
91 forAll(Y, i)
92 {
93  fields.add(Y[i]);
94 }
95 fields.add(hs);
96 
97 DimensionedField<scalar, volMesh> chemistrySh
98 (
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)
109 );