本文整理汇总了C++中volScalarField::dimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ volScalarField::dimensions方法的具体用法?C++ volScalarField::dimensions怎么用?C++ volScalarField::dimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volScalarField
的用法示例。
在下文中一共展示了volScalarField::dimensions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inv
Foam::tmp<Foam::volScalarField>
Foam::populationBalanceSubModels::growthModels::constantGrowth::Kg
(
const volScalarField& abscissa
) const
{
dimensionedScalar minAbs
(
"minAbs",
abscissa.dimensions(),
minAbscissa_.value()
);
dimensionedScalar maxAbs
(
"maxAbs",
abscissa.dimensions(),
maxAbscissa_.value()
);
dimensionedScalar CgND
(
"CgND",
inv(abscissa.dimensions())*inv(abscissa.dimensions())*Cg_.dimensions(),
Cg_.value()
);
return CgND*pos(-abscissa+maxAbs)*pos(abscissa-minAbs);
}
示例2: mesh
tmp<typename steadyStateDdtScheme<Type>::fluxFieldType>
steadyStateDdtScheme<Type>::fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& U,
const fluxFieldType& phi
)
{
return tmp<fluxFieldType>
(
new fluxFieldType
(
IOobject
(
"ddtPhiCorr("
+ rA.name() + ',' + rho.name()
+ ',' + U.name() + ',' + phi.name() + ')',
mesh().time().timeName(),
mesh()
),
mesh(),
dimensioned<typename flux<Type>::type>
(
"0",
rA.dimensions()*rho.dimensions()*phi.dimensions()/dimTime,
pTraits<typename flux<Type>::type>::zero
)
)
);
}
示例3: dimensionedScalar
tmp<volScalarField> SpalartAllmarasDDES<BasicTurbulenceModel>::rd
(
const volScalarField& magGradU
) const
{
tmp<volScalarField> tr
(
min
(
this->nuEff()
/(
max
(
magGradU,
dimensionedScalar("SMALL", magGradU.dimensions(), SMALL)
)
*sqr(this->kappa_*this->y_)
),
scalar(10)
)
);
tr.ref().boundaryField() == 0.0;
return tr;
}
示例4: dimensionedScalar
tmp<volScalarField> SpalartAllmarasIDDES::rd
(
const volScalarField& visc,
const volScalarField& S
) const
{
return min
(
visc
/(
max
(
S,
dimensionedScalar("SMALL", S.dimensions(), SMALL)
)*sqr(kappa_*y_)
+ dimensionedScalar
(
"ROOTVSMALL",
dimensionSet(0, 2 , -1, 0, 0),
ROOTVSMALL
)
),
scalar(10)
);
}
示例5: mesh
tmp<GeometricField<Type, fvPatchField, volMesh>>
steadyStateD2dt2Scheme<Type>::fvcD2dt2
(
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return tmp<GeometricField<Type, fvPatchField, volMesh>>
(
new GeometricField<Type, fvPatchField, volMesh>
(
IOobject
(
"d2dt2("+rho.name()+','+vf.name()+')',
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensioned<Type>
(
"0",
rho.dimensions()*vf.dimensions()/dimTime/dimTime,
Zero
)
)
);
}
示例6: dimensionedScalar
Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressureTools::rho
(
const volScalarField& p
) const
{
if (p.dimensions() == dimPressure)
{
return p.mesh().lookupObject<volScalarField>(rhoName_);
}
else
{
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"rho",
p.mesh().time().timeName(),
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar("zero", dimDensity, rhoInf_)
)
);
}
}
示例7: mesh
tmp<GeometricField<Type, fvPatchField, volMesh> >
EulerLocalDdtScheme<Type>::fvcDdt
(
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
const objectRegistry& registry = this->mesh();
// get access to the scalar beta[i]
const scalarField& beta =
registry.lookupObject<scalarField>(deltaTName_);
volScalarField rDeltaT =
1.0/(beta[0]*registry.lookupObject<volScalarField>(deltaTauName_));
IOobject ddtIOobject
(
"ddt("+rho.name()+','+vf.name()+')',
mesh().time().timeName(),
mesh()
);
if (mesh().moving())
{
return tmp<GeometricField<Type, fvPatchField, volMesh> >
(
new GeometricField<Type, fvPatchField, volMesh>
(
ddtIOobject,
mesh(),
rDeltaT.dimensions()*rho.dimensions()*vf.dimensions(),
rDeltaT.internalField()*
(
rho.internalField()*vf.internalField()
- rho.oldTime().internalField()
*vf.oldTime().internalField()*mesh().V0()/mesh().V()
),
rDeltaT.boundaryField()*
(
rho.boundaryField()*vf.boundaryField()
- rho.oldTime().boundaryField()
*vf.oldTime().boundaryField()
)
)
);
}
else
{
return tmp<GeometricField<Type, fvPatchField, volMesh> >
(
new GeometricField<Type, fvPatchField, volMesh>
(
ddtIOobject,
rDeltaT*(rho*vf - rho.oldTime()*vf.oldTime())
)
);
}
}
示例8: fvScalarMatrix
Foam::tmp<Foam::fvScalarMatrix> Foam::combustionModel::R
(
volScalarField& Y
) const
{
return tmp<fvScalarMatrix>
(
new fvScalarMatrix(Y, dimMass/dimTime*Y.dimensions())
);
}
示例9:
Foam::tmp<Foam::volScalarField>
Foam::populationBalanceSubModels::breakupKernels::exponentialBreakup::Kb
(
const volScalarField& abscissa
) const
{
dimensionedScalar minAbs
(
"minAbs",
abscissa.dimensions(),
minAbscissa_.value()
);
return Cb_*pos(abscissa - minAbs)*exp(expCoeff_*pow3(abscissa));
}
示例10:
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;
}
示例11: 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_;
}
}
示例12:
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;
}
示例13: tfvm
tmp<fvMatrix<Type> >
EulerLocalDdtScheme<Type>::fvmDdt
(
const volScalarField& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
const objectRegistry& registry = this->mesh();
// get access to the scalar beta[i]
const scalarField& beta =
registry.lookupObject<scalarField>(deltaTName_);
tmp<fvMatrix<Type> > tfvm
(
new fvMatrix<Type>
(
vf,
rho.dimensions()*vf.dimensions()*dimVol/dimTime
)
);
fvMatrix<Type>& fvm = tfvm();
scalarField rDeltaT =
1.0/(beta[0]*registry.lookupObject<volScalarField>(deltaTauName_).internalField());
fvm.diag() = rDeltaT*rho.internalField()*mesh().V();
if (mesh().moving())
{
fvm.source() = rDeltaT
*rho.oldTime().internalField()
*vf.oldTime().internalField()*mesh().V0();
}
else
{
fvm.source() = rDeltaT
*rho.oldTime().internalField()
*vf.oldTime().internalField()*mesh().V();
}
return tfvm;
}
示例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: null
tmp<typename EulerLocalDdtScheme<Type>::fluxFieldType>
EulerLocalDdtScheme<Type>::fvcDdtPhiCorr
(
const volScalarField& rA,
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& U,
const fluxFieldType& phi
)
{
IOobject ddtIOobject
(
"ddtPhiCorr("
+ rA.name() + ',' + rho.name() + ',' + U.name() + ',' + phi.name() + ')',
mesh().time().timeName(),
mesh()
);
if (mesh().moving())
{
return tmp<fluxFieldType>
(
new fluxFieldType
(
ddtIOobject,
mesh(),
dimensioned<typename flux<Type>::type>
(
"0",
rA.dimensions()*phi.dimensions()/dimTime,
pTraits<typename flux<Type>::type>::zero
)
)
);
}
else
{
const objectRegistry& registry = this->mesh();
// get access to the scalar beta[i]
const scalarField& beta =
registry.lookupObject<scalarField>(deltaTName_);
volScalarField rDeltaT =
1.0/(beta[0]*registry.lookupObject<volScalarField>(deltaTauName_));
if
(
U.dimensions() == dimVelocity
&& phi.dimensions() == dimVelocity*dimArea
)
{
return tmp<fluxFieldType>
(
new fluxFieldType
(
ddtIOobject,
fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())
*(
fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime()
- (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime())
& mesh().Sf())
)
)
);
}
else if
(
U.dimensions() == dimVelocity
&& phi.dimensions() == dimDensity*dimVelocity*dimArea
)
{
return tmp<fluxFieldType>
(
new fluxFieldType
(
ddtIOobject,
fvcDdtPhiCoeff
(
U.oldTime(),
phi.oldTime()/fvc::interpolate(rho.oldTime())
)
*(
fvc::interpolate(rDeltaT*rA*rho.oldTime())
*phi.oldTime()/fvc::interpolate(rho.oldTime())
- (
fvc::interpolate
(
rDeltaT*rA*rho.oldTime()*U.oldTime()
) & mesh().Sf()
)
)
)
);
}
else if
(
U.dimensions() == dimDensity*dimVelocity
&& phi.dimensions() == dimDensity*dimVelocity*dimArea
)
{
//.........这里部分代码省略.........