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


C++ volScalarField类代码示例

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


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

示例1: limit

void Foam::MULES::explicitSolve
(
    const RhoType& rho,
    volScalarField& psi,
    const surfaceScalarField& phi,
    surfaceScalarField& phiPsi,
    const SpType& Sp,
    const SuType& Su,
    const scalar psiMax,
    const scalar psiMin
)
{
    psi.correctBoundaryConditions();
    limit(rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, 3, false);
    explicitSolve(rho, psi, phiPsi, Sp, Su);
}
开发者ID:BigDog123,项目名称:OpenFOAM-2.1.x,代码行数:16,代码来源:MULESTemplates.C

示例2:

Foam::tmp<Foam::volScalarField>
Foam::populationBalanceSubModels::growthModels::constantGrowth::Kg
(
    const volScalarField& abscissa
) const
{
    dimensionedScalar oneAbs
    (
        "oneAbs",
        dimVolume/sqr(abscissa.dimensions()),
        1.0
    );

    return Cg_*pos(-abscissa + maxAbscissa_)
        *pos(abscissa - minAbscissa_)*oneAbs;
}
开发者ID:OpenQBMM,项目名称:OpenQBMM,代码行数:16,代码来源:constantGrowth.C

示例3:

tmp<GeometricField<Type, fvPatchField, volMesh> >
d2dt2
(
    const volScalarField& rho,
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    return fv::d2dt2Scheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().ddtScheme
        (
            "d2dt2(" + rho.name() + ',' + vf.name() + ')'
        )
    )().fvcD2dt2(rho, vf);
}
开发者ID:Haider-BA,项目名称:foam-extend-3.0,代码行数:16,代码来源:fvcD2dt2.C

示例4: nearWallDist

