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-plus
Commits
0e802bc2
Commit
0e802bc2
authored
Jun 07, 2016
by
Henry Weller
Browse files
PatchFlowRateInjection: Corrected parallel handling of the random position
Resolves bug-report
http://bugs.openfoam.org/view.php?id=2111
parent
8870e187
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C
View file @
0e802bc2
...
...
@@ -161,6 +161,9 @@ Foam::label Foam::PatchFlowRateInjection<CloudType>::parcelsToInject
scalar
c
=
concentration_
.
value
(
0
.
5
*
(
time0
+
time1
));
scalar
nParcels
=
parcelConcentration_
*
c
*
flowRate
()
*
dt
;
cachedRandom
&
rnd
=
this
->
owner
().
rndGen
();
label
nParcelsToInject
=
floor
(
nParcels
);
// Inject an additional parcel with a probability based on the
...
...
@@ -170,7 +173,7 @@ Foam::label Foam::PatchFlowRateInjection<CloudType>::parcelsToInject
nParcelsToInject
>
0
&&
(
nParcels
-
scalar
(
nParcelsToInject
)
>
this
->
owner
().
rndGen
().
p
osition
(
scalar
(
0
),
scalar
(
1
))
>
rnd
.
globalP
osition
(
scalar
(
0
),
scalar
(
1
))
)
)
{
...
...
@@ -242,10 +245,10 @@ void Foam::PatchFlowRateInjection<CloudType>::setProperties
typename
CloudType
::
parcelType
&
parcel
)
{
//
s
et particle velocity to carrier velocity
//
S
et particle velocity to carrier velocity
parcel
.
U
()
=
this
->
owner
().
U
()[
parcel
.
cell
()];
//
s
et particle diameter
//
S
et particle diameter
parcel
.
d
()
=
sizeDistribution_
->
sample
();
}
...
...
src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C
View file @
0e802bc2
...
...
@@ -156,14 +156,7 @@ void Foam::patchInjectionBase::setPositionAndCell
label
&
tetPtI
)
{
scalar
areaFraction
=
0
;
if
(
Pstream
::
master
())
{
areaFraction
=
rnd
.
position
<
scalar
>
(
0
,
patchArea_
);
}
Pstream
::
scatter
(
areaFraction
);
scalar
areaFraction
=
rnd
.
globalPosition
(
scalar
(
0
),
patchArea_
);
if
(
cellOwners_
.
size
()
>
0
)
{
...
...
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