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
d62efed9
Commit
d62efed9
authored
11 years ago
by
andy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: CollidingParcel - refactored to remove code duplication
parent
6a1b5673
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.C
+1
-71
1 addition, 71 deletions
...diate/parcels/Templates/CollidingParcel/CollidingParcel.C
with
1 addition
and
71 deletions
src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.C
+
1
−
71
View file @
d62efed9
...
@@ -69,13 +69,6 @@ bool Foam::CollidingParcel<ParcelType>::move
...
@@ -69,13 +69,6 @@ bool Foam::CollidingParcel<ParcelType>::move
typename
TrackData
::
cloudType
::
parcelType
&
p
=
typename
TrackData
::
cloudType
::
parcelType
&
p
=
static_cast
<
typename
TrackData
::
cloudType
::
parcelType
&>
(
*
this
);
static_cast
<
typename
TrackData
::
cloudType
::
parcelType
&>
(
*
this
);
td
.
switchProcessor
=
false
;
td
.
keepParticle
=
true
;
const
polyMesh
&
mesh
=
td
.
cloud
().
pMesh
();
const
polyBoundaryMesh
&
pbMesh
=
mesh
.
boundaryMesh
();
const
scalarField
&
V
=
mesh
.
cellVolumes
();
switch
(
td
.
part
())
switch
(
td
.
part
())
{
{
case
TrackData
:
:
tpVelocityHalfStep
:
case
TrackData
:
:
tpVelocityHalfStep
:
...
@@ -92,70 +85,7 @@ bool Foam::CollidingParcel<ParcelType>::move
...
@@ -92,70 +85,7 @@ bool Foam::CollidingParcel<ParcelType>::move
case
TrackData
:
:
tpLinearTrack
:
case
TrackData
:
:
tpLinearTrack
:
{
{
scalar
tEnd
=
(
1
.
0
-
p
.
stepFraction
())
*
trackTime
;
ParcelType
::
move
(
td
,
trackTime
);
const
scalar
dtMax
=
tEnd
;
while
(
td
.
keepParticle
&&
!
td
.
switchProcessor
&&
tEnd
>
ROOTVSMALL
)
{
// Apply correction to position for reduced-D cases
meshTools
::
constrainToMeshCentre
(
mesh
,
p
.
position
());
const
point
start
(
p
.
position
());
// Set the Lagrangian time-step
scalar
dt
=
min
(
dtMax
,
tEnd
);
// Remember which cell the parcel is in since this
// will change if a face is hit
const
label
cellI
=
p
.
cell
();
const
scalar
magU
=
mag
(
p
.
U
());
if
(
p
.
active
()
&&
magU
>
ROOTVSMALL
)
{
const
scalar
d
=
dt
*
magU
;
const
scalar
maxCo
=
td
.
cloud
().
solution
().
maxCo
();
const
scalar
dCorr
=
min
(
d
,
maxCo
*
cbrt
(
V
[
cellI
]));
dt
*=
dCorr
/
d
*
p
.
trackToFace
(
p
.
position
()
+
dCorr
*
p
.
U
()
/
magU
,
td
);
}
tEnd
-=
dt
;
p
.
stepFraction
()
=
1
.
0
-
tEnd
/
trackTime
;
// Avoid problems with extremely small timesteps
if
(
dt
>
ROOTVSMALL
)
{
// Update cell based properties
p
.
setCellValues
(
td
,
dt
,
cellI
);
if
(
td
.
cloud
().
solution
().
cellValueSourceCorrection
())
{
p
.
cellValueSourceCorrection
(
td
,
dt
,
cellI
);
}
p
.
calc
(
td
,
dt
,
cellI
);
}
if
(
p
.
onBoundary
()
&&
td
.
keepParticle
)
{
if
(
isA
<
processorPolyPatch
>
(
pbMesh
[
p
.
patch
(
p
.
face
())]))
{
td
.
switchProcessor
=
true
;
}
}
p
.
age
()
+=
dt
;
td
.
cloud
().
functions
().
postMove
(
p
,
cellI
,
dt
,
start
,
td
.
keepParticle
);
}
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