createFields.H
Go to the documentation of this file.
1 Info<< "Reading field p\n" << endl;
3 (
4  IOobject
5  (
6  "p",
7  runTime.name(),
8  mesh,
9  IOobject::MUST_READ,
10  IOobject::AUTO_WRITE
11  ),
12  mesh
13 );
14 
15 Info<< "Reading field U\n" << endl;
17 (
18  IOobject
19  (
20  "U",
21  runTime.name(),
22  mesh,
23  IOobject::MUST_READ,
24  IOobject::AUTO_WRITE
25  ),
26  mesh
27 );
28 
29 #include "createPhi.H"
30 
31 
32 pressureReference pressureReference(p, simple.dict());
33 
34 mesh.schemes().setFluxRequired(p.name());
35 
36 
37 Info<< "Reading field pa\n" << endl;
39 (
40  IOobject
41  (
42  "pa",
43  runTime.name(),
44  mesh,
45  IOobject::MUST_READ,
46  IOobject::AUTO_WRITE
47  ),
48  mesh
49 );
50 
51 Info<< "Reading field Ua\n" << endl;
53 (
54  IOobject
55  (
56  "Ua",
57  runTime.name(),
58  mesh,
59  IOobject::MUST_READ,
60  IOobject::AUTO_WRITE
61  ),
62  mesh
63 );
64 
65 #include "createPhia.H"
66 
67 
68 label paRefCell = 0;
69 scalar paRefValue = 0.0;
71 (
72  pa,
73  simple.dict(),
74  paRefCell,
75  paRefValue
76 );
77 mesh.schemes().setFluxRequired(pa.name());
78 
79 
80 autoPtr<viscosityModel> viscosity(viscosityModel::New(mesh));
81 
82 autoPtr<incompressible::momentumTransportModel> turbulence
83 (
85 );
86 
87 
90 
91 dimensionedScalar lambda(viscosity->lookup("lambda"));
92 dimensionedScalar alphaMax(viscosity->lookup("alphaMax"));
93 
94 const labelList& inletCells = mesh.boundary()["inlet"].faceCells();
95 //const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
96 
98 (
99  IOobject
100  (
101  "alpha",
102  runTime.name(),
103  mesh,
104  IOobject::READ_IF_PRESENT,
105  IOobject::AUTO_WRITE
106  ),
107  lambda*max(Ua & U, zeroSensitivity)
108 );
110 //zeroCells(alpha, outletCells);
111 
112 #include "createFvModels.H"
113 #include "createFvConstraints.H"
Creates and initialises the face-flux field phia.
simpleControl simple(mesh)
volScalarField & p
Definition: createFields.H:23
dimensionedScalar alphaMax(viscosity->lookup("alphaMax"))
const labelList & inletCells
Definition: createFields.H:94
dimensionedScalar zeroSensitivity("0", dimVelocity *dimVelocity, 0.0)
zeroCells(alpha, inletCells)
dimensionedScalar zeroAlpha("0", dimless/dimTime, 0.0)
dimensionedScalar lambda(viscosity->lookup("lambda"))
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
VolField< vector > volVectorField
Definition: volFieldsFwd.H:65
List< label > labelList
A List of labels.
Definition: labelList.H:56
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
const dimensionSet dimless
messageStream Info
const dimensionSet dimTime
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:64
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimVelocity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
bool setRefCell(const volScalarField &field, const volScalarField &fieldRef, const dictionary &dict, label &refCelli, scalar &refValue, const bool forceReference=false)
If the field fieldRef needs referencing find the reference cell nearest.
Definition: findRefCell.C:31
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.name(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating face flux\n"<< endl;surfaceScalarField phi(IOobject("phi", runTime.name(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedScalar(mesh.Sf().dimensions() *U.dimensions(), 0));autoPtr< viscosityModel > viscosity(viscosityModel::New(mesh))
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))
volVectorField U(IOobject("U", runTime.name(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))