Backported potentialFoam and potentialDyMFoam (setFluxRequired, solutionControls...
[foam-extend-4.0.git] / applications / solvers / basic / potentialFoam / createFields.H
blob108ad4e6d91106cf68b187a3882f3a61d166e8f0
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.internalField() = 0;
17     Info<< "Reading field U\n" << endl;
18     volVectorField U
19     (
20         IOobject
21         (
22             "U",
23             runTime.timeName(),
24             mesh,
25             IOobject::MUST_READ,
26             IOobject::AUTO_WRITE
27         ),
28         mesh
29     );
31     if (args.optionFound("resetU"))
32     {
33         U.internalField() = vector::zero;
34     }
36     surfaceScalarField phi
37     (
38         IOobject
39         (
40             "phi",
41             runTime.timeName(),
42             mesh,
43             IOobject::NO_READ,
44             IOobject::AUTO_WRITE
45         ),
46         fvc::interpolate(U) & mesh.Sf()
47     );
50     label pRefCell = 0;
51     scalar pRefValue = 0.0;
52     setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
53     mesh.schemesDict().setFluxRequired(p.name());