本文整理汇总了C++中dimensionedScalar类的典型用法代码示例。如果您正苦于以下问题:C++ dimensionedScalar类的具体用法?C++ dimensionedScalar怎么用?C++ dimensionedScalar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dimensionedScalar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pow
tmp<DimensionedField<scalar, GeoMesh> > pow
(
const dimensionedScalar& ds,
const DimensionedField<scalar, GeoMesh>& dsf
)
{
tmp<DimensionedField<scalar, GeoMesh> > tPow
(
new DimensionedField<scalar, GeoMesh>
(
IOobject
(
"pow(" + ds.name() + ',' + dsf.name() + ')',
dsf.instance(),
dsf.db()
),
dsf.mesh(),
pow(ds, dsf.dimensions())
)
);
pow(tPow().getField(), ds.value(), dsf.getField());
return tPow;
}
开发者ID:Kiiree,项目名称:RapidCFD-dev,代码行数:25,代码来源:DimensionedScalarField.C
示例2: bound
void Foam::bound(volScalarField& vsf, const dimensionedScalar& vsf0)
{
scalar minVsf = min(vsf).value();
if (minVsf < vsf0.value())
{
Info<< "bounding " << vsf.name()
<< ", min: " << gMin(vsf.internalField())
<< " max: " << gMax(vsf.internalField())
<< " average: " << gAverage(vsf.internalField())
<< endl;
vsf.internalField() = max
(
max
(
vsf.internalField(),
fvc::average(max(vsf, vsf0))().internalField()
// Bug fix: was assuming bound on zero. HJ, 25/Nov/2008
*pos(vsf0.value() - vsf.internalField())
),
vsf0.value()
);
vsf.correctBoundaryConditions();
vsf.boundaryField() = max(vsf.boundaryField(), vsf0.value());
}
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Core-OpenFOAM-1.5-dev,代码行数:28,代码来源:bound.C
示例3: unitNormal
vector horizontalVelocityField::streamfunctionAt
(
const point& p,
const Time& t
) const
{
const vector unitNormal(0, -1, 0);
const dimensionedScalar z("z", dimLength, p.z());
dimensionedScalar psi("psi", cmptMultiply(dimVelocity, dimLength), scalar(0));
if (z.value() <= z1.value())
{
// psi is zero
}
else if (z.value() <= z2.value())
{
psi = -0.5*u0*(z - z1 - (z2-z1)/M_PI*Foam::sin(M_PI*(z-z1)/(z2-z1)));
}
else
{
psi = -0.5*u0*(2*z - z2 - z1);
}
return unitNormal * psi.value();
}
开发者ID:AtmosFOAM,项目名称:AtmosFOAM-tools,代码行数:25,代码来源:horizontalVelocityField.C
示例4: mesh
tmp<GeometricField<Type, fvPatchField, volMesh> >
steadyStateDdtScheme<Type>::fvcDdt
(
const dimensionedScalar& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return tmp<GeometricField<Type, fvPatchField, volMesh> >
(
new GeometricField<Type, fvPatchField, volMesh>
(
IOobject
(
"ddt("+rho.name()+','+vf.name()+')',
mesh().time().timeName(),
mesh()
),
mesh(),
dimensioned<Type>
(
"0",
rho.dimensions()*vf.dimensions()/dimTime,
pTraits<Type>::zero
)
)
);
}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:27,代码来源:steadyStateDdtScheme.C
示例5:
tmp<DimensionedField<scalar, GeoMesh> > atan2
(
const dimensionedScalar& ds,
const DimensionedField<scalar, GeoMesh>& dsf
)
{
tmp<DimensionedField<scalar, GeoMesh> > tAtan2
(
new DimensionedField<scalar, GeoMesh>
(
IOobject
(
"atan2(" + ds.name() + ',' + dsf.name() + ')',
dsf.instance(),
dsf.db()
),
dsf.mesh(),
atan2(ds, dsf.dimensions())
)
);
atan2(tAtan2().getField(), ds.value(), dsf.getField());
return tAtan2;
}
开发者ID:Kiiree,项目名称:RapidCFD-dev,代码行数:25,代码来源:DimensionedScalarField.C
示例6: db
void fixedFluxBuoyantExnerFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
const dictionary& thermoProperties
= db().lookupObject<IOdictionary>("thermophysicalProperties");
dimensionedVector g(environmentalProperties.lookup("g"));
const constTransport<hConstThermo<perfectGas<specie> > > air
(
thermoProperties.subDict("mixture")
);
const dimensionedScalar Cp("Cp", dimGasConstant, air.Cp(0,0));
const fvsPatchField<scalar>& thetaf =
patch().lookupPatchField<surfaceScalarField, scalar>("thetaf");
gradient() = (g.value() & patch().nf())/(Cp.value()*thetaf);
fixedGradientFvPatchScalarField::updateCoeffs();
}
开发者ID:AtmosFOAM,项目名称:AtmosFOAM,代码行数:29,代码来源:fixedFluxBuoyantExnerFvPatchScalarField.C
示例7: mesh
tmp<fvMatrix<Type>>
EulerD2dt2Scheme<Type>::fvmD2dt2
(
const dimensionedScalar& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type>> tfvm
(
new fvMatrix<Type>
(
vf,
rho.dimensions()*vf.dimensions()*dimVol
/dimTime/dimTime
)
);
fvMatrix<Type>& fvm = tfvm.ref();
scalar deltaT = mesh().time().deltaTValue();
scalar deltaT0 = mesh().time().deltaT0Value();
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
scalar rDeltaT2 = 4.0/sqr(deltaT + deltaT0);
if (mesh().moving())
{
scalar halfRdeltaT2 = 0.5*rDeltaT2;
const scalarField VV0(mesh().V() + mesh().V0());
const scalarField V0V00(mesh().V0() + mesh().V00());
fvm.diag() = rho.value()*(coefft*halfRdeltaT2)*VV0;
fvm.source() = halfRdeltaT2*rho.value()*
(
(coefft*VV0 + coefft00*V0V00)
*vf.oldTime().primitiveField()
- (coefft00*V0V00)*vf.oldTime().oldTime().primitiveField()
);
}
else
{
fvm.diag() = (coefft*rDeltaT2)*mesh().V()*rho.value();
fvm.source() = rDeltaT2*mesh().V()*rho.value()*
(
(coefft + coefft00)*vf.oldTime().primitiveField()
- coefft00*vf.oldTime().oldTime().primitiveField()
);
}
return tfvm;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:57,代码来源:EulerD2dt2Scheme.C
示例8: dimensionedScalar
Foam::tmp<Foam::volScalarField> Foam::SrivastavaSundaresanFrictionalStress::muf
(
const volScalarField& alpha,
const volScalarField& Theta,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D,
const dimensionedScalar& phi
) const
{
const scalar I2Dsmall = 1.0e-35;
//Creating muf assuming it should be 0 on the boundary which may not be
// true
tmp<volScalarField> tmuf
(
new volScalarField
(
IOobject
(
"muf",
alpha.mesh().time().timeName(),
alpha.mesh()
),
alpha.mesh(),
dimensionedScalar("muf", dimensionSet(1, -1, -1, 0, 0), 1e30)
)
);
volScalarField& muff = tmuf();
forAll (D, celli)
{
if (alpha[celli] >= alphaMinFriction.value())
{
muff[celli] =
0.5*pf[celli]*sin(phi.value())
/(
sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
+ sqr(D[celli].yy() - D[celli].zz())
+ sqr(D[celli].zz() - D[celli].xx()))
+ sqr(D[celli].xy()) + sqr(D[celli].xz())
+ sqr(D[celli].yz())) + I2Dsmall
);
}
if (alpha[celli] < alphaMinFriction.value())
{
muff[celli] = 0.0;
}
}
muff.correctBoundaryConditions();
return tmuf;
}
开发者ID:jpola,项目名称:twophaseeulersedfoam,代码行数:56,代码来源:SrivastavaSundaresanFrictionalStress.C
示例9: mesh
tmp<GeometricField<Type, fvPatchField, volMesh> >
EulerLocalDdtScheme<Type>::fvcDdt
(
const dimensionedScalar& 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.value()*
(
vf.internalField()
- vf.oldTime().internalField()*mesh().V0()/mesh().V()
),
rDeltaT.boundaryField()*rho.value()*
(
vf.boundaryField() - vf.oldTime().boundaryField()
)
)
);
}
else
{
return tmp<GeometricField<Type, fvPatchField, volMesh> >
(
new GeometricField<Type, fvPatchField, volMesh>
(
ddtIOobject,
rDeltaT*rho*(vf - vf.oldTime())
)
);
}
}
开发者ID:Kiiree,项目名称:DensityBasedTurbo,代码行数:56,代码来源:EulerLocalDdtScheme.C
示例10: abort
Foam::dimensionSet Foam::pow
(
const dimensionSet& ds,
const dimensionedScalar& dS
)
{
if (dimensionSet::debug && !dS.dimensions().dimensionless())
{
FatalErrorInFunction
<< "Exponent of pow is not dimensionless"
<< abort(FatalError);
}
dimensionSet dimPow
(
ds[dimensionSet::MASS]*dS.value(),
ds[dimensionSet::LENGTH]*dS.value(),
ds[dimensionSet::TIME]*dS.value(),
ds[dimensionSet::TEMPERATURE]*dS.value(),
ds[dimensionSet::MOLES]*dS.value(),
ds[dimensionSet::CURRENT]*dS.value(),
ds[dimensionSet::LUMINOUS_INTENSITY]*dS.value()
);
return dimPow;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:26,代码来源:dimensionSet.C
示例11: dimensionedScalar
Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::muf
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volTensorField& D,
const dimensionedScalar& phi
) const
{
const scalar I2Dsmall = 1.0e-15;
// Creating muf assuming it should be 0 on the boundary which may not be
// true
tmp<volScalarField> tmuf
(
new volScalarField
(
IOobject
(
"muf",
alpha.mesh().time().timeName(),
alpha.mesh()
),
alpha.mesh(),
dimensionedScalar("muf", dimensionSet(1, -1, -1, 0, 0), 0.0)
)
);
volScalarField& muff = tmuf();
forAll (D, celli)
{
if (alpha[celli] > alphaMax.value()-5e-2)
{
muff[celli] =
0.5*pf[celli]*sin(phi.value())
/(
sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
+ sqr(D[celli].yy() - D[celli].zz())
+ sqr(D[celli].zz() - D[celli].xx()))
+ sqr(D[celli].xy()) + sqr(D[celli].xz())
+ sqr(D[celli].yz())) + I2Dsmall
);
}
}
return tmuf;
}
开发者ID:frankl000,项目名称:OpenFOAM-1.7.x,代码行数:48,代码来源:SchaefferFrictionalStress.C
示例12: convertToPolar
vector geodesicSolidBodyVelocityField::streamfunctionAt
(
const point& p,
const Time& t
) const
{
const dimensionedScalar T = (endTime.value() == -1 ) ? t.endTime() : endTime;
const scalar u0 = 2 * M_PI * radius.value() / T.value();
const polarPoint& polarp = convertToPolar(p);
const scalar lat = polarp.lat();
const scalar lon = polarp.lon();
const scalar psi = - u0 * (Foam::sin(lat) * Foam::cos(alpha) - Foam::cos(lon) * Foam::cos(lat) * Foam::sin(alpha));
return p/mag(p) * psi * radius.value();
}
开发者ID:AtmosFOAM,项目名称:AtmosFOAM-tools,代码行数:16,代码来源:geodesicSolidBodyVelocityField.C
示例13: ddt
tmp<fvMatrix<Type> >
ddt
(
const dimensionedScalar& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return fvm::ddt(rho, vf, "ddt(" + rho.name() + ',' + vf.name() + ')');
}
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:9,代码来源:fvmDdt.C
示例14: departureP
point geodesicSolidBodyVelocityField::initialPositionOf
(
const point& p,
const Time& t
) const
{
// assume alpha = 0
const dimensionedScalar T = (endTime.value() == -1 ) ? t.endTime() : endTime;
const scalar u0 = 2 * M_PI * radius.value() / T.value();
const polarPoint& polarp = convertToPolar(p);
const scalar lat = polarp.lat();
scalar lon = polarp.lon();
lon -= u0/radius.value() * t.value();
const polarPoint departureP(lon, lat, radius.value());
return departureP.cartesian();
}
开发者ID:AtmosFOAM,项目名称:AtmosFOAM-tools,代码行数:19,代码来源:geodesicSolidBodyVelocityField.C
示例15: dimensionedScalar
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
(
const volScalarField& alpha1,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D
) const
{
const scalar I2Dsmall = 1.0e-15;
// Creating nu assuming it should be 0 on the boundary which may not be
// true
tmp<volScalarField> tnu
(
new volScalarField
(
IOobject
(
"Schaeffer:nu",
alpha1.mesh().time().timeName(),
alpha1.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
alpha1.mesh(),
dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0.0)
)
);
volScalarField& nuf = tnu();
forAll (D, celli)
{
if (alpha1[celli] > alphaMax.value() - 5e-2)
{
nuf[celli] =
0.5*pf[celli]*sin(phi_.value())
/(
sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
+ sqr(D[celli].yy() - D[celli].zz())
+ sqr(D[celli].zz() - D[celli].xx()))
+ sqr(D[celli].xy()) + sqr(D[celli].xz())
+ sqr(D[celli].yz())) + I2Dsmall
);
}
}
// Correct coupled BCs
nuf.correctBoundaryConditions();
return tnu;
}
开发者ID:alexQch,项目名称:OpenFOAM-2.3.x,代码行数:54,代码来源:SchaefferFrictionalStress.C
示例16: tfvm
tmp<fvMatrix<Type> >
EulerLocalDdtScheme<Type>::fvmDdt
(
const dimensionedScalar& 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.value()*mesh().V();
if (mesh().moving())
{
fvm.source() = rDeltaT
*rho.value()*vf.oldTime().internalField()*mesh().V0();
}
else
{
fvm.source() = rDeltaT
*rho.value()*vf.oldTime().internalField()*mesh().V();
}
return tfvm;
}
开发者ID:Kiiree,项目名称:DensityBasedTurbo,代码行数:41,代码来源:EulerLocalDdtScheme.C
示例17: z
point horizontalVelocityField::initialPositionOf
(
const point& p,
const Time& t
) const
{
const dimensionedScalar z("z", dimLength, p.z());
if (z.value() <= z1.value())
{
return p;
}
else if (z.value() <= z2.value())
{
return point(p.x() - (u0*sqr(Foam::sin(0.5*M_PI*(z-z1)/(z2-z1)))*t).value(), p.y(), p.z());
}
else
{
return point(p.x() - u0.value()*t.value(), p.y(), p.z());
}
}
开发者ID:AtmosFOAM,项目名称:AtmosFOAM-tools,代码行数:21,代码来源:horizontalVelocityField.C
示例18:
tmp<GeometricField<Type, faPatchField, areaMesh> >
laplacian
(
const dimensionedScalar& gamma,
const GeometricField<Type, faPatchField, areaMesh>& vf
)
{
return gamma*fac::laplacian
(
vf, "laplacian(" + gamma.name() + ',' + vf.name() + ')'
);
}
开发者ID:Haider-BA,项目名称:foam-extend-3.0,代码行数:12,代码来源:facLaplacian.C
示例19: db
void geostrophicZeroFluxFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
const dimensionedScalar g(environmentalProperties.lookup("g"));
const dimensionedScalar beta(environmentalProperties.lookup("beta"));
const dimensionedScalar f0(environmentalProperties.lookup("f0"));
const vector OmegaHat(environmentalProperties.lookup("OmegaHat"));
const surfaceVectorField& Uf
= db().lookupObject<surfaceVectorField>("Uf");
const fvsPatchField<vector> Ufp
= patch().patchField<surfaceVectorField, vector>(Uf);
const surfaceVectorField& Cf = Uf.mesh().Cf();
fvsPatchField<vector> Cfp =
patch().patchField<surfaceVectorField, vector>(Cf);
gradient() = -(f0.value() + beta.value()*Cfp.component(vector::Y))*
((OmegaHat ^ Ufp) & patch().nf())/g.value();
fixedGradientFvPatchScalarField::updateCoeffs();
}
开发者ID:AtmosFOAM,项目名称:AtmosFOAM,代码行数:29,代码来源:geostrophicZeroFluxFvPatchScalarField.C
示例20: tdsf
tmp<DimensionedField<scalar, GeoMesh> > atan2
(
const dimensionedScalar& ds,
const tmp<DimensionedField<scalar, GeoMesh> >& tdsf
)
{
const DimensionedField<scalar, GeoMesh>& dsf = tdsf();
tmp<DimensionedField<scalar, GeoMesh> > tAtan2 =
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New
(
tdsf,
"atan2(" + ds.name() + ',' + dsf.name() + ')',
atan2(ds, dsf.dimensions())
);
atan2(tAtan2().getField(), ds.value(), dsf.getField());
reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf);
return tAtan2;
}
开发者ID:Kiiree,项目名称:RapidCFD-dev,代码行数:22,代码来源:DimensionedScalarField.C
注:本文中的dimensionedScalar类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论