本文整理汇总了C++中volVectorField类的典型用法代码示例。如果您正苦于以下问题:C++ volVectorField类的具体用法?C++ volVectorField怎么用?C++ volVectorField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了volVectorField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: viscoelasticLaw
Foam::S_MDCPP::S_MDCPP
(
const word& name,
const volVectorField& U,
const surfaceScalarField& phi,
const dictionary& dict
)
:
viscoelasticLaw(name, U, phi),
tau_
(
IOobject
(
"tau" + name,
U.time().timeName(),
U.mesh(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
U.mesh()
),
I_
(
dimensionedSymmTensor
(
"I",
dimensionSet(0, 0, 0, 0, 0, 0, 0),
symmTensor
(
1, 0, 0,
1, 0,
1
)
)
),
rho_(dict.lookup("rho")),
etaS_(dict.lookup("etaS")),
etaP_(dict.lookup("etaP")),
zeta_(dict.lookup("zeta")),
lambdaOb_(dict.lookup("lambdaOb")),
lambdaOs_(dict.lookup("lambdaOs")),
q_(dict.lookup("q"))
{}
示例2:
continuousGasKEpsilon<BasicTurbulenceModel>::continuousGasKEpsilon
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName,
const word& type
)
:
kEpsilon<BasicTurbulenceModel>
(
alpha,
rho,
U,
alphaPhi,
phi,
transport,
propertiesName,
type
),
liquidTurbulencePtr_(NULL),
nutEff_
(
IOobject
(
IOobject::groupName("nutEff", U.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
this->nut_
),
alphaInversion_
(
dimensioned<scalar>::lookupOrAddToDict
(
"alphaInversion",
this->coeffDict_,
0.7
)
)
{
if (type == typeName)
{
kEpsilon<BasicTurbulenceModel>::correctNut();
this->printCoeffs(type);
}
}
示例3: exit
Foam::autoPtr<Foam::SRF::SRFModel> Foam::SRF::SRFModel::New
(
const volVectorField& Urel
)
{
// get model name, but do not register the dictionary
// otherwise it is registered in the database twice
const word modelType
(
IOdictionary
(
IOobject
(
"SRFProperties",
Urel.time().constant(),
Urel.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).lookup("SRFModel")
);
Info<< "Selecting SRFModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"SRFModel::New(const fvMesh&)"
) << "Unknown SRFModel type "
<< modelType << nl << nl
<< "Valid SRFModel types are :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<SRFModel>(cstrIter()(Urel));
}
示例4: sum
Foam::scalar Foam::fv::patchMeanVelocityForce::magUbarAve
(
const volVectorField& U
) const
{
vector2D sumAmagUsumA
(
sum
(
(flowDir_ & U.boundaryField()[patchi_])
*mesh_.boundary()[patchi_].magSf()
),
sum(mesh_.boundary()[patchi_].magSf())
);
// If the mean velocity force is applied to a cyclic patch
// for parallel runs include contributions from processorCyclic patches
// generated from the decomposition of the cyclic patch
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
if (Pstream::parRun() && isA<cyclicPolyPatch>(patches[patchi_]))
{
labelList processorCyclicPatches
(
processorCyclicPolyPatch::patchIDs(patch_, patches)
);
forAll(processorCyclicPatches, pcpi)
{
const label patchi = processorCyclicPatches[pcpi];
sumAmagUsumA.x() +=
sum
(
(flowDir_ & U.boundaryField()[patchi])
*mesh_.boundary()[patchi].magSf()
);
sumAmagUsumA.y() += sum(mesh_.boundary()[patchi].magSf());
}
}
示例5: subDict
viscoelasticModel::viscoelasticModel
(
const volScalarField& alpha,
const volVectorField& U,
const surfaceScalarField& phi
)
:
IOdictionary
(
IOobject
(
"viscoelasticProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
lawPtr_(viscoelasticLaw::New(word::null, alpha, U, phi, subDict("rheology")))
{}
示例6:
void dilute::setVectorAverage
(
volVectorField& field,
double**& value,
double**& weight,
volScalarField& weightField,
double**const& mask,
double**const& weight2, //allows the specification of a 2nd weight field
bool weightWithWeight2 //switch to activate 2nd weight field
) const
{
label cellI;
vector valueVec;
scalar weightP;
if(weightWithWeight2) //use weight2, e.g., mass-averaged - has no effect, just weight is DIFFERENT!
for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{
for(int subCell=0;subCell<particleCloud_.cellsPerParticle()[index][0];subCell++)
{
cellI = particleCloud_.cellIDs()[index][subCell];
if (cellI >= 0)
{
for(int i=0;i<3;i++) valueVec[i] = value[index][i];
weightP = weight[index][subCell]*weight2[index][subCell];
weightField[cellI] += weightP;
if(weightP > 0) field[cellI] = valueVec; //field[cellI] = valueVec/weightP;
}
}
}
else //standard, i.e., volume-averaged - has no effect, just weight is DIFFERENT!
for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{
for(int subCell=0;subCell<particleCloud_.cellsPerParticle()[index][0];subCell++)
{
//Info << "subCell=" << subCell << endl;
cellI = particleCloud_.cellIDs()[index][subCell];
if (cellI >= 0)
{
for(int i=0;i<3;i++) valueVec[i] = value[index][i];
weightP = weight[index][subCell];
weightField[cellI] += weightP;
if(weightP > 0) field[cellI] = valueVec; //field[cellI] = valueVec/weightP;
else Warning << "!!! W A R N I N G --- weightP <= 0" << endl;
}
}
}
// correct cell values to patches
field.correctBoundaryConditions();
}
示例7: LESModel
scaleSimilarity::scaleSimilarity
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& transport
)
:
LESModel(typeName, U, phi, transport),
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
printCoeffs();
}
示例8: turbulenceModel
LESModel::LESModel
(
const word& type,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
turbulenceModel(rho, U, phi, thermoPhysicalModel, turbulenceModelName),
IOdictionary
(
IOobject
(
"LESProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(subOrEmptyDict(type + "Coeffs")),
kMin_("kMin", sqr(dimVelocity), SMALL),
delta_(LESdelta::New("delta", U.mesh(), *this))
{
kMin_.readIfPresent(*this);
// Force the construction of the mesh deltaCoeffs which may be needed
// for the construction of the derived models and BCs
mesh_.deltaCoeffs();
}
示例9: piston
void Foam::twoStrokeEngine::setBoundaryVelocity(volVectorField& U)
{
vector pistonVel = piston().cs().axis()*engTime().pistonSpeed().value();
// On the piston movingWallVelocity is used.
// There is no need to update the piston velocity
forAll (scavInPortPatches_, patchi)
{
const label curPatchID =
boundaryMesh().findPatchID(scavInPortPatches_[patchi]);
U.boundaryField()[curPatchID] == pistonVel;
}
}
示例10: Udiag
void Foam::porosityModels::powerLaw::calcForce
(
const volVectorField& U,
const volScalarField& rho,
const volScalarField& mu,
vectorField& force
) const
{
scalarField Udiag(U.size(), 0.0);
const scalarField& V = mesh_.V();
apply(Udiag, V, rho, U);
force = Udiag*U;
}
示例11: KK
dynOneEqEddy::dynOneEqEddy
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& transport,
const word& turbulenceModelName,
const word& modelName
)
:
LESModel(modelName, U, phi, transport, turbulenceModelName),
GenEddyVisc(U, phi, transport),
k_
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_
),
simpleFilter_(U.mesh()),
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
bound(k_, kMin_);
const volScalarField KK(0.5*(filter_(magSqr(U)) - magSqr(filter_(U))));
updateSubGridScaleFields(symm(fvc::grad(U)), KK);
printCoeffs();
}
示例12:
void dense::setVectorAverage
(
volVectorField& field,
double**& value,
double**& weight,
volScalarField& weightField,
double**const& mask
) const
{
label cellI;
vector valueVec;
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++)
{
cellI = particleCloud_.cellIDs()[index][subCell];
if (cellI >= 0)
{
for(int i=0;i<3;i++) valueVec[i] = value[index][i];
weightP = weight[index][subCell];
// first entry in this cell
if(weightField[cellI] == 0)
{
field[cellI] = valueVec;
weightField[cellI] = weightP;
}
else
{
field[cellI] = (field[cellI]*weightField[cellI]+valueVec*weightP)/(weightField[cellI]+weightP);
weightField[cellI] += weightP;
}
}
}//forAllSubPoints
}
}
// correct cell values to patches
field.correctBoundaryConditions();
}
示例13: LESModel
dynOneEqEddy::dynOneEqEddy
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
)
:
LESModel(typeName, rho, U, phi, thermoPhysicalModel),
GenEddyVisc(rho, U, phi, thermoPhysicalModel),
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
updateSubGridScaleFields(dev(symm(fvc::grad(U))));
printCoeffs();
}
示例14: sqr
Foam::nonlinearEddyViscosity<BasicTurbulenceModel>::nonlinearEddyViscosity
(
const word& modelName,
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
)
:
eddyViscosity<BasicTurbulenceModel>
(
modelName,
alpha,
rho,
U,
alphaRhoPhi,
phi,
transport,
propertiesName
),
nonlinearStress_
(
IOobject
(
IOobject::groupName("nonlinearStress", U.group()),
this->runTime_.timeName(),
this->mesh_
),
this->mesh_,
dimensionedSymmTensor
(
"nonlinearStress",
sqr(dimVelocity),
symmTensor::zero
)
)
{}
示例15: apply
void Foam::porosityModels::solidification::apply
(
tensorField& AU,
const RhoFieldType& rho,
const volVectorField& U
) const
{
if (alphaName_ == "none")
{
return apply(AU, geometricOneField(), rho, U);
}
else
{
const volScalarField& alpha = mesh_.lookupObject<volScalarField>
(
IOobject::groupName(alphaName_, U.group())
);
return apply(AU, alpha, rho, U);
}
}