本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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];
}
}
}
示例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();
}
示例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();
}
}
}
示例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;
}
示例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]);
}
示例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();
}
}
}
示例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_;
}
}
示例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();
}
示例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;
}
示例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();
}
}
}
示例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)
);
}
示例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);
}