mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: lagrangian injection - exposed minimum number of particles per parcel. See #728
The minimum number of particles per parcel can now be set in the
injection model input, e.g.:
model1
{
type ...;
massTotal ...;
parcelBasisType ...;
minParticlesPerParcel 1; <-- new optional entry
SOI ...;
...
Uses a value of 1 by default if the entry is not present. The value of
1 is generally recommended and beneficial for coupled cases where small
time steps can lead to the injection of too many parcels and subsequently
greatly over-predict the particle source contributions (momentum, heat,
mass transfer etc)
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -275,6 +275,7 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner)
|
|||||||
nParticleFixed_(0.0),
|
nParticleFixed_(0.0),
|
||||||
time0_(0.0),
|
time0_(0.0),
|
||||||
timeStep0_(this->template getModelProperty<scalar>("timeStep0")),
|
timeStep0_(this->template getModelProperty<scalar>("timeStep0")),
|
||||||
|
minParticlesPerParcel_(1),
|
||||||
delayedVolume_(0.0),
|
delayedVolume_(0.0),
|
||||||
injectorID_(-1)
|
injectorID_(-1)
|
||||||
{}
|
{}
|
||||||
@ -304,6 +305,11 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
|||||||
nParticleFixed_(0.0),
|
nParticleFixed_(0.0),
|
||||||
time0_(owner.db().time().value()),
|
time0_(owner.db().time().value()),
|
||||||
timeStep0_(this->template getModelProperty<scalar>("timeStep0")),
|
timeStep0_(this->template getModelProperty<scalar>("timeStep0")),
|
||||||
|
minParticlesPerParcel_
|
||||||
|
(
|
||||||
|
this->coeffDict().template
|
||||||
|
lookupOrDefault<scalar>("minParticlesPerParcel", 1)
|
||||||
|
),
|
||||||
delayedVolume_(0.0),
|
delayedVolume_(0.0),
|
||||||
injectorID_(this->coeffDict().lookupOrDefault("injectorID", -1))
|
injectorID_(this->coeffDict().lookupOrDefault("injectorID", -1))
|
||||||
{
|
{
|
||||||
@ -382,6 +388,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
|||||||
nParticleFixed_(im.nParticleFixed_),
|
nParticleFixed_(im.nParticleFixed_),
|
||||||
time0_(im.time0_),
|
time0_(im.time0_),
|
||||||
timeStep0_(im.timeStep0_),
|
timeStep0_(im.timeStep0_),
|
||||||
|
minParticlesPerParcel_(im.minParticlesPerParcel_),
|
||||||
delayedVolume_(im.delayedVolume_),
|
delayedVolume_(im.delayedVolume_),
|
||||||
injectorID_(im.injectorID_)
|
injectorID_(im.injectorID_)
|
||||||
{}
|
{}
|
||||||
@ -517,7 +524,7 @@ void Foam::InjectionModel<CloudType>::inject
|
|||||||
pPtr->rho()
|
pPtr->rho()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pPtr->nParticle() >= 1.0)
|
if (pPtr->nParticle() >= minParticlesPerParcel_)
|
||||||
{
|
{
|
||||||
parcelsAdded++;
|
parcelsAdded++;
|
||||||
massAdded += pPtr->nParticle()*pPtr->mass();
|
massAdded += pPtr->nParticle()*pPtr->mass();
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -81,7 +81,7 @@ public:
|
|||||||
// Enumerations
|
// Enumerations
|
||||||
|
|
||||||
//- Parcel basis representation options
|
//- Parcel basis representation options
|
||||||
// i.e constant number of particles OR constant mass per parcel
|
//- i.e constant number of particles OR constant mass per parcel
|
||||||
enum parcelBasis
|
enum parcelBasis
|
||||||
{
|
{
|
||||||
pbNumber,
|
pbNumber,
|
||||||
@ -100,7 +100,7 @@ protected:
|
|||||||
scalar SOI_;
|
scalar SOI_;
|
||||||
|
|
||||||
//- Total volume of particles introduced by this injector [m^3]
|
//- Total volume of particles introduced by this injector [m^3]
|
||||||
// - scaled to ensure massTotal is achieved
|
//- Note: scaled to ensure massTotal is achieved
|
||||||
scalar volumeTotal_;
|
scalar volumeTotal_;
|
||||||
|
|
||||||
//- Total mass to inject [kg]
|
//- Total mass to inject [kg]
|
||||||
@ -128,7 +128,7 @@ protected:
|
|||||||
parcelBasis parcelBasis_;
|
parcelBasis parcelBasis_;
|
||||||
|
|
||||||
//- nParticle to assign to parcels when the 'fixed' basis
|
//- nParticle to assign to parcels when the 'fixed' basis
|
||||||
// is selected
|
//- is selected
|
||||||
scalar nParticleFixed_;
|
scalar nParticleFixed_;
|
||||||
|
|
||||||
//- Continuous phase time at start of injection time step [s]
|
//- Continuous phase time at start of injection time step [s]
|
||||||
@ -137,8 +137,12 @@ protected:
|
|||||||
//- Time at start of injection time step [s]
|
//- Time at start of injection time step [s]
|
||||||
scalar timeStep0_;
|
scalar timeStep0_;
|
||||||
|
|
||||||
|
//- Minimum number of particles used to represent each parcel
|
||||||
|
//- default = 1
|
||||||
|
scalar minParticlesPerParcel_;
|
||||||
|
|
||||||
//- Volume that should have been injected, but would lead to
|
//- Volume that should have been injected, but would lead to
|
||||||
// less than 1 particle per parcel
|
//- less than minParticlesPerParcel_ particle per parcel
|
||||||
scalar delayedVolume_;
|
scalar delayedVolume_;
|
||||||
|
|
||||||
//- Optional injector ID
|
//- Optional injector ID
|
||||||
|
|||||||
Reference in New Issue
Block a user