FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1 Info<< nl << "Reading thermophysicalProperties" << endl;
2 autoPtr<rhoChemistryModel> pChemistry
3 (
4  rhoChemistryModel::New(mesh)
5 );
6 rhoChemistryModel& chemistry = pChemistry();
7 
8 hsReactionThermo& thermo = chemistry.thermo();
9 
10 basicMultiComponentMixture& composition = thermo.composition();
11 PtrList<volScalarField>& Y = composition.Y();
12 
13 word inertSpecie(thermo.lookup("inertSpecie"));
14 
16 (
17  IOobject
18  (
19  "rho",
20  runTime.timeName(),
21  mesh
22  ),
23  thermo.rho()
24 );
25 
26 Info<< "Reading field U\n" << endl;
28 (
29  IOobject
30  (
31  "U",
32  runTime.timeName(),
33  mesh,
34  IOobject::MUST_READ,
35  IOobject::AUTO_WRITE
36  ),
37  mesh
38 );
39 
40 
41 volScalarField& p = thermo.p();
42 const volScalarField& psi = thermo.psi();
43 volScalarField& hs = thermo.hs();
44 const volScalarField& T = thermo.T();
45 
46 
48 
50 (
51  IOobject
52  (
53  "kappa",
54  runTime.timeName(),
55  mesh,
56  IOobject::NO_READ,
57  IOobject::AUTO_WRITE
58  ),
59  mesh,
60  dimensionedScalar("zero", dimless, 0.0)
61 );
62 
63 Info << "Creating turbulence model.\n" << nl;
64 autoPtr<compressible::turbulenceModel> turbulence
65 (
66  compressible::turbulenceModel::New
67  (
68  rho,
69  U,
70  phi,
71  thermo
72  )
73 );
74 
75 Info<< "Creating field DpDt\n" << endl;
78 
79 multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
80 
81 forAll(Y, i)
82 {
83  fields.add(Y[i]);
84 }
85 fields.add(hs);
86 
87 DimensionedField<scalar, volMesh> chemistrySh
88 (
89  IOobject
90  (
91  "chemistry::Sh",
92  runTime.timeName(),
93  mesh,
94  IOobject::NO_READ,
95  IOobject::NO_WRITE
96  ),
97  mesh,
98  dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
99 );