initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / bubbleFoam / createFields.H
blob9367838a52bcfa3d43337c70396d7c865e4c2504
1     Info<< "Reading field alpha\n" << endl;
2     volScalarField alpha
3     (
4         IOobject
5         (
6             "alpha",
7             runTime.timeName(),
8             mesh,
9             IOobject::MUST_READ,
10             IOobject::AUTO_WRITE
11         ),
12         mesh
13     );
15     volScalarField beta
16     (
17         IOobject
18         (
19             "beta",
20             runTime.timeName(),
21             mesh,
22             IOobject::NO_READ,
23             IOobject::NO_WRITE
24         ),
25         scalar(1) - alpha
26         //,alpha.boundaryField().types()
27     );
29     Info<< "Reading field p\n" << endl;
30     volScalarField p
31     (
32         IOobject
33         (
34             "p",
35             runTime.timeName(),
36             mesh,
37             IOobject::MUST_READ,
38             IOobject::AUTO_WRITE
39         ),
40         mesh
41     );
43     Info<< "Reading field Ua\n" << endl;
44     volVectorField Ua
45     (
46         IOobject
47         (
48             "Ua",
49             runTime.timeName(),
50             mesh,
51             IOobject::MUST_READ,
52             IOobject::AUTO_WRITE
53         ),
54         mesh
55     );
57     Info<< "Reading field Ub\n" << endl;
58     volVectorField Ub
59     (
60         IOobject
61         (
62             "Ub",
63             runTime.timeName(),
64             mesh,
65             IOobject::MUST_READ,
66             IOobject::AUTO_WRITE
67         ),
68         mesh
69     );
71     volVectorField U
72     (
73         IOobject
74         (
75             "U",
76             runTime.timeName(),
77             mesh,
78             IOobject::NO_READ,
79             IOobject::AUTO_WRITE
80         ),
81         alpha*Ua + beta*Ub
82     );
85     Info<< "Reading transportProperties\n" << endl;
87     IOdictionary transportProperties
88     (
89         IOobject
90         (
91             "transportProperties",
92             runTime.constant(),
93             mesh,
94             IOobject::MUST_READ,
95             IOobject::NO_WRITE
96         )
97     );
99     dimensionedScalar rhoa
100     (
101         transportProperties.lookup("rhoa")
102     );
104     dimensionedScalar rhob
105     (
106         transportProperties.lookup("rhob")
107     );
109     dimensionedScalar nua
110     (
111         transportProperties.lookup("nua")
112     );
114     dimensionedScalar nub
115     (
116         transportProperties.lookup("nub")
117     );
119     dimensionedScalar da
120     (
121         transportProperties.lookup("da")
122     );
124     dimensionedScalar db
125     (
126         transportProperties.lookup("db")
127     );
129     dimensionedScalar Cvm
130     (
131         transportProperties.lookup("Cvm")
132     );
134     dimensionedScalar Cl
135     (
136         transportProperties.lookup("Cl")
137     );
139     dimensionedScalar Ct
140     (
141         transportProperties.lookup("Ct")
142     );
144     #include "createPhia.H"
145     #include "createPhib.H"
147     surfaceScalarField phi
148     (
149         IOobject
150         (
151             "phi",
152             runTime.timeName(),
153             mesh
154         ),
155         fvc::interpolate(alpha)*phia
156       + fvc::interpolate(beta)*phib
157     );
159     volScalarField rho
160     (
161         IOobject
162         (
163             "rho",
164             runTime.timeName(),
165             mesh
166         ),
167         alpha*rhoa + beta*rhob
168     );
170     #include "createRASTurbulence.H"
172     Info<< "Calculating field DDtUa and DDtUb\n" << endl;
174     volVectorField DDtUa =
175         fvc::ddt(Ua)
176       + fvc::div(phia, Ua)
177       - fvc::div(phia)*Ua;
179     volVectorField DDtUb =
180         fvc::ddt(Ub)
181       + fvc::div(phib, Ub)
182       - fvc::div(phib)*Ub;
185     Info<< "Calculating field g.h\n" << endl;
186     volScalarField gh("gh", g & mesh.C());
189     label pRefCell = 0;
190     scalar pRefValue = 0.0;
191     setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);