Commit 3f637b2f authored by graham's avatar graham
Browse files

ENH: InflationInjection.

Needs dTarget data member in KinematicParcel.

Some functions in InjectionModel no longer const.
parent bd91a2d5
......@@ -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,
......
Markdown is supported
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