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
5d0c0287
Commit
5d0c0287
authored
Nov 12, 2013
by
andy
Browse files
ENH: lagrangian - caches cell length scale on the cloud
parent
407e46db
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
View file @
5d0c0287
...
...
@@ -321,6 +321,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
:
-
1
),
cellOccupancyPtr_
(),
cellLengthScale_
(
cbrt
(
mesh_
.
V
())),
rho_
(
rho
),
U_
(
U
),
mu_
(
mu
),
...
...
@@ -421,6 +422,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
subModelProperties_
(
c
.
subModelProperties_
),
rndGen_
(
c
.
rndGen_
,
true
),
cellOccupancyPtr_
(
NULL
),
cellLengthScale_
(
c
.
cellLengthScale_
),
rho_
(
c
.
rho_
),
U_
(
c
.
U_
),
mu_
(
c
.
mu_
),
...
...
@@ -511,6 +513,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
subModelProperties_
(
dictionary
::
null
),
rndGen_
(
0
,
0
),
cellOccupancyPtr_
(
NULL
),
cellLengthScale_
(
c
.
cellLengthScale_
),
rho_
(
c
.
rho_
),
U_
(
c
.
U_
),
mu_
(
c
.
mu_
),
...
...
@@ -842,7 +845,9 @@ void Foam::KinematicCloud<CloudType>::patchData
template
<
class
CloudType
>
void
Foam
::
KinematicCloud
<
CloudType
>::
updateMesh
()
{
updateCellOccupancy
();
injectors_
.
updateMesh
();
cellLengthScale_
=
cbrt
(
mesh_
.
V
());
}
...
...
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H
View file @
5d0c0287
...
...
@@ -165,6 +165,9 @@ protected:
//- Cell occupancy information for each parcel, (demand driven)
autoPtr
<
List
<
DynamicList
<
parcelType
*>
>
>
cellOccupancyPtr_
;
//- Cell length scale
scalarField
cellLengthScale_
;
// References to the carrier gas fields
...
...
@@ -368,6 +371,9 @@ public:
// if particles are removed or created.
inline
List
<
DynamicList
<
parcelType
*>
>&
cellOccupancy
();
//- Return the cell length scale
inline
const
scalarField
&
cellLengthScale
()
const
;
// References to the carrier gas fields
...
...
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H
View file @
5d0c0287
...
...
@@ -517,6 +517,14 @@ Foam::KinematicCloud<CloudType>::cellOccupancy()
}
template
<
class
CloudType
>
inline
const
Foam
::
scalarField
&
Foam
::
KinematicCloud
<
CloudType
>::
cellLengthScale
()
const
{
return
cellLengthScale_
;
}
template
<
class
CloudType
>
inline
Foam
::
DimensionedField
<
Foam
::
vector
,
Foam
::
volMesh
>&
Foam
::
KinematicCloud
<
CloudType
>::
UTrans
()
...
...
src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C
View file @
5d0c0287
...
...
@@ -265,7 +265,7 @@ bool Foam::KinematicParcel<ParcelType>::move
const
polyMesh
&
mesh
=
td
.
cloud
().
pMesh
();
const
polyBoundaryMesh
&
pbMesh
=
mesh
.
boundaryMesh
();
const
scalarField
&
V
=
mesh
.
cellVolumes
();
const
scalarField
&
cellLengthScale
=
td
.
cloud
().
cellLengthScale
();
const
scalar
maxCo
=
td
.
cloud
().
solution
().
maxCo
();
scalar
tEnd
=
(
1
.
0
-
p
.
stepFraction
())
*
trackTime
;
...
...
@@ -290,7 +290,7 @@ bool Foam::KinematicParcel<ParcelType>::move
if
(
p
.
active
()
&&
moving
&&
(
magU
>
ROOTVSMALL
))
{
const
scalar
d
=
dt
*
magU
;
const
scalar
dCorr
=
min
(
d
,
maxCo
*
c
brt
(
V
[
cellI
])
)
;
const
scalar
dCorr
=
min
(
d
,
maxCo
*
c
ellLengthScale
[
cellI
]);
dt
*=
dCorr
/
d
*
p
.
trackToFace
(
p
.
position
()
+
dCorr
*
U_
/
magU
,
td
);
...
...
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