diff --git a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H index 443bab5f1f..d818f2f0e5 100644 --- a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H +++ b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H @@ -27,15 +27,17 @@ tmp > 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(); } }