initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / interPhaseChangeFoam / createFields.H
blob98d166214b2ca5d34fa2aa554dfab679e16df7ee
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<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
46     autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
47         phaseChangeTwoPhaseMixture::New(U, phi);
49     const dimensionedScalar& rho1 = twoPhaseProperties->rho1();
50     const dimensionedScalar& rho2 = twoPhaseProperties->rho2();
51     const dimensionedScalar& pSat = twoPhaseProperties->pSat();
53     // Need to store rho for ddt(rho, U)
54     volScalarField rho
55     (
56         IOobject
57         (
58             "rho",
59             runTime.timeName(),
60             mesh,
61             IOobject::READ_IF_PRESENT
62         ),
63         alpha1*rho1 + (scalar(1) - alpha1)*rho2,
64         alpha1.boundaryField().types()
65     );
66     rho.oldTime();
69     label pRefCell = 0;
70     scalar pRefValue = 0.0;
71     setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
74     // Construct interface from alpha1 distribution
75     interfaceProperties interface(alpha1, U, twoPhaseProperties());
77     // Construct incompressible turbulence model
78     autoPtr<incompressible::turbulenceModel> turbulence
79     (
80         incompressible::turbulenceModel::New(U, phi, twoPhaseProperties())
81     );