initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / twoLiquidMixingFoam / createFields.H
blobb94bf6c23e65cb80f5557f2bccd1ecd8e4c23946
1     Info<< "Reading field p\n" << endl;
2     volScalarField p
3     (
4         IOobject
5         (
6             "p",
7             runTime.timeName(),
8             mesh,
9             IOobject::MUST_READ,
10             IOobject::AUTO_WRITE
11         ),
12         mesh
13     );
15     Info<< "Reading field alpha1\n" << endl;
16     volScalarField alpha1
17     (
18         IOobject
19         (
20             "alpha1",
21             runTime.timeName(),
22             mesh,
23             IOobject::MUST_READ,
24             IOobject::AUTO_WRITE
25         ),
26         mesh
27     );
29     Info<< "Reading field U\n" << endl;
30     volVectorField U
31     (
32         IOobject
33         (
34             "U",
35             runTime.timeName(),
36             mesh,
37             IOobject::MUST_READ,
38             IOobject::AUTO_WRITE
39         ),
40         mesh
41     );
43     #include "createPhi.H"
45     Info<< "Reading transportProperties\n" << endl;
46     twoPhaseMixture twoPhaseProperties(U, phi);
48     const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
49     const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
51     dimensionedScalar Dab(twoPhaseProperties.lookup("Dab"));
53     // Read the reciprocal of the turbulent Schmidt number
54     dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab"));
56     // Need to store rho for ddt(rho, U)
57     volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2);
58     rho.oldTime();
61     // Mass flux
62     // Initialisation does not matter because rhoPhi is reset after the
63     // alpha1 solution before it is used in the U equation.
64     surfaceScalarField rhoPhi
65     (
66         IOobject
67         (
68             "rho*phi",
69             runTime.timeName(),
70             mesh,
71             IOobject::NO_READ,
72             IOobject::NO_WRITE
73         ),
74         rho1*phi
75     );
78     label pRefCell = 0;
79     scalar pRefValue = 0.0;
80     setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
83     // Construct incompressible turbulence model
84     autoPtr<incompressible::turbulenceModel> turbulence
85     (
86         incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
87     );