ENH: directMappedFixedValue: use different tag
[OpenFOAM-2.0.x.git] / applications / solvers / basic / potentialFoam / createFields.H
blobef3b220257fbc7864f1fd2b9eb6481d09fa6af5c
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::NO_WRITE
11         ),
12         mesh
13     );
15     p = dimensionedScalar("zero", p.dimensions(), 0.0);
18     Info<< "Reading field U\n" << endl;
19     volVectorField U
20     (
21         IOobject
22         (
23             "U",
24             runTime.timeName(),
25             mesh,
26             IOobject::MUST_READ,
27             IOobject::AUTO_WRITE
28         ),
29         mesh
30     );
32     U = dimensionedVector("0", U.dimensions(), vector::zero);
34     surfaceScalarField phi
35     (
36         IOobject
37         (
38             "phi",
39             runTime.timeName(),
40             mesh,
41             IOobject::NO_READ,
42             IOobject::AUTO_WRITE
43         ),
44         fvc::interpolate(U) & mesh.Sf()
45     );
47     if (args.optionFound("initialiseUBCs"))
48     {
49         U.correctBoundaryConditions();
50         phi = fvc::interpolate(U) & mesh.Sf();
51     }
54     label pRefCell = 0;
55     scalar pRefValue = 0.0;
56     setRefCell
57     (
58         p,
59         potentialFlow,
60         pRefCell,
61         pRefValue
62     );