Commit Graph

59 Commits

Author SHA1 Message Date
53af23b9fb Implicit treatment of coupled boundary conditions 2021-08-03 20:08:49 +00:00
0c15f773e0 STYLE: remove/replace unneeded SortableList 2021-07-15 16:47:27 +02:00
239a7884a6 ENH: more flexible finiteArea patch selection (#2084)
- support wordRes for selecting patch names

- ownerPolyPatch specification is now optional, which simplifies input
  and also supports a faMesh spanning different patches but with a
  single boundary condition.

  Alternatively, can specify more granularity if required.

  ```
  polyMeshPatches  ( "top.*" );

  boundary
  {
      inlet1
      {
          type patch;
          ownerPolyPatch top1;    // <- specific to this portion
          neighbourPolyPatch inlet;
      }
      inlet2
      {
          type patch;
          ownerPolyPatch top2;    // <- specific to this portion
          neighbourPolyPatch inlet;
      }
      outlet
      {
          type patch;
          neighbourPolyPatch outflow;
      }
      bound
      {
          type symmetry;
          neighbourPolyPatch bound;
      }
  }
  ```
2021-06-10 09:25:00 +02:00
f421e29c2e ENH: improved handling of dangling finiteArea edges (#2084)
- restrict searching to patch quantities to avoid triggering
  mesh edge calculations
2021-05-27 21:04:55 +02:00
ac51890051 ENH: parallel makeFaMesh with consistency on processor boundaries (#2084)
- consider the neighbour polyPatch addressing on the connecting edge,
  even when the neighbouring processor does not have a corresponding
  section of the finiteArea mesh.

  These "dangling" edges now propagate their real connectivity across.
2021-05-27 21:04:55 +02:00
0cf4aede6e ENH: initial revamp of faMesh to improve modularity (#2084)
- improved separation of patch creation that is also parallel-aware,
  which now allows creation in parallel

- memory-safe use of PtrList for adding patches, with a more generalized
  faPatchData helper

- use uindirectPrimitivePatch instead of indirectPrimitivePatch
  for internal patch handling.

- align boundary methods with polyMesh equivalents

- system/faMeshDefinition instead of constant/faMesh/faMeshDefinition
  as per blockMesh convention. Easier to manage definitions, easier
  for cleanup.

- drop inheritence from GeoMesh.
2021-05-27 21:04:55 +02:00
2b7b3700c2 ENH: replace keyType with wordRe for matching selectors.
- The keyType is primarily used within dictionary reading, whereas
  wordRe and wordRes are used for selectors in code.
  Unifying on wordRe and wordRes reduces the number matching options.
2021-04-19 16:33:42 +00:00
cdbc3e2de6 ENH: List/DynamicList appendUniq() method
- affords some code reduction.

STYLE: use HashSet insert() without found() check in more places
2021-04-19 16:33:42 +00:00
9a2a22a03a ENH: provide setter methods for IOobject read/write options etc.
- simplifies local toggling.

- centralize fileModification static variables into IOobject.
  They were previously scattered between IOobject and regIOobject
2021-03-17 15:10:00 +01:00
f24e3f113f ENH: use PtrListOps to reduce code 2021-02-09 16:22:23 +01:00
bc430ccdef ENH: New vibro-acoustic model suite
- New solver: `acousticFoam`
  - New base finite-area region class: `regionFaModel`
  - New base shell model classes:
    - `vibrationShellModel`
    - `thermalShellModel`
  - New shell models:
    - A vibration-shell model: `KirchhoffShell`
    - A thermal-shell model: `thermalShell`
  - New finite-area/finite-volume boundary conditions:
    - `clampedPlate`
    - `timeVaryingFixedValue`
    - `acousticWaveTransmissive`
  - New base classes for `fvOption` of finite-area methods: `faOption`
  - New `faOption`s:
    - `contactHeatFluxSource`
    - `externalFileSource`
    - `externalHeatFluxSource`
    - `jouleHeatingSource`
  - New tutorial: `compressible/acousticFoam/obliqueAirJet`

Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-12-10 13:36:12 +00:00
0b68f14f7d ENH: more explicit about handling empty matchers for index lookup
- for boundary meshes, zones etc. The behaviour with an empty matcher
  was either not properly documented, and looped through all
  names just to establish there was no match.

STYLE: removed redundant typedefs for point fields
2020-12-08 13:18:34 +01:00
9122713b37 STYLE: mark deprecated findIndices methods with warnings
- were deprecated Aug-2018, but not marked as such
2020-11-25 19:53:02 +01:00
07bbae0c55 STYLE: use brace constructors for Foam::zero and Foam::one
- makes it clearer that these are constructors and not function calls
2020-11-19 16:57:45 +01:00
a1ccd1b716 STYLE: use DebugInFunction macro 2020-05-01 16:11:18 +02:00
5c9f07df7a STYLE: include demandDrivenData.H wherever deleteDemandDrivenData is used
- allows easier identification for future changes
2020-04-30 11:16:06 +02:00
79048eb68f STYLE: use writeEntry(), beginBlock(), endBlock() methods
- use dictionary::get<..> instead of lookup in a few more places
2020-04-28 10:41:23 +02:00
3c9c39e92a STYLE: use data/cdata instead of begin when accessing raw content 2020-02-21 12:32:12 +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
4de1215b44 STYLE: use default for constructors/destructors 2019-10-28 16:13:42 +01:00
e2d3d0125b STYLE: fix merge artifacts 2019-10-01 14:25:35 +02:00
58f6258d7a BUG: Correcting delta in fa consistent with fv.
Solve issue 1431 Gitlab. delta() calculation on the patch is consistent
with not applying non-orthogonality on the patch.
2019-09-27 15:16:00 -07:00
38b53e5346 STYLE: use default destructor in header definitions 2019-09-24 12:14:36 +02:00
fb09f56aba ENH: use FatalErrorInLookup macros (#1362) 2019-07-12 18:00:00 +02:00
f0f4af16d2 Merge remote-tracking branch 'origin/master' into develop 2019-04-08 12:05:24 +02:00
aacb7b0c35 BUG: faMesh: support for multi-region moving meshes. See #1170. 2019-03-04 11:00:52 +00:00
ebb6a0272e BUG: faMesh: support for multi-region moving meshes. See #1170. 2019-03-04 11:00:52 +00:00
77b2c8482d BUG: faMesh: processors without faMesh. See #1090.
pointNormals calculation gets triggered through processorfvPatches
so on processors that don't have these bypass this. This leads
to the global reduction hanging.
2019-03-04 10:56:41 +00:00
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
6c419174e1 STYLE: writeEntry instead of writeKeyword + END 2019-01-11 11:03:36 +01:00
1d85fecf4d ENH: use Zero when zero-initializing types
- makes the intent clearer and avoids the need for additional
  constructor casting. Eg,

      labelList(10, Zero)    vs.  labelList(10, 0)
      scalarField(10, Zero)  vs.  scalarField(10, scalar(0))
      vectorField(10, Zero)  vs.  vectorField(10, vector::zero)
2018-12-11 23:50:15 +01:00
a8ff5b10e8 COMP: Resolved compiler warnings 2018-12-03 16:46:24 +00:00
9bfc010e64 ENH: faMesh: decompose zero-sized patches. Fixes #1090. 2018-11-21 16:38:33 +00:00
4e04c1966f ENH: use dictionary::get<word>() instead of lookup() in a few places 2018-10-19 09:11:31 +02:00
8eddcc072a ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033)
- use the dictionary 'get' methods instead of readScalar for
  additional checking

     Unchecked:  readScalar(dict.lookup("key"));
     Checked:    dict.get<scalar>("key");

- In templated classes that also inherit from a dictionary, an additional
  'template' keyword will be required. Eg,

     this->coeffsDict().template get<scalar>("key");

  For this common use case, the predefined getXXX shortcuts may be
  useful. Eg,

     this->coeffsDict().getScalar("key");
2018-10-12 08:14:47 +02:00
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
64c3e484bb STYLE: add nBoundaryFaces() method to primitiveMesh
- nBoundaryFaces() is often used and is identical to
  (nFaces() - nInternalFaces()).

- forward the mesh nInternalFaces() and nBoundaryFaces() to
  polyBoundaryMesh as nFaces() and start() respectively,
  for use when operating on a polyBoundaryMesh.

STYLE:

- use identity() function with starting offset when creating boundary maps.

     labelList map
     (
         identity(mesh.nBoundaryFaces(), mesh.nInternalFaces())
     );

  vs.

     labelList map(mesh.nBoundaryFaces());
     forAll(map, i)
     {
         map[i] = mesh.nInternalFaces() + i;
     }
2018-09-27 10:17:30 +02:00
4d6f0498d6 ENH: use vector::normalise and VectorSpace::normalised for clarity 2018-08-10 15:18:29 +02:00
c1964d7807 ENH: distinguish between face areaNormal/unitNormal in the code 2018-08-10 15:43:06 +02:00
b81a2f2fa6 STYLE: use edge::unitVec() for improved code clarity 2018-08-10 14:41:32 +02:00
84e2df4994 ENH: added ZoneMesh indices(), selection() with wordRes matcher
- rationalized code dealing with extraction of name or indices from
  coordinateSystems, polyBoundaryMesh, faBoundaryMesh, fvBoundaryMesh,
  ZoneMesh to use internal implementations that allow direct
  searching/matching without building an intermediate list of names.

- simpler and more efficient handling of patch group matching.
2018-08-03 22:40:19 +02:00
d25dd342fa STYLE: spurious reading of int instead of label 2018-07-24 09:52:11 +02:00
67d4736a16 COMP: fvMesh: add hasDb() member 2018-06-05 10:54:58 +01:00
f9fe71815a STYLE: consistent use of '= delete' for removed constructors/assignments
- make the purpose more explicit, and reduces some work for the
  compiler as well.
2018-05-30 12:03:17 +02:00
6b6b36afd3 STYLE: revert bitSet/HashSet setMany() to set() method (issue #837)
- improves backward compatibility and more naming consistency.
  Retain setMany(iter1, iter2) to avoid ambiguity with the
  PackedList::set(index, value) method.
2018-05-29 17:38:02 +02:00
2f567e53de COMP: silence some compiler warnings/errors
- catch (value)
- forward declarations for operator<<()
- non-const access to Reaction name()
- spurious return statement
2018-05-07 17:21:56 +02:00
a230e8d408 STYLE: Correcting typos 2018-03-28 17:14:16 +01:00
f0435beb9c Merge remote-tracking branch 'origin/master' into develop 2018-03-16 23:38:29 +01:00
d17bc72585 ENH: consistency of HashSet setMany(), insertMany() with packed-list version
- this also provides a better separation of the intent
  (ie, inserting a single value, or inserting multiply values)
2018-03-14 21:08:29 +01:00