ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / incompressible / adjointShapeOptimizationFoam / createFields.H
blobaf9e9de6bec7b3f33fe32752eb36be6265e69bea
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 U\n" << endl;
16     volVectorField U
17     (
18         IOobject
19         (
20             "U",
21             runTime.timeName(),
22             mesh,
23             IOobject::MUST_READ,
24             IOobject::AUTO_WRITE
25         ),
26         mesh
27     );
29     #include "createPhi.H"
32     label pRefCell = 0;
33     scalar pRefValue = 0.0;
34     setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
37     Info<< "Reading field pa\n" << endl;
38     volScalarField pa
39     (
40         IOobject
41         (
42             "pa",
43             runTime.timeName(),
44             mesh,
45             IOobject::MUST_READ,
46             IOobject::AUTO_WRITE
47         ),
48         mesh
49     );
51     Info<< "Reading field Ua\n" << endl;
52     volVectorField Ua
53     (
54         IOobject
55         (
56             "Ua",
57             runTime.timeName(),
58             mesh,
59             IOobject::MUST_READ,
60             IOobject::AUTO_WRITE
61         ),
62         mesh
63     );
65     #include "createPhia.H"
68     label paRefCell = 0;
69     scalar paRefValue = 0.0;
70     setRefCell
71     (
72         pa,
73         mesh.solutionDict().subDict("SIMPLE"),
74         paRefCell,
75         paRefValue
76     );
79     singlePhaseTransportModel laminarTransport(U, phi);
81     autoPtr<incompressible::RASModel> turbulence
82     (
83         incompressible::RASModel::New(U, phi, laminarTransport)
84     );
87     dimensionedScalar zeroSensitivity("0", dimVelocity*dimVelocity, 0.0);
88     dimensionedScalar zeroAlpha("0", dimless/dimTime, 0.0);
90     dimensionedScalar lambda(laminarTransport.lookup("lambda"));
91     dimensionedScalar alphaMax(laminarTransport.lookup("alphaMax"));
93     const labelList& inletCells = mesh.boundary()["inlet"].faceCells();
94     //const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
96     volScalarField alpha
97     (
98         IOobject
99         (
100             "alpha",
101             runTime.timeName(),
102             mesh,
103             IOobject::READ_IF_PRESENT,
104             IOobject::AUTO_WRITE
105         ),
106         lambda*max(Ua & U, zeroSensitivity)
107     );
108     zeroCells(alpha, inletCells);
109     //zeroCells(alpha, outletCells);