Commit Graph

836 Commits

Author SHA1 Message Date
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
mattijs
26f6f4257a STYLE: createBafflesDict: typo in comment 2018-10-31 13:55:06 +00: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
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
mattijs
b937a531bd STYLE: Allrun: use suffix option 2018-10-03 09:39:27 +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
a6e735e5ce TUT: samplingDebug was left enabled in tutorial (and missing a file) 2018-07-18 19:41:32 +02:00
Andrew Heather
6e35bcda70 ENH: Updated config for release v1806 2018-06-28 12:56:00 +01:00
Andrew Heather
16a6379183 TUT: Cleaned up headers 2018-06-26 17:37:38 +01:00
Mark Olesen
2df51655ca TUT: remove stray catalyst script 2018-06-27 08:22:13 +02:00
Mark Olesen
b70b2d8629 TUT: fixup formatting, tabs etc 2018-06-26 16:37:35 +02:00
Mark Olesen
30b4eda7a4 TUT: update some old keywords found in tutorials
- functionObjectLibs -> libs
- redirectType -> name
- change deprecated writeCompression flags types to Switch.

- cleanup some trailing ';;' from some dictionaries
2018-06-26 14:18:52 +02:00
Andrew Heather
1e5919f8b0 TUT: Updates - see #856 2018-06-26 11:16:24 +01:00
Mark Olesen
d9568a4b56 SUBMODULE: updates for catalyst
- SIGFPE handling, cmake configuration

CONFIG: adjust for simplified Catalyst channel naming

- no sub-channels, select volField output based in the
  (internal | boundary) dictionary switches instead
