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
512bfcfd
Commit
512bfcfd
authored
8 years ago
by
Henry Weller
Browse files
Options
Downloads
Patches
Plain Diff
CloudFunctionObjects::ParticleCollector: Corrected handling of "concentricCircle" mode
Patch contributed by Karl Meredith, FM Global.
parent
47bd8e13
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/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C
+38
-18
38 additions, 18 deletions
...loudFunctionObjects/ParticleCollector/ParticleCollector.C
with
38 additions
and
18 deletions
src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C
+
38
−
18
View file @
512bfcfd
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
========= |
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / O peration |
\\ / A nd | Copyright (C) 2012-201
6
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-201
7
OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
...
@@ -171,7 +171,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
...
@@ -171,7 +171,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
}
}
else
else
{
{
//
s
et 4 quadrants for single sector cases
//
S
et 4 quadrants for single sector cases
nS
=
4
;
nS
=
4
;
vector
tangent
=
Zero
;
vector
tangent
=
Zero
;
...
@@ -200,7 +200,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
...
@@ -200,7 +200,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
label
nPoint
=
radius_
.
size
()
*
nPointPerRadius
;
label
nPoint
=
radius_
.
size
()
*
nPointPerRadius
;
label
nFace
=
radius_
.
size
()
*
nS
;
label
nFace
=
radius_
.
size
()
*
nS
;
//
a
dd origin
//
A
dd origin
nPoint
++
;
nPoint
++
;
points_
.
setSize
(
nPoint
);
points_
.
setSize
(
nPoint
);
...
@@ -213,7 +213,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
...
@@ -213,7 +213,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
points_
[
0
]
=
origin
;
points_
[
0
]
=
origin
;
//
p
oints
//
P
oints
forAll
(
radius_
,
radI
)
forAll
(
radius_
,
radI
)
{
{
label
pointOffset
=
radI
*
nPointPerRadius
+
1
;
label
pointOffset
=
radI
*
nPointPerRadius
+
1
;
...
@@ -226,7 +226,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
...
@@ -226,7 +226,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
}
}
}
}
//
f
aces
//
F
aces
DynamicList
<
label
>
facePts
(
2
*
nPointPerSector
);
DynamicList
<
label
>
facePts
(
2
*
nPointPerSector
);
forAll
(
radius_
,
radI
)
forAll
(
radius_
,
radI
)
{
{
...
@@ -236,7 +236,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
...
@@ -236,7 +236,7 @@ void Foam::ParticleCollector<CloudType>::initConcentricCircles()
{
{
facePts
.
clear
();
facePts
.
clear
();
//
a
ppend origin point
//
A
ppend origin point
facePts
.
append
(
0
);
facePts
.
append
(
0
);
for
(
label
ptI
=
0
;
ptI
<
nPointPerSector
;
ptI
++
)
for
(
label
ptI
=
0
;
ptI
<
nPointPerSector
;
ptI
++
)
...
@@ -304,16 +304,16 @@ void Foam::ParticleCollector<CloudType>::collectParcelPolygon
...
@@ -304,16 +304,16 @@ void Foam::ParticleCollector<CloudType>::collectParcelPolygon
if
(
sign
(
d1
)
==
sign
(
d2
))
if
(
sign
(
d1
)
==
sign
(
d2
))
{
{
//
d
id not cross polygon plane
//
D
id not cross polygon plane
continue
;
continue
;
}
}
//
i
ntersection point
//
I
ntersection point
const
point
pIntersect
=
p1
+
(
d1
/
(
d1
-
d2
))
*
(
p2
-
p1
);
const
point
pIntersect
=
p1
+
(
d1
/
(
d1
-
d2
))
*
(
p2
-
p1
);
const
List
<
face
>&
tris
=
faceTris_
[
facei
];
const
List
<
face
>&
tris
=
faceTris_
[
facei
];
//
i
dentify if point is within poly bounds
//
I
dentify if point is within poly bounds
forAll
(
tris
,
triI
)
forAll
(
tris
,
triI
)
{
{
const
face
&
tri
=
tris
[
triI
];
const
face
&
tri
=
tris
[
triI
];
...
@@ -347,11 +347,11 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
...
@@ -347,11 +347,11 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
if
(
sign
(
d1
)
==
sign
(
d2
))
if
(
sign
(
d1
)
==
sign
(
d2
))
{
{
//
d
id not cross plane
//
D
id not cross plane
return
;
return
;
}
}
//
i
ntersection point in cylindrical co-ordinate system
//
I
ntersection point in cylindrical co-ordinate system
const
point
pCyl
=
coordSys_
.
localPosition
(
p1
+
(
d1
/
(
d1
-
d2
))
*
(
p2
-
p1
));
const
point
pCyl
=
coordSys_
.
localPosition
(
p1
+
(
d1
/
(
d1
-
d2
))
*
(
p2
-
p1
));
scalar
r
=
pCyl
[
0
];
scalar
r
=
pCyl
[
0
];
...
@@ -381,7 +381,10 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
...
@@ -381,7 +381,10 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
}
}
}
}
hitFaceIDs_
.
append
(
secI
);
if
(
secI
!=
-
1
)
{
hitFaceIDs_
.
append
(
secI
);
}
}
}
...
@@ -651,7 +654,7 @@ void Foam::ParticleCollector<CloudType>::postMove
...
@@ -651,7 +654,7 @@ void Foam::ParticleCollector<CloudType>::postMove
return
;
return
;
}
}
//
s
lightly extend end position to avoid falling within tracking tolerances
//
S
lightly extend end position to avoid falling within tracking tolerances
const
point
position1
=
position0
+
1
.
0001
*
(
p
.
position
()
-
position0
);
const
point
position1
=
position0
+
1
.
0001
*
(
p
.
position
()
-
position0
);
hitFaceIDs_
.
clear
();
hitFaceIDs_
.
clear
();
...
@@ -669,8 +672,7 @@ void Foam::ParticleCollector<CloudType>::postMove
...
@@ -669,8 +672,7 @@ void Foam::ParticleCollector<CloudType>::postMove
break
;
break
;
}
}
default:
default:
{
{}
}
}
}
...
@@ -681,15 +683,33 @@ void Foam::ParticleCollector<CloudType>::postMove
...
@@ -681,15 +683,33 @@ void Foam::ParticleCollector<CloudType>::postMove
if
(
negateParcelsOppositeNormal_
)
if
(
negateParcelsOppositeNormal_
)
{
{
scalar
Unormal
=
0
;
vector
Uhat
=
p
.
U
();
vector
Uhat
=
p
.
U
();
switch
(
mode_
)
{
case
mtPolygon
:
{
Unormal
=
Uhat
&
normal_
[
facei
];
break
;
}
case
mtConcentricCircle
:
{
Unormal
=
Uhat
&
normal_
[
0
];
break
;
}
default:
{}
}
Uhat
/=
mag
(
Uhat
)
+
ROOTVSMALL
;
Uhat
/=
mag
(
Uhat
)
+
ROOTVSMALL
;
if
((
Uhat
&
normal_
[
facei
])
<
0
)
if
(
Unormal
<
0
)
{
{
m
*
=
-
1
.
0
;
m
=
-
m
;
}
}
}
}
//
a
dd mass contribution
//
A
dd mass contribution
mass_
[
facei
]
+=
m
;
mass_
[
facei
]
+=
m
;
if
(
nSector_
==
1
)
if
(
nSector_
==
1
)
...
...
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