Commit Graph

24 Commits

Author SHA1 Message Date
46e7dab0cb ENH: Adding stabilizationSchemes FO and tutorial 2018-06-06 12:54:34 -07:00
091d847094 ENH: Added a new function object to create a field relative to a field value
Calculates and outputs a field whose values are offset to a reference
    value obtained by sampling the field at a user-specified location.

    The field values are calculated using:

    \f[
        f_c = s(f_{c,t} - f_p + f_{off})
    \f]

    where
    \vartable
        f_c     | field values at cell
        s       | optional scale factor (default = 1)
        f_{c,t} | current field values at cell at this time
        f_p     | field value at position
        f_{off} | offset field value (default = 0)
    \endvartable

Usage
    Example of function object specification to calculate the reference
field:
    \verbatim
    pRef
    {
        type        reference;
        libs        ("libfieldFunctionObjects.so");
        ...
        field       p;
        result      pRef;
        position    (0 0 0);
        scale       1.2;
        offset      100000;
    }
    \endverbatim
2018-05-08 13:19:46 +01:00
fb152bd9c9 COMP: Added missing make/files entries. Fixes #682 2017-12-26 23:16:06 +00:00
21716842fd ENH: Added new Curle function object
Calculates the acoustic pressure based on Curle's analogy.

Curle's analogy is implemented as:

    \f[
        p' = 4 \frac{\pi}{c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)}
    \f]

where
    p'          | Curle's acoustic pressure [Pa] or [Pa (m3/rho)]
    c_0         | Reference speed of sound [m/s]
    \vec d      | Distance vector to observer locations [m]
    F           | Force [N] or [N (m3/rho)]
2017-06-26 13:32:14 +01:00
a6ef8b9027 INT: Integration of isoAdvector and supporting material
Community contribution from Johan Roenby, DHI

IsoAdvector is a geometric Volume-of-Fluid method for advection of a
sharp interface between two incompressible fluids. It works on both
structured and unstructured meshes with no requirements on cell shapes.
IsoAdvector is as an alternative choice for the interface compression
treatment with the MULES limiter implemented in the interFoam family
of solvers.

The isoAdvector concept and code was developed at DHI and was funded
by a Sapere Aude postdoc grant to Johan Roenby from The Danish Council
for Independent Research | Technology and Production Sciences (Grant-ID:
DFF - 1337-00118B - FTP).
Co-funding is also provided by the GTS grant to DHI from the Danish
Agency for Science, Technology and Innovation.

The ideas behind and performance of the isoAdvector scheme is
documented in:

    Roenby J, Bredmose H, Jasak H. 2016 A computational method for sharp
    interface  advection. R. Soc. open sci. 3: 160405.
    [http://dx.doi.org/10.1098/rsos.160405](http://dx.doi.org/10.1098/rsos.160405)

Videos showing isoAdvector's performance with a number of standard
test cases can be found in this youtube channel:

    https://www.youtube.com/channel/UCt6Idpv4C8TTgz1iUX0prAA

Project contributors:

* Johan Roenby <jro@dhigroup.com> (Inventor and main developer)
* Hrvoje Jasak <hrvoje.jasak@fsb.hr> (Consistent treatment of
  boundary faces including processor boundaries, parallelisation,
  code clean up
* Henrik Bredmose <hbre@dtu.dk> (Assisted in the conceptual
  development)
* Vuko Vukcevic <vuko.vukcevic@fsb.hr> (Code review, profiling,
  porting to foam-extend, bug fixing, testing)
* Tomislav Maric <tomislav@sourceflux.de> (Source file
  rearrangement)
* Andy Heather <a.heather@opencfd.co.uk> (Integration into OpenFOAM
  for v1706 release)

See the integration repository below to see the full set of changes
implemented for release into OpenFOAM v1706

    https://develop.openfoam.com/Community/Integration-isoAdvector
2017-06-20 14:36:15 +01:00
af434646d3 Adding flux to Make/files. And updating scalarTransport header instructions
scalarTransport does not generate its own phiMean anymore but it is given from the user.
This "flux" can be generated using the "flux" FO
2016-12-20 12:27:36 -08:00
f0a046fa81 GIT: Resolved conflict 2016-12-14 15:56:58 +00:00
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +00:00
031c75374e ENH: Relocated injectedParticle class to lagrangian library 2016-12-01 17:04:37 +00:00
8602fd13f4 ENH: Initial commit of new particleDistribution FO - generates 'general' distribution for lagrangian particle clouds 2016-12-01 16:52:37 +00:00
78bb633dfc ENH: extractEulerianParticles FO - refactored to output a cloud of particles - distribution analysis to follow... 2016-11-30 23:32:33 +00:00
271c8c8c6e ENH: Added new extractEulerianParticles function object
Generates discrete particle data from multiphase calculations by
interrogating the phase fraction field at a faceZone.

Data is written in raw form, i.e. per particle collected, with
as an optional binned distribution
2016-11-29 14:56:48 +00:00
7d39328b5a functionObjects::add: Add list of fields
The operation can be applied to any volume or surface fields generating a
    volume or surface scalar field.

    Example of function object specification:
    \verbatim
    Ttot
    {
        type            add;
        libs            ("libfieldFunctionObjects.so");
        fields          (T Tdelta);
        result          Ttot;
        executeControl  writeTime;
        writeControl    writeTime;
    }
    \endverbatim

Also refactored functionObjects::fieldsExpression to avoid code
duplication between the 'add' and 'subtract' functionObjects.
2016-11-19 21:48:48 +00:00
0eca493cb8 functionObjects::subtract: From the first field subtract the remaining fields in the list
The operation can be applied to any volume or surface fields generating a
    volume or surface scalar field.

    Example of function object specification:
    \verbatim
    Tdiff
    {
        type            subtract;
        libs            ("libfieldFunctionObjects.so");
        fields          (T Tmean);
        result          Tdiff;
        executeControl  writeTime;
        writeControl    writeTime;
    }
    \endverbatim
2016-11-18 22:20:22 +00:00
47eb24bed5 GIT: Resolved conflicts arising from merge with develop branch 2016-09-26 10:57:34 +01:00
b9940cbbb1 COMP: Multiple changes - first clean build after latest merge - UNTESTED 2016-09-23 15:36:53 +01:00
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
7b788f0922 functionObjects::volRegion: General base-class to handle vol (cell) region processing
Renamed the original volRegion -> volFieldValue to clarify the purpose
of this class to process vol fields on a volRegion.
2016-08-11 15:11:19 +01:00
3e3a183732 Completed transformation of post-processing utilities into functionObjects 2016-06-28 19:26:23 +01:00
850013e732 functionObjects::XiReactionRate: Writes the turbulent flame-speed and reaction-rate volScalarFields for the Xi-based combustion models
Replaces the obsolete and 'wdot' utility.
2016-06-27 08:58:36 +01:00
28f049e9b9 writeCellCentres utility: Replaced by writeCellCentres functionObject
postProcess -func writeCellCentres
2016-06-27 07:51:19 +01:00
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
4734b1af5b wallShearStress: utility replaced by functionObject used with the '-postProcess' option 2016-06-09 16:05:13 +01:00
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