Commit Graph

1069 Commits

Author SHA1 Message Date
6ab699633d ENH: wallHeatFlux - separated field and log writing. Fixes #1613 2020-03-11 17:45:25 +00:00
aa9be5b5cd ENH: nearWallFields - updated construction of sampled field. Fixes #1620 2020-03-11 15:26:46 +00:00
2c4b639e1f ENH: 'mag' postOperation for surfaceFieldValue (#1622)
- support postOperation for volFieldValue as well
2020-03-11 11:59:04 +01:00
6f230a8b67 COMP: Corrections for icc compiler. Fixes #1608 2020-03-03 17:00:35 +00:00
fc26fb758d ENH: add stringListOps with whitelist/blacklist matching
- refactored from ensightMesh, foamToVTK, surfaceMeshExtract

STYLE: use wordRes matching() method instead of findString() function
2020-02-26 21:40:09 +01:00
4e6caf8d61 STYLE: return Switch by value, not const-reference 2020-02-21 11:44:29 +01:00
514751dcf7 STY: General clean up 2020-02-19 10:40:56 -08:00
499933dbab ENH: Adding features for phase change solvers
1) Adding interfaceHeight FO
2) Adding interfaceHeatResistance mass transfer model to
   interCondensatingEvaporatingFoam with spread source approach
3) Reworking framework for icoReactingMultiphaseInterFoam
2020-02-19 14:18:25 +00:00
33f9ae5080 ENH: improvements to IOstreamOption
* Support default values for format/compress enum lookups.

  - Avoids situations where the preferred default format is not ASCII.
    For example, with dictionary input:

        format binar;

    The typing mistake would previously have caused formatEnum to
    default to ASCII. We can now properly control its behaviour.

        IOstream::formatEnum
        (
            dict.get<word>("format"), IOstream::BINARY
        );

    Allowing us to switch ascii/binary, using BINARY by default even in
    the case of spelling mistakes. The mistakes are flagged, but the
    return value can be non-ASCII.

* The format/compression lookup behave as pass-through if the lookup
  string is empty.

  - Allows the following to work without complaint

      IOstream::formatEnum
      (
          dict.getOrDefault("format", word::null), IOstream::BINARY
      );

  - Or use constructor-like failsafe method

      IOstream::formatEnum("format", dict, IOstream::BINARY);

  - Apply the same behaviour with setting stream format/compression
    from a word.

       is.format("binar");

    will emit a warning, but leave the stream format UNCHANGED

* Rationalize versionNumber construction

  - constexpr constructors where possible.
    Default construct is the "currentVersion"

  - Construct from token to shift the burden to versionNumber.
    Support token as argument to version().

    Now:

        is.version(headerDict.get<token>("version"));

    or failsafe constructor method

        is.version
        (
            IOstreamOption::versionNumber("version", headerDict)
        );

    Before (controlled input):

        is.version
        (
            IOstreamOption::versionNumber
            (
                headerDict.get<float>("version")
            )
        );

    Old, uncontrolled input - has been removed:

        is.version(headerDict.lookup("version"));

* improve consistency, default behaviour for IOstreamOption construct

  - constexpr constructors where possible

  - add copy construct with change of format.

  - construct IOstreamOption from streamFormat is now non-explicit.
    This is a commonly expected result with no ill-effects
2020-02-18 21:51:35 +01:00
55e7da670c ENH: improve analytical eigendecompositions
- `tensor` and `tensor2D` returns complex eigenvalues/vectors
  - `symmTensor` and `symmTensor2D` returns real eigenvalues/vectors
  - adds new test routines for eigendecompositions
  - improves numerical stability by:
    - using new robust algorithms,
    - reordering the conditional branches in root-type selection
