diff --git a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H index 443bab5f1f0456208692ae94e11b964da0baf09f..d818f2f0e5fb334baba91c8de5bd09b424b617f3 100644 --- a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H +++ b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H @@ -27,15 +27,17 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate sf.rename(vf.name() + '_' + dir.name()); // Correct BCs of the positive (outgoing) fluxes - if (dir[0] > 0) + forAll(sf.boundaryField(), patchi) { - forAll(sf.boundaryField(), patchi) + if + ( + !sf.boundaryField()[patchi].coupled() + && sf.boundaryField()[patchi].size() + && dir.boundaryField()[patchi][0] > 0 + ) { - if (!sf.boundaryField()[patchi].coupled()) - { - sf.boundaryField()[patchi] = - vf.boundaryField()[patchi].patchInternalField(); - } + sf.boundaryField()[patchi] = + vf.boundaryField()[patchi].patchInternalField(); } }