Commit 76afade7 authored by graham's avatar graham
Browse files

ENH: Correcting pbNumber, shouldn't be divided by number of parcels.

Adding pbFixed so nParticles is specified directly by the user, making
massTotal not determine anything in this case.

Removing unused private data member.
parent e757cbd0
......@@ -346,7 +346,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
{
ParcelType& p = static_cast<ParcelType&>(*this);
// Invoke poost-processing mdoel
// Invoke post-processing model
td.cloud().postProcessing().postPatch(p, patchI);
// Invoke surface film model
......
......@@ -212,7 +212,12 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
}
case pbNumber:
{
nP = massTotal_/(rho*volumeTotal_*parcels);
nP = massTotal_/(rho*volumeTotal_);
break;
}
case pbFixed:
{
nP = nParticlesFixed_;
break;
}
default:
......@@ -285,6 +290,7 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner)
nInjections_(0),
parcelsAddedTotal_(0),
parcelBasis_(pbNumber),
nParticlesFixed_(0.0),
time0_(0.0),
timeStep0_(0.0)
{
......@@ -310,6 +316,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
nInjections_(0),
parcelsAddedTotal_(0),
parcelBasis_(pbNumber),
nParticlesFixed_(0.0),
time0_(owner.db().time().value()),
timeStep0_(0.0)
{
......@@ -320,6 +327,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
<< endl;
const word parcelBasisType = coeffDict_.lookup("parcelBasisType");
if (parcelBasisType == "mass")
{
parcelBasis_ = pbMass;
......@@ -328,6 +336,16 @@ Foam::InjectionModel<CloudType>::InjectionModel
{
parcelBasis_ = pbNumber;
}
else if (parcelBasisType == "fixed")
{
parcelBasis_ = pbFixed;
Info<< " Choosing nParticles to be a fixed value, massTotal "
<< "variable now does not determine anything."
<< endl;
nParticlesFixed_ = readScalar(coeffDict_.lookup("nParticles"));
}
else
{
FatalErrorIn
......@@ -338,7 +356,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
"CloudType&, "
"const word&"
")"
)<< "parcelBasisType must be either 'number' or 'mass'" << nl
)<< "parcelBasisType must be either 'number', 'mass' or 'fixed'" << nl
<< exit(FatalError);
}
......
......@@ -73,7 +73,8 @@ public:
enum parcelBasis
{
pbNumber,
pbMass
pbMass,
pbFixed
};
......@@ -137,6 +138,10 @@ protected:
//- Parcel basis enumeration
parcelBasis parcelBasis_;
//- nParticles to assign to parcels when the 'fixed' basis
// is selected
scalar nParticlesFixed_;
//- Continuous phase time at start of injection time step [s]
scalar time0_;
......
......@@ -76,9 +76,6 @@ class ManualInjection
//- Parcel size PDF model
const autoPtr<pdfs::pdf> parcelPDF_;
//- Number of particles represented by each parcel
scalar nParticlesPerParcel_;
protected:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment