createFields.H
Go to the documentation of this file.
1 Info<< "Reading field p\n" << endl;
3 (
4  IOobject
5  (
6  "p",
7  runTime.timeName(),
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.timeName(),
22  mesh,
23  IOobject::MUST_READ,
24  IOobject::AUTO_WRITE
25  ),
26  mesh
27 );
28 
29 #include "createPhi.H"
30 
31 
33 
34 mesh.schemes().setFluxRequired(p.name());
35 
36 
37 Info<< "Reading field pa\n" << endl;
39 (
40  IOobject
41  (
42  "pa",
43  runTime.timeName(),
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.timeName(),
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.timeName(),
103  mesh,
104  IOobject::READ_IF_PRESENT,
105  IOobject::AUTO_WRITE
106  ),
107  lambda*max(Ua & U, zeroSensitivity)
108 );
109 zeroCells(alpha, inletCells);
110 //zeroCells(alpha, outletCells);
111 
112 #include "createFvModels.H"
113 #include "createFvConstraints.H"
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
pressureReference pressureReference(mixture.p(), p_rgh, pimple.dict(), false)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
dimensionedScalar lambda(viscosity->lookup("lambda"))
zeroCells(alpha, inletCells)
const dimensionSet dimless
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
fvMesh & mesh
volScalarField & p
Definition: createFields.H:25
dimensionedScalar zeroAlpha("0", dimless/dimTime, 0.0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
const dimensionSet dimTime
Info<< "Reading field p\"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, simple.dict());mesh.schemes().setFluxRequired(p.name());Info<< "Reading field pa\"<< endl;volScalarField pa(IOobject("pa", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field Ua\"<< endl;volVectorField Ua(IOobject("Ua", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);# 65 "/home/ubuntu/OpenFOAM-10/applications/solvers/incompressible/adjointShapeOptimisationFoam/createFields.H" 2label paRefCell=0;scalar paRefValue=0.0;setRefCell(pa, simple.dict(), paRefCell, paRefValue);mesh.schemes().setFluxRequired(pa.name());autoPtr< viscosityModel > viscosity(viscosityModel::New(mesh))
phi
Definition: correctPhi.H:3
List< label > labelList
A List of labels.
Definition: labelList.H:56
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
const dimensionSet dimVelocity
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
dimensionedScalar zeroSensitivity("0", dimVelocity *dimVelocity, 0.0)
dimensionedScalar alphaMax(viscosity->lookup("alphaMax"))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
messageStream Info
Creates and initialises the face-flux field phia.
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
simpleControl simple(mesh)