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
1cb18632
Commit
1cb18632
authored
14 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: streamLineParticle : improved
parent
935be5df
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/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
+11
-6
11 additions, 6 deletions
...ing/functionObjects/field/streamLine/streamLineParticle.C
with
11 additions
and
6 deletions
src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
+
11
−
6
View file @
1cb18632
...
@@ -45,6 +45,7 @@ Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
...
@@ -45,6 +45,7 @@ Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
)
const
)
const
{
{
streamLineParticle
testParticle
(
*
this
);
streamLineParticle
testParticle
(
*
this
);
bool
oldKeepParticle
=
td
.
keepParticle
;
bool
oldKeepParticle
=
td
.
keepParticle
;
bool
oldSwitchProcessor
=
td
.
switchProcessor
;
bool
oldSwitchProcessor
=
td
.
switchProcessor
;
scalar
fraction
=
testParticle
.
trackToFace
(
position
()
+
dt
*
U
,
td
);
scalar
fraction
=
testParticle
.
trackToFace
(
position
()
+
dt
*
U
,
td
);
...
@@ -196,9 +197,7 @@ bool Foam::streamLineParticle::move
...
@@ -196,9 +197,7 @@ bool Foam::streamLineParticle::move
// Cross cell in steps:
// Cross cell in steps:
// - at subiter 0 calculate dt to cross cell in nSubCycle steps
// - at subiter 0 calculate dt to cross cell in nSubCycle steps
// - at the last subiter do all of the remaining track
// - at the last subiter do all of the remaining track
// - do a few more subiters than nSubCycle since velocity might
for
(
label
subIter
=
0
;
subIter
<
td
.
nSubCycle_
;
subIter
++
)
// be decreasing
for
(
label
subIter
=
0
;
subIter
<
2
*
td
.
nSubCycle_
;
subIter
++
)
{
{
--
lifeTime_
;
--
lifeTime_
;
...
@@ -217,14 +216,14 @@ bool Foam::streamLineParticle::move
...
@@ -217,14 +216,14 @@ bool Foam::streamLineParticle::move
// Adapt dt to cross cell in a few steps
// Adapt dt to cross cell in a few steps
dt
=
calcSubCycleDeltaT
(
td
,
dt
,
U
);
dt
=
calcSubCycleDeltaT
(
td
,
dt
,
U
);
}
}
else
if
(
subIter
==
td
.
nSubCycle_
-
1
)
else
if
(
subIter
==
td
.
nSubCycle_
-
1
)
{
{
// Do full step on last subcycle
// Do full step on last subcycle
dt
=
min
(
dtMax
,
tEnd
);
dt
=
min
(
dtMax
,
tEnd
);
}
}
scalar
fraction
=
trackToFace
(
position
()
+
dt
*
U
,
td
);
scalar
fraction
=
trackToFace
(
position
()
+
dt
*
U
,
td
);
dt
*=
fraction
;
dt
*=
fraction
;
tEnd
-=
dt
;
tEnd
-=
dt
;
...
@@ -236,7 +235,13 @@ bool Foam::streamLineParticle::move
...
@@ -236,7 +235,13 @@ bool Foam::streamLineParticle::move
lifeTime_
=
0
;
lifeTime_
=
0
;
}
}
if
(
!
td
.
keepParticle
||
td
.
switchProcessor
||
lifeTime_
==
0
)
if
(
face
()
!=
-
1
||
!
td
.
keepParticle
||
td
.
switchProcessor
||
lifeTime_
==
0
)
{
{
break
;
break
;
}
}
...
...
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