Commit Graph

623 Commits

Author SHA1 Message Date
Henry Weller
de02a089ba tutorials: Removed references to 'sampleDict' 2016-06-13 14:53:56 +01:00
Chris Greenshields
cc151ce9a0 pimpleDyMFoam/mixerVesselAMI2D: removed redundant coefficient 2016-06-13 13:12:24 +01:00
Henry Weller
83321bd4f7 functionObjects: renamed faceSource -> surfaceRegion, cellSource -> volRegion
The use of the term 'source' in the context of post-processing is
confusing and does not properly describe the process of region
selection.  The new names 'surfaceRegion' and 'volRegion' better
describe the purpose of the functionObjects which is to provide field
processing functionality limited to a specified region of space, either
a surface or volume.

The keyword 'source' is renamed 'regionType' which better describes the
purpose which is to specify the method by which the surface or volume
region is selected.

The keyword to select the name of the surface or volume region is
renamed from 'sourceName' to 'name' consistent with the other
name-changes above.
2016-06-12 20:56:51 +01:00
Henry Weller
43b3fa2ce3 functionObjects::scalarTransport: simplified, standardized, rationalized
tutorials/incompressible/pisoFoam/les/pitzDaily: Added scalarTransport
functionObject to demonstrate the new functionality
2016-06-08 15:11:57 +01:00
Chris Greenshields
ee6188ed09 Removed fixedWalls from cuttingPatches because it is redundant now fixedWalls is noSlip 2016-06-08 14:08:26 +01:00
Chris Greenshields
c32f4fef00 Corrected RAS cavity case to be consistent with User Guide tutorial 2016-06-08 14:01:50 +01:00
Henry Weller
dd281330bc foamInfoExec: Time listing functionality superseded by foamListTimes 2016-06-03 19:23:27 +01:00
Henry Weller
ea6d010f51 tutorials/incompressible/pimpleDyMFoam/propeller: Use the standard 'Q' functionObject configuration 2016-05-31 21:21:41 +01:00
Henry Weller
d438da1eb7 ACMI: Corrected conservation issue
Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2057
2016-05-30 08:29:11 +01:00
Henry Weller
e4dc50dcb0 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
Henry Weller
8b3b04b2f0 tutorials/incompressible/pimpleDyMFoam/propeller/system/Q: Updated 2016-05-22 19:03:23 +01:00
Henry Weller
3eec5854be Standardized the selection of required and optional fields in BCs, fvOptions, functionObjects etc.
In most boundary conditions, fvOptions etc. required and optional fields
to be looked-up from the objectRegistry are selected by setting the
keyword corresponding to the standard field name in the BC etc. to the
appropriate name in the objectRegistry.  Usually a default is provided
with sets the field name to the keyword name, e.g. in the
totalPressureFvPatchScalarField the velocity is selected by setting the
keyword 'U' to the appropriate name which defaults to 'U':

        Property     | Description             | Required    | Default value
        U            | velocity field name     | no          | U
        phi          | flux field name         | no          | phi
        .
        .
        .

However, in some BCs and functionObjects and many fvOptions another
convention is used in which the field name keyword is appended by 'Name'
e.g.

        Property     | Description             | Required    | Default value
        pName        | pressure field name     | no          | p
        UName        | velocity field name     | no          | U

This difference in convention is unnecessary and confusing, hinders code
and dictionary reuse and complicates code maintenance.  In this commit
the appended 'Name' is removed from the field selection keywords
standardizing OpenFOAM on the first convention above.
2016-05-21 20:28:20 +01:00
Henry Weller
83c7e97655 dynamicCode: Renamed 'redirectType' to 'name' to clarify the purpose
of the entry which is to provide the name of the generated class.

'redirectType' is supported for backward-compatibility.
2016-05-18 23:10:42 +01:00
Henry Weller
83bae2efd3 functionObjects: Renamed dictionary entry 'functionObjectLibs' -> 'libs'
This changes simplifies the specification of functionObjects in
controlDict and is consistent with the 'libs' option in controlDict to
load special solver libraries.

