FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1  Info<< "Reading thermophysical properties\n" << 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 
24  volScalarField& p = thermo.p();
25  volScalarField& hs = thermo.hs();
26  const volScalarField& T = thermo.T();
27  const volScalarField& psi = thermo.psi();
28 
29  multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
30 
31  forAll(Y, i)
32  {
33  fields.add(Y[i]);
34  }
35  fields.add(hs);
36 
38  (
39  IOobject
40  (
41  "rho",
42  runTime.timeName(),
43  mesh,
44  IOobject::NO_READ,
45  IOobject::AUTO_WRITE
46  ),
47  thermo.rho()
48  );
49 
50  // lagrangian effective density field - used externally (optional)
52  (
53  IOobject
54  (
55  "rhoEffLagrangian",
56  runTime.timeName(),
57  mesh,
58  IOobject::NO_READ,
59  IOobject::AUTO_WRITE
60  ),
61  mesh,
62  dimensionedScalar("zero", dimDensity, 0.0)
63  );
64 
65  // dynamic pressure field - used externally (optional)
67  (
68  IOobject
69  (
70  "pDyn",
71  runTime.timeName(),
72  mesh,
73  IOobject::NO_READ,
74  IOobject::AUTO_WRITE
75  ),
76  mesh,
77  dimensionedScalar("zero", dimPressure, 0.0)
78  );
79 
80 
81  Info<< "\nReading field U\n" << endl;
83  (
84  IOobject
85  (
86  "U",
87  runTime.timeName(),
88  mesh,
89  IOobject::MUST_READ,
90  IOobject::AUTO_WRITE
91  ),
92  mesh
93  );
94 
96 
97  DimensionedField<scalar, volMesh> kappa
98  (
99  IOobject
100  (
101  "kappa",
102  runTime.timeName(),
103  mesh,
104  IOobject::NO_READ,
105  IOobject::AUTO_WRITE
106  ),
107  mesh,
108  dimensionedScalar("zero", dimless, 0.0)
109  );
110 
111  Info<< "Creating turbulence model\n" << endl;
112  autoPtr<compressible::turbulenceModel> turbulence
113  (
114  compressible::turbulenceModel::New
115  (
116  rho,
117  U,
118  phi,
119  thermo
120  )
121  );
122 
123  Info<< "Creating field DpDt\n" << endl;
125  (
126  "DpDt",
128  );
129 
130  Info<< "\nConstructing explicit enthalpy source" << endl;
132  (
133  "energy",
134  mesh,
136  "hs"
137  );
138 
139  DimensionedField<scalar, volMesh> chemistrySh
140  (
141  IOobject
142  (
143  "chemistry::Sh",
144  runTime.timeName(),
145  mesh,
146  IOobject::NO_READ,
147  IOobject::NO_WRITE
148  ),
149  mesh,
150  dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
151  );