Clean up
[ShipHydroSIG.git] / src / navalFoamVariant2 / createFields.H
blob984365265d972340da98be31d24a42bd68b1e01c
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 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, "alpha1");
49     // Need to store rho for ddt(rho, U)
50     volScalarField rho
51     (
52         IOobject
53         (
54             "rho",
55             runTime.timeName(),
56             mesh,
57             IOobject::READ_IF_PRESENT
58         ),
59         twoPhaseProperties.rho()
60     );
61     rho.oldTime();
64     Info<< "Reading field p\n" << endl;
65     volScalarField p
66     (
67         IOobject
68         (
69             "p",
70             runTime.timeName(),
71             mesh,
72             IOobject::READ_IF_PRESENT,
73             IOobject::AUTO_WRITE
74         ),
75         pd + rho*(g & mesh.C()),
76         pd.boundaryField().types()
77     );
80     label pRefCell = 0;
81     scalar pRefValue = 0.0;
82     setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
83     dimensionedScalar one("one", dimless, 1.0);
85     Info<< "Calculating field g.h\n" << endl;
86     volScalarField gh("gh", g & mesh.C());
87     surfaceScalarField ghf("ghf", g & mesh.Cf());
91     // Construct interface from alpha1 distribution
92     interfaceProperties interface(alpha1, U, twoPhaseProperties);
94      // Construct incompressible turbulence model
95     autoPtr<incompressible::turbulenceModel> turbulence
96     (
97         incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
98     );
100     Info<< "Reading field rAU if present\n" << endl;
101     volScalarField rAU
102     (
103         IOobject
104         (
105             "rAU",
106             runTime.timeName(),
107             mesh,
108             IOobject::READ_IF_PRESENT,
109             IOobject::AUTO_WRITE
110         ),
111         mesh,
112         dimensionedScalar("dt", dimTime, 1.0),
113 //         runTime.deltaT(),
114         zeroGradientFvPatchScalarField::typeName
115     );
117     numericalBeach beach(U);