67ab0b5abd
- in FOAM library updated containers backported PackedBoolList, hashedWordList, nullObject, wordRe, backported functions to backported int32 support backported tableReaders backported Function1, TimeFunction1 backported dynamicCode (for codedBCs, ...) -- needs to be mapped out advanced error macros (FatalIOErrorInFunction, ...) -- needs to be mapped out backported IOobject::MUST_READ_IF_MODIFIED and added IOobject::READ_IF_PRESENT_IF_MODIFIED (only in FO) - in postProcessing backported IO FOs (partialWrite, removeRegisteredObject, writeDictionary, writeRegisteredObject) backported field FOs (fieldCoordinateSystemTransform, fieldValues, nearWallFields, processorField, readFields, regionSizeDistribution, streamLine, wallBoundedStreamLine) backported fvTools FOs (calcFvcDiv, calcFvcGrad, calcMag) backported jobControl FOs (abortCalculation) backported utilities FOs (ourantNo, Lambda2, Peclet, Q, codedFunctionObject, pressureTools, residuals, scalarTransport, setTimeStep, timeActivatedFileUpdate, turbulenceFields, vorticity, wallShearStress)
122 lines
3 KiB
C++
122 lines
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);
|
|
|
|
|
|
// Search for wall patches faces and store normals
|
|
|
|
scalar nWallFaces(0);
|
|
vector wallNormal(vector::zero);
|
|
|
|
const fvPatchList& patches = mesh.boundary();
|
|
|
|
forAll(patches, patchi)
|
|
{
|
|
const fvPatch& currPatch = patches[patchi];
|
|
|
|
if (isA<wallFvPatch>(currPatch))
|
|
{
|
|
forAll(currPatch, facei)
|
|
{
|
|
nWallFaces++;
|
|
|
|
if (nWallFaces == 1)
|
|
{
|
|
wallNormal =
|
|
- mesh.Sf().boundaryField()[patchi][facei]
|
|
/mesh.magSf().boundaryField()[patchi][facei];
|
|
}
|
|
else if (nWallFaces == 2)
|
|
{
|
|
vector wallNormal2 =
|
|
mesh.Sf().boundaryField()[patchi][facei]
|
|
/mesh.magSf().boundaryField()[patchi][facei];
|
|
|
|
//- Check that wall faces are parallel
|
|
if
|
|
(
|
|
mag(wallNormal & wallNormal2) > 1.01
|
|
||mag(wallNormal & wallNormal2) < 0.99
|
|
)
|
|
{
|
|
Info<< "boundaryFoam: wall faces are not parallel"
|
|
<< endl
|
|
<< abort(FatalError);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Info<< "boundaryFoam: number of wall faces > 2"
|
|
<< endl
|
|
<< abort(FatalError);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//- create position array for graph generation
|
|
scalarField y = wallNormal & mesh.C().internalField();
|
|
|
|
|
|
dimensionedVector gradP
|
|
(
|
|
"gradP",
|
|
dimensionSet(0, 1, -2, 0, 0),
|
|
vector(0, 0, 0)
|
|
);
|