Support for the old 'functionObjectLibs' name is supported for backward compatibility.
2016-05-16 22:09:01 +01:00
Henry Weller
78d2971b21 functionObjects: rewritten to all be derived from 'functionObject'
- Avoids the need for the 'OutputFilterFunctionObject' wrapper
  - Time-control for execution and writing is now provided by the
    'timeControlFunctionObject' which instantiates the processing
    'functionObject' and controls its operation.
  - Alternative time-control functionObjects can now be written and
    selected at run-time without the need to compile wrapped version of
    EVERY existing functionObject which would have been required in the
    old structure.
  - The separation of 'execute' and 'write' functions is now formalized in the
    'functionObject' base-class and all derived classes implement the
    two functions.
  - Unnecessary implementations of functions with appropriate defaults
    in the 'functionObject' base-class have been removed reducing
    clutter and simplifying implementation of new functionObjects.
  - The 'coded' 'functionObject' has also been updated, simplified and tested.
  - Further simplification is now possible by creating some general
    intermediate classes derived from 'functionObject'.
2016-05-15 16:40:01 +01:00
Henry Weller
274d1df8a4 snappyHexMesh: Automatically remove zero-sized patches
All patches are preserved if the 'keepPatches' option is set true.
Patch contributed by Mattijs Janssens
2016-05-13 17:47:38 +01:00
Henry Weller
6164c2f262 Standardized the naming of functions which control the writing of fields etc.
to have the prefix 'write' rather than 'output'

So outputTime() -> writeTime()

but 'outputTime()' is still supported for backward-compatibility.

Also removed the redundant secondary-writing functionality from Time
which has been superseded by the 'writeRegisteredObject' functionObject.
2016-05-12 17:38:01 +01:00
Henry Weller
c983670c91 functionObjects: Changed options 'outputControl' -> 'writeControl' and 'outputInterval' -> 'writeInterval'
for consistency with the time controls in controlDict and to avoid
unnecessary confusion.  All code and tutorials have been updated.

