mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: InflationInjection.
Needs dTarget data member in KinematicParcel. Some functions in InjectionModel no longer const.
This commit is contained in:
@ -57,6 +57,7 @@ Foam::coalParcel::coalParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& pi0,
|
||||
@ -78,6 +79,7 @@ Foam::coalParcel::coalParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
pi0,
|
||||
|
||||
@ -79,6 +79,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& pi0,
|
||||
|
||||
@ -297,9 +297,10 @@ public:
|
||||
//- Return refernce to the random object
|
||||
inline Random& rndGen();
|
||||
|
||||
//- Return the cell occupancy information for each parcel,
|
||||
// non-const access, the caller is responsible for updating
|
||||
// it if particles are removed or created.
|
||||
//- Return the cell occupancy information for each
|
||||
// parcel, non-const access, the caller is
|
||||
// responsible for updating it for its own purposes
|
||||
// if particles are removed or created.
|
||||
inline List<DynamicList<ParcelType*> >& cellOccupancy();
|
||||
|
||||
|
||||
|
||||
@ -300,6 +300,27 @@ Foam::CollisionRecordList<PairType, WallType>::matchPairRecord
|
||||
}
|
||||
|
||||
|
||||
template<class PairType, class WallType>
|
||||
bool Foam::CollisionRecordList<PairType, WallType>::checkPairRecord
|
||||
(
|
||||
label origProcOfOther,
|
||||
label origIdOfOther
|
||||
)
|
||||
{
|
||||
forAll(pairRecords_, i)
|
||||
{
|
||||
PairCollisionRecord<PairType>& pCR = pairRecords_[i];
|
||||
|
||||
if (pCR.match(origProcOfOther, origIdOfOther))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class PairType, class WallType>
|
||||
Foam::WallCollisionRecord<WallType>&
|
||||
Foam::CollisionRecordList<PairType, WallType>::matchWallRecord
|
||||
@ -333,6 +354,26 @@ Foam::CollisionRecordList<PairType, WallType>::matchWallRecord
|
||||
}
|
||||
|
||||
|
||||
template<class PairType, class WallType>
|
||||
bool Foam::CollisionRecordList<PairType, WallType>::checkWallRecord
|
||||
(
|
||||
const vector& pRel,
|
||||
scalar radius
|
||||
)
|
||||
{
|
||||
forAll(wallRecords_, i)
|
||||
{
|
||||
WallCollisionRecord<WallType>& wCR = wallRecords_[i];
|
||||
|
||||
if (wCR.match(pRel, radius))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class PairType, class WallType>
|
||||
void Foam::CollisionRecordList<PairType, WallType>::update()
|
||||
|
||||
@ -168,6 +168,10 @@ public:
|
||||
label origIdOfOther
|
||||
);
|
||||
|
||||
//- Enquire if the specified record exists without modifying
|
||||
// its accessed status
|
||||
bool checkPairRecord(label origProcOfOther, label origIdOfOther);
|
||||
|
||||
//- Enquires if the position of wall impact relative to the
|
||||
// particle centre is present in the records. If so, return
|
||||
// access to the WallCollisionRecord (hence the data) and
|
||||
@ -179,6 +183,10 @@ public:
|
||||
scalar radius
|
||||
);
|
||||
|
||||
//- Enquire if the specified record exists without modifying
|
||||
// its accessed status
|
||||
bool checkWallRecord(const vector& pRel, scalar radius);
|
||||
|
||||
//- Update the collision records, deleting any records not
|
||||
// marked as having been accessed, then mark all records as
|
||||
// not accessed ready for the next evaluation
|
||||
|
||||
@ -225,6 +225,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
||||
typeId_(p.typeId_),
|
||||
nParticle_(p.nParticle_),
|
||||
d_(p.d_),
|
||||
dTarget_(p.dTarget_),
|
||||
U_(p.U_),
|
||||
f_(p.f_),
|
||||
angularMomentum_(p.angularMomentum_),
|
||||
|
||||
@ -250,6 +250,9 @@ protected:
|
||||
//- Diameter [m]
|
||||
scalar d_;
|
||||
|
||||
//- Target diameter [m]
|
||||
scalar dTarget_;
|
||||
|
||||
//- Velocity of Parcel [m/s]
|
||||
vector U_;
|
||||
|
||||
@ -347,6 +350,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -388,6 +392,9 @@ public:
|
||||
//- Return const access to diameter
|
||||
inline scalar d() const;
|
||||
|
||||
//- Return const access to target diameter
|
||||
inline scalar dTarget() const;
|
||||
|
||||
//- Return const access to velocity
|
||||
inline const vector& U() const;
|
||||
|
||||
@ -427,6 +434,9 @@ public:
|
||||
//- Return access to diameter
|
||||
inline scalar& d();
|
||||
|
||||
//- Return access to target diameter
|
||||
inline scalar& dTarget();
|
||||
|
||||
//- Return access to velocity
|
||||
inline vector& U();
|
||||
|
||||
@ -478,19 +488,19 @@ public:
|
||||
inline scalar volume() const;
|
||||
|
||||
//- Particle volume for a given diameter
|
||||
inline scalar volume(const scalar d) const;
|
||||
inline static scalar volume(const scalar d);
|
||||
|
||||
//- Particle projected area
|
||||
inline scalar areaP() const;
|
||||
|
||||
//- Projected area for given diameter
|
||||
inline scalar areaP(const scalar d) const;
|
||||
inline static scalar areaP(const scalar d);
|
||||
|
||||
//- Particle surface area
|
||||
inline scalar areaS() const;
|
||||
|
||||
//- Surface area for given diameter
|
||||
inline scalar areaS(const scalar d) const;
|
||||
inline static scalar areaS(const scalar d);
|
||||
|
||||
//- Reynolds number
|
||||
inline scalar Re
|
||||
|
||||
@ -91,6 +91,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
|
||||
typeId_(owner.parcelTypeId()),
|
||||
nParticle_(0),
|
||||
d_(0.0),
|
||||
dTarget_(0.0),
|
||||
U_(vector::zero),
|
||||
f_(vector::zero),
|
||||
angularMomentum_(vector::zero),
|
||||
@ -116,6 +117,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -128,6 +130,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
|
||||
typeId_(typeId),
|
||||
nParticle_(nParticle0),
|
||||
d_(d0),
|
||||
dTarget_(dTarget0),
|
||||
U_(U0),
|
||||
f_(f0),
|
||||
angularMomentum_(angularMomentum0),
|
||||
@ -292,6 +295,13 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::d() const
|
||||
}
|
||||
|
||||
|
||||
template <class ParcelType>
|
||||
inline Foam::scalar Foam::KinematicParcel<ParcelType>::dTarget() const
|
||||
{
|
||||
return dTarget_;
|
||||
}
|
||||
|
||||
|
||||
template <class ParcelType>
|
||||
inline const Foam::vector& Foam::KinematicParcel<ParcelType>::U() const
|
||||
{
|
||||
@ -380,6 +390,13 @@ inline Foam::scalar& Foam::KinematicParcel<ParcelType>::d()
|
||||
}
|
||||
|
||||
|
||||
template <class ParcelType>
|
||||
inline Foam::scalar& Foam::KinematicParcel<ParcelType>::dTarget()
|
||||
{
|
||||
return dTarget_;
|
||||
}
|
||||
|
||||
|
||||
template <class ParcelType>
|
||||
inline Foam::vector& Foam::KinematicParcel<ParcelType>::U()
|
||||
{
|
||||
@ -504,7 +521,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume() const
|
||||
|
||||
template <class ParcelType>
|
||||
inline Foam::scalar
|
||||
Foam::KinematicParcel<ParcelType>::volume(const scalar d) const
|
||||
Foam::KinematicParcel<ParcelType>::volume(const scalar d)
|
||||
{
|
||||
return pi/6.0*pow3(d);
|
||||
}
|
||||
@ -519,7 +536,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaP() const
|
||||
|
||||
template <class ParcelType>
|
||||
inline Foam::scalar
|
||||
Foam::KinematicParcel<ParcelType>::areaP(const scalar d) const
|
||||
Foam::KinematicParcel<ParcelType>::areaP(const scalar d)
|
||||
{
|
||||
return 0.25*areaS(d);
|
||||
}
|
||||
@ -534,7 +551,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaS() const
|
||||
|
||||
template <class ParcelType>
|
||||
inline Foam::scalar
|
||||
Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const
|
||||
Foam::KinematicParcel<ParcelType>::areaS(const scalar d)
|
||||
{
|
||||
return pi*d*d;
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ Foam::string Foam::KinematicParcel<ParcelType>::propHeader =
|
||||
+ " typeId"
|
||||
+ " nParticle"
|
||||
+ " d"
|
||||
+ " dTarget "
|
||||
+ " (Ux Uy Uz)"
|
||||
+ " (fx fy fz)"
|
||||
+ " (angularMomentumx angularMomentumy angularMomentumz)"
|
||||
@ -68,6 +69,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
||||
typeId_(0),
|
||||
nParticle_(0.0),
|
||||
d_(0.0),
|
||||
dTarget_(0.0),
|
||||
U_(vector::zero),
|
||||
f_(vector::zero),
|
||||
angularMomentum_(vector::zero),
|
||||
@ -88,6 +90,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
||||
typeId_ = readLabel(is);
|
||||
nParticle_ = readScalar(is);
|
||||
d_ = readScalar(is);
|
||||
dTarget_ = readScalar(is);
|
||||
is >> U_;
|
||||
is >> f_;
|
||||
is >> angularMomentum_;
|
||||
@ -106,6 +109,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
||||
+ sizeof(typeId_)
|
||||
+ sizeof(nParticle_)
|
||||
+ sizeof(d_)
|
||||
+ sizeof(dTarget_)
|
||||
+ sizeof(U_)
|
||||
+ sizeof(f_)
|
||||
+ sizeof(angularMomentum_)
|
||||
@ -150,6 +154,9 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, d);
|
||||
|
||||
IOField<scalar> dTarget(c.fieldIOobject("dTarget", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, dTarget);
|
||||
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, U);
|
||||
|
||||
@ -234,6 +241,7 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
|
||||
p.typeId_ = typeId[i];
|
||||
p.nParticle_ = nParticle[i];
|
||||
p.d_ = d[i];
|
||||
p.dTarget_ = dTarget[i];
|
||||
p.U_ = U[i];
|
||||
p.f_ = f[i];
|
||||
p.angularMomentum_ = angularMomentum[i];
|
||||
@ -271,6 +279,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
|
||||
np
|
||||
);
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np);
|
||||
IOField<scalar> dTarget(c.fieldIOobject("dTarget", IOobject::NO_READ), np);
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);
|
||||
IOField<vector> f(c.fieldIOobject("f", IOobject::NO_READ), np);
|
||||
IOField<vector> angularMomentum
|
||||
@ -333,6 +342,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
|
||||
typeId[i] = p.typeId();
|
||||
nParticle[i] = p.nParticle();
|
||||
d[i] = p.d();
|
||||
dTarget[i] = p.dTarget();
|
||||
U[i] = p.U();
|
||||
f[i] = p.f();
|
||||
angularMomentum[i] = p.angularMomentum();
|
||||
@ -357,6 +367,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
|
||||
typeId.write();
|
||||
nParticle.write();
|
||||
d.write();
|
||||
dTarget.write();
|
||||
U.write();
|
||||
f.write();
|
||||
angularMomentum.write();
|
||||
@ -390,6 +401,7 @@ Foam::Ostream& Foam::operator<<
|
||||
<< token::SPACE << p.typeId()
|
||||
<< token::SPACE << p.nParticle()
|
||||
<< token::SPACE << p.d()
|
||||
<< token::SPACE << p.dTarget()
|
||||
<< token::SPACE << p.U()
|
||||
<< token::SPACE << p.f()
|
||||
<< token::SPACE << p.angularMomentum()
|
||||
@ -409,6 +421,7 @@ Foam::Ostream& Foam::operator<<
|
||||
+ sizeof(p.typeId())
|
||||
+ sizeof(p.nParticle())
|
||||
+ sizeof(p.d())
|
||||
+ sizeof(p.dTarget())
|
||||
+ sizeof(p.U())
|
||||
+ sizeof(p.f())
|
||||
+ sizeof(p.angularMomentum())
|
||||
|
||||
@ -306,6 +306,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
|
||||
@ -113,6 +113,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -134,6 +135,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
angularMomentum0,
|
||||
|
||||
@ -255,6 +255,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
|
||||
@ -98,6 +98,7 @@ inline Foam::ReactingParcel<ParcelType>::ReactingParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -116,6 +117,7 @@ inline Foam::ReactingParcel<ParcelType>::ReactingParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
angularMomentum0,
|
||||
|
||||
@ -268,6 +268,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
|
||||
@ -99,6 +99,7 @@ inline Foam::ThermoParcel<ParcelType>::ThermoParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -116,6 +117,7 @@ inline Foam::ThermoParcel<ParcelType>::ThermoParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
angularMomentum0,
|
||||
|
||||
@ -67,6 +67,7 @@ Foam::basicKinematicParcel::basicKinematicParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -84,6 +85,7 @@ Foam::basicKinematicParcel::basicKinematicParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
angularMomentum0,
|
||||
|
||||
@ -81,6 +81,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
|
||||
@ -57,6 +57,7 @@ Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -79,6 +80,7 @@ Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
angularMomentum0,
|
||||
|
||||
@ -82,6 +82,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
|
||||
@ -57,6 +57,7 @@ Foam::basicReactingParcel::basicReactingParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -75,6 +76,7 @@ Foam::basicReactingParcel::basicReactingParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
angularMomentum0,
|
||||
|
||||
@ -80,6 +80,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector& U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
|
||||
@ -60,6 +60,7 @@ Foam::basicThermoParcel::basicThermoParcel
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
@ -77,6 +78,7 @@ Foam::basicThermoParcel::basicThermoParcel
|
||||
typeId,
|
||||
nParticle0,
|
||||
d0,
|
||||
dTarget0,
|
||||
U0,
|
||||
f0,
|
||||
angularMomentum0,
|
||||
|
||||
@ -80,6 +80,7 @@ public:
|
||||
const label typeId,
|
||||
const scalar nParticle0,
|
||||
const scalar d0,
|
||||
const scalar dTarget0,
|
||||
const vector U0,
|
||||
const vector& f0,
|
||||
const vector& angularMomentum0,
|
||||
|
||||
@ -33,11 +33,13 @@ License
|
||||
#include "ConeInjection.H"
|
||||
#include "ConeInjectionMP.H"
|
||||
#include "FieldActivatedInjection.H"
|
||||
#include "InflationInjection.H"
|
||||
#include "KinematicLookupTableInjection.H"
|
||||
#include "ManualInjection.H"
|
||||
#include "NoInjection.H"
|
||||
#include "PatchInjection.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeParcelInjectionModels(ParcelType) \
|
||||
@ -63,6 +65,12 @@ License
|
||||
ParcelType \
|
||||
); \
|
||||
makeInjectionModelType \
|
||||
( \
|
||||
InflationInjection, \
|
||||
KinematicCloud, \
|
||||
ParcelType \
|
||||
); \
|
||||
makeInjectionModelType \
|
||||
( \
|
||||
KinematicLookupTableInjection, \
|
||||
KinematicCloud, \
|
||||
|
||||
@ -36,7 +36,7 @@ Foam::label Foam::ConeInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
@ -54,7 +54,7 @@ Foam::scalar Foam::ConeInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
|
||||
@ -123,14 +123,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Number of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -36,7 +36,7 @@ Foam::label Foam::ConeInjectionMP<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
@ -63,7 +63,7 @@ Foam::scalar Foam::ConeInjectionMP<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
|
||||
@ -133,14 +133,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Number of parcels to introduce over the time step
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -36,7 +36,7 @@ Foam::label Foam::FieldActivatedInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if (sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
|
||||
{
|
||||
@ -54,7 +54,7 @@ Foam::scalar Foam::FieldActivatedInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if (sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
|
||||
{
|
||||
|
||||
@ -123,14 +123,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -0,0 +1,466 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "InflationInjection.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "PackedBoolList.H"
|
||||
#include "Switch.H"
|
||||
#include "cellSet.H"
|
||||
#include "ListListOps.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
)
|
||||
{
|
||||
const polyMesh& mesh = this->owner().mesh();
|
||||
|
||||
List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
|
||||
this->owner().cellOccupancy();
|
||||
|
||||
scalar gR = growthRate_().value(time1);
|
||||
|
||||
scalar dT = time1 - time0;
|
||||
|
||||
// Inflate existing particles
|
||||
|
||||
forAll(inflationCells_, iCI)
|
||||
{
|
||||
label cI = inflationCells_[iCI];
|
||||
|
||||
typename CloudType::parcelType* pPtr = NULL;
|
||||
|
||||
forAll(cellOccupancy[cI], cPI)
|
||||
{
|
||||
pPtr = cellOccupancy[cI][cPI];
|
||||
|
||||
scalar dTarget = pPtr->dTarget();
|
||||
|
||||
pPtr->d() = min(dTarget, pPtr->d() + gR*dT);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate new particles
|
||||
|
||||
newParticles_.clear();
|
||||
|
||||
Random& rnd = this->owner().rndGen();
|
||||
|
||||
// Diameter factor, when splitting particles into 4, this is the
|
||||
// factor that modifies the diameter.
|
||||
scalar dFact = sqrt(2.0)/(sqrt(3.0) + sqrt(2.0));
|
||||
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
volumeAccumulator_ +=
|
||||
fraction_*flowRateProfile_().integrate(time0, time1);
|
||||
}
|
||||
|
||||
labelHashSet cellCentresUsed;
|
||||
|
||||
// Loop escape counter
|
||||
label maxIterations = max
|
||||
(
|
||||
1,
|
||||
(10*volumeAccumulator_)
|
||||
/CloudType::parcelType::volume(parcelPDF_().minValue())
|
||||
);
|
||||
|
||||
label iterationNo = 0;
|
||||
|
||||
// Info<< "Accumulated volume to inject: "
|
||||
// << returnReduce(volumeAccumulator_, sumOp<scalar>()) << endl;
|
||||
|
||||
while (!generationCells_.empty() && volumeAccumulator_ > 0)
|
||||
{
|
||||
if (iterationNo > maxIterations)
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::label "
|
||||
"Foam::InflationInjection<CloudType>::parcelsToInject"
|
||||
"("
|
||||
"const scalar time0, "
|
||||
"const scalar time1"
|
||||
")"
|
||||
)
|
||||
<< "Maximum particle split iterations ("
|
||||
<< maxIterations << ") exceeded" << endl;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
label cI =
|
||||
generationCells_[rnd.integer(0, generationCells_.size() - 1)];
|
||||
|
||||
// Pick a particle at random from the cell - if there are
|
||||
// none, insert one at the cell centre. Otherwise, split an
|
||||
// existing particle into four new ones.
|
||||
|
||||
if (cellOccupancy[cI].empty())
|
||||
{
|
||||
if (!cellCentresUsed.found(cI))
|
||||
{
|
||||
scalar dNew = parcelPDF_().sample();
|
||||
|
||||
newParticles_.append
|
||||
(
|
||||
vectorPairScalarPair
|
||||
(
|
||||
Pair<vector>(mesh.cellCentres()[cI], vector::zero),
|
||||
Pair<scalar>(dNew, dNew)
|
||||
)
|
||||
);
|
||||
|
||||
volumeAccumulator_ -= CloudType::parcelType::volume(dNew);
|
||||
|
||||
cellCentresUsed.insert(cI);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
label cPI = rnd.integer(0, cellOccupancy[cI].size() - 1);
|
||||
|
||||
// This has to be a reference to the pointer so that it
|
||||
// can be set to NULL when the particle is deleted.
|
||||
typename CloudType::parcelType*& pPtr = cellOccupancy[cI][cPI];
|
||||
|
||||
if (pPtr != NULL)
|
||||
{
|
||||
scalar pD = pPtr->d();
|
||||
|
||||
// Select bigger particles by preference
|
||||
if ((pD/pPtr->dTarget()) < rnd.scalar01())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const point& pP = pPtr->position();
|
||||
const vector& pU = pPtr->U();
|
||||
|
||||
// Generate a tetrahedron of new positions with the
|
||||
// four new spheres fitting inside the old one, where
|
||||
// a is the diameter of the new spheres, and is
|
||||
// related to the diameter of the enclosing sphere, A,
|
||||
// by a = sqrt(2)*A/(sqrt(3) + sqrt(2));
|
||||
|
||||
// Positions around the origin, which is the
|
||||
// tetrahedron centroid (centre of old sphere).
|
||||
|
||||
// x = a/sqrt(3)
|
||||
// r = a/(2*sqrt(6))
|
||||
// R = sqrt(3)*a/(2*sqrt(2))
|
||||
// d = a/(2*sqrt(3))
|
||||
|
||||
// p0(x, 0, -r)
|
||||
// p1(-d, a/2, -r)
|
||||
// p2(-d, -a/2, -r)
|
||||
// p3(0, 0, R)
|
||||
|
||||
scalar a = pD*dFact;
|
||||
|
||||
scalar x = a/sqrt(3.0);
|
||||
scalar r = a/(2.0*sqrt(6.0));
|
||||
scalar R = sqrt(3.0)*a/(2.0*sqrt(2.0));
|
||||
scalar d = a/(2.0*sqrt(3.0));
|
||||
|
||||
scalar dNew = parcelPDF_().sample();
|
||||
scalar volNew = CloudType::parcelType::volume(dNew);
|
||||
|
||||
newParticles_.append
|
||||
(
|
||||
vectorPairScalarPair
|
||||
(
|
||||
Pair<vector>(vector(x, 0, -r) + pP, pU),
|
||||
Pair<scalar>(a, dNew)
|
||||
)
|
||||
);
|
||||
volumeAccumulator_ -= volNew;
|
||||
|
||||
dNew = parcelPDF_().sample();
|
||||
newParticles_.append
|
||||
(
|
||||
vectorPairScalarPair
|
||||
(
|
||||
Pair<vector>(vector(-d, a/2, -r) + pP, pU),
|
||||
Pair<scalar>(a, dNew)
|
||||
)
|
||||
);
|
||||
volumeAccumulator_ -= volNew;
|
||||
|
||||
dNew = parcelPDF_().sample();
|
||||
newParticles_.append
|
||||
(
|
||||
vectorPairScalarPair
|
||||
(
|
||||
Pair<vector>(vector(-d, -a/2, -r) + pP, pU),
|
||||
Pair<scalar>(a, dNew)
|
||||
)
|
||||
);
|
||||
volumeAccumulator_ -= volNew;
|
||||
|
||||
dNew = parcelPDF_().sample();
|
||||
newParticles_.append
|
||||
(
|
||||
vectorPairScalarPair
|
||||
(
|
||||
Pair<vector>(vector(0, 0, R) + pP, pU),
|
||||
Pair<scalar>(a, dNew)
|
||||
)
|
||||
);
|
||||
volumeAccumulator_ -= volNew;
|
||||
|
||||
// Account for the lost volume of the particle which
|
||||
// is to be deleted
|
||||
volumeAccumulator_ += CloudType::parcelType::volume
|
||||
(
|
||||
pPtr->dTarget()
|
||||
);
|
||||
|
||||
this->owner().deleteParticle(*pPtr);
|
||||
|
||||
pPtr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
iterationNo++;
|
||||
}
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
List<List<vectorPairScalarPair> > gatheredNewParticles
|
||||
(
|
||||
Pstream::nProcs()
|
||||
);
|
||||
|
||||
gatheredNewParticles[Pstream::myProcNo()] = newParticles_;
|
||||
|
||||
// Gather data onto master
|
||||
Pstream::gatherList(gatheredNewParticles);
|
||||
|
||||
// Combine
|
||||
List<vectorPairScalarPair> combinedNewParticles
|
||||
(
|
||||
ListListOps::combine<List<vectorPairScalarPair> >
|
||||
(
|
||||
gatheredNewParticles,
|
||||
accessOp<List<vectorPairScalarPair> >()
|
||||
)
|
||||
);
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
newParticles_ = combinedNewParticles;
|
||||
}
|
||||
|
||||
Pstream::scatter(newParticles_);
|
||||
}
|
||||
|
||||
return newParticles_.size();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::InflationInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
return fraction_*flowRateProfile_().integrate(time0, time1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::InflationInjection<CloudType>::InflationInjection
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
InjectionModel<CloudType>(dict, owner, typeName),
|
||||
generationSetName_(this->coeffDict().lookup("generationCellSet")),
|
||||
inflationSetName_(this->coeffDict().lookup("inflationCellSet")),
|
||||
generationCells_(),
|
||||
inflationCells_(),
|
||||
duration_(readScalar(this->coeffDict().lookup("duration"))),
|
||||
flowRateProfile_
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
(
|
||||
"flowRateProfile",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
growthRate_
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
(
|
||||
"growthRate",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
newParticles_(),
|
||||
volumeAccumulator_(0.0),
|
||||
fraction_(1.0),
|
||||
parcelPDF_
|
||||
(
|
||||
pdfs::pdf::New
|
||||
(
|
||||
this->coeffDict().subDict("parcelPDF"),
|
||||
owner.rndGen()
|
||||
)
|
||||
)
|
||||
{
|
||||
cellSet generationCells(this->owner().mesh(), generationSetName_);
|
||||
|
||||
generationCells_ = generationCells.toc();
|
||||
|
||||
cellSet inflationCells(this->owner().mesh(), inflationSetName_);
|
||||
|
||||
// Union of cellSets
|
||||
inflationCells |= generationCells;
|
||||
|
||||
inflationCells_ = inflationCells.toc();
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
scalar generationVolume = 0.0;
|
||||
|
||||
forAll(generationCells_, gCI)
|
||||
{
|
||||
label cI = generationCells_[gCI];
|
||||
|
||||
generationVolume += this->owner().mesh().cellVolumes()[cI];
|
||||
}
|
||||
|
||||
scalar totalGenerationVolume = generationVolume;
|
||||
|
||||
reduce(totalGenerationVolume, sumOp<scalar>());
|
||||
|
||||
fraction_ = generationVolume/totalGenerationVolume;
|
||||
}
|
||||
|
||||
// Set total volume/mass to inject
|
||||
this->volumeTotal_ = fraction_*flowRateProfile_().integrate(0.0, duration_);
|
||||
this->massTotal_ *= fraction_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::InflationInjection<CloudType>::~InflationInjection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::InflationInjection<CloudType>::active() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::InflationInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
return this->SOI_ + duration_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InflationInjection<CloudType>::setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar,
|
||||
vector& position,
|
||||
label& cellOwner,
|
||||
label& tetFaceI,
|
||||
label& tetPtI
|
||||
)
|
||||
{
|
||||
position = newParticles_[parcelI].first().first();
|
||||
|
||||
this->findCellAtPosition
|
||||
(
|
||||
cellOwner,
|
||||
tetFaceI,
|
||||
tetPtI,
|
||||
position,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InflationInjection<CloudType>::setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar,
|
||||
typename CloudType::parcelType& parcel
|
||||
)
|
||||
{
|
||||
parcel.U() = newParticles_[parcelI].first().second();
|
||||
|
||||
parcel.d() = newParticles_[parcelI].second().first();
|
||||
|
||||
parcel.dTarget() = newParticles_[parcelI].second().second();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::InflationInjection<CloudType>::fullyDescribed() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::InflationInjection<CloudType>::validInjection(const label)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,200 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::InflationInjection
|
||||
|
||||
Description
|
||||
Inflation injection - creates new particles by splitting existing
|
||||
particles within in a set of generation cells, then inflating them
|
||||
to a target diameter within the generation cells and an additional
|
||||
set of inflation cells.
|
||||
|
||||
SourceFiles
|
||||
InflationInjection.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef InflationInjection_H
|
||||
#define InflationInjection_H
|
||||
|
||||
#include "InjectionModel.H"
|
||||
#include "pdf.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Structure to hold:
|
||||
// + position = vectorPairScalarPair::first().first()
|
||||
// + velocity = vectorPairScalarPair::first().second()
|
||||
// + diameter = vectorPairScalarPair::second().first()
|
||||
// + target diameter = vectorPairScalarPair::second().second()
|
||||
// One structure to allow single operation parallel comms
|
||||
typedef Tuple2<Pair<vector>, Pair<scalar> > vectorPairScalarPair;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class InflationInjection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class InflationInjection
|
||||
:
|
||||
public InjectionModel<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of cellSet for generating new particles
|
||||
word generationSetName_;
|
||||
|
||||
//- Name of cellSet for inflating new particles
|
||||
word inflationSetName_;
|
||||
|
||||
//- Set of cells to generate particles in
|
||||
labelList generationCells_;
|
||||
|
||||
//- Set of cells to inflate particles in, includes all
|
||||
// generation cells
|
||||
labelList inflationCells_;
|
||||
|
||||
//- Injection duration [s]
|
||||
const scalar duration_;
|
||||
|
||||
//- Flow rate profile relative to SOI [m3/s]
|
||||
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
||||
|
||||
//- Growth rate of particle diameters towards target [m/s]
|
||||
const autoPtr<DataEntry<scalar> > growthRate_;
|
||||
|
||||
//- Positions, velocities, diameters and target diameters of
|
||||
// new particles after splitting
|
||||
DynamicList<vectorPairScalarPair> newParticles_;
|
||||
|
||||
//- Accumulation variable to carry over volume from one injection
|
||||
// to the next
|
||||
scalar volumeAccumulator_;
|
||||
|
||||
//- Fraction of injection controlled by this processor
|
||||
scalar fraction_;
|
||||
|
||||
//- Parcel size PDF model
|
||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Number of parcels to introduce over the time step relative to SOI
|
||||
label parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("InflationInjection");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
InflationInjection
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~InflationInjection();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
||||
// Injection geometry
|
||||
|
||||
//- Set the injection position and owner cell, tetFace and tetPt
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner,
|
||||
label& tetFaceI,
|
||||
label& tetPtI
|
||||
);
|
||||
|
||||
//- Set the parcel properties
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType& parcel
|
||||
);
|
||||
|
||||
//- Flag to identify whether model fully describes the parcel
|
||||
virtual bool fullyDescribed() const;
|
||||
|
||||
//- Return flag to identify whether or not injection of parcelI is
|
||||
// permitted
|
||||
virtual bool validInjection(const label parcelI);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "InflationInjection.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -159,6 +159,8 @@ bool Foam::InjectionModel<CloudType>::findCellAtPosition
|
||||
|
||||
reduce(procI, maxOp<label>());
|
||||
|
||||
// Ensure that only one processor attempts to insert this Parcel
|
||||
|
||||
if (procI != Pstream::myProcNo())
|
||||
{
|
||||
cellI = -1;
|
||||
@ -166,11 +168,12 @@ bool Foam::InjectionModel<CloudType>::findCellAtPosition
|
||||
tetPtI = -1;
|
||||
}
|
||||
|
||||
// Last chance - find nearest cell and try that one
|
||||
// - the point is probably on an edge
|
||||
// Last chance - find nearest cell and try that one - the point is
|
||||
// probably on an edge
|
||||
if (procI == -1)
|
||||
{
|
||||
cellI = owner_.mesh().findNearestCell(position);
|
||||
|
||||
if (cellI >= 0)
|
||||
{
|
||||
position += SMALL*(cellCentres[cellI] - position);
|
||||
@ -428,14 +431,15 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
||||
const scalar padTime = max(0.0, SOI_ - time0_);
|
||||
|
||||
// Introduce new parcels linearly across carrier phase timestep
|
||||
for (label parcelI=0; parcelI<newParcels; parcelI++)
|
||||
for (label parcelI = 0; parcelI < newParcels; parcelI++)
|
||||
{
|
||||
if (validInjection(parcelI))
|
||||
{
|
||||
// Calculate the pseudo time of injection for parcel 'parcelI'
|
||||
scalar timeInj = time0_ + padTime + deltaT*parcelI/newParcels;
|
||||
|
||||
// Determine the injection position and owner cell
|
||||
// Determine the injection position and owner cell,
|
||||
// tetFace and tetPt
|
||||
label cellI = -1;
|
||||
label tetFaceI = -1;
|
||||
label tetPtI = -1;
|
||||
|
||||
@ -156,14 +156,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const = 0;
|
||||
) = 0;
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
virtual scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const = 0;
|
||||
) = 0;
|
||||
|
||||
//- Additional flag to identify whether or not injection of parcelI is
|
||||
// permitted
|
||||
|
||||
@ -33,7 +33,7 @@ Foam::label Foam::KinematicLookupTableInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
@ -51,7 +51,7 @@ Foam::scalar Foam::KinematicLookupTableInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
scalar volume = 0.0;
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
|
||||
@ -100,14 +100,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -37,7 +37,7 @@ Foam::label Foam::ManualInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((0.0 >= time0) && (0.0 < time1))
|
||||
{
|
||||
@ -55,7 +55,7 @@ Foam::scalar Foam::ManualInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
// All parcels introduced at SOI
|
||||
if ((0.0 >= time0) && (0.0 < time1))
|
||||
|
||||
@ -95,14 +95,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -33,7 +33,7 @@ Foam::label Foam::NoInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar,
|
||||
const scalar
|
||||
) const
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -44,7 +44,7 @@ Foam::scalar Foam::NoInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar,
|
||||
const scalar
|
||||
) const
|
||||
)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@ -60,14 +60,14 @@ protected:
|
||||
(
|
||||
const scalar,
|
||||
const scalar
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar,
|
||||
const scalar
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -34,7 +34,7 @@ Foam::label Foam::PatchInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
@ -52,7 +52,7 @@ Foam::scalar Foam::PatchInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
|
||||
@ -101,14 +101,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -32,7 +32,7 @@ Foam::label Foam::ReactingLookupTableInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
@ -50,7 +50,7 @@ Foam::scalar Foam::ReactingLookupTableInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
scalar volume = 0.0;
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
|
||||
@ -103,14 +103,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -33,7 +33,7 @@ Foam::ReactingMultiphaseLookupTableInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
@ -52,7 +52,7 @@ Foam::ReactingMultiphaseLookupTableInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
scalar volume = 0.0;
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
|
||||
@ -106,14 +106,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -33,7 +33,7 @@ Foam::label Foam::ThermoLookupTableInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
@ -51,7 +51,7 @@ Foam::scalar Foam::ThermoLookupTableInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
)
|
||||
{
|
||||
scalar volume = 0.0;
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
|
||||
@ -102,14 +102,14 @@ protected:
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user