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


C++ fvPatch::faceCells方法代码示例

本文整理汇总了C++中fvPatch::faceCells方法的典型用法代码示例。如果您正苦于以下问题:C++ fvPatch::faceCells方法的具体用法?C++ fvPatch::faceCells怎么用?C++ fvPatch::faceCells使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fvPatch的用法示例。


在下文中一共展示了fvPatch::faceCells方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: forAll

void implicitExtrapolationFvPatchField<Type>::setExtraData(const fvPatch& p){

    const fvMesh& m = p.boundaryMesh().mesh();
    const faceList& meshFaces = m.faces();
    const cellList cells = m.cells();
    const labelList& faceCells = p.faceCells();
    const volVectorField& centers = m.C();

    forAll(faceCells,i){

        const label curCellLabel = faceCells[i];
        const label curPatchFaceLabel = p.patch().start() + i;

        const label secondFace = cells[curCellLabel].opposingFaceLabel(curPatchFaceLabel,meshFaces);
        secondFacesIDs[i] = secondFace;
        const label ownerSecondFace = m.owner()[secondFace];
        const label neighbourSecondFace = m.neighbour()[secondFace];

        if (curCellLabel == ownerSecondFace){
            secondNormalCellIsOwner[i] = 0;
        }
        else{
            secondNormalCellIsOwner[i] = 1;
        }

        secondDeltas[i] = mag(centers[ownerSecondFace] - centers[neighbourSecondFace]);

    }

}
开发者ID:JonasBuenger,项目名称:myFoamStuff,代码行数:30,代码来源:implicitExtrapolationFvPatchField.C

示例2: magGradUw

void epsilonLowReWallFunctionFvPatchScalarField::calculate
(
    const turbulenceModel& turbulence,
    const List<scalar>& cornerWeights,
    const fvPatch& patch,
    scalarField& G,
    scalarField& epsilon
)
{
    const label patchi = patch.index();

    const scalarField& y = turbulence.y()[patchi];

    const scalar Cmu25 = pow025(Cmu_);
    const scalar Cmu75 = pow(Cmu_, 0.75);

    const tmp<volScalarField> tk = turbulence.k();
    const volScalarField& k = tk();

    const tmp<scalarField> tnuw = turbulence.nu(patchi);
    const scalarField& nuw = tnuw();

    const tmp<scalarField> tnutw = turbulence.nut(patchi);
    const scalarField& nutw = tnutw();

    const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchi];

    const scalarField magGradUw(mag(Uw.snGrad()));

    // Set epsilon and G
    forAll(nutw, faceI)
    {
        label cellI = patch.faceCells()[faceI];

        scalar yPlus = Cmu25*sqrt(k[cellI])*y[faceI]/nuw[faceI];

        scalar w = cornerWeights[faceI];

        if (yPlus > yPlusLam_)
        {
            epsilon[cellI] += w*Cmu75*pow(k[cellI], 1.5)/(kappa_*y[faceI]);
        }
        else
        {
            epsilon[cellI] += w*2.0*k[cellI]*nuw[faceI]/sqr(y[faceI]);
        }

        G[cellI] +=
            w
           *(nutw[faceI] + nuw[faceI])
           *magGradUw[faceI]
           *Cmu25*sqrt(k[cellI])
           /(kappa_*y[faceI]);
    }
开发者ID:CDAC-CFD,项目名称:OpenFOAM-2.4.x,代码行数:54,代码来源:epsilonLowReWallFunctionFvPatchScalarField.C

示例3: OFinterpolate

