ENH: Adding cell centre self seed controls.

This commit is contained in:
graham
2010-09-27 14:56:13 +01:00
parent eb5f2954b9
commit 4ced40cb98
2 changed files with 17 additions and 3 deletions

View File

@ -26,7 +26,6 @@ License
#include "InflationInjection.H" #include "InflationInjection.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "PackedBoolList.H" #include "PackedBoolList.H"
#include "Switch.H"
#include "cellSet.H" #include "cellSet.H"
#include "ListListOps.H" #include "ListListOps.H"
@ -127,7 +126,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
if (cellOccupancy[cI].empty()) if (cellOccupancy[cI].empty())
{ {
if (!cellCentresUsed.found(cI)) if (selfSeed_ && !cellCentresUsed.found(cI))
{ {
scalar dNew = parcelPDF_().sample(); scalar dNew = parcelPDF_().sample();
@ -136,7 +135,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
vectorPairScalarPair vectorPairScalarPair
( (
Pair<vector>(mesh.cellCentres()[cI], vector::zero), Pair<vector>(mesh.cellCentres()[cI], vector::zero),
Pair<scalar>(dNew, dNew) Pair<scalar>(dSeed_, dNew)
) )
); );
@ -340,6 +339,8 @@ Foam::InflationInjection<CloudType>::InflationInjection
newParticles_(), newParticles_(),
volumeAccumulator_(0.0), volumeAccumulator_(0.0),
fraction_(1.0), fraction_(1.0),
selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)),
dSeed_(SMALL),
parcelPDF_ parcelPDF_
( (
pdfs::pdf::New pdfs::pdf::New
@ -349,6 +350,11 @@ Foam::InflationInjection<CloudType>::InflationInjection
) )
) )
{ {
if (selfSeed_)
{
dSeed_ = readScalar(this->coeffDict().lookup("dSeed"));
}
cellSet generationCells(this->owner().mesh(), generationSetName_); cellSet generationCells(this->owner().mesh(), generationSetName_);
generationCells_ = generationCells.toc(); generationCells_ = generationCells.toc();

View File

@ -40,6 +40,7 @@ SourceFiles
#include "InjectionModel.H" #include "InjectionModel.H"
#include "pdf.H" #include "pdf.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -99,6 +100,13 @@ class InflationInjection
//- Fraction of injection controlled by this processor //- Fraction of injection controlled by this processor
scalar fraction_; scalar fraction_;
//- Switch to control whether or not the injector is allowed
// to create new particles in empty cells
Switch selfSeed_;
//- Diameter with which to create new seed particles
scalar dSeed_;
//- Parcel size PDF model //- Parcel size PDF model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<pdfs::pdf> parcelPDF_;