Commit Graph

47 Commits

Author SHA1 Message Date
Andrew Heather
6748f10d5d ENH: Lagrangian - added particle output to stream functions 2019-12-09 23:21:53 +00:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
ffbb0710fd ENH: add cloud::readObjects(const objectRegistry&)
- this can be use for situations where the cloud data has been
  provided by a non-file transport.
2019-08-02 18:30:12 +02:00
Mark Olesen
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
Mark Olesen
743311df7d STYLE: consistent access for particle sizeofFields, particle iterators 2019-07-30 14:22:56 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
c1964d7807 ENH: distinguish between face areaNormal/unitNormal in the code 2018-08-10 15:43:06 +02:00
Will Bainbridge
a33b6aa447 ENH: particle: Optimisation by inlining key methods
Resolves bug report https://bugs.openfoam.org/view.php?id=2871
2018-03-13 08:22:33 +00:00
Andrew Heather
a230e8d408 STYLE: Correcting typos 2018-03-28 17:14:16 +01:00
Mark Olesen
d69c26311f STYLE: relocate geometryType enum to cloud class (issue #721) 2018-02-19 12:40:06 +01:00
Andrew Heather
66f473b11c ENH: Updated extractEulerianParticles and deps after change to barycentric tracking 2017-12-22 13:19:41 +00:00
Andrew Heather
2defba00a9 ENH: Lagrangian - provided backwards compatibility for cases using the
old "positions" file form

The change to barycentric-based tracking changed the contents of the
cloud "positions" file to a new format comprising the barycentric
co-ordinates and other cell position-based info.  This broke
backwards compatibility, providing no option to restart old cases
(v1706 and earlier), and caused difficulties for dependent code, e.g.
for post-processing utilities that could only infer the contents only
after reading.

The barycentric position info is now written to a file called
"coordinates" with provision to restart old cases for which only the
"positions" file is available. Related utilities, e.g. for parallel
running and data conversion have been updated to be able to support both
file types.

To write the "positions" file by default, use set the following option
in the InfoSwitches section of the controlDict:

    writeLagrangianPositions 1;
2017-09-13 13:13:36 +01:00
Will Bainbridge
b8440c4232 lagrangian: Removed unnecessary patch argument from hit methods
The patch can be determined from the particle when it is needed. Most of
the time it is not.
2017-08-23 16:27:36 +01:00
Will Bainbridge
b78d844cf4 lagrangian: Removed duplicate data from method arguments
A lot of methods were taking argument data which could be referenced or
generated from the parcel class at little or no additional cost. This
was confusing and generated the possibility of inconsistent data states.
2017-08-23 15:14:32 +01:00
Will Bainbridge
22bd391903 lagrangian: Simplification of parallel transfer 2017-08-22 17:57:11 +01:00
Will Bainbridge
87c15bf1c6 lagrangian: Un-templated the tracking data
Tracking data classes are no longer templated on the derived cloud type.
The advantage of this is that they can now be passed to sub models. This
should allow continuous phase data to be removed from the parcel
classes. The disadvantage is that every function which once took a
templated TrackData argument now needs an additional TrackCloudType
argument in order to perform the necessary down-casting.
2017-08-22 15:28:04 +01:00
Andrew Heather
d8d6030ab6 INT: Integration of Mattijs' collocated parallel IO additions
Original commit message:
------------------------

Parallel IO: New collated file format

When an OpenFOAM simulation runs in parallel, the data for decomposed fields and
mesh(es) has historically been stored in multiple files within separate
directories for each processor.  Processor directories are named 'processorN',
where N is the processor number.

This commit introduces an alternative "collated" file format where the data for
each decomposed field (and mesh) is collated into a single file, which is
written and read on the master processor.  The files are stored in a single
directory named 'processors'.

The new format produces significantly fewer files - one per field, instead of N
per field.  For large parallel cases, this avoids the restriction on the number
of open files imposed by the operating system limits.

The file writing can be threaded allowing the simulation to continue running
while the data is being written to file.  NFS (Network File System) is not
needed when using the the collated format and additionally, there is an option
to run without NFS with the original uncollated approach, known as
"masterUncollated".

The controls for the file handling are in the OptimisationSwitches of
etc/controlDict:

OptimisationSwitches
{
    ...

    //- Parallel IO file handler
    //  uncollated (default), collated or masterUncollated
    fileHandler uncollated;

    //- collated: thread buffer size for queued file writes.
    //  If set to 0 or not sufficient for the file size threading is not used.
    //  Default: 2e9
    maxThreadFileBufferSize 2e9;

    //- masterUncollated: non-blocking buffer size.
    //  If the file exceeds this buffer size scheduled transfer is used.
    //  Default: 2e9
    maxMasterFileBufferSize 2e9;
}

When using the collated file handling, memory is allocated for the data in the
thread.  maxThreadFileBufferSize sets the maximum size of memory in bytes that
is allocated.  If the data exceeds this size, the write does not use threading.

When using the masterUncollated file handling, non-blocking MPI communication
requires a sufficiently large memory buffer on the master node.
maxMasterFileBufferSize sets the maximum size in bytes of the buffer.  If the
data exceeds this size, the system uses scheduled communication.

The installation defaults for the fileHandler choice, maxThreadFileBufferSize
and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within
the case controlDict file, like other parameters.  Additionally the fileHandler
can be set by:
- the "-fileHandler" command line argument;
- a FOAM_FILEHANDLER environment variable.

A foamFormatConvert utility allows users to convert files between the collated
and uncollated formats, e.g.
    mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated

An example case demonstrating the file handling methods is provided in:
$FOAM_TUTORIALS/IO/fileHandling

The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
2017-07-07 11:39:56 +01:00
Andrew Heather
065bfa264e INT: Compatibility updates followinglatest integrations 2017-09-05 10:19:09 +01:00
Will Bainbridge
f021409db3 lagrangian: Made ACMI interactions insensitive to cell-face order 2017-08-11 10:22:03 +01:00
Will Bainbridge
9b57ef06cf Lagrangian: Enabled tracking through ACMI patches and minor code improvements
Particle collisions with ACMI patches are now handled. The hit detects
whether the location is within the overlap or the coupled region and
recurses, calling the hit routine appropriate for the region.

The low level tracking methods are now more consistently named. There is
now a distinction between tracking to a face and hitting it. Function
object side effects have been moved out of the base layer and into the
parcels on which they are meaningful.
2017-08-09 15:52:33 +01:00
Will Bainbridge
e9fb8b8572 tetIndices: Removed duplicate logic
The logic for generating tetrahedra from a face base point and an offset
was duplicated in a few places. It is now confined to the tetIndices
class.
2017-06-01 09:59:38 +01:00
Will Bainbridge
04c11064b3 particle: Corrected the direction of tracking when passing through an
AMI. Applied the transformation.
2017-05-04 18:25:41 +01:00
Will Bainbridge
743dea87d2 Lagrangian: Rewrite of the particle tracking algorithm to function in
terms of the local barycentric coordinates of the current tetrahedron,
rather than the global coordinate system.

Barycentric tracking works on any mesh, irrespective of mesh quality.
Particles do not get "lost", and tracking does not require ad-hoc
"corrections" or "rescues" to function robustly, because the calculation
of particle-face intersections is unambiguous and reproducible, even at
small angles of incidence.

Each particle position is defined by topology (i.e. the decomposed tet
cell it is in) and geometry (i.e. where it is in the cell). No search
operations are needed on restart or reconstruct, unlike when particle
positions are stored in the global coordinate system.

The particle positions file now contains particles' local coordinates
and topology, rather than the global coordinates and cell. This change
to the output format is not backwards compatible. Existing cases with
Lagrangian data will not restart, but they will still run from time
zero without any modification. This change was necessary in order to
guarantee that the loaded particle is valid, and therefore
fundamentally prevent "loss" and "search-failure" type bugs (e.g.,
2517, 2442, 2286, 1836, 1461, 1341, 1097).

The tracking functions have also been converted to function in terms
of displacement, rather than end position. This helps remove floating
point error issues, particularly towards the end of a tracking step.

Wall bounded streamlines have been removed. The implementation proved
incompatible with the new tracking algorithm. ParaView has a surface
LIC plugin which provides equivalent, or better, functionality.

Additionally, bug report <https://bugs.openfoam.org/view.php?id=2517>
is resolved by this change.
2017-04-28 08:03:44 +01:00
Andrew Heather
99a1eee024 ENH: Lagrangian - added functions to add particle data as fields on an object registry 2016-11-30 17:18:48 +00:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
aaf8819c92 tetPtI -> tetPti 2016-08-16 11:30:17 +01:00
Andrew Heather
b9313ef2fe ENH: Consistency updates after Foundation merge and code tidying 2016-04-25 16:46:56 +01:00
Henry Weller
450728ea84 Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
andy
fd9d801e2d GIT: Initial commit after latest foundation merge 2016-04-25 11:40:48 +01:00
Henry Weller
43beb06018 Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
Henry Weller
8c6fa81eba vector::zero -> Zero 2016-04-16 18:34:41 +01:00
mattijs
9e3ce4ec7f Merge branch 'master' of develop.openfoam.com:Development/OpenFOAM-plus into feature-shared-file
Conflicts:
	applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
	applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C
	applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundary.C
	applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
	applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/vtkPV4Foam/vtkPV4FoamUpdateInfo.C
	applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C
	applications/utilities/postProcessing/velocityField/Co/Co.C
	applications/utilities/postProcessing/velocityField/Pe/Pe.C
	applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C
	applications/utilities/preProcessing/changeDictionary/changeDictionary.C
	applications/utilities/preProcessing/setFields/setFields.C
	applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
	applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
	applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C
	applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C
	src/OpenFOAM/db/IOobject/IOobject.C
	src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C
	src/OpenFOAM/db/IOobjects/IOField/IOField.C
	src/OpenFOAM/db/IOobjects/IOList/IOList.C
	src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C
	src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C
	src/OpenFOAM/db/Time/findInstance.C
	src/OpenFOAM/db/regIOobject/regIOobject.C
	src/OpenFOAM/db/regIOobject/regIOobjectI.H
	src/OpenFOAM/db/regIOobject/regIOobjectRead.C
	src/OpenFOAM/db/regIOobject/regIOobjectWrite.C
	src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/IOmapDistribute.C
	src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
	src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
	src/dynamicMesh/fvMeshDistribute/IOmapDistributePolyMesh.C
	src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8Data.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C
	src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
	src/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C
	src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
	src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.C
	src/lagrangian/basic/Cloud/CloudIO.C
	src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C
	src/postProcessing/foamCalcFunctions/basic/addSubtract/addSubtract.C
	src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C
	src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C
	src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C
	src/triSurface/triSurface/surfacePatch/surfacePatchIOList.C
2016-01-25 16:29:04 +00:00
mattijs
e424059208 ENH: glboal file handling: initial commit
Moved file path handling to regIOobject and made it type specific so
now every object can have its own rules. Examples:
- faceZones are now processor local (and don't search up anymore)
- timeStampMaster is now no longer hardcoded inside IOdictionary
  (e.g. uniformDimensionedFields support it as well)
- the distributedTriSurfaceMesh is properly processor-local; no need
  for fileModificationChecking manipulation.
2016-01-25 13:03:15 +00:00
Henry Weller
c4d5f65a10 Completed update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-11 09:03:39 +00:00
Henry
a3232e5de7 cyclicAMIPolyPatch: Correct particle transformations across cyclic AMI patches
Patch provided by Daniel Jasiński
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1694
2015-05-20 12:44:31 +01:00
Henry
632170f0ee Added return when position_ == endPosition
May resolve bug-report http://www.openfoam.org/mantisbt/view.php?id=1459
2014-12-16 20:45:51 +00:00
Henry
3f5eda25f0 symmetryPlane: add symmetryPlane as a special type of symmetry condition applied to a single plane
The standard/previous general symmetry type is now named symmetry
    both in class and lookup name for consistency.  The rigorous
    symmetryPlane type is needed for moving-mesh cases in which the
    motion it constrained by one or two planes.
2013-12-06 15:45:11 +00:00
andy
17bb9fd22a BUG: particle tracking - wrong index used - mantis #1059 2013-11-20 11:22:36 +00:00
andy
8e79bf1b82 ENH: Added initial support for particle tracking across AMI patches 2013-08-14 15:54:40 +01:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
mattijs
d8ac667359 BUG: particleTemplates: reference to temporary 2011-07-07 16:24:34 +01:00
graham
adfc2de66e ENH: Moving the calculation of the lambda denominator/numerator upwards.
Expensive to look it up in the lambda function, passing from trackToFace as an
argument.
2011-04-07 11:23:18 +01:00
graham
bddb31eaf8 BUG: lambda numerator and denominator too small for tiny domains.
They go < SMALL for micro/nano domains and trigger corrections.  An absolute
value of SMALL is not justifiable, using cell volume scaled comparison.
2011-04-06 11:12:33 +01:00
mattijs
fbfac5e83c ENH: cyclics: transformPosition for lagrangian positions. Rotational transform calculation
For rotational:
- 180 degree transformation now correct
- use furthest away face to determine rotation
- do not use calculated faceNormals at all
2011-03-17 15:56:46 +00:00
andy
fa91103344 BUG: corrected wallImpactDistance/hasWallImpactDistance functionality
ENH: Propagated virtual mechanism through to derived types
2011-03-07 11:49:02 +00:00
andy
06024cf988 ENH: Updated lagrangian basic particle
- removed templating
- updated track data
2011-02-24 16:02:28 +00:00