void Foam::functionObjects::yPlus::calcYPlus
(
    const turbulenceModel& turbModel,
    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:mattijsjanssens,项目名称:OpenFOAM-dev,代码行数:47,代码来源:yPlus.C

示例5:

void dense::setScalarAverage
(
    volScalarField& field,
    double**& value,
    double**& weight,
    volScalarField& weightField,
    double**const& mask
) const
{
    label cellI;
    scalar valueScal;
    scalar weightP;

    for(int index=0; index< particleCloud_.numberOfParticles(); index++)
    {
        if(mask[index][0])
        {
            for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
            {
                //Info << "subCell=" << subCell << endl;
                cellI = particleCloud_.cellIDs()[index][subCell];

                if (cellI >= 0)
                {
                    valueScal = value[index][0];
                    weightP = weight[index][0];

                    // first entry in this cell
                    if(weightField[cellI] == 0)
                    {
                        field[cellI] = valueScal;
                        weightField[cellI] = weightP;
                    }
                    else
                    {
                        field[cellI] = (field[cellI]*weightField[cellI]+valueScal*weightP)/(weightField[cellI]+weightP);
                        weightField[cellI] += weightP;
                    }
                }
            }
        }
    }

    // correct cell values to patches
    field.correctBoundaryConditions();
}
开发者ID:wangxiaoliang2012,项目名称:CFDEMcoupling-PUBLIC,代码行数:46,代码来源:dense.C

示例6: if

void Foam::compressibleTwoPhaseMixtureThermo::heBoundaryCorrection(volScalarField& h)
{
    volScalarField::GeometricBoundaryField& hbf = h.boundaryField();

    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:unicfdlab,项目名称:twoPhaseMixingCentralFoam,代码行数:18,代码来源:compressibleTwoPhaseMixtureThermo.C

示例7:

tmp<fvMatrix<Type> >
steadyStateDdtScheme<Type>::fvmDdt
(
    const volScalarField& rho,
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    tmp<fvMatrix<Type> > tfvm
    (
        new fvMatrix<Type>
        (
            vf,
            rho.dimensions()*vf.dimensions()*dimVol/dimTime
        )
    );

    return tfvm;
}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:18,代码来源:steadyStateDdtScheme.C

示例8: Tmin

void Foam::fv::limitTemperature::correct(volScalarField& he)
{
    const basicThermo& thermo =
        mesh_.lookupObject<basicThermo>(basicThermo::dictName);

    scalarField Tmin(cells_.size(), Tmin_);
    scalarField Tmax(cells_.size(), Tmax_);

    scalarField heMin(thermo.he(thermo.p(), Tmin, cells_));
    scalarField heMax(thermo.he(thermo.p(), Tmax, cells_));

    scalarField& hec = he.internalField();

    forAll(cells_, i)
    {
        label cellI = cells_[i];
        hec[cellI]= max(min(hec[cellI], heMax[i]), heMin[i]);
    }
开发者ID:BarisCumhur,项目名称:OpenFOAM-dev,代码行数:18,代码来源:limitTemperature.C

示例9: if

void Foam::basicThermo::hBoundaryCorrection(volScalarField& h)
{
    volScalarField::GeometricBoundaryField& hbf = h.boundaryField();

    forAll(hbf, patchi)
    {
        if (isA<gradientEnthalpyFvPatchScalarField>(hbf[patchi]))
        {
            refCast<gradientEnthalpyFvPatchScalarField>(hbf[patchi]).gradient()
                = hbf[patchi].fvPatchField::snGrad();
        }
        else if (isA<mixedEnthalpyFvPatchScalarField>(hbf[patchi]))
        {
            refCast<mixedEnthalpyFvPatchScalarField>(hbf[patchi]).refGrad()
                = hbf[patchi].fvPatchField::snGrad();
        }
    }
}
开发者ID:degirmen,项目名称:openfoam-extend-OpenFOAM-1.6-ext,代码行数:18,代码来源:basicThermo.C

示例10: FatalErrorIn

Foam::scalar Foam::power::rho(const volScalarField& p) const
{
    if (p.dimensions() == dimPressure)
    {
        return 1.0;
    }
    else
    {
        if (rhoName_ != "rhoInf")
        {
            FatalErrorIn("power::rho(const volScalarField& p)")
                << "Dynamic pressure is expected but kinematic is provided."
                << exit(FatalError);
        }

        return rhoRef_;
    }
}
开发者ID:0Nel,项目名称:foamtools,代码行数:18,代码来源:power.C

示例11: name_

Foam::phaseModel::phaseModel
(
    const word& phaseName,
    const volScalarField& p,
    const volScalarField& T
)
:
    volScalarField
    (
        IOobject
        (
            IOobject::groupName("alpha", phaseName),
            p.mesh().time().timeName(),
            p.mesh(),
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        p.mesh()
    ),
    name_(phaseName),
    p_(p),
    T_(T),
    thermo_(NULL),
    dgdt_
    (
        IOobject
        (
            IOobject::groupName("dgdt", phaseName),
            p.mesh().time().timeName(),
            p.mesh(),
            IOobject::READ_IF_PRESENT,
            IOobject::AUTO_WRITE
        ),
        p.mesh(),
        dimensionedScalar("0", dimless/dimTime, 0)
    )
{
    {
        volScalarField Tp(IOobject::groupName("T", phaseName), T);
        Tp.write();
    }

    thermo_ = rhoThermo::New(p.mesh(), phaseName);
    thermo_->validate(phaseName, "e");

    correct();
}
开发者ID:BarisCumhur,项目名称:OpenFOAM-2.3.x,代码行数:47,代码来源:phaseModel.C

示例12: forAll

wordList mixtureKEpsilon<BasicTurbulenceModel>::epsilonBoundaryTypes
(
    const volScalarField& epsilon
) const
{
    const volScalarField::GeometricBoundaryField& ebf = epsilon.boundaryField();

    wordList ebt = ebf.types();

    forAll(ebf, patchi)
    {
        if (isA<fixedValueFvPatchScalarField>(ebf[patchi]))
        {
            ebt[patchi] = fixedValueFvPatchScalarField::typeName;
        }
    }

    return ebt;
}
开发者ID:billybore,项目名称:OpenFOAM-2.3.x,代码行数:19,代码来源:mixtureKEpsilon.C

示例13: heBoundaryCorrection

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

示例14: dimensionedScalar

tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::rd
(
    const volScalarField& nur,
    const volScalarField& magGradU
) const
{
    return min
    (
        nur
       /(
           max
           (
               magGradU,
               dimensionedScalar("SMALL", magGradU.dimensions(), SMALL)
           )*sqr(this->kappa_*this->y_)
       ),
       scalar(10)
    );
}
开发者ID:aguerrehoracio,项目名称:OpenFOAM-dev,代码行数:19,代码来源:SpalartAllmarasIDDES.C

示例15: path

void writeCellGraph
(
    const volScalarField& vsf,
    const word& graphFormat
)
{
    fileName path(vsf.time().path()/"graphs"/vsf.time().timeName());
    mkDir(path);

    graph
    (
        vsf.name(),
        "x",
        vsf.name(),
        vsf.mesh().C().primitiveField().component(vector::X),
        vsf.primitiveField()
    ).write(path/vsf.name(), graphFormat);
}
开发者ID:EricAlex,项目名称:OpenFOAM-dev,代码行数:18,代码来源:writeCellGraph.C


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