Commit Graph

43 Commits

Author SHA1 Message Date
Andrew Heather
d3949086ce RELEASE: Updated headers to v2412 2024-12-24 11:17:31 +00:00
Andrew Heather
630d60de3b RELEASE: Updated headers to v2406 2024-06-24 09:58:36 +01:00
Andrew Heather
28aad3a03e RELEASE: Updated headers to v2312 2023-12-20 19:42:55 +01:00
Andrew Heather
763bf4674d RELEASE: Updated headers to v2306 2023-06-28 16:35:48 +01:00
Mark Olesen
ee39e3d276 STYLE: use explicit REGISTER option when storing fields 2023-04-25 13:45:08 +02:00
Andrew Heather
7e61f36c12 RELEASE: Updated headers to v2212 2022-12-21 16:16:18 +00:00
Mark Olesen
5b29ff0e42 ENH: consolidate 'formatOptions' handling for coordSetWriter/surfaceWriter
- replaced ad hoc handling of formatOptions with coordSetWriter and
  surfaceWriter helpers.

  Accompanying this change, it is now possible to specify "default"
  settings to be inherited, format-specific settings and have a
  similar layering with surface-specific overrides.

- snappyHexMesh now conforms to setFormats

  Eg,

      formatOptions
      {
          default
          {
              verbose     true;
              format      binary;
          }
          vtk
          {
              precision   10;
          }
     }

     surfaces
     {
         surf1
         {
             ...

             formatOptions
             {
                 ensight
                 {
                     scale   1000;
                 }
             }
         }
     }
2022-11-08 16:48:08 +00:00
Mark Olesen
4393ffa8dc ENH: template invariant base classes for {fa,fae,fv,fvs,point}PatchField
- simplifies construction/inheritance

ENH: add {fa,fv}PatchField::zeroGradientType() static

- can be used to avoid literal "zeroGradient" in places

STYLE: adjust naming of pointPatch runtime selection table

- simply use 'patch' as per fa/fv fields

