Commit Graph

1674 Commits

Author SHA1 Message Date
5af2515f87 buoyantBoussinesqPimpleFoam: Corrected handling of time-step adjustment
Resolves bug-report http://bugs.openfoam.org/view.php?id=2104
2016-05-29 22:26:53 +01:00
8b672f0f1a postProcessing: Replaced 'foamCalc' and the 'postCalc' utilities
with the more general and flexible 'postProcess' utility and '-postProcess' solver option

Rationale
---------

Both the 'postProcess' utility and '-postProcess' solver option use the
same extensive set of functionObjects available for data-processing
during the run avoiding the substantial code duplication necessary for
the 'foamCalc' and 'postCalc' utilities and simplifying maintenance.
Additionally consistency is guaranteed between solver data processing
and post-processing.

The functionObjects have been substantially re-written and generalized
to simplify development and encourage contribution.

Configuration
-------------

An extensive set of simple functionObject configuration files are
provided in

OpenFOAM-dev/etc/caseDicts/postProcessing

and more will be added in the future.  These can either be copied into
'<case>/system' directory and included into the 'controlDict.functions'
sub-dictionary or included directly from 'etc/caseDicts/postProcessing'
using the '#includeEtc' directive or the new and more convenient
'#includeFunc' directive which searches the
'<etc>/caseDicts/postProcessing' directories for the selected
functionObject, e.g.

functions
{
    #includeFunc Q
    #includeFunc Lambda2
}

'#includeFunc' first searches the '<case>/system' directory in case
there is a local configuration.

Description of #includeFunc
---------------------------

    Specify a functionObject dictionary file to include, expects the
    functionObject name to follow (without quotes).

    Search for functionObject dictionary file in
    user/group/shipped directories.
    The search scheme allows for version-specific and
    version-independent files using the following hierarchy:
    - \b user settings:
      - ~/.OpenFOAM/\<VERSION\>/caseDicts/postProcessing
      - ~/.OpenFOAM/caseDicts/postProcessing
    - \b group (site) settings (when $WM_PROJECT_SITE is set):
      - $WM_PROJECT_SITE/\<VERSION\>/caseDicts/postProcessing
      - $WM_PROJECT_SITE/caseDicts/postProcessing
    - \b group (site) settings (when $WM_PROJECT_SITE is not set):
      - $WM_PROJECT_INST_DIR/site/\<VERSION\>/caseDicts/postProcessing
      - $WM_PROJECT_INST_DIR/site/caseDicts/postProcessing
    - \b other (shipped) settings:
      - $WM_PROJECT_DIR/etc/caseDicts/postProcessing

    An example of the \c \#includeFunc directive:
    \verbatim
        #includeFunc <funcName>
    \endverbatim

postProcess
-----------

The 'postProcess' utility and '-postProcess' solver option provide the
same set of controls to execute functionObjects after the run either by
reading a specified set of fields to process in the case of
'postProcess' or by reading all fields and models required to start the
run in the case of '-postProcess' for each selected time:

postProcess -help

Usage: postProcess [OPTIONS]
options:
  -case <dir>       specify alternate case directory, default is the cwd
  -constant         include the 'constant/' dir in the times list
  -dict <file>      read control dictionary from specified location
  -field <name>     specify the name of the field to be processed, e.g. U
  -fields <list>    specify a list of fields to be processed, e.g. '(U T p)' -
                    regular expressions not currently supported
  -func <name>      specify the name of the functionObject to execute, e.g. Q
  -funcs <list>     specify the names of the functionObjects to execute, e.g.
                    '(Q div(U))'
  -latestTime       select the latest time
  -newTimes         select the new times
  -noFunctionObjects
                    do not execute functionObjects
  -noZero           exclude the '0/' dir from the times list, has precedence
                    over the -withZero option
  -parallel         run in parallel
  -region <name>    specify alternative mesh region
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -time <ranges>    comma-separated time ranges - eg, ':10,20,40:70,1000:'
  -srcDoc           display source code in browser
  -doc              display application documentation in browser
  -help             print the usage

 pimpleFoam -postProcess -help

Usage: pimpleFoam [OPTIONS]
options:
  -case <dir>       specify alternate case directory, default is the cwd
  -constant         include the 'constant/' dir in the times list
  -dict <file>      read control dictionary from specified location
  -field <name>     specify the name of the field to be processed, e.g. U
  -fields <list>    specify a list of fields to be processed, e.g. '(U T p)' -
                    regular expressions not currently supported
  -func <name>      specify the name of the functionObject to execute, e.g. Q
  -funcs <list>     specify the names of the functionObjects to execute, e.g.
                    '(Q div(U))'
  -latestTime       select the latest time
  -newTimes         select the new times
  -noFunctionObjects
                    do not execute functionObjects
  -noZero           exclude the '0/' dir from the times list, has precedence
                    over the -withZero option
  -parallel         run in parallel
  -postProcess      Execute functionObjects only
  -region <name>    specify alternative mesh region
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -time <ranges>    comma-separated time ranges - eg, ':10,20,40:70,1000:'
  -srcDoc           display source code in browser
  -doc              display application documentation in browser
  -help             print the usage

