This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/incompressible/boundaryFoam/createFields.H
2018-06-18 10:53:14 +01:00

65 lines
1.3 KiB
C++

Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Creating face flux\n" << endl;
surfaceScalarField phi
(
IOobject
(
"phi",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", mesh.Sf().dimensions()*U.dimensions(), 0.0)
);
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> turbulence
(
incompressible::RASModel::New(U, phi, laminarTransport)
);
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedVector Ubar
(
transportProperties.lookup("Ubar")
);
vector flowDirection = (Ubar/mag(Ubar)).value();
tensor flowMask = sqr(flowDirection);
dimensionedVector gradP
(
"gradP",
dimensionSet(0, 1, -2, 0, 0),
vector(0, 0, 0)
);