scalarField Foam::OFinterpolate(const fvPatch& patch, const objectRegistry& db, scalarField boundaryTheta){

    const volScalarField& Theta = db.lookupObject<volScalarField>("Theta");
    const vectorField ThetaGradient = fvc::grad(Theta,"leastSquares");
    const vectorField& patchDeltas = patch.delta();     // cell-centre to face-centre vector

    for(int i=0; i<patch.size(); i++){
        boundaryTheta[i] = Theta[patch.faceCells()[i]]
                            + ( ThetaGradient[i] & patchDeltas[i] );
    }

    return boundaryTheta;

}
开发者ID:JonasBuenger,项目名称:myFoamStuff,代码行数:14,代码来源:interpolateThetaAtBoundary.C

示例4: secondNormalFaceIsOwner

//template<class type>
secondNormalBoundaryCells::secondNormalBoundaryCells(const fvPatch& p):
    secondNormalFaceIsOwner(p.size()),
    secondDeltas(p.size()),
    secondFaces(p.size()),
    secondInternalCoeffs(p.size()){

    const fvMesh& m = p.boundaryMesh().mesh();
    const faceList& meshFaces = m.faces();
    const cellList cells = m.cells();
    const labelList& faceCells = p.faceCells();
    const volVectorField& centers = m.C();
    const labelList& neighbours = m.neighbour();
    const labelList& owners = m.owner();

    forAll(faceCells,i){

        const label curCellLabel = faceCells[i];
        const label curPatchFaceLabel = p.patch().start() + i;

        const label secondFace = cells[curCellLabel].opposingFaceLabel(curPatchFaceLabel,meshFaces);
        secondFaces[i] = secondFace;

        if (curCellLabel == m.owner()[secondFace]){

            secondNormalFaceIsOwner[i] = false;
            secondDeltas[i] = mag(centers[curCellLabel] - centers[neighbours[secondFace]]);

        }
        else{

            secondNormalFaceIsOwner[i] = true;
            secondDeltas[i] = mag(centers[curCellLabel] - centers[owners[secondFace]]);

        }

    }



}
开发者ID:JonasBuenger,项目名称:myFoamStuff,代码行数:41,代码来源:secondNormalBoundaryCells.C

示例5: magGradUw

void Foam::epsilonLowReWallFunctionFvPatchScalarField::calculate
(
    const turbulenceModel& turbModel,
    const List<scalar>& cornerWeights,
    const fvPatch& patch,
    scalarField& G0,
    scalarField& epsilon0
)
{
    const label patchi = patch.index();

    const scalarField& y = turbModel.y()[patchi];

    const scalar Cmu25 = pow025(Cmu_);
    const scalar Cmu75 = pow(Cmu_, 0.75);

    const tmp<volScalarField> tk = turbModel.k();
    const volScalarField& k = tk();

    const tmp<scalarField> tnuw = turbModel.nu(patchi);
    const scalarField& nuw = tnuw();

    const tmp<scalarField> tnutw = turbModel.nut(patchi);
    const scalarField& nutw = tnutw();

    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];

    const scalarField magGradUw(mag(Uw.snGrad()));

    const DimensionedField<scalar, volMesh>& G =
        db().lookupObject<DimensionedField<scalar, volMesh> >
        (
            turbModel.GName()
        );

    // Set epsilon and G
    forAll(nutw, facei)
    {
        label celli = patch.faceCells()[facei];

        scalar yPlus = Cmu25*sqrt(k[celli])*y[facei]/nuw[facei];

        scalar w = cornerWeights[facei];

        if (yPlus > yPlusLam_)
        {
            epsilon0[celli] += w*Cmu75*pow(k[celli], 1.5)/(kappa_*y[facei]);

            G0[celli] +=
                w
               *(nutw[facei] + nuw[facei])
               *magGradUw[facei]
               *Cmu25*sqrt(k[celli])
               /(kappa_*y[facei]);
        }
        else
        {
            epsilon0[celli] += w*2.0*k[celli]*nuw[facei]/sqr(y[facei]);
            G0[celli] += G[celli];
        }
    }
开发者ID:Rodbourn,项目名称:OpenFOAM-dev,代码行数:61,代码来源:epsilonLowReWallFunctionFvPatchScalarField.C


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