本文整理汇总了C++中volVectorField::boundaryField方法的典型用法代码示例。如果您正苦于以下问题:C++ volVectorField::boundaryField方法的具体用法?C++ volVectorField::boundaryField怎么用?C++ volVectorField::boundaryField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volVectorField
的用法示例。
在下文中一共展示了volVectorField::boundaryField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void calcYPlus
(
const TurbulenceModel& turbulenceModel,
const fvMesh& mesh,
const volVectorField& U,
volScalarField& yPlus
)
{
volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
const volScalarField::GeometricBoundaryField nutBf =
turbulenceModel->nut()().boundaryField();
const volScalarField::GeometricBoundaryField nuEffBf =
turbulenceModel->nuEff()().boundaryField();
const volScalarField::GeometricBoundaryField nuBf =
turbulenceModel->nu()().boundaryField();
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
{
const fvPatch& patch = patches[patchi];
if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]))
{
const nutWallFunctionFvPatchScalarField& nutPf =
dynamic_cast<const nutWallFunctionFvPatchScalarField&>
(
nutBf[patchi]
);
yPlus.boundaryField()[patchi] = nutPf.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << nutPf.patch().name()
<< ", wall-function " << nutPf.type()
<< ", y+ : min: " << gMin(Yp) << " max: " << gMax(Yp)
<< " average: " << gAverage(Yp) << nl << endl;
}
else if (isA<wallFvPatch>(patch))
{
yPlus.boundaryField()[patchi] =
d[patchi]
*sqrt
(
nuEffBf[patchi]
*mag(U.boundaryField()[patchi].snGrad())
)/nuBf[patchi];
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << patch.name()
<< " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp)
<< " average: " << gAverage(Yp) << nl << endl;
}
}
}
示例2: sum
Foam::scalar Foam::fv::patchMeanVelocityForce::magUbarAve
(
const volVectorField& U
) const
{
vector2D sumAmagUsumA
(
sum
(
(flowDir_ & U.boundaryField()[patchi_])
*mesh_.boundary()[patchi_].magSf()
),
sum(mesh_.boundary()[patchi_].magSf())
);
// If the mean velocity force is applied to a cyclic patch
// for parallel runs include contributions from processorCyclic patches
// generated from the decomposition of the cyclic patch
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
if (Pstream::parRun() && isA<cyclicPolyPatch>(patches[patchi_]))
{
labelList processorCyclicPatches
(
processorCyclicPolyPatch::patchIDs(patch_, patches)
);
forAll(processorCyclicPatches, pcpi)
{
const label patchi = processorCyclicPatches[pcpi];
sumAmagUsumA.x() +=
sum
(
(flowDir_ & U.boundaryField()[patchi])
*mesh_.boundary()[patchi].magSf()
);
sumAmagUsumA.y() += sum(mesh_.boundary()[patchi].magSf());
}
}
示例3: piston
void Foam::twoStrokeEngine::setBoundaryVelocity(volVectorField& U)
{
vector pistonVel = piston().cs().axis()*engTime().pistonSpeed().value();
// On the piston movingWallVelocity is used.
// There is no need to update the piston velocity
forAll (scavInPortPatches_, patchi)
{
const label curPatchID =
boundaryMesh().findPatchID(scavInPortPatches_[patchi]);
U.boundaryField()[curPatchID] == pistonVel;
}
}
示例4: nuEff
void Foam::yPlusLES::calcIncompressibleYPlus
(
const fvMesh& mesh,
const volVectorField& U,
volScalarField& yPlus
)
{
const incompressible::LESModel& model =
mesh.lookupObject<incompressible::LESModel>("LESProperties");
volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
volScalarField nuEff(model.nuEff());
const fvPatchList& patches = mesh.boundary();
const volScalarField nuLam(model.nu());
bool foundPatch = false;
forAll(patches, patchI)
{
const fvPatch& currPatch = patches[patchI];
if (isA<wallFvPatch>(currPatch))
{
foundPatch = true;
yPlus.boundaryField()[patchI] =
d[patchI]
*sqrt
(
nuEff.boundaryField()[patchI]
*mag(U.boundaryField()[patchI].snGrad())
)
/nuLam.boundaryField()[patchI];
const scalarField& Yp = yPlus.boundaryField()[patchI];
scalar minYp = gMin(Yp);
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
Info<< " patch " << currPatch.name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
}
if (Pstream::master())
{
file() << obr_.time().value() << token::TAB
<< currPatch.name() << token::TAB
<< minYp << token::TAB << maxYp << token::TAB
<< avgYp << endl;
}
}
}
if (log_ && !foundPatch)
{
Info<< " no " << wallFvPatch::typeName << " patches" << endl;
}
}