2020-02-18 12:21:01 +00:00
a97628121c ENH: overhaul ensight handling (#1579)
- includes restructuring and simplification of low-level ensight part
  handling and refactor of backends to improve code reuse.

foamToEnsight
-------------

  * new cellZone support.
    This was previously only possible via a separate foamToEnsightParts
    utility that was not parallelized.

  * support for point fields.

  * `-nearCellValue` option (as per foamToVTK)

  * data indexing now uses values from the time index.
    This is consistent with the ensightWrite function object and
    can help with restarts.

  * existing ensight directories are removed, unless the -no-overwrite
    option is supplied

foamToEnsightParts
------------------
  * now redundant and removed.

ensightOutputSurface (new class)
--------------------------------
  * a lightweight wrapper for point/face references that is tailored
    for the ensightSurfaceWriter. It uses compact face/point information
    and is serial only, since this is the format requirements from the
    surfaceWriter class.

ensightMesh (revised class)
---------------------------
  * now only holds a polyMesh reference, which removes its dependency
    on finiteVolume and allows it to be relocated under fileFormats
    instead of conversion.

Removed classes: ensightParts, ensighPartFaces, ensightPartCells

- these were used by foamToEnsightParts, but not needed anymore.
2020-02-18 11:09:43 +00:00
ae5c7dab36 DEFEATURE: remove runTimePostProcessing (migrate to submodule) 2020-01-23 14:22:26 +01:00
596e4aef3f STYLE: remove trailing space, tabs 2020-01-22 10:00:03 +01:00
8e78a27822 BUG: pressure FO - resolved hydrostatic contribution for incompressible cases. See #1544 2020-01-07 16:17:25 +00:00
83e0501a77 Merge branch 'develop' of https://develop.openfoam.com/Development/openfoam into develop 2019-12-16 13:40:35 +00:00
da06067213 ENH: surfaceDistance: FO to calc distance-to-surface field. Fixes #1523. 2019-12-16 12:18:34 +00:00
1a16207e0d COMP: compilation of Test-QRMatrix (clang, int64)
- remove unused local functions from volumeExprDriver
2019-12-16 11:22:15 +01:00
b63721f8bc Merge branch 'feature-proudmann-fo' into 'develop'
ENH: Added new function object to compute the Proudman acoustic power

See merge request Development/openfoam!303
2019-12-13 20:04:26 +00:00
30fe28ee8e ENH: Added new function object to compute the Proudman acoustic power
Calculates the acoustic power due to the volume of isotropic turbulence
using Proudman's formula

The acoustic power \f$ P_A \f$ [W/m3] in terms of turbulence \f$ k \f$
and \f$ \epsilon \f$ is given as:

    \f[
        P_A = alpha_\epsilon \rho \epsilon M_t^5
    \f]

where \f$ alpha_\epsilon \f$ is a constant (0.1) and

    \f[
        M_t = \frac{\sqrt{2 k}}{a_0}
    \f]

with \f$ a_0 \f$ the speed of sound.  The acoustic power is also output in
dB using:

    \f[
        L_P = 10 \log \frac{P_A}{P_ref}
    \f]

where \f$ P_ref \f$ is a constant (1e-12 W/m3)

Usage
    Example of function object specification to calculate the Proudman acoustic
    power

    proudmanAcousticPower1
    {
        type        proudmanAcousticPower;
        libs        ("libfieldFunctionObjects.so");
        ...

        // Required additional entries for incompressible calculations
        rhoInf      1.225;
        aRef        340;
    }

    Where the entries comprise:
        Property     | Description                 | Required   | Default value
        type         | type name: proudmanAcousticPower         | yes        |
        rhoInf       | Freestream density for incompressible cases  | no |
        aRef         | Reference spped of sound for incompressible cases | no |
        alphaEps     | Model coefficient           | no         | 0.1

Note
- The freestream density and reference speed of sound are only necessary
  when a thermodynamics package is unavailable, typically for incompressible
  cases.
2019-12-11 21:37:39 +00:00
a8ab9b8796 CONFIG: prefer use of ParaView_MESA_DIR in runTimePostProcessing
- when using VTK from ParaView sources it can better to tag them as
  such, but simultaneously not mask the ParaView with hardware
  rendering.

  The additional ParaView_MESA_DIR variable allows this.
  The balance of library and path setup is unaffected by this.

DOC: update doc/BuildIssues
2019-12-12 14:29:59 +01:00
6709f3ef6f ENH: Added new limitFields function object
Limits fields to user-specified min and max bounds

Usage
Example of function object specification:

    limitFields1
    {
        type        limitFields;
        libs        ("libfieldFunctionObjects.so");
        ...
        fields      (U);
        limit       max;
        max         100;
    }

Where the entries comprise:
    Property     | Description                 | Required | Default
    type         | type name: limitFields      | yes |
    fields       | list of fields to process   | yes |
    limit        | bound to limit - see below  | yes |
    min          | min limit value             | partly |
    max          | max limit value             | partly |

The "limit" entry can take the value:
- min : specify a minimum value
- max : specify a maximum value
- both : specify a minimum value and a maximum value
2019-12-10 11:04:20 +00:00
31aad2159f STYLE: writeFile - renamed writeTime to writeCurrentTime to avoid conflicts 2019-09-09 09:19:38 +01:00
5d7d24df94 GIT: Housekeeping 2019-12-06 17:43:08 +00:00
98467036b3 STYLE: regularize quoting and exit on failed 'cd' 2019-11-13 13:19:16 +01:00
7e9a417fca STYLE: adjust member ordering to improve packing (of bools) 2019-11-12 16:57:45 +01:00
3238a63a10 DOC: add description text for AMIWeights, fieldsExpression 2019-11-12 14:26:41 +01:00
7c1190f0b1 ENH: rationalize some string methods.
- silently deprecate 'startsWith', 'endsWith' methods
  (added in 2016: 2b14360662), in favour of
  'starts_with', 'ends_with' methods, corresponding to C++20 and
  allowing us to cull then in a few years.

- handle single character versions of starts_with, ends_with.

- add single character version of removeEnd and silently deprecate
  removeTrailing which did the same thing.

- drop the const versions of removeRepeated, removeTrailing.
  Unused and with potential confusion.

STYLE: use shrink_to_fit(), erase()
2019-11-11 18:50:00 +01:00
186b0350f9 ENH: Pressure function object - added optional inclusion of hydrostatic pressure
Example - create p-rgh from p:

    pressure-p-rgh
    {
        type            pressure;
        libs            (fieldFunctionObjects);
        writeControl    writeTime;
        mode            static;
        rho             rhoInf;
        rhoInf          1;
        hydrostaticMode subtract;
        g               (0 -9.81 0);
        hRef            0;
    }

- the hydrostaticMode entry is optional - setting is shown during construction
- g and/or hRef values are retrieved from the database if not specified
2019-10-22 15:54:13 +01:00
671519d2d9 ENH: Function objects - runTimePostProcessing - updated and exposed culling options 2019-11-01 11:03:30 +00:00
52d2643994 BUG: surfaceFieldValue interpolate on sampled surface fails (fixes #1488) 2019-11-11 08:54:05 +01:00
e6dfb39c66 STYLE: remove unnecessary stdout, stderr /dev/null redirects
- no stderr redirect needed:
    * 'command -v'

- no stdout/stderr redirect needed:
    * 'rm -f'

STYLE: consistent spacing after redirects
2019-11-06 10:44:36 +01:00
ec7e3c88e4 ENH: test for WM_PROJECT_DIR being set/unset in scripts 2019-11-06 09:18:51 +01:00
e5916fd9ba ENH: use findMinMax instead of findMin, findMax separately 2019-11-05 13:10:23 +01:00
b0c88dff58 ENH: treat self-assignment as no-op instead of a Fatal (#1473)
- this can help if using std algorithms that return a const reference
  such as std::min() does.
2019-11-05 11:10:49 +01:00
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
fb7698f6a1 ENH: streamLine: add bidirectional tracking. Fixes #1466. 2019-10-23 16:52:27 +01:00
848a63572a BUG: nearWallFields: incorrect sampling location. Fixes #1464.
It was tracking to find the wanted sampling location. This tracking
was using the offsetted seed point instead of the offsetted wanted
sampling point.
2019-10-23 16:26:22 +01:00
f75e01c8c2 CONFIG: adjustments for CMake files
- drop plugin support for Qt4 (old paraview)

- handle upcoming changes in VTK version naming in CMake files
  * VTK_MAJOR_VERSION becomes VTK_VERSION_MAJOR etc.
2019-10-04 11:48:03 +02:00
38b53e5346 STYLE: use default destructor in header definitions 2019-09-24 12:14:36 +02:00
35d77aaec0 ENH: mapFields FO - mapping now on call to execute 2019-09-12 10:40:19 +01:00
b86f9944d7 ENH: handle some miscellaneous mixed input types (#1378) 2019-08-06 16:57:29 +02:00
1d79c0452c ENH: additional contiguous traits (#1378)
- change contiguous from a series of global functions to separate
  templated traits classes:

    - is_contiguous
    - is_contiguous_label
    - is_contiguous_scalar

  The static constexpr 'value' and a constexpr conversion operator
  allow use in template expressions.  The change also makes it much
  easier to define general traits and to inherit from them.

  The is_contiguous_label and is_contiguous_scalar are special traits
  for handling data of homogeneous components of the respective types.
2019-07-29 11:36:30 +02:00
037be8dbb0 STYLE: use default constructors/destructors for base cloud classes
- use cloud::defaultName instead of "defaultCloud" string literal
2019-08-02 17:22:00 +02:00
e90eafcf18 ENH: rationalize cloud method inheritance
- a top-level cloud::nParcels() virtual, which is overloaded by the
  first level of Cloud inheritance. This permits quick determination of
  cloud sizes, even when retrieved from registry with the base level.
  Eg,
      cloud* cldPtr = mesh.cfindObject<cloud>("myCloud");
      label nParcels = (cldPtr ? cldPtr->nParcels() : 0);

- make writeLagrangianPositions on by default unless explicitly
  disabled in the InfoSwitches.

  Flag output errors (where neither coordinates nor positions are
  written) with Fatal.

- additional IOField helper functions in cloud

STYLE: simplify iterator inheritance
2019-08-02 17:20:18 +02:00
492c30c34e ENH: mapFields FO - read schemes and cache mapped fields by default. See #1390 2019-08-05 09:48:25 +01:00
b0d32ce1b4 STYLE: use 'operator>>' instead of readLabel and readScalar 2019-07-30 14:52:46 +02:00
743311df7d STYLE: consistent access for particle sizeofFields, particle iterators 2019-07-30 14:22:56 +02:00
f94be1bebb ENH: use FatalIOErrorInLookup instead of FatalErrorInLookup 2019-07-16 10:26:51 +02:00
fb09f56aba ENH: use FatalErrorInLookup macros (#1362) 2019-07-12 18:00:00 +02:00