surfaceInterpolation:localMin,localMax: Add support for consistent interpolation on coupled BCs

Resolves bug-report http://bugs.openfoam.org/view.php?id=2100
This commit is contained in:
Henry Weller
2016-05-26 14:55:44 +01:00
parent 71addd7bbb
commit 5976e79ceb
2 changed files with 54 additions and 16 deletions

View File

@ -138,14 +138,6 @@ public:
);
GeometricField<Type, fvsPatchField, surfaceMesh>& vff = tvff.ref();
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
Boundary& vffbf = vff.boundaryFieldRef();
forAll(vffbf, patchi)
{
vffbf[patchi] = vf.boundaryField()[patchi];
}
const labelUList& own = mesh.owner();
const labelUList& nei = mesh.neighbour();
@ -154,6 +146,33 @@ public:
vff[facei] = max(vf[own[facei]], vf[nei[facei]]);
}
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
Boundary& bff = vff.boundaryFieldRef();
forAll(bff, patchi)
{
const fvPatchField<Type>& pf = vf.boundaryField()[patchi];
Field<Type>& pff = bff[patchi];
if (pf.coupled())
{
tmp<Field<Type>> tpif(pf.patchInternalField());
const Field<Type>& pif = tpif();
tmp<Field<Type>> tpnf(pf.patchNeighbourField());
const Field<Type>& pnf = tpnf();
forAll(pff, i)
{
pff[i] = max(pif[i], pnf[i]);
}
}
else
{
pff = pf;
}
}
return tvff;
}
};

View File

@ -138,14 +138,6 @@ public:
);
GeometricField<Type, fvsPatchField, surfaceMesh>& vff = tvff.ref();
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
Boundary& vffbf = vff.boundaryFieldRef();
forAll(vffbf, patchi)
{
vffbf[patchi] = vf.boundaryField()[patchi];
}
const labelUList& own = mesh.owner();
const labelUList& nei = mesh.neighbour();
@ -154,6 +146,33 @@ public:
vff[facei] = minMod(vf[own[facei]], vf[nei[facei]]);
}
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
Boundary& bff = vff.boundaryFieldRef();
forAll(bff, patchi)
{
const fvPatchField<Type>& pf = vf.boundaryField()[patchi];
Field<Type>& pff = bff[patchi];
if (pf.coupled())
{
tmp<Field<Type>> tpif(pf.patchInternalField());
const Field<Type>& pif = tpif();
tmp<Field<Type>> tpnf(pf.patchNeighbourField());
const Field<Type>& pnf = tpnf();
forAll(pff, i)
{
pff[i] = minMod(pif[i], pnf[i]);
}
}
else
{
pff = pf;
}
}
return tvff;
}
};