本文整理汇总了C++中volScalarField::boundaryFieldRef方法的典型用法代码示例。如果您正苦于以下问题:C++ volScalarField::boundaryFieldRef方法的具体用法?C++ volScalarField::boundaryFieldRef怎么用?C++ volScalarField::boundaryFieldRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volScalarField
的用法示例。
在下文中一共展示了volScalarField::boundaryFieldRef方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gradyPsi
bool Foam::patchDistMethods::Poisson::correct
(
volScalarField& y,
volVectorField& n
)
{
if (!tyPsi_.valid())
{
tyPsi_ = tmp<volScalarField>
(
volScalarField::New
(
"yPsi",
mesh_,
dimensionedScalar(sqr(dimLength), 0),
y.boundaryFieldRef().types()
)
);
}
volScalarField& yPsi = tyPsi_.ref();
solve(fvm::laplacian(yPsi) == dimensionedScalar(dimless, -1.0));
volVectorField gradyPsi(fvc::grad(yPsi));
volScalarField magGradyPsi(mag(gradyPsi));
y = sqrt(magSqr(gradyPsi) + 2*yPsi) - magGradyPsi;
// Cache yPsi if the mesh is moving otherwise delete
if (!mesh_.changing())
{
tyPsi_.clear();
}
// Only calculate n if the field is defined
if (notNull(n))
{
n =
-gradyPsi
/max
(
magGradyPsi,
dimensionedScalar(dimLength, small)
);
}
return true;
}
示例2: if
void Foam::functionObjects::yPlus::calcYPlus
(
const turbulenceModel& turbModel,
const fvMesh& mesh,
volScalarField& yPlus
)
{
volScalarField::Boundary d = nearWallDist(mesh).y();
const volScalarField::Boundary nutBf =
turbModel.nut()().boundaryField();
const volScalarField::Boundary nuEffBf =
turbModel.nuEff()().boundaryField();
const volScalarField::Boundary nuBf =
turbModel.nu()().boundaryField();
const fvPatchList& patches = mesh.boundary();
volScalarField::Boundary& yPlusBf = yPlus.boundaryFieldRef();
forAll(patches, patchi)
{
const fvPatch& patch = patches[patchi];
if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]))
{
const nutWallFunctionFvPatchScalarField& nutPf =
dynamic_cast<const nutWallFunctionFvPatchScalarField&>
(
nutBf[patchi]
);
yPlusBf[patchi] = nutPf.yPlus();
}
else if (isA<wallFvPatch>(patch))
{
yPlusBf[patchi] =
d[patchi]
*sqrt
(
nuEffBf[patchi]
*mag(turbModel.U().boundaryField()[patchi].snGrad())
)/nuBf[patchi];
}
}
}
示例3: if
void Foam::heThermo<BasicThermo, MixtureType>::
heBoundaryCorrection(volScalarField& h)
{
volScalarField::Boundary& hBf = h.boundaryFieldRef();
forAll(hBf, patchi)
{
if (isA<gradientEnergyFvPatchScalarField>(hBf[patchi]))
{
refCast<gradientEnergyFvPatchScalarField>(hBf[patchi]).gradient()
= hBf[patchi].fvPatchField::snGrad();
}
else if (isA<mixedEnergyFvPatchScalarField>(hBf[patchi]))
{
refCast<mixedEnergyFvPatchScalarField>(hBf[patchi]).refGrad()
= hBf[patchi].fvPatchField::snGrad();
}
}
}