Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
775f3996
Commit
775f3996
authored
Sep 06, 2017
by
mattijs
Browse files
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
parents
dbc0bbc9
92ce092e
Changes
4
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/manipulation/checkMesh/checkTopology.C
View file @
775f3996
...
...
@@ -35,9 +35,78 @@ License
#include
"processorPolyPatch.H"
#include
"surfaceWriter.H"
#include
"checkTools.H"
#include
"treeBoundBox.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
<
class
PatchType
>
void
Foam
::
checkPatch
(
const
bool
allGeometry
,
const
word
&
name
,
const
PatchType
&
pp
,
pointSet
&
points
)
{
Info
<<
" "
<<
setw
(
20
)
<<
name
<<
setw
(
9
)
<<
returnReduce
(
pp
.
size
(),
sumOp
<
label
>
())
<<
setw
(
9
)
<<
returnReduce
(
pp
.
nPoints
(),
sumOp
<
label
>
());
if
(
!
Pstream
::
parRun
())
{
typedef
typename
PatchType
::
surfaceTopo
TopoType
;
TopoType
pTyp
=
pp
.
surfaceType
();
if
(
pp
.
empty
())
{
Info
<<
setw
(
34
)
<<
"ok (empty)"
;
}
else
if
(
pTyp
==
TopoType
::
MANIFOLD
)
{
if
(
pp
.
checkPointManifold
(
true
,
&
points
))
{
Info
<<
setw
(
34
)
<<
"multiply connected (shared point)"
;
}
else
{
Info
<<
setw
(
34
)
<<
"ok (closed singly connected)"
;
}
// Add points on non-manifold edges to make set complete
pp
.
checkTopology
(
false
,
&
points
);
}
else
{
pp
.
checkTopology
(
false
,
&
points
);
if
(
pTyp
==
TopoType
::
OPEN
)
{
Info
<<
setw
(
34
)
<<
"ok (non-closed singly connected)"
;
}
else
{
Info
<<
setw
(
34
)
<<
"multiply connected (shared edge)"
;
}
}
}
if
(
allGeometry
)
{
const
labelList
&
mp
=
pp
.
meshPoints
();
if
(
returnReduce
(
mp
.
size
(),
sumOp
<
label
>
())
>
0
)
{
boundBox
bb
(
pp
.
points
(),
mp
,
true
);
// reduce
Info
<<
' '
<<
bb
;
}
}
}
Foam
::
label
Foam
::
checkTopology
(
const
polyMesh
&
mesh
,
...
...
@@ -466,6 +535,13 @@ Foam::label Foam::checkTopology
}
}
// Non-manifold points
pointSet
points
(
mesh
,
"nonManifoldPoints"
,
mesh
.
nPoints
()
/
1000
);
{
if
(
!
Pstream
::
parRun
())
...
...
@@ -478,17 +554,8 @@ Foam::label Foam::checkTopology
Info
<<
"
\n
Checking basic patch addressing..."
<<
endl
;
}
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
// Non-manifold points
pointSet
points
(
mesh
,
"nonManifoldPoints"
,
mesh
.
nPoints
()
/
1000
);
Pout
.
setf
(
ios_base
::
left
);
Info
<<
" "
...
...
@@ -511,76 +578,127 @@ Foam::label Foam::checkTopology
if
(
!
isA
<
processorPolyPatch
>
(
pp
))
{
Info
<<
" "
<<
setw
(
20
)
<<
pp
.
name
()
<<
setw
(
9
)
<<
returnReduce
(
pp
.
size
(),
sumOp
<
label
>
())
<<
setw
(
9
)
<<
returnReduce
(
pp
.
nPoints
(),
sumOp
<
label
>
());
checkPatch
(
allGeometry
,
pp
.
name
(),
pp
,
points
);
Info
<<
endl
;
}
}
if
(
!
Pstream
::
parRun
())
{
primitivePatch
::
surfaceTopo
pTyp
=
pp
.
surfaceType
();
//Info.setf(ios_base::right);
}
if
(
pp
.
empty
())
{
Info
<<
setw
(
34
)
<<
"ok (empty)"
;
}
else
if
(
pTyp
==
primitivePatch
::
MANIFOLD
)
{
if
(
pp
.
checkPointManifold
(
true
,
&
points
))
{
Info
<<
setw
(
34
)
<<
"multiply connected (shared point)"
;
}
else
{
Info
<<
setw
(
34
)
<<
"ok (closed singly connected)"
;
}
{
if
(
!
Pstream
::
parRun
())
{
Info
<<
"
\n
Checking faceZone topology for multiply connected"
<<
" surfaces..."
<<
endl
;
}
else
{
Info
<<
"
\n
Checking basic faceZone addressing..."
<<
endl
;
}
// Add points on non-manifold edges to make set complete
pp
.
checkTopology
(
false
,
&
points
);
}
else
{
pp
.
checkTopology
(
false
,
&
points
);
Pout
.
setf
(
ios_base
::
left
);
if
(
pTyp
==
primitivePatch
::
OPEN
)
{
Info
<<
setw
(
34
)
<<
"ok (non-closed singly connected)"
;
}
else
{
Info
<<
setw
(
34
)
<<
"multiply connected (shared edge)"
;
}
}
}
const
faceZoneMesh
&
faceZones
=
mesh
.
faceZones
();
if
(
allGeometry
)
{
const
labelList
&
mp
=
pp
.
meshPoints
();
if
(
faceZones
.
size
())
{
Info
<<
" "
<<
setw
(
20
)
<<
"FaceZone"
<<
setw
(
9
)
<<
"Faces"
<<
setw
(
9
)
<<
"Points"
;
if
(
returnReduce
(
mp
.
size
(),
sumOp
<
label
>
())
>
0
)
{
boundBox
bb
(
pp
.
points
(),
mp
,
true
);
// reduce
Info
<<
' '
<<
bb
;
}
}
if
(
!
Pstream
::
parRun
())
{
Info
<<
setw
(
34
)
<<
"Surface topology"
;
}
if
(
allGeometry
)
{
Info
<<
" Bounding box"
;
}
Info
<<
endl
;
forAll
(
faceZones
,
zoneI
)
{
const
faceZone
&
fz
=
faceZones
[
zoneI
];
checkPatch
(
allGeometry
,
fz
.
name
(),
fz
(),
points
);
Info
<<
endl
;
}
}
if
(
points
.
size
())
else
{
Info
<<
"
<<Writing "
<<
returnReduce
(
points
.
size
(),
sumOp
<
label
>
())
<<
" conflicting points to set "
<<
points
.
name
()
<<
endl
;
Info
<<
"
No faceZones found."
<<
endl
;
}
}
points
.
instance
()
=
mesh
.
pointsInstance
();
points
.
write
();
label
nPoints
=
returnReduce
(
points
.
size
(),
sumOp
<
label
>
());
if
(
nPoints
)
{
Info
<<
" <<Writing "
<<
nPoints
<<
" conflicting points to set "
<<
points
.
name
()
<<
endl
;
points
.
instance
()
=
mesh
.
pointsInstance
();
points
.
write
();
if
(
setWriter
.
valid
())
{
mergeAndWrite
(
setWriter
,
points
);
}
}
//Info.setf(ios_base::right);
{
Info
<<
"
\n
Checking basic cellZone addressing..."
<<
endl
;
Pout
.
setf
(
ios_base
::
left
);
const
cellZoneMesh
&
cellZones
=
mesh
.
cellZones
();
if
(
cellZones
.
size
())
{
Info
<<
" "
<<
setw
(
20
)
<<
"CellZone"
<<
setw
(
9
)
<<
"Cells"
<<
setw
(
9
)
<<
"Points"
<<
setw
(
13
)
<<
"BoundingBox"
<<
endl
;
const
cellList
&
cells
=
mesh
.
cells
();
const
faceList
&
faces
=
mesh
.
faces
();
treeBoundBox
bb
(
boundBox
::
invertedBox
);
PackedBoolList
isZonePoint
(
mesh
.
nPoints
());
forAll
(
cellZones
,
zoneI
)
{
const
cellZone
&
cZone
=
cellZones
[
zoneI
];
forAll
(
cZone
,
i
)
{
const
label
cellI
=
cZone
[
i
];
const
cell
&
cFaces
=
cells
[
cellI
];
forAll
(
cFaces
,
cFacei
)
{
const
face
&
f
=
faces
[
cFaces
[
cFacei
]];
forAll
(
f
,
fp
)
{
if
(
isZonePoint
.
set
(
f
[
fp
]))
{
bb
.
add
(
mesh
.
points
()[
f
[
fp
]]);
}
}
}
}
Info
<<
" "
<<
setw
(
20
)
<<
cZone
.
name
()
<<
setw
(
9
)
<<
returnReduce
(
cZone
.
size
(),
sumOp
<
label
>
())
<<
setw
(
9
)
<<
returnReduce
(
isZonePoint
.
count
(),
sumOp
<
label
>
())
<<
setw
(
3
)
<<
bb
<<
endl
;
}
}
else
{
Info
<<
" No cellZones found."
<<
endl
;
}
}
// Force creation of all addressing if requested.
...
...
etc/caseDicts/createZeroDirectoryTemplates/boundaryConditions/fluid/incompressible/inletOptions
View file @
775f3996
...
...
@@ -41,7 +41,7 @@ flowSpecification
U
{
type flowRateInletVelocity;
volumeFlowRate ${:VALUE.volumeFlowRate};
volume
tric
FlowRate ${:VALUE.volume
tric
FlowRate};
value ${:VALUE.U};
}
p
...
...
src/functionObjects/field/Curle/Curle.C
View file @
775f3996
...
...
@@ -99,7 +99,7 @@ bool Foam::functionObjects::Curle::calc()
volScalarField
&
pDash
=
tpDash
.
ref
();
const
volVectorField
d
(
scopedName
(
"d"
),
C
-
x0_
);
pDash
=
4
*
mathematical
::
pi
/
c0_
*
(
d
/
magSqr
(
d
)
&
dfdt
);
pDash
=
(
d
/
magSqr
(
d
)
&
dfdt
)
/
(
4
.
0
*
mathematical
::
pi
*
c0_
);
return
store
(
resultName_
,
tpDash
);
}
...
...
src/functionObjects/field/Curle/Curle.H
View file @
775f3996
...
...
@@ -33,7 +33,7 @@ Description
Curle's analogy is implemented as:
\f[
p' =
4
\frac{\pi
}{
c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)}
p' = \frac{
1}{4
\pi
c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)}
\f]
...
...
@@ -68,8 +68,8 @@ Usage
type | Type name: Curle | yes |
field | Pressure field name | no | p
result | Acoustic pressure field name | no | Curle
patches | Sound generation patch names | yes |
c0 | Reference speed of sound | yes |
patches | Sound generation patch names | yes |
c0 | Reference speed of sound | yes |
\endtable
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment