Commit d87a880e authored by Mark Olesen's avatar Mark Olesen
Browse files

COMP: avoid ambiguous construct from tmp - postProcessing

parent 3d3c95a3
......@@ -119,12 +119,14 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName)
if (ok)
{
Field<Type> values = combineFields(setFieldValues<Type>(fieldName));
Field<Type> values(combineFields(setFieldValues<Type>(fieldName)));
scalarField V = combineFields(filterField(mesh().V()));
scalarField V(combineFields(filterField(mesh().V())));
scalarField weightField =
combineFields(setFieldValues<scalar>(weightFieldName_));
scalarField weightField
(
combineFields(setFieldValues<scalar>(weightFieldName_))
);
if (Pstream::master())
{
......
......@@ -138,8 +138,8 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
if (ok)
{
Field<Type> values = getFieldValues<Type>(fieldName);
scalarField weightField = getFieldValues<scalar>(weightFieldName_);
Field<Type> values(getFieldValues<Type>(fieldName));
scalarField weightField(getFieldValues<scalar>(weightFieldName_));
scalarField magSf;
if (surfacePtr_.valid())
......
......@@ -408,22 +408,24 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const
{
label patchi = iter.key();
vectorField Md = mesh.C().boundaryField()[patchi] - CofR_;
vectorField Md(mesh.C().boundaryField()[patchi] - CofR_);
scalarField sA = mag(Sfb[patchi]);
scalarField sA(mag(Sfb[patchi]));
// Normal force = surfaceUnitNormal * (surfaceNormal & forceDensity)
vectorField fN =
vectorField fN
(
Sfb[patchi]/sA
*(
Sfb[patchi] & fD.boundaryField()[patchi]
);
)
);
fm.first().first() += sum(fN);
fm.second().first() += sum(Md ^ fN);
// Tangential force (total force minus normal fN)
vectorField fT = sA*fD.boundaryField()[patchi] - fN;
vectorField fT(sA*fD.boundaryField()[patchi] - fN);
fm.first().second() += sum(fT);
fm.second().second() += sum(Md ^ fT);
......@@ -450,14 +452,14 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const
{
label patchi = iter.key();
vectorField Md = mesh.C().boundaryField()[patchi] - CofR_;
vectorField Md(mesh.C().boundaryField()[patchi] - CofR_);
vectorField pf = Sfb[patchi]*(p.boundaryField()[patchi] - pRef);
vectorField pf(Sfb[patchi]*(p.boundaryField()[patchi] - pRef));
fm.first().first() += rho(p)*sum(pf);
fm.second().first() += rho(p)*sum(Md ^ pf);
vectorField vf = Sfb[patchi] & devRhoReffb[patchi];
vectorField vf(Sfb[patchi] & devRhoReffb[patchi]);
fm.first().second() += sum(vf);
fm.second().second() += sum(Md ^ vf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment