mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: add directionalMeshWave functionality
For a given point within a given mesh, the existing `meshWave` method gives the orthogonal distance to a patch. In meshes with very steep terrain (e.g. a hill of 90 [deg], this might be problematic for the fields that require the distance to the patch associated with the terrain surface. `directionalMeshWave` is a variant of `meshWave` distance-to-patch method, which ignores the component in the specified direction. Can be used e.g. to calculate the distance in the z-direction only. TUT: add example of directionalMeshWave to mesh/moveDynamicMesh/SnakeCanyon Requirement by CENER Implementation by Mattijs Janssens
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,7 +63,7 @@ class wallPoint;
|
||||
Class patchDataWave Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class TransferType>
|
||||
template<class TransferType, class TrackingData = int>
|
||||
class patchDataWave
|
||||
:
|
||||
public cellDistFuncs
|
||||
@ -84,6 +85,10 @@ private:
|
||||
//- Do accurate distance calculation for near-wall cells.
|
||||
bool correctWalls_;
|
||||
|
||||
//- Additional data to be passed into underlying containers
|
||||
TrackingData& td_;
|
||||
|
||||
|
||||
//
|
||||
// After construction:
|
||||
//
|
||||
@ -115,7 +120,14 @@ private:
|
||||
) const;
|
||||
|
||||
//- Copy MeshWave values into *this
|
||||
label getValues(const MeshWave<TransferType>&);
|
||||
label getValues(const MeshWave<TransferType, TrackingData>&);
|
||||
|
||||
|
||||
// Private static data
|
||||
|
||||
//- Used as default trackdata value to satisfy default template
|
||||
// argument.
|
||||
static int dummyTrackData_;
|
||||
|
||||
|
||||
public:
|
||||
@ -131,7 +143,8 @@ public:
|
||||
const polyMesh& mesh,
|
||||
const labelHashSet& patchIDs,
|
||||
const UPtrList<Field<Type>>& initialPatchValuePtrs,
|
||||
bool correctWalls = true
|
||||
const bool correctWalls = true,
|
||||
TrackingData& td = dummyTrackData_
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user