Skip to content
GitLab
Menu
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
191cc6a1
Commit
191cc6a1
authored
Dec 13, 2010
by
graham
Browse files
BUG: Forcing subcycling to restart after final step in cell.
parent
71271df6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
View file @
191cc6a1
...
...
@@ -45,12 +45,15 @@ Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
)
const
{
streamLineParticle
testParticle
(
*
this
);
bool
oldKeepParticle
=
td
.
keepParticle
;
bool
oldSwitchProcessor
=
td
.
switchProcessor
;
scalar
fraction
=
testParticle
.
trackToFace
(
position
()
+
dt
*
U
,
td
);
scalar
fraction
=
testParticle
.
trackToFace
(
position
()
+
dt
*
U
,
td
);
td
.
keepParticle
=
oldKeepParticle
;
td
.
switchProcessor
=
oldSwitchProcessor
;
// Adapt the dt to subdivide the trajectory into 4 substeps.
// Adapt the dt to subdivide the trajectory into substeps.
return
dt
*
fraction
/
td
.
nSubCycle_
;
}
...
...
@@ -196,9 +199,7 @@ bool Foam::streamLineParticle::move
// Cross cell in steps:
// - at subiter 0 calculate dt to cross cell in nSubCycle steps
// - at the last subiter do all of the remaining track
// - do a few more subiters than nSubCycle since velocity might
// be decreasing
for
(
label
subIter
=
0
;
subIter
<
2
*
td
.
nSubCycle_
;
subIter
++
)
for
(
label
subIter
=
0
;
subIter
<
td
.
nSubCycle_
;
subIter
++
)
{
--
lifeTime_
;
...
...
@@ -217,14 +218,17 @@ bool Foam::streamLineParticle::move
// Adapt dt to cross cell in a few steps
dt
=
calcSubCycleDeltaT
(
td
,
dt
,
U
);
}
else
if
(
subIter
==
td
.
nSubCycle_
-
1
)
else
if
(
subIter
==
td
.
nSubCycle_
-
1
)
{
// Do full step on last subcycle
dt
=
min
(
dtMax
,
tEnd
);
// Force subCycling to restart
subIter
=
td
.
nSubCycle_
;
}
scalar
fraction
=
trackToFace
(
position
()
+
dt
*
U
,
td
);
scalar
fraction
=
trackToFace
(
position
()
+
dt
*
U
,
td
);
dt
*=
fraction
;
tEnd
-=
dt
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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