mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: improvements to gap detection:
- shoot rays to nearest point on surface and two perpendicular rays (instead of always shooting in the 3 coordinate directions) - avoid bleeding through the surface intersection
This commit is contained in:
@ -1366,14 +1366,17 @@ Foam::label Foam::meshRefinement::markInternalGapRefinement
|
|||||||
<< mesh_.globalData().nTotalFaces() << endl;
|
<< mesh_.globalData().nTotalFaces() << endl;
|
||||||
|
|
||||||
|
|
||||||
FaceCellWave<transportData> deltaCalc
|
transportData::trackData td(surfaceIndex_);
|
||||||
|
|
||||||
|
FaceCellWave<transportData, transportData::trackData> deltaCalc
|
||||||
(
|
(
|
||||||
mesh_,
|
mesh_,
|
||||||
frontFaces,
|
frontFaces,
|
||||||
frontData,
|
frontData,
|
||||||
faceData,
|
faceData,
|
||||||
cellData,
|
cellData,
|
||||||
mesh_.globalData().nTotalCells()+1
|
mesh_.globalData().nTotalCells()+1,
|
||||||
|
td
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,6 @@ namespace Foam
|
|||||||
|
|
||||||
// Forward declaration of classes
|
// Forward declaration of classes
|
||||||
class polyMesh;
|
class polyMesh;
|
||||||
class hexRef8;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class transportData Declaration
|
Class transportData Declaration
|
||||||
@ -55,6 +54,23 @@ class transportData
|
|||||||
:
|
:
|
||||||
public wallPointData<scalar>
|
public wallPointData<scalar>
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Class used to pass additional data in
|
||||||
|
class trackData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Per face the index of the surface hit
|
||||||
|
const labelList& surfaceIndex_;
|
||||||
|
|
||||||
|
trackData(const labelList& surfaceIndex)
|
||||||
|
:
|
||||||
|
surfaceIndex_(surfaceIndex)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|||||||
@ -101,12 +101,17 @@ inline bool Foam::transportData::updateCell
|
|||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label,
|
const label faceI,
|
||||||
const transportData& neighbourWallInfo,
|
const transportData& neighbourWallInfo,
|
||||||
const scalar tol,
|
const scalar tol,
|
||||||
TrackingData& td
|
TrackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (td.surfaceIndex_[faceI] != -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
|
const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
|
||||||
|
|
||||||
bool updated = update
|
bool updated = update
|
||||||
@ -132,6 +137,11 @@ inline bool Foam::transportData::updateFace
|
|||||||
TrackingData& td
|
TrackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (td.surfaceIndex_[thisFaceI] != -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return update
|
return update
|
||||||
(
|
(
|
||||||
mesh.faceCentres()[thisFaceI],
|
mesh.faceCentres()[thisFaceI],
|
||||||
@ -152,6 +162,11 @@ inline bool Foam::transportData::updateFace
|
|||||||
TrackingData& td
|
TrackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (td.surfaceIndex_[thisFaceI] != -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return update
|
return update
|
||||||
(
|
(
|
||||||
mesh.faceCentres()[thisFaceI],
|
mesh.faceCentres()[thisFaceI],
|
||||||
|
|||||||
Reference in New Issue
Block a user