The functionObjects to execute may be specified on the command-line
using the '-func' option for a single functionObject or '-funcs' for a
list, e.g.

postProcess -func Q
postProcess -funcs '(div(U) div(phi))'

In the case of 'Q' the default field to process is 'U' which is
specified in and read from the configuration file but this may be
overridden thus:

postProcess -func 'Q(Ua)'

as is done in the example above to calculate the two forms of the divergence of
the velocity field.  Additional fields which the functionObjects may depend on
can be specified using the '-field' or '-fields' options.

The 'postProcess' utility can only be used to execute functionObjects which
process fields present in the time directories.  However, functionObjects which
depend on fields obtained from models, e.g. properties derived from turbulence
models can be executed using the '-postProcess' of the appropriate solver, e.g.

pisoFoam -postProcess -func PecletNo

or

sonicFoam -postProcess -func MachNo

In this case all required fields will have already been read so the '-field' or
'-fields' options are not be needed.

Henry G. Weller
CFD Direct Ltd.
2016-05-28 18:58:48 +01:00
7a3f939aae etcFiles: Added functions to find directories in the 'etc' directories
'findEtcFiles' moved from OSspecific to 'etcFiles' as it is not OS-specific
2016-05-28 18:55:37 +01:00
f1a5196adf ReadFields: Added functions to read selected fields and store in the objectRegistry 2016-05-26 22:59:08 +01:00
d94368cf87 functionObjects::blendingFactor: Minor reformat 2016-05-26 22:58:46 +01:00
c2328cba3c fileName: Added recursive directory search function
//- Recursively search the given directory for the file
    //  returning the path relative to the directory or
    //  fileName::null if not found
    fileName search(const word& file, const fileName& directory);
2016-05-26 21:43:16 +01:00
0c34135438 SafeFatalIOError: Updated to print correct file and line number
Resolves bug-report http://bugs.openfoam.org/view.php?id=2102
Patch contributed by Mattijs Janssens
2016-05-26 17:40:37 +01:00
fd52818d3d etc/caseDicts/postProcessing: Updated for recent developments in functionObjects 2016-05-26 16:31:32 +01:00
53d97b8574 etc/caseDicts/postProcessing/fields: Added 'components' and 'div' 2016-05-26 15:34:15 +01:00
6ea0cbc9cb etc/caseDicts/postProcessing/fields/Q: Simplified 2016-05-26 15:34:01 +01:00
129532cbcf functionObjects::Q: Result field named "Q" if the field is "U" otherwise "Q(<fieldName>)" 2016-05-26 15:32:31 +01:00
f4ecb2ff23 functionObjects::randomise: New functionObject to create a field with a random perturbation 2016-05-26 15:32:10 +01:00
bf71b29434 messageStream: Updated 'DebugVar' to handle multi-line object output
Resolves feature-request http://bugs.openfoam.org/view.php?id=2101
Patch contributed by Mattijs Janssens
2016-05-26 14:57:15 +01:00
5976e79ceb surfaceInterpolation:localMin,localMax: Add support for consistent interpolation on coupled BCs
Resolves bug-report http://bugs.openfoam.org/view.php?id=2100
2016-05-26 14:55:44 +01:00
71addd7bbb functionObjects::magSqr, components: New functionObjects to calculate the 'magSqr' and 'components' of a field 2016-05-26 10:15:14 +01:00
b50e21467f regionFunctionObject: Indent 'write' messages 2016-05-26 10:14:51 +01:00
5badb830e9 functionObjects::fieldExpression: Corrected docs 2016-05-26 10:14:29 +01:00
5c6a393ead functionObjects:🔍 Removed redundant warning 2016-05-26 10:14:07 +01:00
640b38bbce functionObjects::blendingFactor: Removed redundant warning 2016-05-26 10:13:36 +01:00
48e5817039 messageStream: Added 'Log' macro which outputs to 'Info' if 'log' is true
regionFunctionObject: moved 'log_' to public 'log' to support the 'Log' macro
2016-05-25 18:19:46 +01:00
608da26c5d thermoSingleLayer: Provide better stabilization for the energy equation as delta -> 0 2016-05-25 18:12:07 +01:00
ef3c7c045d simpleControl: Change the number of steps printed to be relative to the current time (for restarts) rather than 0
Resolves feature-request http://bugs.openfoam.org/view.php?id=2096
2016-05-25 16:58:28 +01:00
0477b8f50c regionFunctionObject: Moved the field/object maintenance functions from fvMeshFunctionObject into regionFunctionObject 2016-05-25 16:26:57 +01:00
6bc00144fc functionObjects: Clear the result field from the objectRegistry if the argument fields are not available
This is needed to handle the processing of many time directories, some
of which may have the required fields and some not.
2016-05-25 15:40:58 +01:00
e9a37fee34 postProcess: catch missing field errors to process further time-directories 2016-05-25 15:39:37 +01:00
6b1a55dc9b codedFunctionObject: Updated documentation 2016-05-24 14:01:33 +01:00
9ef803920c functionObjects: Rationalize logging 2016-05-24 10:40:28 +01:00
70ccff6840 functionObjects::surfaceInterpolateFields: Derive from fvMeshFunctionObject 2016-05-24 10:40:02 +01:00
131c0eeb84 functionObjects::fieldAverage,turbulenceFields: derive from fvMeshFunctionObject 2016-05-24 09:57:41 +01:00
b454b7ce43 functionObjects::regionFunctionObject: Added optional 'log' entry (defaults to true) 2016-05-24 09:03:41 +01:00
aa70b282b4 functionObjects::MachNo: New functionObject to calculate the Mach number volScalarField
of a compressible single-phase flow