The old names 'outputControl' and 'outputInterval' are but supported for
backward compatibility but deprecated.
2016-05-12 11:38:11 +01:00
Henry Weller
34811e43cd tutorials/incompressible/simpleFoam: Updated for changes in functionObjects 2016-05-09 19:12:38 +01:00
Henry Weller
fe16f10f26 tutorials: "readFields" is no longer needed to post-process functionObjects
Use the solver '-postProcess' command-line option instead of execFlowFunctionObjects
2016-05-09 17:03:15 +01:00
Henry Weller
cf4b35693c tutorials: Remove the unnecessary "\"s on "cp", "rm" and "mv"
Resolves bug-report http://bugs.openfoam.org/view.php?id=2077
2016-05-05 15:17:55 +01:00
Henry Weller
1b34231340 tutorials: Renamed .org -> .orig
See http://www.openfoam.org/mantisbt/view.php?id=2076
  - .org is the file extension for emacs org-mode as well
  - .orig is more to the point (.org isn't always recognized as "original")
  - .original is too long, although more consistent with the convention
    of source code file naming

Update script contributed by Bruno Santos
2016-04-30 21:53:50 +01:00
Henry Weller
294379d421 tutorials/incompressible/pisoFoam/les/motorBike: Corrected typos
Resolves bug-report http://openfoam.org/mantisbt/view.php?id=2061
2016-04-21 21:13:10 +01:00
Henry Weller
ed2cff905c tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre: Updated for latest version of collapseEdges 2016-03-06 21:34:31 +00:00
Henry Weller
4bc77e6aff Sprucing up the tutorials folder and adding -dict to "collapseEdges"
Patch provided by Bruno Santos
Resolves patch application request http://www.openfoam.org/mantisbt/view.php?id=2015
2016-03-06 19:06:44 +00:00
Henry Weller
350d03246e scripts: Reformat with consistent section separators 2016-02-15 18:30:24 +00:00
Henry Weller
cfa7678ba8 foamRunTutorials: Rationalized support for the "-test" option
RunFunctions: Added "isTest()" argument parsing function
tutorials: Updated Allrun scripts to propagate the "-test" option
tutorials: Removed the lower Alltest scripts and updated the Allrun to
    use the "isTest()" function to handle test-specific operation
2016-02-15 15:49:05 +00:00
Henry Weller
caf3c353d3 tutorials: Simplified the Allrun and Allclean scripts 2016-02-14 18:32:34 +00:00
Henry Weller
fc2ce73723 Solvers: Added support for extrapolated pressure boundary conditions
The boundary conditions of HbyA are now constrained by the new "constrainHbyA"
function which applies the velocity boundary values for patches for which the
velocity cannot be modified by assignment and pressure extrapolation is
not specified via the new
"fixedFluxExtrapolatedPressureFvPatchScalarField".

The new function "constrainPressure" sets the pressure gradient
appropriately for "fixedFluxPressureFvPatchScalarField" and
"fixedFluxExtrapolatedPressureFvPatchScalarField" boundary conditions to
ensure the evaluated flux corresponds to the known velocity values at
the boundary.

The "fixedFluxPressureFvPatchScalarField" boundary condition operates
exactly as before, ensuring the correct flux at fixed-flux boundaries by
compensating for the body forces (gravity in particular) with the
pressure gradient.

The new "fixedFluxExtrapolatedPressureFvPatchScalarField" boundary
condition may be used for cases with or without body-forces to set the
pressure gradient to compensate not only for the body-force but also the
extrapolated "HbyA" which provides a second-order boundary condition for
pressure.  This is useful for a range a problems including impinging
flow, extrapolated inlet conditions with body-forces or for highly
viscous flows, pressure-induced separation etc.  To test this boundary
condition at walls in the motorBike tutorial case set

    lowerWall
    {
        type            fixedFluxExtrapolatedPressure;
    }

    motorBikeGroup
    {
        type            fixedFluxExtrapolatedPressure;
    }

Currently the new extrapolated pressure boundary condition is supported
for all incompressible and sub-sonic compressible solvers except those
providing implicit and tensorial porosity support.  The approach will be
extended to cover these solvers and options in the future.

Note: the extrapolated pressure boundary condition is experimental and
requires further testing to assess the range of applicability,
stability, accuracy etc.

Henry G. Weller
CFD Direct Ltd.
2016-02-13 17:48:26 +00:00
Henry Weller
e405c69c39 tutorials/incompressible/icoFoam: Simplified the handling of the wall BCs in cavityClipped 2016-02-12 18:09:21 +00:00
Henry Weller
0315d654d9 tutorials: Add pFinal to PISO settings in icoFoam and mhdFoam tutorials 2016-02-12 15:48:10 +00:00
Henry Weller
daf44fda3d tutorials and templates: Updated wall BC for velocity to noSlip 2016-02-09 20:08:34 +00:00
Henry Weller
9233361899 noSlip: New wall boundary condition for velocity
noSlip is equivalent to fixedValue with a value of (0 0 0) but is
simpler to specify e.g.

     upperWall
     {
         type            noSlip;
     }
2016-02-09 18:45:13 +00:00
Henry Weller
011177665f porousBlockage: New pisoFoam tutorial to demonstrate the porosity source fvOption
To see the different behavior of flow through and around the blockage
change D in constant/fvOptions:

        // D 100;  // Very little blockage
        // D 200;  // Some blockage but steady flow
        // D 500;  // Slight waviness in the far wake
        D 1000; // Fully shedding behavior
2016-02-09 13:42:39 +00:00
Henry Weller
923f39a9f8 tutorials/incompressible/nonNewtonianIcoFoam: Added pFinal 2016-02-02 20:06:08 +00:00
Henry Weller
b3d47f0423 bin/tools/RunFunctions: runParallel now obtains the number of processors from numberOfSubdomains
in decomposeParDict.

This default number of processors may be overridden by the new "-np"
option to runParallel which must be specified before the application
name e.g.:

runParallel -np 4 pisoFoam
2016-01-27 14:19:25 +00:00
Henry Weller
f23ab37eca tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun: Updated to handle missing polyMesh dir 2015-12-14 10:22:06 +00:00
Henry Weller
33fdce88f5 porosityModels: Specification of name and dimensions of porosity coefficients is now optional
e.g.

    DarcyForchheimerCoeffs
    {
        d   (5e7 -1000 -1000);
        f   (0 0 0);

        coordinateSystem
        {
            type    cartesian;
            origin  (0 0 0);
            coordinateRotation
            {
                type    axesRotation;
                e1      (1 0 0);
                e2      (0 0 1);
            }
        }
    }
2015-11-17 12:05:57 +00:00
Henry Weller
d98136e122 tutorials: Removed unnecessary "boundary" files 2015-11-13 20:05:37 +00:00
Chris Greenshields
ad24568623 Redundant boundary.org files removed from tutorial cases 2015-11-13 16:59:58 +00:00
Henry Weller
d073e483b8 tutorials/incompressible/simpleFoam/pitzDaily: Change default model to kEpsilon
and reduce relaxation factors to improve stability over a range of
models and systems.
2015-11-01 12:24:25 +00:00
Henry Weller
f4202d9ee6 sixDoFSolver: Run-time selectable solver (integrator) for sixDoFRigidBodyMotion
The built-in explicit symplectic integrator has been replaced by a
general framework supporting run-time selectable integrators.  Currently
the explicit symplectic, implicit Crank-Nicolson and implicit Newmark
methods are provided, all of which are 2nd-order in time:

Symplectic 2nd-order explicit time-integrator for 6DoF solid-body motion:

    Reference:
        Dullweber, A., Leimkuhler, B., & McLachlan, R. (1997).
        Symplectic splitting methods for rigid body molecular dynamics.
        The Journal of chemical physics, 107(15), 5840-5851.

    Can only be used for explicit integration of the motion of the body,
    i.e. may only be called once per time-step, no outer-correctors may be
    applied.  For implicit integration with outer-correctors choose either
    CrankNicolson or Newmark schemes.

    Example specification in dynamicMeshDict:
    solver
    {
        type    symplectic;
    }

Newmark 2nd-order time-integrator for 6DoF solid-body motion:

    Reference:
        Newmark, N. M. (1959).
        A method of computation for structural dynamics.
        Journal of the Engineering Mechanics Division, 85(3), 67-94.

    Example specification in dynamicMeshDict:
    solver
    {
        type    Newmark;
        gamma   0.5;    // Velocity integration coefficient
        beta    0.25;   // Position integration coefficient
    }

Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion:

    The off-centering coefficients for acceleration (velocity integration) and
    velocity (position/orientation integration) may be specified but default
    values of 0.5 for each are used if they are not specified.  With the default
    off-centering this scheme is equivalent to the Newmark scheme with default
    coefficients.

    Example specification in dynamicMeshDict:
    solver
    {
        type    CrankNicolson;
        aoc     0.5;    // Acceleration off-centering coefficient
        voc     0.5;    // Velocity off-centering coefficient
    }

Both the Newmark and Crank-Nicolson are proving more robust and reliable
than the symplectic method for solving complex coupled problems and the
tutorial cases have been updated to utilize this.

In this new framework it would be straight forward to add other methods
should the need arise.

Henry G. Weller
CFD Direct
2015-10-19 14:03:46 +01:00
Henry Weller
81e083fc59 wingMotion tutorials: added missing ';' 2015-10-01 14:07:29 +01:00
Henry Weller
7be9bb61e6 tutorials/incompressible/SRFSimpleFoam/mixer: Improved case setup and schemes 2015-07-24 17:01:27 +01:00
Henry Weller
37cfc3ab46 tutorials: Removed unnecessary spaces between parentheses and values in vectors 2015-07-21 20:55:44 +01:00
Henry Weller
4c21f24a8c Input of dimensionedScalars: update read-construction of dimensionedScalar in applications
so that the specification of the name and dimensions are optional in property dictionaries.

Update tutorials so that the name of the dimensionedScalar property is
no longer duplicated but optional dimensions are still provided and are
checked on read.
2015-07-20 22:52:53 +01:00
Henry Weller
15198a34bd fluxRequired: Added setFluxRequired function to fvSchemes class
Added calls to setFluxRequired for p in all incompressible solvers which
avoids the need to add fluxRequired entries in fvSchemes dictionary.

Will add calls to setFluxRequired to the rest of the solvers.
2015-07-15 15:04:51 +01:00
Henry Weller
59f17355cf rotorDiskSource: Debugged the duplicated interpolation functions
Needs rewriting to avoid unnecessary code duplication, preferably using
standard OpenFOAM interpolation functionality.
2015-07-03 12:41:25 +01:00
Henry Weller
8c8a3a162f tutorials/incompressible/simpleFoam/rotorDisk: Tutorial for the rotorDiskSource functionObject
Provided by Richard Jones
2015-07-01 12:37:21 +01:00
Henry Weller
256be2641f Renamed pressureGradientExplicitSource to meanVelocityForce
as it is the applied the force necessary to maintain the specified mean velocity
2015-06-30 19:13:16 +01:00