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 
30  (
31  IOobject
32  (
33  "rho",
34  runTime.timeName(),
35  mesh,
36  IOobject::NO_READ,
37  IOobject::AUTO_WRITE
38  ),
39  thermo.rho()
40  );
41 
42  Info<< "\nReading field U\n" << endl;
44  (
45  IOobject
46  (
47  "U",
48  runTime.timeName(),
49  mesh,
50  IOobject::MUST_READ,
51  IOobject::AUTO_WRITE
52  ),
53  mesh
54  );
55 
57 
58  DimensionedField<scalar, volMesh> kappa
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" << endl;
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;
86  (
87  "DpDt",
89  );
90 
91  multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
92 
93  forAll(Y, i)
94  {
95  fields.add(Y[i]);
96  }
97  fields.add(hs);
98 
99  DimensionedField<scalar, volMesh> chemistrySh
100  (
101  IOobject
102  (
103  "chemistry::Sh",
104  runTime.timeName(),
105  mesh,
106  IOobject::NO_READ,
107  IOobject::NO_WRITE
108  ),
109  mesh,
110  dimensionedScalar("chemistry::Sh", dimEnergy/dimTime/dimVolume, 0.0)
111  );