2018-06-24 15:50:50 +02:00
Mark Olesen
eed1e99378 TUT: remove 'functions' dictionary scope from catalyst files
- rename Allrun.parallel to Allrun-parallel (issue #899)
2018-06-23 13:41:20 +02:00
Mark Olesen
e0db37f043 ENH: support rhoRef for derived surfMesh sampled fields (issue #898) 2018-06-22 16:57:30 +02:00
Mark Olesen
4d03e4386d STYLE: update version info in some tutorial files 2018-08-14 11:58:52 +02:00
Mark Olesen
45f4a8b9c5 ENH: bounding box clipping for ensightWrite function object (issue #973)
- for larger problems with a smaller region of interest, can apply a
  bounding to limit the size of the ensight geometry and fields created.

  Since the implementation uses a fvMeshSubset, there is an additional
  per-process memory overhead.

  A high output frequency should be avoided with moving meshes, since
  this indirectly forces a frequent update of the submesh.
2018-08-14 11:50:53 +02:00
mattijs
da74e872f4 STYLE: overset: remove unused dictionary entry 2018-08-09 17:39:22 +01:00
sergio
0be3caec4a ENH: Improving twoRotorTutorial set up 2018-08-09 15:09:56 -07:00
Mark Olesen
de2eed3e7d ENH: additional methods and improvements to plane
- signedDistance() method is like distance() but retains
  the positive/negative sign for the side of the plane.

- the sign() method returns the sign as -1,0,+1 integer for
  classification purposes where it is important to distinguish between
  a zero value and a positive value (eg, for cutting). Optional
  tolerance can be supplied to round for zero.

- refactor and inlined simple and frequently used methods.

- add boundBox faceCentre() method, which can be useful for creating
  clipping planes from a bounding box.
  Relocated treeBoundBox faceNormals to boundBox since they apply
  equally there - the meaning of the faces (x-min, x-max, etc)
  is the same, even if the point addressing for the faces differs.
2018-08-03 23:17:49 +02:00
Mark Olesen
329f3a99e4 TUT: remove extraneous '}' from dictionary input 2018-07-26 17:06:10 +02:00
Mark Olesen
d58c142404 ENH: use restricted dictionary lookup for utilities (issue #762)
- get<label>, get<scalar> instead of readLabel, readScalar, etc.
2018-07-24 08:08:30 +02:00
Mark Olesen
ec318a95d1 Merge remote-tracking branch 'origin/master' into develop 2018-07-23 21:18:43 +02:00
Andrew Heather
598c49fe8a TUT: Added new tutorial cases 2018-06-22 15:25:06 +01:00
Andrew Heather
abb597359f ENH: Updated the boundaryDataSurfaceWriter to use a plain list for the points file 2018-06-22 15:24:07 +01:00
Mark Olesen
f7d4f52726 STYLE: update names of known solvers, consistent End value (issue #856) 2018-06-21 16:03:06 +02:00
Mark Olesen
237f20b0ed TUT: tab removal 2018-06-21 15:43:15 +02:00
Mark Olesen
73fbed1c2c TUT: consistent use of scale and headers for blockMeshDict 2018-06-21 15:28:25 +02:00
Mark Olesen
dcde2eed74 TUT: consistent name for runTimePostProcessing dictionary 2018-06-21 11:56:00 +02:00
Andrew Heather
f9dc9dbf5f TUT: updates 2018-06-21 08:31:22 +01:00
sergio
7bf7aaea91 ENH: Further enhancements to stabilizationSchemes 2018-06-19 12:04:27 -07:00
sergio
9001aa2440 Merge branch 'develop-pre-release' of develop.openfoam.com:Development/OpenFOAM-plus into develop-pre-release 2018-06-19 11:23:36 -07:00
sergio
a3a6768608 ENH: Adding additional entry to stabilizationSchemes.
Correcting tutorial and expanding documentation
2018-06-19 11:21:56 -07:00
Mark Olesen
1871b1d3bc TUT: use separate forces file for wingMotion2D 2018-06-19 17:18:15 +02:00
mattijs
0c5f36f40a ENH: Move stabilisation to steady-state part of LES motorBike tutorial. See #856. 2018-06-18 15:00:47 +01:00
Mark Olesen
cad0455d46 TUT: consistent application name for lumpedPointMotion
- use simpleFoam for steady-state and change to pimpleFoam for
  transient. This provides better correspondence with the expected log
  output.
2018-07-23 09:12:06 +02:00
Mark Olesen
712f49758a TUT: update snappy dictionaries to use minMedialAxisAngle
- canonical parameter name changed from "minMedianAxisAngle" to
  "minMedialAxisAngle" (DEC-2013), but was never previously reported
  as having changed.
2018-07-18 16:47:34 +02:00
Mark Olesen
181582fef8 TUT: remove extraneous '}' from dictionary input 2018-07-11 14:24:49 +02:00
Mark Olesen
d530bc254a STYLE: code cleanup searchableSurface (issue #929)
- improve doxygen entries for searchable surfaces.

- support selection of searchable surfaces with shorter names.
  Eg,
      type   box | cylinder | ...;
  vs  type   searchableBox | searchableCylinder | ...;
2018-07-06 11:03:28 +02:00
Andrew Heather
7b8e2b1a18 Merge remote-tracking branch 'origin/master' into develop 2018-07-10 16:42:59 +01:00
Mark Olesen
ad5ab870ef Merge branch 'feature-dictionary-checks' into develop 2018-07-05 13:40:25 +02:00
Mark Olesen
f7dc92d744 STYLE: mark compatibility level for keyword redirectType (issue #912)
- was replaced with "name" in 1706
2018-07-05 09:26:26 +02:00
Mark Olesen
2662042d49 ENH: improve controls for Time (issue #910)
- relocate some standard functionality to TimePaths to allow a lighter
  means of managing time directories without using the entire Time
  mechanism.

- optional enableLibs for Time construction (default is on)
  and a corresponding argList::noLibs() and "-no-libs" option

STYLE:

- mark Time::outputTime() as deprecated MAY-2016

- use pre-increment for runTime, although there is no difference in
  behaviour or performance.
2018-07-02 10:20:01 +02:00
Mark Olesen
e3d306d3cf TUT: additional and extra closing braces in dictionaries 2018-06-18 14:05:49 +02:00
sergio
46e7dab0cb ENH: Adding stabilizationSchemes FO and tutorial 2018-06-06 12:54:34 -07:00
Andrew Heather
f700bce878 Merge remote-tracking branch 'origin/develop' into develop-pre-release 2018-05-17 12:14:27 +01:00