ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / applications / solvers / lagrangian / porousExplicitSourceReactingParcelFoam / createFields.H
blobcf3f484bdbcb97ef4cccdc73a8154db9bf8b203c
1     Info<< "Reading thermophysical properties\n" << endl;
3     autoPtr<rhoChemistryModel> pChemistry
4     (
5         rhoChemistryModel::New(mesh)
6     );
7     rhoChemistryModel& chemistry = pChemistry();
9     hsReactionThermo& 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))
17     {
18         FatalErrorIn(args.executable())
19             << "Specified inert specie '" << inertSpecie << "' not found in "
20             << "species list. Available species:" << composition.species()
21             << exit(FatalError);
22     }
24     volScalarField& p = thermo.p();
25     volScalarField& hs = thermo.hs();
26     const volScalarField& T = thermo.T();
27     const volScalarField& psi = thermo.psi();
29     volScalarField rho
30     (
31         IOobject
32         (
33             "rho",
34             runTime.timeName(),
35             mesh,
36             IOobject::NO_READ,
37             IOobject::AUTO_WRITE
38         ),
39         thermo.rho()
40     );
42     Info<< "\nReading field U\n" << endl;
43     volVectorField U
44     (
45         IOobject
46         (
47             "U",
48             runTime.timeName(),
49             mesh,
50             IOobject::MUST_READ,
51             IOobject::AUTO_WRITE
52         ),
53         mesh
54     );
56     #include "compressibleCreatePhi.H"
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     );
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     );
84     Info<< "Creating multi-variate interpolation scheme\n" << endl;
85     multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
87     forAll(Y, i)
88     {
89         fields.add(Y[i]);
90     }
91     fields.add(hs);
93     DimensionedField<scalar, volMesh> chemistrySh
94     (
95         IOobject
96         (
97             "chemistry::Sh",
98             runTime.timeName(),
99             mesh,
100             IOobject::NO_READ,
101             IOobject::NO_WRITE
102         ),
103         mesh,
104         dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
105     );