STYLE: add zero-size guard to patch constraintType(const word&)
2022-09-22 16:09:14 +02:00
Andrew Heather
7792501a01 RELEASE: Updated headers for v2206 2022-06-24 15:41:02 +01:00
Mark Olesen
ad0235a751 ENH: support surface writer output transform (#2505)
- this allows the "relocation" of sampled surfaces. For example,
  to reposition into a different coordinate system for importing
  into CAD.

- incorporate output scaling for all surface writer types.

  This was previously done on an adhoc basis for different writers,
  but with now included in the base-level so that all writers
  can automatically use scale + transform.

  Example:

  formatOptions
  {
      vtk
      {
          scale 1000;  // m -> mm
          transform
          {
              origin  (0.05 0 0);
              rotation axisAngle;
              axis    (0 0 1);
              angle   -45;
          }
      }
  }
2022-06-13 08:22:52 +00:00
Mark Olesen
9a75ce8434 ENH: support coordinateSystem/transform for sampled planes
- previously only defined for cell-cutting version, now for
  iso-surface version too

TUT: remove old transform/coordinateSystem syntax
2022-06-08 16:43:05 +02:00
Mark Olesen
fbaadf3a94 ENH: make 'planeType' optional for dictionary construct of a plane
- simpler to write for sampled cutting planes etc.
  For example,

      slice
      {
          type        cuttingPlane;
          point       (0 0 0);
          normal      (0 0 1);
          interpolate true;
      }

  instead of

      slice
      {
          type        cuttingPlane;
          planeType   pointAndNormal;
          pointAndNormalDict
          {
              point   (0 0 0);
              normal  (0 0 1);
          }
          interpolate true;
      }

STYLE: add noexcept to some plane methods
2022-06-08 16:43:05 +02:00
Mark Olesen
7184de50df ENH: simplify coordinate rotation specification (#2505)
- can specify rotations that are not "axes" in a compact form:

      transform
      {
          origin  (0 0 0);
          rotation none;
      }

      transform
      {
          origin  (0 0 0);
          rotation axisAngle;
          axis    (0 0 1);
          angle   45;
      }

   An expanded dictionary form also remains possible:

      transform
      {
          origin  (0 0 0);
          rotation
          {
              type  axisAngle;
              axis  (0 0 1);
              angle 45;
          }
      }

STYLE: verbose deprecation for "coordinateRotation" keyword

- the "coordinateRotation" keyword was replaced by the "rotation"
  keyword (OpenFOAM-v1812 and later) but was handled silently.
  Now elevated to non-silent.

STYLE: alias lookups "axesRotation", "EulerRotation", "STARCDRotation"

- these warn and report the equivalent short form, which aids in
  upgrading. Previously had silent lookups.
2022-06-07 17:25:30 +02:00
Andrew Heather
a2014242cf RELEASE: Updated headers for v2112 2021-12-20 14:18:01 +00:00
Mark Olesen
a530b505ed TUT: replace m4 versions of angledDuct blockMeshDict with native forms
- dictionary parameters to change the bend angle

- blockMesh transform parameters to allow different orientations
2021-07-28 13:14:44 +02:00
Andrew Heather
e3796745ed CONFIG: Updated headers to v2106
Minor clean-up
2021-06-28 09:14:42 +01:00
Kutalmis Bercin
7ce111809e TUT: compressible: clean up tutorials 2021-05-27 08:59:28 +00:00
Andrew Heather
79e353b84e RELEASE: Updated version to v2012 2020-12-23 10:01:39 +01:00
Mark Olesen
44052de594 TUT: skip some tutorials when dynamicCode is not available
- silence failed restoration of controlDict from controlDict.orig
  (idempotent?)
2020-08-06 19:34:20 +02:00
Andrew Heather
538d749220 REL: Updated headers to version v2006 2020-06-29 17:27:54 +01:00
Mark Olesen
7065593b3f BUG: regression in fluxSummary cellZoneAndDirection (fixes #1736)
- related to change c3571b7357 (does not affect 1912 or older).

  Remnant check for data() should have used valid() method instead.

TUT: add fluxSummary cellZoneAndDirection to angledDuct/implicit
2020-06-19 12:52:00 +02:00
Mark Olesen
5982a1aab4 STYLE: update tutorials
- use simpler decomposeParDict in tutorials, several had old
  'boilerplate' decomposeParDict

- use simpler libs () format

- update surface sampling to use dictionary format
2020-06-17 10:11:33 +02:00
Kutalmis Bercin
cee3dab140 TUT: cleanup compressible tutorials
- for all tutorial cases:
     - correct/uniformize dict-style
     - rm redundant dict entries

 - compressible.overRhoPimpleDyMFoam.twoSimpleRotors: rm redundant file: pointDisplacement
 - compressible.overRhoSimpleFoam.hotCylinder
 - compressible.rhoCentralDyMFoam.movingCone
 - compressible.rhoCentralFoam.forwardStep: activate purgeWrite=10
 - compressible.rhoCentralFoam.LadenburgJet60psi: rm redundant files: mapFieldsDict & sample
 - compressible.rhoCentralFoam.shockTube: rm redundant file: sample; command: cleanSample
 - compressible.rhoPimpleFoam.laminar.sineWaveDamping: rm redundant file: V; activate purgeWrite=10
 - compressible.rhoPimpleFoam.LES.pitzDaily: activate purgeWrite=10
 - compressible.rhoPimpleFoam.RAS.aerofoilNACA0012: activate purgeWrite=10
 - compressible.rhoPimpleFoam.RAS.angledDuct: add Allclean
 - compressible.rhoPimpleFoam.RAS.mixerVessel2D: add Allclean; rm makeMesh
 - compressible.rhoPimpleFoam.RAS.angledDuctLTS: add Allclean
 - compressible.rhoPimpleFoam.RAS.TJunctionAverage
 - compressible.rhoPorousSimpleFoam.angledDuct
 - compressible.rhoSimpleFoam.aerofoilNACA0012
 - compressible.rhoSimpleFoam.angledDuctExplicitFixedCoeff
 - compressible.rhoSimpleFoam.squareBend
 - compressible.rhoSimpleFoam.gasMixing.injectorPipe
 - compressible.sonicDyMFoam.movingCone: rm redundant file: cuttingPlane
 - compressible.sonicFoam.laminar.shockTube
 - compressible.sonicFoam.RAS.nacaAirfoil
 - compressible.sonicFoam.RAS.prism
2020-01-29 12:26:36 +00:00
Mark Olesen
b0072bfab8 ENH: regIOobject store() now also registers the object
- previously the store() method just set the ownedByRegistry flag.
  Now ensure that it is indeed registered first.

- support register/store of tmp<> items.
  The tmp parameter is not cleared, but changed from PTR to CREF
  to allow further use.

  The implicit registration allows code simplification using the
  GeometricField::New factory method, for example.

  Old Code
  ========
      volScalarField* ptr = new volScalarField
      (
          IOobject
          (
              fieldName,
              mesh.time().timeName(),
              mesh,
              IOobject::NO_READ,
              IOobject::NO_WRITE,
              true  // Register
          ),
          mesh,
          dimless,
          zeroGradientFvPatchField<scalar>::typeName
      );
      ptr->store();

  New Code
  ========
      auto tptr = volScalarField::New
      (
          fieldName,
          mesh,
          dimless,
          zeroGradientFvPatchField<scalar>::typeName
      );
      regIOobject::store(tptr);

  or even
      regIOobject::store
      (
          volScalarField::New
          (
              fieldName,
              mesh,
              dimless,
              zeroGradientFvPatchField<scalar>::typeName
          )
      );
2020-01-13 15:37:25 +00:00
Andrew Heather
ae2ab06312 REL: Release preparations 2019-12-23 09:49:23 +00:00
Mark Olesen
98467036b3 STYLE: regularize quoting and exit on failed 'cd' 2019-11-13 13:19:16 +01:00
Mark Olesen
46d7db79aa TUT: consistent calling of m4 2019-11-06 11:50:42 +01:00
Mark Olesen
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
Mark Olesen
ec7e3c88e4 ENH: test for WM_PROJECT_DIR being set/unset in scripts 2019-11-06 09:18:51 +01:00
OpenFOAM bot
880d81475b TUT: use simpler syntax for libs entries 2019-08-30 16:45:45 +02:00
Mark Olesen
2ca4792734 TUT: add coded example for sampling cellZoneId (#1383) 2019-08-21 12:13:51 +02:00
Andrew Heather
be44dcaf1f RELEASE: Version clean-up for release 2019-06-25 11:51:19 +01:00
Andrew Heather
9231534efa STYLE: Updating version to v1812 2018-12-19 18:07:52 +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
Andrew Heather
6e35bcda70 ENH: Updated config for release v1806 2018-06-28 12:56:00 +01:00
Mark Olesen
c792a9d7df TUT: script cleanup, provide cleanCase0 for commonly used operation 2017-10-12 19:20:56 +02:00
Mark Olesen
c2a0663cc7 TUT: use general 'scale' instead of 'convertToMeters' in blockMeshDict
- although this has been supported for many years, the tutorials
  continued to use "convertToMeters" entry, which is specific to blockMesh.
  The "scale" is more consistent with other dictionaries.

ENH:
- ignore "scale 0;" (treat as no scaling) for blockMeshDict,
  consistent with use elsewhere.
2017-08-03 06:38:30 +02:00
Andrew Heather
91b90da4f3 Integrated Foundation code to commit 104aac5 2017-05-17 16:35:18 +01:00
Andrew Heather
dcb1a95e35 MRG: Integrated Foundation code to commit 7d6845d 2017-03-23 14:33:33 +00:00
Mark Olesen
21679c04e4 STYLE: adjust tutorial Allclean scripts (issue #310)
- A few without a 'cd' at the start.
  Several remove files that are already covered by the cleanCase function.
2016-11-20 17:26:44 +01:00
Andrew Heather
1fbcb686ff STYLE: Consistency updates 2016-09-23 16:52:46 +01:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Mark Olesen
6e6ed0ca94 STYLE: cleanup rhoPorousSimpleFoam tutorial case
- better cleanup, avoid collisions between implicit and explicit cases
2016-06-29 14:21:02 +02:00