本文整理汇总了C++中surfaceScalarField类的典型用法代码示例。如果您正苦于以下问题:C++ surfaceScalarField类的具体用法?C++ surfaceScalarField怎么用?C++ surfaceScalarField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了surfaceScalarField类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: correctedScheme_
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
limitedSnGrad<Type>::correction
(
const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
const GeometricField<Type, fvsPatchField, surfaceMesh> corr
(
correctedScheme_().correction(vf)
);
const surfaceScalarField limiter
(
min
(
limitCoeff_
*mag(snGradScheme<Type>::snGrad(vf, deltaCoeffs(vf), "SndGrad"))
/(
(1 - limitCoeff_)*mag(corr)
+ dimensionedScalar("small", corr.dimensions(), SMALL)
),
dimensionedScalar("one", dimless, 1.0)
)
);
if (fv::debug)
{
InfoInFunction
<< "limiter min: " << min(limiter.primitiveField())
<< " max: "<< max(limiter.primitiveField())
<< " avg: " << average(limiter.primitiveField()) << endl;
}
return limiter*corr;
}
开发者ID:EricAlex,项目名称:OpenFOAM-dev,代码行数:35,代码来源:limitedSnGrad.C
示例2: word
Foam::combustionModel::combustionModel
(
const dictionary& combustionProperties,
const hsCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const surfaceScalarField& phi,
const volScalarField& rho
)
:
combustionModelCoeffs_
(
combustionProperties.subDict
(
word(combustionProperties.lookup("combustionModel")) + "Coeffs"
)
),
thermo_(thermo),
turbulence_(turbulence),
mesh_(phi.mesh()),
phi_(phi),
rho_(rho),
stoicRatio_(thermo.lookup("stoichiometricAirFuelMassRatio")),
s_(thermo.lookup("stoichiometricOxygenFuelMassRatio")),
qFuel_(thermo_.lookup("qFuel")),
composition_(thermo.composition())
{}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:26,代码来源:combustionModel.C
示例3: forAll
void Foam::MRFZone::makeRelativeRhoFlux
(
const RhoFieldType& rho,
surfaceScalarField& phi
) const
{
if (!active_)
{
return;
}
const surfaceVectorField& Cf = mesh_.Cf();
const surfaceVectorField& Sf = mesh_.Sf();
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vectorField& Cfi = Cf;
const vectorField& Sfi = Sf;
scalarField& phii = phi.primitiveFieldRef();
// Internal faces
forAll(internalFaces_, i)
{
label facei = internalFaces_[i];
phii[facei] -= rho[facei]*(Omega ^ (Cfi[facei] - origin_)) & Sfi[facei];
}
开发者ID:mattijsjanssens,项目名称:OpenFOAM-dev,代码行数:26,代码来源:MRFZoneTemplates.C
示例4: div
tmp<fvMatrix<Type> >
div
(
const surfaceScalarField& flux,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return fvm::div(flux, vf, "div("+flux.name()+','+vf.name()+')');
}
开发者ID:000861,项目名称:OpenFOAM-2.1.x,代码行数:9,代码来源:fvmDiv.C
示例5:
tmp<GeometricField<Type, fvPatchField, volMesh> >
DDt
(
const surfaceScalarField& phi,
const GeometricField<Type, fvPatchField, volMesh>& psi
)
{
tmp<GeometricField<Type, fvPatchField, volMesh> > ddtDivPhiPsi
= fvc::ddt(psi) + fvc::div(phi, psi);
if (phi.mesh().moving())
{
return ddtDivPhiPsi - fvc::div(phi + phi.mesh().phi())*psi;
}
else
{
return ddtDivPhiPsi - fvc::div(phi)*psi;
}
}
开发者ID:000861,项目名称:OpenFOAM-2.1.x,代码行数:19,代码来源:fvcDDt.C
示例6:
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
flux
(
const surfaceScalarField& phi,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
return fvc::flux
(
phi, vf, "flux("+phi.name()+','+vf.name()+')'
);
}
开发者ID:BarisCumhur,项目名称:OpenFOAM-dev,代码行数:12,代码来源:fvcFlux.C
示例7: boundaryField
void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const
{
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
const volScalarField::Boundary& alphaBf = boundaryField();
const surfaceScalarField::Boundary& phiBf = phi()().boundaryField();
forAll(alphaPhiBf, patchi)
{
fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi];
if (!alphaPhip.coupled())
{
alphaPhip = phiBf[patchi]*alphaBf[patchi];
}
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:15,代码来源:phaseModel.C
示例8:
Foam::combustionModel::combustionModel
(
const dictionary& combustionProps,
hsCombustionThermo& thermo,
const compressible::turbulenceModel& turbulence,
const surfaceScalarField& phi,
const volScalarField& rho
)
:
coeffs_(dictionary::null),
thermo_(thermo),
turbulence_(turbulence),
mesh_(phi.mesh()),
phi_(phi),
rho_(rho)
{}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:16,代码来源:combustionModel.C
示例9: strainRate
generalizedNewtonian<BasicTurbulenceModel>::generalizedNewtonian
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
)
:
linearViscousStress<laminarModel<BasicTurbulenceModel>>
(
typeName,
alpha,
rho,
U,
alphaRhoPhi,
phi,
transport,
propertiesName
),
viscosityModel_
(
generalizedNewtonianViscosityModel::New
(
this->coeffDict_
)
),
nu_
(
IOobject
(
IOobject::groupName("generalizedNewtonian:nu", alphaRhoPhi.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
viscosityModel_->nu(this->nu(), strainRate())
)
{}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:44,代码来源:generalizedNewtonian.C
示例10: tConvection
tmp<GeometricField<Type, fvPatchField, volMesh> >
noConvectionScheme<Type>::fvcDiv
(
const surfaceScalarField& faceFlux,
const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
tmp<GeometricField<Type, fvPatchField, volMesh> > tConvection
(
fvc::surfaceIntegrate(flux(faceFlux, vf))
);
tConvection().rename
(
"convection(" + faceFlux.name() + ',' + vf.name() + ')'
);
return tConvection;
}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:19,代码来源:noConvectionScheme.C
示例11: tfvm
tmp<fvMatrix<Type> >
noConvectionScheme<Type>::fvmDiv
(
const surfaceScalarField& faceFlux,
GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
tmp<fvMatrix<Type> > tfvm
(
new fvMatrix<Type>
(
vf,
faceFlux.dimensions()*vf.dimensions()
)
);
// Touch diagonal for consistency
tfvm().diag() = 0;
return tfvm;
}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:21,代码来源:noConvectionScheme.C
示例12: getScalingFlowRate
scalar fieldOperations::
getScalingFlowRate(const surfaceScalarField& phi)
{
return mag( gSum(phi.boundaryField()[scalingPatchID_]) );
}
开发者ID:vitst,项目名称:dissolFoam,代码行数:5,代码来源:fieldOperations.C
示例13: readLabel
void Foam::MULES::implicitSolve
(
const RhoType& rho,
volScalarField& psi,
const surfaceScalarField& phi,
surfaceScalarField& phiPsi,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin
)
{
const fvMesh& mesh = psi.mesh();
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
label maxIter
(
readLabel(MULEScontrols.lookup("maxIter"))
);
label nLimiterIter
(
readLabel(MULEScontrols.lookup("nLimiterIter"))
);
scalar maxUnboundedness
(
readScalar(MULEScontrols.lookup("maxUnboundedness"))
);
scalar CoCoeff
(
readScalar(MULEScontrols.lookup("CoCoeff"))
);
scalarField allCoLambda(mesh.nFaces());
{
slicedSurfaceScalarField CoLambda
(
IOobject
(
"CoLambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allCoLambda,
false // Use slices for the couples
);
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
tmp<surfaceScalarField> Cof =
mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs()
*mag(phi/interpolate(rho))/mesh.magSf();
CoLambda == 1.0/max(CoCoeff*Cof, scalar(1));
}
else
{
tmp<surfaceScalarField> Cof =
mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs()
*mag(phi)/mesh.magSf();
CoLambda == 1.0/max(CoCoeff*Cof, scalar(1));
}
}
scalarField allLambda(allCoLambda);
//scalarField allLambda(mesh.nFaces(), 1.0);
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
linear<scalar> CDs(mesh);
upwind<scalar> UDs(mesh, phi);
//fv::uncorrectedSnGrad<scalar> snGrads(mesh);
fvScalarMatrix psiConvectionDiffusion
(
//.........这里部分代码省略.........
开发者ID:Al-th,项目名称:OpenFOAM-2.2.x,代码行数:101,代码来源:MULESTemplates.C
示例14: tVsc
void Foam::MULES::limiter
(
scalarField& allLambda,
const RdeltaTType& rDeltaT,
const RhoType& rho,
const volScalarField& psi,
const surfaceScalarField& phiBD,
const surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin
)
{
const scalarField& psiIf = psi;
const volScalarField::GeometricBoundaryField& psiBf = psi.boundaryField();
const fvMesh& mesh = psi.mesh();
const dictionary& MULEScontrols = mesh.solverDict(psi.name());
label nLimiterIter
(
MULEScontrols.lookupOrDefault<label>("nLimiterIter", 3)
);
scalar smoothLimiter
(
MULEScontrols.lookupOrDefault<scalar>("smoothLimiter", 0)
);
const scalarField& psi0 = psi.oldTime();
const labelUList& owner = mesh.owner();
const labelUList& neighb = mesh.neighbour();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
const scalarField& V = tVsc();
const scalarField& phiBDIf = phiBD;
const surfaceScalarField::GeometricBoundaryField& phiBDBf =
phiBD.boundaryField();
const scalarField& phiCorrIf = phiCorr;
const surfaceScalarField::GeometricBoundaryField& phiCorrBf =
phiCorr.boundaryField();
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
scalarField& lambdaIf = lambda;
surfaceScalarField::GeometricBoundaryField& lambdaBf =
lambda.boundaryField();
scalarField psiMaxn(psiIf.size(), psiMin);
scalarField psiMinn(psiIf.size(), psiMax);
scalarField sumPhiBD(psiIf.size(), 0.0);
scalarField sumPhip(psiIf.size(), VSMALL);
scalarField mSumPhim(psiIf.size(), VSMALL);
forAll(phiCorrIf, facei)
{
label own = owner[facei];
label nei = neighb[facei];
psiMaxn[own] = max(psiMaxn[own], psiIf[nei]);
psiMinn[own] = min(psiMinn[own], psiIf[nei]);
psiMaxn[nei] = max(psiMaxn[nei], psiIf[own]);
psiMinn[nei] = min(psiMinn[nei], psiIf[own]);
sumPhiBD[own] += phiBDIf[facei];
sumPhiBD[nei] -= phiBDIf[facei];
scalar phiCorrf = phiCorrIf[facei];
if (phiCorrf > 0.0)
{
sumPhip[own] += phiCorrf;
mSumPhim[nei] += phiCorrf;
}
else
{
mSumPhim[own] -= phiCorrf;
sumPhip[nei] -= phiCorrf;
//.........这里部分代码省略.........
开发者ID:BarisCumhur,项目名称:OpenFOAM-dev,代码行数:101,代码来源:MULESTemplates.C
示例15: res
tmp<errorEstimate<Type> >
div
(
const surfaceScalarField& flux,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
const fvMesh& mesh = vf.mesh();
const scalarField& vols = mesh.V();
const surfaceVectorField& faceCentres = mesh.Cf();
const volVectorField& cellCentres = mesh.C();
const fvPatchList& patches = mesh.boundary();
const unallocLabelList& owner = mesh.owner();
const unallocLabelList& neighbour = mesh.neighbour();
Field<Type> res(vols.size(), pTraits<Type>::zero);
scalarField aNorm(vols.size(), 0.0);
// Get sign of flux
const surfaceScalarField signF = pos(flux);
// Calculate gradient of the solution
GeometricField
<
typename outerProduct<vector, Type>::type, fvPatchField, volMesh
> gradVf = fvc::grad(vf);
// Internal faces
forAll (owner, faceI)
{
// Calculate the centre of the face
const vector& curFaceCentre = faceCentres[faceI];
// Owner
vector ownD = curFaceCentre - cellCentres[owner[faceI]];
// Subtract convection
res[owner[faceI]] -=
(
vf[owner[faceI]]
+ (ownD & gradVf[owner[faceI]])
)*flux[faceI];
aNorm[owner[faceI]] += signF[faceI]*flux[faceI];
// Neighbour
vector neiD = curFaceCentre - cellCentres[neighbour[faceI]];
// Subtract convection
res[neighbour[faceI]] +=
(
vf[neighbour[faceI]]
+ (neiD & gradVf[neighbour[faceI]])
)*flux[faceI];
aNorm[neighbour[faceI]] -= (1.0 - signF[faceI])*flux[faceI];
}
forAll (patches, patchI)
{
const vectorField& patchFaceCentres =
faceCentres.boundaryField()[patchI];
const scalarField& patchFlux = flux.boundaryField()[patchI];
const scalarField& patchSignFlux = signF.boundaryField()[patchI];
const labelList& fCells = patches[patchI].faceCells();
forAll (fCells, faceI)
{
vector d =
patchFaceCentres[faceI] - cellCentres[fCells[faceI]];
// Subtract convection
res[fCells[faceI]] -=
(
vf[fCells[faceI]]
+ (d & gradVf[fCells[faceI]])
)*patchFlux[faceI];
aNorm[fCells[faceI]] += patchSignFlux[faceI]*patchFlux[faceI];
}
}
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:84,代码来源:resErrorDiv.C
示例16: tVsc
void Foam::MULES::limiter
(
scalargpuField& allLambda,
const RdeltaTType& rDeltaT,
const RhoType& rho,
const volScalarField& psi,
const surfaceScalarField& phiBD,
const surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin,
const label nLimiterIter
)
{
const scalargpuField& psiIf = psi.getField();
const volScalarField::GeometricBoundaryField& psiBf = psi.boundaryField();
const scalargpuField& psi0 = psi.oldTime();
const fvMesh& mesh = psi.mesh();
const labelgpuList& owner = mesh.owner();
const labelgpuList& neighb = mesh.neighbour();
const labelgpuList& losort = mesh.lduAddr().losortAddr();
const labelgpuList& ownStart = mesh.lduAddr().ownerStartAddr();
const labelgpuList& losortStart = mesh.lduAddr().losortStartAddr();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
const scalargpuField& V = tVsc().getField();
const scalargpuField& phiBDIf = phiBD;
const surfaceScalarField::GeometricBoundaryField& phiBDBf =
phiBD.boundaryField();
const scalargpuField& phiCorrIf = phiCorr;
const surfaceScalarField::GeometricBoundaryField& phiCorrBf =
phiCorr.boundaryField();
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
scalargpuField& lambdaIf = lambda;
surfaceScalarField::GeometricBoundaryField& lambdaBf =
lambda.boundaryField();
scalargpuField psiMaxn(psiIf.size(), psiMin);
scalargpuField psiMinn(psiIf.size(), psiMax);
scalargpuField sumPhiBD(psiIf.size(), 0.0);
scalargpuField sumPhip(psiIf.size(), VSMALL);
scalargpuField mSumPhim(psiIf.size(), VSMALL);
thrust::for_each
(
thrust::make_counting_iterator(0),
thrust::make_counting_iterator(0)+psiIf.size(),
limiterMULESFunctor
(
owner.data(),
neighb.data(),
ownStart.data(),
losortStart.data(),
losort.data(),
psiIf.data(),
phiBDIf.data(),
phiCorrIf.data(),
psiMaxn.data(),
psiMinn.data(),
sumPhiBD.data(),
sumPhip.data(),
mSumPhim.data()
)
);
forAll(phiCorrBf, patchi)
{
const fvPatchScalarField& psiPf = psiBf[patchi];
const scalargpuField& phiBDPf = phiBDBf[patchi];
const scalargpuField& phiCorrPf = phiCorrBf[patchi];
const labelgpuList& pcells = mesh.lduAddr().patchSortCells(patchi);
//.........这里部分代码省略.........
开发者ID:Kiiree,项目名称:RapidCFD-dev,代码行数:101,代码来源:MULESTemplates.C
注:本文中的surfaceScalarField类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论