Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
2df11e36
Commit
2df11e36
authored
9 months ago
by
mattijs
Committed by
Mattijs Janssens
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ENH: nearWallDist: cross patch boundaries. See
#3215
parent
04a0bb92
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/finiteVolume/fvMesh/wallDist/nearWallDist/nearWallDist.C
+55
-32
55 additions, 32 deletions
src/finiteVolume/fvMesh/wallDist/nearWallDist/nearWallDist.C
with
55 additions
and
32 deletions
src/finiteVolume/fvMesh/wallDist/nearWallDist/nearWallDist.C
+
55
−
32
View file @
2df11e36
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020
,2024
OpenCFD Ltd.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
This file is part of OpenFOAM.
This file is part of OpenFOAM.
...
@@ -27,60 +27,83 @@ License
...
@@ -27,60 +27,83 @@ License
\*---------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include
"nearWallDist.H"
#include
"nearWallDist.H"
#include
"fvMesh.H"
#include
"cellDistFuncs.H"
#include
"cellDistFuncs.H"
#include
"wallFvPatch.H"
#include
"wallFvPatch.H"
#include
"surfaceFields.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void
Foam
::
nearWallDist
::
calculate
()
void
Foam
::
nearWallDist
::
calculate
()
{
{
cellDistFuncs
wallUtils
(
mesh_
);
const
cellDistFuncs
wallUtils
(
mesh_
);
// Get patch ids of walls
// Collect indices of wall patches
labelHashSet
wallPatchIDs
(
wallUtils
.
getPatchIDs
<
wallPolyPatch
>
());
// Size neighbours array for maximum possible
DynamicList
<
label
>
wallPatchIDs
(
mesh_
.
boundary
().
size
());
label
nWalls
=
0
;
DynamicList
<
label
>
neighbours
(
wallUtils
.
maxPatchSize
(
wallPatchIDs
));
forAll
(
mesh_
.
boundary
(),
patchi
)
{
if
(
isA
<
wallFvPatch
>
(
mesh_
.
boundary
()[
patchi
]))
{
wallPatchIDs
.
append
(
patchi
);
nWalls
+=
mesh_
.
boundary
()[
patchi
].
size
();
}
else
{
// Set distance to 0
operator
[](
patchi
)
=
0
.
0
;
}
}
// Co
rr
ect all
cells wit
h face o
n
wall
// Co
ll
ect all
mes
h face
s
o
f
wall
patches
const
volVectorField
&
cellCentres
=
mesh_
.
C
(
);
DynamicList
<
label
>
faceLabels
(
nWalls
);
for
All
(
mesh_
.
boundary
(),
patchi
)
for
(
const
label
patchi
:
wallPatchIDs
)
{
{
fvPatchScalarField
&
ypatch
=
operator
[](
patchi
);
const
fvPatch
&
patch
=
mesh_
.
boundary
()[
patchi
];
const
fvPatch
&
patch
=
mesh_
.
boundary
()[
patchi
];
const
auto
&
pp
=
patch
.
patch
();
if
(
isA
<
wallFvPatch
>
(
patch
)
)
forAll
(
patch
,
i
)
{
{
const
polyPatch
&
pPatch
=
patch
.
patch
();
faceLabels
.
append
(
pp
.
start
()
+
i
);
}
}
const
labelUList
&
faceCells
=
patch
.
faceCells
();
const
uindirectPrimitivePatch
wallPatch
(
UIndirectList
<
face
>
(
mesh_
.
faces
(),
faceLabels
),
mesh_
.
points
()
);
// Check cells with face on wall
const
volVectorField
&
cellCentres
=
mesh_
.
C
();
forAll
(
patch
,
patchFacei
)
{
wallUtils
.
getPointNeighbours
(
pPatch
,
patchFacei
,
neighbours
);
label
minFacei
=
-
1
;
DynamicList
<
label
>
neighbours
;
ypatch
[
patchFacei
]
=
wallUtils
.
smallestDist
nWalls
=
0
;
(
for
(
const
label
patchi
:
wallPatchIDs
)
cellCentres
[
faceCells
[
patchFacei
]],
{
pPatch
,
const
fvPatch
&
patch
=
mesh_
.
boundary
()[
patchi
];
neighbours
,
const
labelUList
&
faceCells
=
patch
.
patch
().
faceCells
();
minFacei
);
fvPatchScalarField
&
ypatch
=
operator
[](
patchi
);
}
}
forAll
(
patch
,
patchFacei
)
else
{
{
ypatch
=
0
.
0
;
// Get point connected neighbours (in wallPatch indices!)
wallUtils
.
getPointNeighbours
(
wallPatch
,
nWalls
,
neighbours
);
label
minFacei
=
-
1
;
ypatch
[
patchFacei
]
=
wallUtils
.
smallestDist
(
cellCentres
[
faceCells
[
patchFacei
]],
wallPatch
,
neighbours
,
minFacei
);
nWalls
++
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment