ENH: support user specification of ensight time format/precision (#2999)

- new format option keywords: timeFormat, timePrecision

CONFIG: default ensight output is now consistently BINARY

- this removes some uncertainty with the ensightWrite functionObject
  which was previously dependent on the simulation writeFormat
  and makes its behaviour consistent with foamToEnsight

  Note: binary Ensight output is consistent with the
  defaults for VTP output (inline binary)

ENH: minor adjustment of ensight writing methods
This commit is contained in:
Mark Olesen
2023-10-17 15:00:29 +02:00
committed by Andrew Heather
parent 8ec35d0b26
commit dafae668d1
23 changed files with 458 additions and 225 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -97,10 +97,7 @@ Foam::functionObjects::ensightWrite::ensightWrite
:
fvMeshFunctionObject(name, runTime, dict),
writeOpts_(),
caseOpts_
(
IOstreamOption::formatEnum("format", dict, runTime.writeFormat())
),
caseOpts_("format", dict, IOstreamOption::BINARY),
outputDir_(),
consecutive_(false),
meshState_(polyMesh::TOPO_CHANGE),
@ -180,6 +177,9 @@ bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
caseOpts_.width(dict.getOrDefault<label>("width", 8));
caseOpts_.overwrite(dict.getOrDefault("overwrite", false));
caseOpts_.timeFormat("timeFormat", dict);
caseOpts_.timePrecision("timePrecision", dict);
// Output directory

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,6 +42,9 @@ Description
writeInterval 1;
format binary;
timeFormat scientific;
timePrecision 5;
overwrite true;
width 12;
@ -95,11 +98,13 @@ Description
\heading Ensight Output Options
\table
Property | Description | Required | Default
format | ascii or binary format | no | same as simulation
format | ascii or binary format | no | binary
width | Mask width for \c data/XXXX | no | 8
directory | The output directory name | no | postProcessing/NAME
overwrite | Remove existing directory | no | false
consecutive | Consecutive output numbering | no | false
timeFormat | Time format (ensight case) | no | scientific
timePrecision | Time precision (ensight case) | no | 5
\endtable
\heading Output Selection