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:
mattijs
2015-10-28 15:02:17 +00:00
parent 3f2d5983ad
commit ec76bca024
3 changed files with 38 additions and 4 deletions

View File

@ -1366,14 +1366,17 @@ Foam::label Foam::meshRefinement::markInternalGapRefinement
<< mesh_.globalData().nTotalFaces() << endl;
FaceCellWave<transportData> deltaCalc
transportData::trackData td(surfaceIndex_);
FaceCellWave<transportData, transportData::trackData> deltaCalc
(
mesh_,
frontFaces,
frontData,
faceData,
cellData,
mesh_.globalData().nTotalCells()+1
mesh_.globalData().nTotalCells()+1,
td
);

View File

@ -45,7 +45,6 @@ namespace Foam
// Forward declaration of classes
class polyMesh;
class hexRef8;
/*---------------------------------------------------------------------------*\
Class transportData Declaration
@ -55,6 +54,23 @@ class transportData
:
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 Member Functions

View File

@ -101,12 +101,17 @@ inline bool Foam::transportData::updateCell
(
const polyMesh& mesh,
const label cellI,
const label,
const label faceI,
const transportData& neighbourWallInfo,
const scalar tol,
TrackingData& td
)
{
if (td.surfaceIndex_[faceI] != -1)
{
return false;
}
const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
bool updated = update
@ -132,6 +137,11 @@ inline bool Foam::transportData::updateFace
TrackingData& td
)
{
if (td.surfaceIndex_[thisFaceI] != -1)
{
return false;
}
return update
(
mesh.faceCentres()[thisFaceI],
@ -152,6 +162,11 @@ inline bool Foam::transportData::updateFace
TrackingData& td
)
{
if (td.surfaceIndex_[thisFaceI] != -1)
{
return false;
}
return update
(
mesh.faceCentres()[thisFaceI],