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
124ad071
Commit
124ad071
authored
12 years ago
by
andy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Only generate random numbers when required
parent
c5755f7a
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/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/drippingInjection/drippingInjection.C
+33
-24
33 additions, 24 deletions
...atic/injectionModel/drippingInjection/drippingInjection.C
with
33 additions
and
24 deletions
src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/drippingInjection/drippingInjection.C
+
33
−
24
View file @
124ad071
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -66,13 +66,8 @@ drippingInjection::drippingInjection
rndGen_
)
),
diameter_
(
owner
.
regionMesh
().
nCells
(),
0
.
0
)
{
forAll
(
diameter_
,
faceI
)
{
diameter_
[
faceI
]
=
parcelDistribution_
->
sample
();
}
}
diameter_
(
owner
.
regionMesh
().
nCells
(),
-
1
.
0
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
...
...
@@ -117,27 +112,41 @@ void drippingInjection::correct
// Collect the data to be transferred
forAll
(
mass
ToInject
,
cellI
)
forAll
(
mass
Drip
,
cellI
)
{
scalar
rhoc
=
rho
[
cellI
];
scalar
diam
=
diameter_
[
cellI
];
scalar
minMass
=
particlesPerParcel_
*
rhoc
*
pi
/
6
*
pow3
(
diam
);
if
(
massDrip
[
cellI
]
>
minMass
)
if
(
massDrip
[
cellI
]
>
0
)
{
// All drip mass can be injected
massToInject
[
cellI
]
+=
massDrip
[
cellI
];
availableMass
[
cellI
]
-=
massDrip
[
cellI
];
// Set particle diameter
diameterToInject
[
cellI
]
=
diameter_
[
cellI
];
// Retrieve new particle diameter sample
diameter_
[
cellI
]
=
parcelDistribution_
->
sample
();
// set new particle diameter if not already set
if
(
diameter_
[
cellI
]
<
0
)
{
diameter_
[
cellI
]
=
parcelDistribution_
->
sample
();
}
scalar
&
diam
=
diameter_
[
cellI
];
scalar
rhoc
=
rho
[
cellI
];
scalar
minMass
=
particlesPerParcel_
*
rhoc
*
pi
/
6
*
pow3
(
diam
);
if
(
massDrip
[
cellI
]
>
minMass
)
{
// All drip mass can be injected
massToInject
[
cellI
]
+=
massDrip
[
cellI
];
availableMass
[
cellI
]
-=
massDrip
[
cellI
];
// Set particle diameter
diameterToInject
[
cellI
]
=
diam
;
// Retrieve new particle diameter sample
diam
=
parcelDistribution_
->
sample
();
}
else
{
// Particle mass below minimum threshold - cannot be injected
massToInject
[
cellI
]
=
0
.
0
;
diameterToInject
[
cellI
]
=
0
.
0
;
}
}
else
{
// Mass below minimum threshold - cannot be injected
massToInject
[
cellI
]
=
0
.
0
;
diameterToInject
[
cellI
]
=
0
.
0
;
}
...
...
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