diff --git a/src/functionObjects/utilities/ensightWrite/ensightWrite.C b/src/functionObjects/utilities/ensightWrite/ensightWrite.C index c3b927ff97..d9d0170369 100644 --- a/src/functionObjects/utilities/ensightWrite/ensightWrite.C +++ b/src/functionObjects/utilities/ensightWrite/ensightWrite.C @@ -85,6 +85,15 @@ Foam::functionObjects::ensightWrite::ensightWrite dirName_("ensightWrite"), consecutive_(false) { + if (postProcess) + { + // Disable for post-process mode. + // Emit as FatalError for the try/catch in the caller. + FatalError + << type() << " disabled in post-process mode" + << exit(FatalError); + } + read(dict); } diff --git a/src/functionObjects/utilities/vtkWrite/vtkWrite.C b/src/functionObjects/utilities/vtkWrite/vtkWrite.C index efc490d4c9..f5d28883ca 100644 --- a/src/functionObjects/utilities/vtkWrite/vtkWrite.C +++ b/src/functionObjects/utilities/vtkWrite/vtkWrite.C @@ -56,6 +56,15 @@ Foam::functionObjects::vtkWrite::vtkWrite selectFields_(), dirName_("VTK") { + if (postProcess) + { + // Disable for post-process mode. + // Emit as FatalError for the try/catch in the caller. + FatalError + << type() << " disabled in post-process mode" + << exit(FatalError); + } + read(dict); } diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/ensightWrite b/tutorials/incompressible/simpleFoam/motorBike/system/ensightWrite index 2630bdc3b6..6e609b30d2 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/ensightWrite +++ b/tutorials/incompressible/simpleFoam/motorBike/system/ensightWrite @@ -10,8 +10,8 @@ ensightWrite // Fields to output (words or regex) fields (U p "(k|epsilon|omega)"); - writeControl writeTime; - writeInterval 1; + writeControl writeTime; + writeInterval 1; } // ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/controlDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/controlDict index 2f6bf24381..05cc58fa59 100644 --- a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/controlDict +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/controlDict @@ -50,6 +50,7 @@ runTimeModifiable true; functions { + #include "ensightWrite" #include "vtkWrite" } diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/ensightWrite b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/ensightWrite new file mode 100644 index 0000000000..2345202b8e --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/ensightWrite @@ -0,0 +1,18 @@ +// -*- C++ -*- +// Minimal example of using the ensight write function object. +// Many more options possible +ensightWrite +{ + type ensightWrite; + libs ("libutilityFunctionObjects.so"); + log true; + + // Fields to output (words or regex) + fields (U p "(k|epsilon|omega)"); + + //- Write more frequent than fields + writeControl timeStep; + writeInterval 5; +} + +// ************************************************************************* //