mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: avoid ambiguous construct from tmp - gradSchemes
This commit is contained in:
@ -112,8 +112,10 @@ Foam::fv::extendedLeastSquaresGrad<Type>::calcGrad
|
||||
|
||||
if (vsf.boundaryField()[patchi].coupled())
|
||||
{
|
||||
Field<Type> neiVsf =
|
||||
vsf.boundaryField()[patchi].patchNeighbourField();
|
||||
const Field<Type> neiVsf
|
||||
(
|
||||
vsf.boundaryField()[patchi].patchNeighbourField()
|
||||
);
|
||||
|
||||
forAll(neiVsf, patchFaceI)
|
||||
{
|
||||
|
||||
@ -111,7 +111,10 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
||||
const labelUList& neighbour = mesh_.neighbour();
|
||||
|
||||
// Build the d-vectors
|
||||
surfaceVectorField d = mesh_.Sf()/(mesh_.magSf()*mesh_.deltaCoeffs());
|
||||
surfaceVectorField d
|
||||
(
|
||||
mesh_.Sf()/(mesh_.magSf()*mesh_.deltaCoeffs())
|
||||
);
|
||||
|
||||
if (!mesh_.orthogonal())
|
||||
{
|
||||
@ -124,7 +127,7 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
||||
|
||||
forAll(owner, faceI)
|
||||
{
|
||||
symmTensor wdd = 1.0/magSqr(d[faceI])*sqr(d[faceI]);
|
||||
const symmTensor wdd(1.0/magSqr(d[faceI])*sqr(d[faceI]));
|
||||
|
||||
dd[owner[faceI]] += wdd;
|
||||
dd[neighbour[faceI]] += wdd;
|
||||
@ -146,11 +149,11 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
||||
}
|
||||
}
|
||||
|
||||
scalarField detdd = det(dd);
|
||||
scalarField detdd(det(dd));
|
||||
|
||||
Info<< "max(detdd) = " << max(detdd) << endl;
|
||||
Info<< "min(detdd) = " << min(detdd) << endl;
|
||||
Info<< "average(detdd) = " << average(detdd) << endl;
|
||||
Info<< "max(detdd) = " << max(detdd) << nl
|
||||
<< "min(detdd) = " << min(detdd) << nl
|
||||
<< "average(detdd) = " << average(detdd) << endl;
|
||||
|
||||
label nAddCells = 0;
|
||||
label maxNaddCells = 4*detdd.size();
|
||||
@ -219,13 +222,13 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
||||
|
||||
additionalCells_.setSize(nAddCells);
|
||||
|
||||
Info<< "max(detdd) = " << max(detdd) << endl;
|
||||
Info<< "min(detdd) = " << min(detdd) << endl;
|
||||
Info<< "average(detdd) = " << average(detdd) << endl;
|
||||
Info<< "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl;
|
||||
Info<< "max(detdd) = " << max(detdd) << nl
|
||||
<< "min(detdd) = " << min(detdd) << nl
|
||||
<< "average(detdd) = " << average(detdd) << nl
|
||||
<< "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl;
|
||||
|
||||
// Invert the dd tensor
|
||||
symmTensorField invDd = inv(dd);
|
||||
const symmTensorField invDd(inv(dd));
|
||||
|
||||
|
||||
// Revisit all faces and calculate the lsP and lsN vectors
|
||||
|
||||
@ -122,11 +122,13 @@ Foam::fv::fourthGrad<Type>::calcGrad
|
||||
const scalarField& lambdap = lambda.boundaryField()[patchi];
|
||||
|
||||
// Build the d-vectors
|
||||
vectorField pd =
|
||||
vectorField pd
|
||||
(
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
/ (
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
* mesh.deltaCoeffs().boundaryField()[patchi]
|
||||
)
|
||||
);
|
||||
|
||||
if (!mesh.orthogonal())
|
||||
@ -138,8 +140,10 @@ Foam::fv::fourthGrad<Type>::calcGrad
|
||||
const labelUList& faceCells =
|
||||
fGrad.boundaryField()[patchi].patch().faceCells();
|
||||
|
||||
Field<GradType> neighbourSecondfGrad =
|
||||
secondfGrad.boundaryField()[patchi].patchNeighbourField();
|
||||
const Field<GradType> neighbourSecondfGrad
|
||||
(
|
||||
secondfGrad.boundaryField()[patchi].patchNeighbourField()
|
||||
);
|
||||
|
||||
forAll(faceCells, patchFaceI)
|
||||
{
|
||||
|
||||
@ -154,9 +154,11 @@ void Foam::fv::gaussGrad<Type>::correctBoundaryConditions
|
||||
{
|
||||
if (!vsf.boundaryField()[patchi].coupled())
|
||||
{
|
||||
vectorField n =
|
||||
const vectorField n
|
||||
(
|
||||
vsf.mesh().Sf().boundaryField()[patchi]
|
||||
/vsf.mesh().magSf().boundaryField()[patchi];
|
||||
/ vsf.mesh().magSf().boundaryField()[patchi]
|
||||
);
|
||||
|
||||
gGrad.boundaryField()[patchi] += n *
|
||||
(
|
||||
|
||||
@ -108,8 +108,10 @@ Foam::fv::leastSquaresGrad<Type>::calcGrad
|
||||
|
||||
if (vsf.boundaryField()[patchi].coupled())
|
||||
{
|
||||
Field<Type> neiVsf =
|
||||
vsf.boundaryField()[patchi].patchNeighbourField();
|
||||
const Field<Type> neiVsf
|
||||
(
|
||||
vsf.boundaryField()[patchi].patchNeighbourField()
|
||||
);
|
||||
|
||||
forAll(neiVsf, patchFaceI)
|
||||
{
|
||||
|
||||
@ -130,11 +130,13 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
const labelUList& faceCells = p.patch().faceCells();
|
||||
|
||||
// Build the d-vectors
|
||||
vectorField pd =
|
||||
vectorField pd
|
||||
(
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
/ (
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
* mesh.deltaCoeffs().boundaryField()[patchi]
|
||||
)
|
||||
);
|
||||
|
||||
if (!mesh.orthogonal())
|
||||
@ -167,7 +169,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
|
||||
|
||||
// Invert the dd tensor
|
||||
symmTensorField invDd = inv(dd);
|
||||
const symmTensorField invDd(inv(dd));
|
||||
|
||||
|
||||
// Revisit all faces and calculate the lsP and lsN vectors
|
||||
@ -194,11 +196,13 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
|
||||
const labelUList& faceCells = p.faceCells();
|
||||
|
||||
// Build the d-vectors
|
||||
vectorField pd =
|
||||
vectorField pd
|
||||
(
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
/(
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
*mesh.deltaCoeffs().boundaryField()[patchi]
|
||||
)
|
||||
);
|
||||
|
||||
if (!mesh.orthogonal())
|
||||
|
||||
@ -97,7 +97,7 @@ Foam::fv::cellLimitedGrad<Foam::scalar>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
scalarField psfNei = psf.patchNeighbourField();
|
||||
const scalarField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
@ -126,7 +126,7 @@ Foam::fv::cellLimitedGrad<Foam::scalar>::calcGrad
|
||||
|
||||
if (k_ < 1.0)
|
||||
{
|
||||
scalarField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf);
|
||||
const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
|
||||
maxVsf += maxMinVsf;
|
||||
minVsf -= maxMinVsf;
|
||||
|
||||
@ -250,7 +250,7 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
vectorField psfNei = psf.patchNeighbourField();
|
||||
const vectorField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
@ -279,7 +279,7 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad
|
||||
|
||||
if (k_ < 1.0)
|
||||
{
|
||||
vectorField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf);
|
||||
const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
|
||||
maxVsf += maxMinVsf;
|
||||
minVsf -= maxMinVsf;
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ Foam::fv::cellMDLimitedGrad<Foam::scalar>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
scalarField psfNei = psf.patchNeighbourField();
|
||||
const scalarField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
@ -127,7 +127,7 @@ Foam::fv::cellMDLimitedGrad<Foam::scalar>::calcGrad
|
||||
|
||||
if (k_ < 1.0)
|
||||
{
|
||||
scalarField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf);
|
||||
const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
|
||||
maxVsf += maxMinVsf;
|
||||
minVsf -= maxMinVsf;
|
||||
|
||||
@ -240,7 +240,7 @@ Foam::fv::cellMDLimitedGrad<Foam::vector>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
vectorField psfNei = psf.patchNeighbourField();
|
||||
const vectorField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
@ -269,7 +269,7 @@ Foam::fv::cellMDLimitedGrad<Foam::vector>::calcGrad
|
||||
|
||||
if (k_ < 1.0)
|
||||
{
|
||||
vectorField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf);
|
||||
const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
|
||||
maxVsf += maxMinVsf;
|
||||
minVsf -= maxMinVsf;
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ Foam::fv::faceLimitedGrad<Foam::scalar>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
scalarField psfNei = psf.patchNeighbourField();
|
||||
const scalarField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
@ -267,7 +267,7 @@ Foam::fv::faceLimitedGrad<Foam::vector>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
vectorField psfNei = psf.patchNeighbourField();
|
||||
const vectorField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
|
||||
@ -119,7 +119,7 @@ Foam::fv::faceMDLimitedGrad<Foam::scalar>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
scalarField psfNei = psf.patchNeighbourField();
|
||||
const scalarField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
@ -261,7 +261,7 @@ Foam::fv::faceMDLimitedGrad<Foam::vector>::calcGrad
|
||||
|
||||
if (psf.coupled())
|
||||
{
|
||||
vectorField psfNei = psf.patchNeighbourField();
|
||||
const vectorField psfNei(psf.patchNeighbourField());
|
||||
|
||||
forAll(pOwner, pFacei)
|
||||
{
|
||||
|
||||
@ -153,11 +153,14 @@ gaussLaplacianScheme<Type, GType>::fvmLaplacian
|
||||
{
|
||||
const fvMesh& mesh = this->mesh();
|
||||
|
||||
surfaceVectorField Sn = mesh.Sf()/mesh.magSf();
|
||||
const surfaceVectorField Sn(mesh.Sf()/mesh.magSf());
|
||||
|
||||
surfaceVectorField SfGamma = mesh.Sf() & gamma;
|
||||
GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn = SfGamma & Sn;
|
||||
surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn;
|
||||
const surfaceVectorField SfGamma(mesh.Sf() & gamma);
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn
|
||||
(
|
||||
SfGamma & Sn
|
||||
);
|
||||
const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn);
|
||||
|
||||
tmp<fvMatrix<Type> > tfvm = fvmLaplacianUncorrected(SfGammaSn, vf);
|
||||
fvMatrix<Type>& fvm = tfvm();
|
||||
@ -192,11 +195,13 @@ gaussLaplacianScheme<Type, GType>::fvcLaplacian
|
||||
{
|
||||
const fvMesh& mesh = this->mesh();
|
||||
|
||||
surfaceVectorField Sn = mesh.Sf()/mesh.magSf();
|
||||
|
||||
surfaceVectorField SfGamma = mesh.Sf() & gamma;
|
||||
GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn = SfGamma & Sn;
|
||||
surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn;
|
||||
const surfaceVectorField Sn(mesh.Sf()/mesh.magSf());
|
||||
const surfaceVectorField SfGamma(mesh.Sf() & gamma);
|
||||
const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn
|
||||
(
|
||||
SfGamma & Sn
|
||||
);
|
||||
const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn);
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > tLaplacian
|
||||
(
|
||||
|
||||
@ -66,10 +66,12 @@ limitedSnGrad<Type>::correction
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh> corr =
|
||||
correctedSnGrad<Type>(this->mesh()).correction(vf);
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh> corr
|
||||
(
|
||||
correctedSnGrad<Type>(this->mesh()).correction(vf)
|
||||
);
|
||||
|
||||
surfaceScalarField limiter
|
||||
const surfaceScalarField limiter
|
||||
(
|
||||
min
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user