Commit Graph

3075 Commits

Author SHA1 Message Date
Mark Olesen
ff18ab58c2 ENH: add 'use' action for parcel selection
- shortcut for "clear" + "add".

  At the end of the operation, only parcels matching that particular
  selection source will be used.
2018-11-24 13:34:02 +01:00
Mark Olesen
58dae2de43 ENH: improvements for dataCloud function object (issue #1044)
- now supports a parcel selection mechanism like vtkCloud,
  giving the ability to select a subset of parcels.
  For example, a given stride, or removal of parcels with a small
  diameter.

  Eg,
      dataCloud output Time: 3.2
      Applying parcel filtering to 994 parcels
      - add stride 4
      - subtract field U : (less 0.2)
      After filtering using 214/994 parcels

- add output precision control for dataCloud
2018-11-24 13:14:57 +01:00
Mark Olesen
0f48b89185 ENH: output filtering of vtkCloud by user selection (#1056)
- can filter by stride or field information.
  For example,

      selection
      {
          stride
          {
              // every 10th parcelId
              action  add;
              source  stride;
              stride  10;
          }
          Umin
          {
              // Remove slow parcels
              action  subtract;
              source  field;
              field   U;
              accept  (less 1e-3);
          }
          diam
          {
              // Only particular diameter ranges
              action  subset;
              source  field;
              field   d;
              accept  (greater 1e-3) and (less 1e-3);
          }
      }
2018-11-13 22:57:49 +01:00
Mark Olesen
0d29257a6d STYLE: use vtk::surfaceWriter instead of sampleSurface version 2018-10-16 14:49:56 +02:00
Mark Olesen
c73dcc34f0 TUT: update foamToVTK usage 2018-11-12 01:42:20 +01:00
Mark Olesen
42bb497084 ENH: improvements for vtkWrite function object (issue #926)
- parallel output.

  The output is now postProcessing/<name> for similar reasoning as
  mentioned in #866 - better alignment with other function objects, no
  collision with foamToVTK output.

- align the input parameters with those of vtkCloud so that we can
  specify the ASCII precision and the padding width for the output
  file names as well.

- emit TimeValue field, support file series generation

- support internal or boundary meshes, combining the result into a vtm
  file.

- can restrict conversion based on zone names, enclosing volumes,
  bounding box
2018-10-09 15:52:52 +02:00
Mark Olesen
03eec4a5db ENH: code improvements for vtkCloud function object (issue #926)
- use parallel list writing, beginDataArray methods.

- use static_assert to restrict conversion of non-label integral types

- cache .vtp.series information by fileName instead of by cloud name.
  This issues if the output directory changes, and simplifies code.

ENH: emit TimeValue in files generated by vtkCloud

- additional information for passing to ParaView

ENH: vtkCloud output to postProcessing/ (issue #866)

- better alignment with other function objects, no collision with
  foamToVTK output.
2018-09-17 09:36:00 +02:00
Mark Olesen
8f4067015d STYLE: remove shebang from LogFunctions
- file is to be sourced, non-executable.

- remove stray .keep file from tutorial case
2018-11-22 17:31:34 +01:00
Mark Olesen
5277221063 GIT: file permissions 2018-11-22 16:44:17 +01:00
mattijs
4a37e23ffa ENH: floatingBody: excess debug switches 2018-11-22 08:58:56 +00:00
mattijs
ba86d90ffc ENH: single precision: various small fixes. See #1086. 2018-11-21 11:12:25 +00:00
Mark Olesen
dd87c98393 ENH: add read guard for dimensionedType constructors (#762)
- deprecate dimensionedType constructors using an Istream in favour of
  versions accepting a keyword and a dictionary.

  Dictionary entries are almost the exclusive means of read
  constructing a dimensionedType. By construct from the dictionary
  entry instead of doing a lookup() first, we can detect possible
  input errors such as too many tokens as a result of a input syntax
  error.

  Constructing a dimensionedType from a dictionary entry now has
  two forms.

  1.  dimensionedType(key, dims, dict);

      This is the constructor that will normally be used.

      It accepts entries with optional leading names and/or
      dimensions. If the entry contains dimensions, they are
      verified against the expected dimensions and an IOError is
      raised if they do not correspond. On conclusion, checks the
      token stream for any trailing rubbish.

  2.  dimensionedType(key, dict);

      This constructor is used less frequently.

      Similar to the previous description, except that it is initially
      dimensionless. If entry contains dimensions, they are used
      without further verification. The constructor also includes a
      token stream check.

      This constructor is useful when the dimensions are entirely
      defined from the dictionary input, but also when handling
      transition code where the input dimensions are not obvious from
      the source.

      This constructor can also be handy when obtaining values from
      a dictionary without needing to worry about the input dimensions.
      For example,

         Info<< "rho: " << dimensionedScalar("rho", dict).value() << nl;

      This will accept a large range of inputs without hassle.

ENH: consistent handling of dimensionedType for inputs (#1083)

BUG: incorrect Omega dimensions (fixes #2084)
2018-11-20 15:14:10 +01:00
Mark Olesen
f269371dbc ENH: support cylindrical coordinates in fieldCoordinateSystemTransform (#1076) 2018-11-16 15:12:19 +01:00
Mattijs Janssens
8ceec6456a Mapping injected faces through interpolation 2018-11-15 14:58:56 +00:00
Mark Olesen
90dd4b30cd TUT: syntax typo (#1059) 2018-11-12 13:59:38 +01:00
mattijs
e9af742819 BUG: uniformFixedValue: do not evaluate upon reading. Fixes #1058. 2018-11-12 09:15:09 +00:00
Mark Olesen
3cf177e759 Work-package-09 geometric constraint 2018-11-08 20:50:47 +00:00
Mark Olesen
5f556ffb4a ENH: make sourceInfo sub-dictionary optional for topoSet (#1060)
- helps reduce clutter in the topoSetDict files.

  Caveats when using this.

  The older specification styles using "name" will conflict with the
  set name. Eg,

    {
        name    f0
        type    faceSet;
        action  add;
        source  patchToFace;
        sourceInfo
        {
            name   inlet;
        }
    }

    would flattened to the following
    {
        name    f0
        type    faceSet;
        action  add;
        source  patchToFace;
        name   inlet;
    }
    which overwrites the "name" used for the faceSet.

    The solution is to use the updated syntax:

    {
        name    f0
        type    faceSet;
        action  add;
        source  patchToFace;
        patch   inlet;
    }
2018-11-07 10:33:36 +01:00
Mark Olesen
3f017a01c0 TUT: syntax typo (#1059) 2018-11-01 14:42:37 +00:00
Mark Olesen
7325e3ac7d ENH: topoSetSource::SUBTRACT enum action (#1060)
- old 'DELETE' enum was easily confused with 'REMOVE', which removes
  the set, not the elements from the set.

- provide corresponding subtractSet() method

STYLE: HashSet set/unset instead of insert/erase methods in topoSetSource

- simplifies switching to/from bitSet storage
2018-10-30 15:09:44 +00:00
Mark Olesen
9b638f9a71 ENH: distinguish between cell/face/point topoSetSource (#1060)
- add intermediate classes topoSetCellSource, topoSetFaceSource,
  topoSetPointSource and corresponding New() factories
2018-10-30 12:01:36 +00:00
Mark Olesen
9a87a043d6 ENH: consistency updates for patchToFace topoSetSource (#1060)
- Support specification with "patches" and "patch" keywords
  (similar to zone selection). Keyword "name" for compatibility.
2018-10-30 12:01:36 +00:00
Mark Olesen
50fe195374 ENH: use "origin" for searchable sphere etc. (#1060)
- replaces "centre", using the same keyword as other objects
  (eg, plane, rotatedBox, coordinateSystem etc).
2018-10-29 15:51:05 +00:00
Mark Olesen
c2e58dca64 ENH: support multiple zones for topo set sources (#1060)
- uses the keywords 'zones' and 'zone' to avoid potential conflicts
  with a named topoSet action, but accepts 'name' for compatibility.
2018-10-29 12:54:30 +00:00
mattijs
26f6f4257a STYLE: createBafflesDict: typo in comment 2018-10-31 13:55:06 +00:00
mattijs
192e2eeb9d BUG: tutorials: fix tutorials for 1812. See #1059. 2018-10-31 12:08:55 +00:00
mattijs
5f91007d4a ENH: twoSimpleRotors: missing value field 2018-10-30 16:48:05 +00:00
Mark Olesen
f865fb432f TUT: missing semi-colons 2018-10-19 21:48:31 +02:00
sergio
6e9520d3c1 Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-10-17 10:29:34 -07:00
sergio
5daa38d5b4 ENH:
Update of overRhoPimpleDyMFoam and overInterDyMFoam solvers.
Adding corresponding tutorials with best possible settings
The main effort was put on reducing pressure spikes as the
stencil change with hole cells on the background mesh.
2018-10-17 10:10:06 -07:00
Mark Olesen
14a39405c2 ENH: simple dataCloud function object (issue #1044)
- writes positions and a single field (eg, diameter) in plain ASCII files,
  suitable for importing in a spreadsheet or manipulation with
  scripting tools.

- code integrated from
  https://develop.openfoam.com/Community/OpenFOAM-addOns
2018-10-17 17:37:23 +02:00
Mark Olesen
8fabc32539 ENH: simplify objectRegistry access names (issue #322)
New name:  findObject(), cfindObject()
  Old name:  lookupObjectPtr()

      Return a const pointer or nullptr on failure.

  New name:  findObject()
  Old name:  --

      Return a non-const pointer or nullptr on failure.

  New name:  getObjectPtr()
  Old name:  lookupObjectRefPtr()

      Return a non-const pointer or nullptr on failure.
      Can be called on a const object and it will perform a
      const_cast.

- use these updated names and functionality in more places

NB: The older methods names are deprecated, but continue to be defined.
2018-10-17 16:44:10 +02:00
mattijs
4cce1d74d2 ENH: overset: do not trigger wall-wall interaction. See #1041. 2018-10-15 14:07:10 +01:00
mattijs
8e03400635 ENH: snappyHexMesh: force all running; remove excess tutorial. 2018-10-15 11:33:00 +01:00
Andrew Heather
1eba709319 ENH: Added new fieldExtents function object
Description
    Calculates the spatial minimum and maximum extents of a field

    The extents are derived from the bound box limits after identifying
    the locations where field values exceed the user-supplied threshold
    value.

Usage
    Example of function object specification:

    fieldExtents1
    {
        type        fieldExtents;
        libs        ("libfieldFunctionObjects.so");
        ...
        writeToFile yes;
        log         yes;
        fields      (alpha);
        threshold   0.5;
        patches     ();
    }

    Where the entries comprise:

        Property      | Description              | Required   | Default
        type          | type name: fieldExtents  | yes        |
        writeToFile   | write extents data to file | no       | yes
        log           | write extents data to standard output | no | yes
        internalField | Process the internal field | no       | yes
        threshold     | Field value to identify extents boundary | yes |
        referencePosition | Reference position   | no         | (0 0 0)
        fields        | list of fields to process | yes       |
        patches       | list of patches to process | no       | <all>

    Output data is written to the file \<timeDir\>/fieldExtents.dat

Note
    For non-scalar fields, the magnitude of the field is employed and
    compared to the threshold value.
2018-10-16 13:01:15 +01:00
Mark Olesen
19d600472a ENH: auto-detect git in tutorials Alltest 2018-10-12 23:29:16 +02:00
sergio
77753021df Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-10-04 09:14:08 -07:00
sergio
789d261f0e Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop 2018-10-01 17:14:39 -07:00
sergio
d0c39b0e27 ENH: Changing non-interpolation field in versetFvPatchField
for correct run time reading.
Setting up twoSimpleRotors tutorial for smooth pressure
fluctuations
2018-10-01 17:11:39 -07:00
Mark Olesen
6697bb4735 ENH: improve, simplify, rationalize coordinate system handling (issue #863)
Previously the coordinate system functionality was split between
coordinateSystem and coordinateRotation. The coordinateRotation stored
the rotation tensor and handled all tensor transformations.

The functionality has now been revised and consolidated into the
coordinateSystem classes. The sole purpose of coordinateRotation
is now just to provide a selectable mechanism of how to define the
rotation tensor (eg, axis-angle, euler angles, local axes) for user
input, but after providing the appropriate rotation tensor it has
no further influence on the transformations.

--

The coordinateSystem class now contains an origin and a base rotation
tensor directly and various transformation methods.

  - The origin represents the "shift" for a local coordinate system.

  - The base rotation tensor represents the "tilt" or orientation
    of the local coordinate system in general (eg, for mapping
    positions), but may require position-dependent tensors when
    transforming vectors and tensors.

For some coordinate systems (currently the cylindrical coordinate system),
the rotation tensor required for rotating a vector or tensor is
position-dependent.

The new coordinateSystem and its derivates (cartesian, cylindrical,
indirect) now provide a uniform() method to define if the rotation
tensor is position dependent/independent.

The coordinateSystem transform and invTransform methods are now
available in two-parameter forms for obtaining position-dependent
rotation tensors. Eg,

      ... = cs.transform(globalPt, someVector);

In some cases it can be useful to use query uniform() to avoid
storage of redundant values.

      if (cs.uniform())
      {
          vector xx = cs.transform(someVector);
      }
      else
      {
          List<vector> xx = cs.transform(manyPoints, someVector);
      }

Support transform/invTransform for common data types:
   (scalar, vector, sphericalTensor, symmTensor, tensor).

====================
  Breaking Changes
====================

- These changes to coordinate systems and rotations may represent
  a breaking change for existing user coding.

- Relocating the rotation tensor into coordinateSystem itself means
  that the coordinate system 'R()' method now returns the rotation
  directly instead of the coordinateRotation. The method name 'R()'
  was chosen for consistency with other low-level entities (eg,
  quaternion).

  The following changes will be needed in coding:

      Old:  tensor rot = cs.R().R();
      New:  tensor rot = cs.R();

      Old:  cs.R().transform(...);
      New:  cs.transform(...);

  Accessing the runTime selectable coordinateRotation
  has moved to the rotation() method:

      Old:  Info<< "Rotation input: " << cs.R() << nl;
      New:  Info<< "Rotation input: " << cs.rotation() << nl;

- Naming consistency changes may also cause code to break.

      Old:  transformVector()
      New:  transformPrincipal()

  The old method name transformTensor() now simply becomes transform().

====================
  New methods
====================

For operations requiring caching of the coordinate rotations, the
'R()' method can be used with multiple input points:

       tensorField rots(cs.R(somePoints));

   and later

       Foam::transformList(rots, someVectors);

The rotation() method can also be used to change the rotation tensor
via a new coordinateRotation definition (issue #879).

The new methods transformPoint/invTransformPoint provide
transformations with an origin offset using Cartesian for both local
and global points. These can be used to determine the local position
based on the origin/rotation without interpreting it as a r-theta-z
value, for example.

================
  Input format
================

- Streamline dictionary input requirements

  * The default type is cartesian.
  * The default rotation type is the commonly used axes rotation
    specification (with e1/e2/3), which is assumed if the 'rotation'
    sub-dictionary does not exist.

    Example,

    Compact specification:

        coordinateSystem
        {
            origin  (0 0 0);
            e2      (0 1 0);
            e3      (0.5 0 0.866025);
        }

    Full specification (also accepts the longer 'coordinateRotation'
    sub-dictionary name):

        coordinateSystem
        {
            type    cartesian;
            origin  (0 0 0);

            rotation
            {
                type    axes;
                e2      (0 1 0);
                e3      (0.5 0 0.866025);
            }
        }

   This simplifies the input for many cases.

- Additional rotation specification 'none' (an identity rotation):

      coordinateSystem
      {
          origin  (0 0 0);
          rotation { type none; }
      }

- Additional rotation specification 'axisAngle', which is similar
  to the -rotate-angle option for transforming points (issue #660).
  For some cases this can be more intuitive.

  For example,

      rotation
      {
          type    axisAngle;
          axis    (0 1 0);
          angle   30;
      }
  vs.
      rotation
      {
          type    axes;
          e2      (0 1 0);
          e3      (0.5 0 0.866025);
      }

- shorter names (or older longer names) for the coordinate rotation
  specification.

     euler         EulerRotation
     starcd        STARCDRotation
     axes          axesRotation

================
  Coding Style
================
- use Foam::coordSystem namespace for categories of coordinate systems
  (cartesian, cylindrical, indirect). This reduces potential name
  clashes and makes a clearer declaration. Eg,

      coordSystem::cartesian csys_;

  The older names (eg, cartesianCS, etc) remain available via typedefs.

- added coordinateRotations namespace for better organization and
  reduce potential name clashes.
2018-10-01 13:54:10 +02:00
mattijs
b937a531bd STYLE: Allrun: use suffix option 2018-10-03 09:39:27 +01:00
mattijs
c0460d3015 Merge remote-tracking branch 'Customer-VWG/wp3-directional-refinement' into develop 2018-10-04 13:43:33 +01:00
mattijs
8076963c68 ENH: snappyHexMesh: directional smoothing. See #1031 2018-10-04 12:03:53 +01:00
mattijs
8e82e7b8e8 ENH: heatTransfer: allow free patch to be moved. See #1026. 2018-10-01 09:51:24 +01:00
Mark Olesen
d92d77cc84 Merge remote-tracking branch 'origin/master' into develop 2018-09-28 13:20:41 +02:00
Andrew Heather
1135f1572d TUT: Removed unused/misleading entries - see #1020 2018-09-27 16:34:44 +01:00
Mark Olesen
47519b2e04 ENH: new sampling type "surfaceCut"
- an alternative to distanceSurface (with distance zero) that uses
  a cell cutting approach instead of an iso-surface.
2018-09-18 08:40:46 +02:00
Mark Olesen
4aa94bd1d7 ENH: improve distanceSurface handling (issue #1012)
- 'signed' input parameter only mandatory for distance > 0.
  A distance <= 0 is always signed and the input parameter is ignored.

- Use normal distance when distance == 0. This has no effect when
  the surface has no open edges, but improves on rounding issues
  around the zero crossing when the surface has open edges.

  This may still need future revisiting.
2018-09-19 14:18:57 +02:00
Mark Olesen
a6e735e5ce TUT: samplingDebug was left enabled in tutorial (and missing a file) 2018-07-18 19:41:32 +02:00
Mark Olesen
1b76ff6001 BUG: vtkCloud suppresses output for empty clouds (closes #866)
- the original intention was to avoid vtp output when the clouds are
  empty anyhow. However, it is useful for post-processing to have
  clouds with zero parcels (eg, before the start of injection).

  Pruning of empty clouds is now an option in the vtkCloud dictionary
  controls, with the default being false (no pruning). This represents
  a non-breaking change in behaviour since it generates more output
  than previously.

  Example,
  {
      type    vtkCloud;
      //- Suppress writing of empty clouds (default: false)
      prune   true;
  }
2018-07-11 07:53:51 +02:00