See tutorials/compressible/sonicFoam/laminar/forwardStep/system/controlDict
2016-05-23 21:45:41 +01:00
32b66139cd functionObjects::forces: Corrected lookup of fluidThermo 2016-05-23 21:45:07 +01:00
21773a47b6 etc/config.*/aliases: Renamed aliases to be less SHOUTY and confusing 2016-05-23 18:47:28 +01:00
16284bcd78 functionObjects::enstrophy: new functionObject to calculate the enstrophy of the velocity 2016-05-23 15:22:15 +01:00
2b07709b74 functionObjects::flowType: new functionObject which calculates and writes the flowType of velocity field
The flow type parameter is obtained according to the following equation:
    \verbatim
                 |D| - |Omega|
        lambda = -------------
                 |D| + |Omega|

        -1 = rotational flow
         0 = simple shear flow
         1 = planar extensional flow
    \endverbatim
2016-05-23 14:59:10 +01:00
2aec6916f0 functionObjects: Corrected 'grp' entries for 'field' functionObjects 2016-05-23 14:56:06 +01:00
39cf529866 DimensionedScalarField, GeometricScalarField: Added more rigorous dimension-checking for 'pow' functions 2016-05-23 12:04:02 +01:00
3ec4370139 functionObjects::pressure: Use the new 'tmp' 'move' constructor
to return unchanged 'tmp' arguments
2016-05-23 12:03:19 +01:00
8f75fa5d46 tmp: Added 'move' constructor to simplify return of unchanged 'tmp' arguments. 2016-05-23 12:01:36 +01:00
f58a48c675 functionObjects::pressureTools: simplified, standardized, rationalized and renamed 'pressure' 2016-05-22 21:29:46 +01:00
593df27f58 functionObjects::residuals: Minor reformatting 2016-05-22 21:29:22 +01:00
a3d88f3e82 functionObjects::writeDictionary: Write the dictionaries from the write function not execute 2016-05-22 21:28:46 +01:00
2e399d34bc functionObjects: Corrected member function documentation 2016-05-22 21:28:24 +01:00
da1c026f67 tutorials/incompressible/pimpleDyMFoam/propeller/system/Q: Updated 2016-05-22 19:03:23 +01:00
d69c9e3d1a functionObjects/field: link turbulenceModel 2016-05-22 19:02:59 +01:00
b93943ae55 functionObjects::yPlus: simplified, standardized, rationalized 2016-05-22 17:08:40 +01:00
e825f1ece0 fvcCellReduce: Correct signature and implementation of 'cellReduce' of a 'tmp' field 2016-05-22 17:07:53 +01:00
45e3b49c0d functionObjects::blendingFactor: simplified, standardized, rationalized 2016-05-22 16:30:48 +01:00
2ff102c5db fvMeshFunctionObject: Rename 'write' -> 'writeField' to avoid clash with base-class 2016-05-22 16:30:12 +01:00
2d1573d2ed transformGeometricField: Use '.ref()' to obtain non-const access to a temporary 2016-05-22 14:29:59 +01:00