Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / multiphase / multiphaseInterFoam / createFields.H
blobef92fb9bce6d3c090e08a78a00574343e2e25aa2
1     Info<< "Reading field pd\n" << endl;
2     volScalarField pd
3     (
4         IOobject
5         (
6             "pd",
7             runTime.timeName(),
8             mesh,
9             IOobject::MUST_READ,
10             IOobject::AUTO_WRITE
11         ),
12         mesh
13     );
15     Info<< "Reading field U\n" << endl;
16     volVectorField U
17     (
18         IOobject
19         (
20             "U",
21             runTime.timeName(),
22             mesh,
23             IOobject::MUST_READ,
24             IOobject::AUTO_WRITE
25         ),
26         mesh
27     );
29 #   include "createPhi.H"
31     multiphaseMixture mixture(U, phi);
33     // Need to store rho for ddt(rho, U)
34     volScalarField rho
35     (
36         IOobject
37         (
38             "rho",
39             runTime.timeName(),
40             mesh,
41             IOobject::READ_IF_PRESENT
42         ),
43         mixture.rho()
44     );
45     rho.oldTime();
48     Info<< "Calculating field g.h\n" << endl;
49     volScalarField gh("gh", g & mesh.C());
50     surfaceScalarField ghf("gh", g & mesh.Cf());
52     volScalarField p
53     (
54         IOobject
55         (
56             "p",
57             runTime.timeName(),
58             mesh,
59             IOobject::NO_READ,
60             IOobject::AUTO_WRITE
61         ),
62         pd + rho*gh
63     );
66     label pdRefCell = 0;
67     scalar pdRefValue = 0.0;
68     setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
70     scalar pRefValue = 0.0;
72     if (pd.needReference())
73     {
74         pRefValue = readScalar
75         (
76             mesh.solutionDict().subDict("PISO").lookup("pRefValue")
77         );
79         p += dimensionedScalar
80         (
81             "p",
82             p.dimensions(),
83             pRefValue - getRefCellValue(p, pdRefCell)
84         );
85     }
87     // Construct incompressible turbulence model
88     autoPtr<incompressible::turbulenceModel> turbulence
89     (
90         incompressible::turbulenceModel::New(U, phi, mixture)
91     );