当前位置: 首页>>代码示例>>C++>>正文


C++ volScalarField::boundaryFieldRef方法代码示例

本文整理汇总了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;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:48,代码来源:PoissonPatchDistMethod.C

示例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];
        }
    }
}
开发者ID:luguo15123,项目名称:OpenFOAM-dev,代码行数:48,代码来源:yPlus.C

示例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();
        }
    }
}
开发者ID:EricAlex,项目名称:OpenFOAM-dev,代码行数:19,代码来源:heThermo.C


注:本文中的volScalarField::boundaryFieldRef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。