本文整理汇总了C++中volVectorField::dimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ volVectorField::dimensions方法的具体用法?C++ volVectorField::dimensions怎么用?C++ volVectorField::dimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volVectorField
的用法示例。
在下文中一共展示了volVectorField::dimensions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forAllConstIter
void Foam::functionObjects::wallShearStress::calcShearStress
(
const volSymmTensorField& Reff,
volVectorField& shearStress
)
{
shearStress.dimensions().reset(Reff.dimensions());
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchi = iter.key();
vectorField& ssp = shearStress.boundaryFieldRef()[patchi];
const vectorField& Sfp = mesh_.Sf().boundaryField()[patchi];
const scalarField& magSfp = mesh_.magSf().boundaryField()[patchi];
const symmTensorField& Reffp = Reff.boundaryField()[patchi];
ssp = (-Sfp/magSfp) & Reffp;
}
示例2: primaryReff
tmp<fvVectorMatrix> surfaceShearForce::correct(volVectorField& U)
{
// local reference to film model
const kinematicSingleLayer& film =
static_cast<const kinematicSingleLayer&>(owner_);
// local references to film fields
const volScalarField& mu = film.mu();
const volVectorField& Uw = film.Uw();
const volScalarField& delta = film.delta();
const volVectorField& Up = film.UPrimary();
// film surface linear coeff to apply to velocity
tmp<volScalarField> tCs;
typedef compressible::turbulenceModel turbModel;
if (film.primaryMesh().foundObject<turbModel>("turbulenceProperties"))
{
// local reference to turbulence model
const turbModel& turb =
film.primaryMesh().lookupObject<turbModel>("turbulenceProperties");
// calculate and store the stress on the primary region
const volSymmTensorField primaryReff(turb.devRhoReff());
// create stress field on film
// - note boundary condition types (mapped)
// - to map, the field name must be the same as the field on the
// primary region
volSymmTensorField Reff
(
IOobject
(
primaryReff.name(),
film.regionMesh().time().timeName(),
film.regionMesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
film.regionMesh(),
dimensionedSymmTensor
(
"zero",
primaryReff.dimensions(),
symmTensor::zero
),
film.mappedFieldAndInternalPatchTypes<symmTensor>()
);
// map stress from primary region to film region
Reff.correctBoundaryConditions();
dimensionedScalar U0("SMALL", U.dimensions(), SMALL);
tCs = Cf_*mag(-film.nHat() & Reff)/(mag(Up - U) + U0);
}
else
{
// laminar case - employ simple coeff-based model
const volScalarField& rho = film.rho();
tCs = Cf_*rho*mag(Up - U);
}
dimensionedScalar d0("SMALL", delta.dimensions(), SMALL);
// linear coeffs to apply to velocity
const volScalarField& Cs = tCs();
volScalarField Cw("Cw", mu/(0.3333*(delta + d0)));
Cw.min(1.0e+06);
return
(
- fvm::Sp(Cs, U) + Cs*Up // surface contribution
- fvm::Sp(Cw, U) + Cw*Uw // wall contribution
);
}