Based on patch contributed by Juho Peltola, VTT Resolves feature request https://bugs.openfoam.org/view.php?id=2572