mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -102,7 +102,8 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
|||||||
(
|
(
|
||||||
positions_,
|
positions_,
|
||||||
ppi.position(),
|
ppi.position(),
|
||||||
procCelli
|
procCelli,
|
||||||
|
false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -162,7 +162,8 @@ Foam::Particle<ParticleType>::Particle
|
|||||||
(
|
(
|
||||||
const Cloud<ParticleType>& cloud,
|
const Cloud<ParticleType>& cloud,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI
|
const label cellI,
|
||||||
|
bool doCellFacePt
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
cloud_(cloud),
|
cloud_(cloud),
|
||||||
@ -175,7 +176,10 @@ Foam::Particle<ParticleType>::Particle
|
|||||||
origProc_(Pstream::myProcNo()),
|
origProc_(Pstream::myProcNo()),
|
||||||
origId_(cloud_.getNewParticleID())
|
origId_(cloud_.getNewParticleID())
|
||||||
{
|
{
|
||||||
|
if (doCellFacePt)
|
||||||
|
{
|
||||||
initCellFacePt();
|
initCellFacePt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -346,7 +346,8 @@ public:
|
|||||||
(
|
(
|
||||||
const Cloud<ParticleType>&,
|
const Cloud<ParticleType>&,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI
|
const label cellI,
|
||||||
|
bool doCellFacePt = true
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
|
|||||||
@ -68,15 +68,17 @@ public:
|
|||||||
Particle<passiveParticle>(c, position, cellI, tetFaceI, tetPtI)
|
Particle<passiveParticle>(c, position, cellI, tetFaceI, tetPtI)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from components, with searching for tetFace and tetPt
|
//- Construct from components, with searching for tetFace and
|
||||||
|
// tetPt unless disabled by doCellFacePt = false.
|
||||||
passiveParticle
|
passiveParticle
|
||||||
(
|
(
|
||||||
const Cloud<passiveParticle>& c,
|
const Cloud<passiveParticle>& c,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI
|
const label cellI,
|
||||||
|
bool doCellFacePt = true
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<passiveParticle>(c, position, cellI)
|
Particle<passiveParticle>(c, position, cellI, doCellFacePt)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
|
|||||||
@ -57,6 +57,7 @@ Foam::coalParcel::coalParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& pi0,
|
const vector& pi0,
|
||||||
@ -78,6 +79,7 @@ Foam::coalParcel::coalParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
pi0,
|
pi0,
|
||||||
|
|||||||
@ -79,6 +79,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& pi0,
|
const vector& pi0,
|
||||||
|
|||||||
@ -43,6 +43,52 @@ void Foam::KinematicCloud<ParcelType>::preEvolve()
|
|||||||
{
|
{
|
||||||
this->dispersion().cacheFields(true);
|
this->dispersion().cacheFields(true);
|
||||||
forces_.cacheFields(true, interpolationSchemes_);
|
forces_.cacheFields(true, interpolationSchemes_);
|
||||||
|
updateCellOccupancy();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
void Foam::KinematicCloud<ParcelType>::buildCellOccupancy()
|
||||||
|
{
|
||||||
|
if (cellOccupancyPtr_.empty())
|
||||||
|
{
|
||||||
|
cellOccupancyPtr_.reset
|
||||||
|
(
|
||||||
|
new List<DynamicList<ParcelType*> >(mesh_.nCells())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (cellOccupancyPtr_().size() != mesh_.nCells())
|
||||||
|
{
|
||||||
|
// If the size of the mesh has changed, reset the
|
||||||
|
// cellOccupancy size
|
||||||
|
|
||||||
|
cellOccupancyPtr_().setSize(mesh_.nCells());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DynamicList<ParcelType*> >& cellOccupancy = cellOccupancyPtr_();
|
||||||
|
|
||||||
|
forAll(cellOccupancy, cO)
|
||||||
|
{
|
||||||
|
cellOccupancy[cO].clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
forAllIter(typename KinematicCloud<ParcelType>, *this, iter)
|
||||||
|
{
|
||||||
|
cellOccupancy[iter().cell()].append(&iter());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
void Foam::KinematicCloud<ParcelType>::updateCellOccupancy()
|
||||||
|
{
|
||||||
|
// Only build the cellOccupancy if the pointer is set, i.e. it has
|
||||||
|
// been requested before.
|
||||||
|
|
||||||
|
if (cellOccupancyPtr_.valid())
|
||||||
|
{
|
||||||
|
buildCellOccupancy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -80,8 +126,19 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud()
|
|||||||
g_.value()
|
g_.value()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
label preInjectionSize = this->size();
|
||||||
|
|
||||||
this->surfaceFilm().inject(td);
|
this->surfaceFilm().inject(td);
|
||||||
|
|
||||||
|
// Update the cellOccupancy if the size of the cloud has changed
|
||||||
|
// during the injection.
|
||||||
|
if (preInjectionSize != this->size())
|
||||||
|
{
|
||||||
|
updateCellOccupancy();
|
||||||
|
|
||||||
|
preInjectionSize = this->size();
|
||||||
|
}
|
||||||
|
|
||||||
this->injection().inject(td);
|
this->injection().inject(td);
|
||||||
|
|
||||||
if (coupled_)
|
if (coupled_)
|
||||||
@ -89,6 +146,18 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud()
|
|||||||
resetSourceTerms();
|
resetSourceTerms();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Assume that motion will update the cellOccupancy as necessary
|
||||||
|
// before it is required.
|
||||||
|
motion(td);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
void Foam::KinematicCloud<ParcelType>::motion
|
||||||
|
(
|
||||||
|
typename ParcelType::trackData& td
|
||||||
|
)
|
||||||
|
{
|
||||||
// Sympletic leapfrog integration of particle forces:
|
// Sympletic leapfrog integration of particle forces:
|
||||||
// + apply half deltaV with stored force
|
// + apply half deltaV with stored force
|
||||||
// + move positions with new velocity
|
// + move positions with new velocity
|
||||||
@ -136,6 +205,8 @@ void Foam::KinematicCloud<ParcelType>::moveCollide
|
|||||||
// td.part() = ParcelType::trackData::tpRotationalTrack;
|
// td.part() = ParcelType::trackData::tpRotationalTrack;
|
||||||
// Cloud<ParcelType>::move(td);
|
// Cloud<ParcelType>::move(td);
|
||||||
|
|
||||||
|
updateCellOccupancy();
|
||||||
|
|
||||||
this->collision().collide();
|
this->collision().collide();
|
||||||
|
|
||||||
td.part() = ParcelType::trackData::tpVelocityHalfStep;
|
td.part() = ParcelType::trackData::tpVelocityHalfStep;
|
||||||
@ -194,6 +265,7 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
|
|||||||
particleProperties_.lookup("cellValueSourceCorrection")
|
particleProperties_.lookup("cellValueSourceCorrection")
|
||||||
),
|
),
|
||||||
rndGen_(label(0)),
|
rndGen_(label(0)),
|
||||||
|
cellOccupancyPtr_(),
|
||||||
rho_(rho),
|
rho_(rho),
|
||||||
U_(U),
|
U_(U),
|
||||||
mu_(mu),
|
mu_(mu),
|
||||||
|
|||||||
@ -136,6 +136,9 @@ protected:
|
|||||||
//- Random number generator - used by some injection routines
|
//- Random number generator - used by some injection routines
|
||||||
Random rndGen_;
|
Random rndGen_;
|
||||||
|
|
||||||
|
//- Cell occupancy information for each parcel, (demand driven)
|
||||||
|
autoPtr<List<DynamicList<ParcelType*> > > cellOccupancyPtr_;
|
||||||
|
|
||||||
|
|
||||||
// References to the carrier gas fields
|
// References to the carrier gas fields
|
||||||
|
|
||||||
@ -209,10 +212,20 @@ protected:
|
|||||||
//- Pre-evolve
|
//- Pre-evolve
|
||||||
void preEvolve();
|
void preEvolve();
|
||||||
|
|
||||||
|
//- Build the cellOccupancy
|
||||||
|
void buildCellOccupancy();
|
||||||
|
|
||||||
|
//- Update (i.e. build) the cellOccupancy if it has
|
||||||
|
// already been used
|
||||||
|
void updateCellOccupancy();
|
||||||
|
|
||||||
//- Evolve the cloud
|
//- Evolve the cloud
|
||||||
void evolveCloud();
|
void evolveCloud();
|
||||||
|
|
||||||
//- Move-collide
|
//- Particle motion
|
||||||
|
void motion(typename ParcelType::trackData& td);
|
||||||
|
|
||||||
|
//- Move-collide particles
|
||||||
void moveCollide(typename ParcelType::trackData& td);
|
void moveCollide(typename ParcelType::trackData& td);
|
||||||
|
|
||||||
//- Post-evolve
|
//- Post-evolve
|
||||||
@ -284,6 +297,12 @@ public:
|
|||||||
//- Return refernce to the random object
|
//- Return refernce to the random object
|
||||||
inline Random& rndGen();
|
inline Random& rndGen();
|
||||||
|
|
||||||
|
//- 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();
|
||||||
|
|
||||||
|
|
||||||
// References to the carrier gas fields
|
// References to the carrier gas fields
|
||||||
|
|
||||||
|
|||||||
@ -302,6 +302,19 @@ inline Foam::Random& Foam::KinematicCloud<ParcelType>::rndGen()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
inline Foam::List<Foam::DynamicList<ParcelType*> >&
|
||||||
|
Foam::KinematicCloud<ParcelType>::cellOccupancy()
|
||||||
|
{
|
||||||
|
if (cellOccupancyPtr_.empty())
|
||||||
|
{
|
||||||
|
buildCellOccupancy();
|
||||||
|
}
|
||||||
|
|
||||||
|
return cellOccupancyPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
inline Foam::DimensionedField<Foam::vector, Foam::volMesh>&
|
inline Foam::DimensionedField<Foam::vector, Foam::volMesh>&
|
||||||
Foam::KinematicCloud<ParcelType>::UTrans()
|
Foam::KinematicCloud<ParcelType>::UTrans()
|
||||||
|
|||||||
@ -120,8 +120,19 @@ void Foam::ReactingCloud<ParcelType>::evolveCloud()
|
|||||||
this->g().value()
|
this->g().value()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
label preInjectionSize = this->size();
|
||||||
|
|
||||||
this->surfaceFilm().inject(td);
|
this->surfaceFilm().inject(td);
|
||||||
|
|
||||||
|
// Update the cellOccupancy if the size of the cloud has changed
|
||||||
|
// during the injection.
|
||||||
|
if (preInjectionSize != this->size())
|
||||||
|
{
|
||||||
|
this->updateCellOccupancy();
|
||||||
|
|
||||||
|
preInjectionSize = this->size();
|
||||||
|
}
|
||||||
|
|
||||||
this->injection().inject(td);
|
this->injection().inject(td);
|
||||||
|
|
||||||
if (this->coupled())
|
if (this->coupled())
|
||||||
@ -129,7 +140,19 @@ void Foam::ReactingCloud<ParcelType>::evolveCloud()
|
|||||||
resetSourceTerms();
|
resetSourceTerms();
|
||||||
}
|
}
|
||||||
|
|
||||||
Cloud<ParcelType>::move(td);
|
// Assume that motion will update the cellOccupancy as necessary
|
||||||
|
// before it is required.
|
||||||
|
motion(td);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
void Foam::ReactingCloud<ParcelType>::motion
|
||||||
|
(
|
||||||
|
typename ParcelType::trackData& td
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ThermoCloud<ParcelType>::motion(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -130,6 +130,9 @@ protected:
|
|||||||
//- Evolve the cloud
|
//- Evolve the cloud
|
||||||
void evolveCloud();
|
void evolveCloud();
|
||||||
|
|
||||||
|
//- Particle motion
|
||||||
|
void motion(typename ParcelType::trackData& td);
|
||||||
|
|
||||||
//- Post-evolve
|
//- Post-evolve
|
||||||
void postEvolve();
|
void postEvolve();
|
||||||
|
|
||||||
|
|||||||
@ -93,8 +93,19 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud()
|
|||||||
this->g().value()
|
this->g().value()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
label preInjectionSize = this->size();
|
||||||
|
|
||||||
this->surfaceFilm().inject(td);
|
this->surfaceFilm().inject(td);
|
||||||
|
|
||||||
|
// Update the cellOccupancy if the size of the cloud has changed
|
||||||
|
// during the injection.
|
||||||
|
if (preInjectionSize != this->size())
|
||||||
|
{
|
||||||
|
this->updateCellOccupancy();
|
||||||
|
|
||||||
|
preInjectionSize = this->size();
|
||||||
|
}
|
||||||
|
|
||||||
this->injection().inject(td);
|
this->injection().inject(td);
|
||||||
|
|
||||||
if (this->coupled())
|
if (this->coupled())
|
||||||
@ -102,7 +113,19 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud()
|
|||||||
resetSourceTerms();
|
resetSourceTerms();
|
||||||
}
|
}
|
||||||
|
|
||||||
Cloud<ParcelType>::move(td);
|
// Assume that motion will update the cellOccupancy as necessary
|
||||||
|
// before it is required.
|
||||||
|
motion(td);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
void Foam::ReactingMultiphaseCloud<ParcelType>::motion
|
||||||
|
(
|
||||||
|
typename ParcelType::trackData& td
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ReactingCloud<ParcelType>::motion(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -121,6 +121,9 @@ protected:
|
|||||||
//- Evolve the cloud
|
//- Evolve the cloud
|
||||||
void evolveCloud();
|
void evolveCloud();
|
||||||
|
|
||||||
|
//- Particle motion
|
||||||
|
void motion(typename ParcelType::trackData& td);
|
||||||
|
|
||||||
//- Post-evolve
|
//- Post-evolve
|
||||||
void postEvolve();
|
void postEvolve();
|
||||||
|
|
||||||
|
|||||||
@ -86,8 +86,19 @@ void Foam::ThermoCloud<ParcelType>::evolveCloud()
|
|||||||
this->g().value()
|
this->g().value()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
label preInjectionSize = this->size();
|
||||||
|
|
||||||
|
// Update the cellOccupancy if the size of the cloud has changed
|
||||||
|
// during the injection.
|
||||||
this->surfaceFilm().inject(td);
|
this->surfaceFilm().inject(td);
|
||||||
|
|
||||||
|
if (preInjectionSize != this->size())
|
||||||
|
{
|
||||||
|
this->updateCellOccupancy();
|
||||||
|
|
||||||
|
preInjectionSize = this->size();
|
||||||
|
}
|
||||||
|
|
||||||
this->injection().inject(td);
|
this->injection().inject(td);
|
||||||
|
|
||||||
if (this->coupled())
|
if (this->coupled())
|
||||||
@ -95,7 +106,19 @@ void Foam::ThermoCloud<ParcelType>::evolveCloud()
|
|||||||
resetSourceTerms();
|
resetSourceTerms();
|
||||||
}
|
}
|
||||||
|
|
||||||
Cloud<ParcelType>::move(td);
|
// Assume that motion will update the cellOccupancy as necessary
|
||||||
|
// before it is required.
|
||||||
|
motion(td);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
void Foam::ThermoCloud<ParcelType>::motion
|
||||||
|
(
|
||||||
|
typename ParcelType::trackData& td
|
||||||
|
)
|
||||||
|
{
|
||||||
|
KinematicCloud<ParcelType>::motion(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -121,6 +121,9 @@ protected:
|
|||||||
//- Evolve the cloud
|
//- Evolve the cloud
|
||||||
void evolveCloud();
|
void evolveCloud();
|
||||||
|
|
||||||
|
//- Particle motion
|
||||||
|
void motion(typename ParcelType::trackData& td);
|
||||||
|
|
||||||
//- Post-evolve
|
//- Post-evolve
|
||||||
void postEvolve();
|
void postEvolve();
|
||||||
|
|
||||||
|
|||||||
@ -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>
|
template<class PairType, class WallType>
|
||||||
Foam::WallCollisionRecord<WallType>&
|
Foam::WallCollisionRecord<WallType>&
|
||||||
Foam::CollisionRecordList<PairType, WallType>::matchWallRecord
|
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>
|
template<class PairType, class WallType>
|
||||||
void Foam::CollisionRecordList<PairType, WallType>::update()
|
void Foam::CollisionRecordList<PairType, WallType>::update()
|
||||||
|
|||||||
@ -168,6 +168,10 @@ public:
|
|||||||
label origIdOfOther
|
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
|
//- Enquires if the position of wall impact relative to the
|
||||||
// particle centre is present in the records. If so, return
|
// particle centre is present in the records. If so, return
|
||||||
// access to the WallCollisionRecord (hence the data) and
|
// access to the WallCollisionRecord (hence the data) and
|
||||||
@ -179,6 +183,10 @@ public:
|
|||||||
scalar radius
|
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
|
//- Update the collision records, deleting any records not
|
||||||
// marked as having been accessed, then mark all records as
|
// marked as having been accessed, then mark all records as
|
||||||
// not accessed ready for the next evaluation
|
// not accessed ready for the next evaluation
|
||||||
|
|||||||
@ -225,6 +225,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
|||||||
typeId_(p.typeId_),
|
typeId_(p.typeId_),
|
||||||
nParticle_(p.nParticle_),
|
nParticle_(p.nParticle_),
|
||||||
d_(p.d_),
|
d_(p.d_),
|
||||||
|
dTarget_(p.dTarget_),
|
||||||
U_(p.U_),
|
U_(p.U_),
|
||||||
f_(p.f_),
|
f_(p.f_),
|
||||||
angularMomentum_(p.angularMomentum_),
|
angularMomentum_(p.angularMomentum_),
|
||||||
|
|||||||
@ -250,6 +250,9 @@ protected:
|
|||||||
//- Diameter [m]
|
//- Diameter [m]
|
||||||
scalar d_;
|
scalar d_;
|
||||||
|
|
||||||
|
//- Target diameter [m]
|
||||||
|
scalar dTarget_;
|
||||||
|
|
||||||
//- Velocity of Parcel [m/s]
|
//- Velocity of Parcel [m/s]
|
||||||
vector U_;
|
vector U_;
|
||||||
|
|
||||||
@ -347,6 +350,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -388,6 +392,9 @@ public:
|
|||||||
//- Return const access to diameter
|
//- Return const access to diameter
|
||||||
inline scalar d() const;
|
inline scalar d() const;
|
||||||
|
|
||||||
|
//- Return const access to target diameter
|
||||||
|
inline scalar dTarget() const;
|
||||||
|
|
||||||
//- Return const access to velocity
|
//- Return const access to velocity
|
||||||
inline const vector& U() const;
|
inline const vector& U() const;
|
||||||
|
|
||||||
@ -427,6 +434,9 @@ public:
|
|||||||
//- Return access to diameter
|
//- Return access to diameter
|
||||||
inline scalar& d();
|
inline scalar& d();
|
||||||
|
|
||||||
|
//- Return access to target diameter
|
||||||
|
inline scalar& dTarget();
|
||||||
|
|
||||||
//- Return access to velocity
|
//- Return access to velocity
|
||||||
inline vector& U();
|
inline vector& U();
|
||||||
|
|
||||||
@ -478,19 +488,19 @@ public:
|
|||||||
inline scalar volume() const;
|
inline scalar volume() const;
|
||||||
|
|
||||||
//- Particle volume for a given diameter
|
//- Particle volume for a given diameter
|
||||||
inline scalar volume(const scalar d) const;
|
inline static scalar volume(const scalar d);
|
||||||
|
|
||||||
//- Particle projected area
|
//- Particle projected area
|
||||||
inline scalar areaP() const;
|
inline scalar areaP() const;
|
||||||
|
|
||||||
//- Projected area for given diameter
|
//- Projected area for given diameter
|
||||||
inline scalar areaP(const scalar d) const;
|
inline static scalar areaP(const scalar d);
|
||||||
|
|
||||||
//- Particle surface area
|
//- Particle surface area
|
||||||
inline scalar areaS() const;
|
inline scalar areaS() const;
|
||||||
|
|
||||||
//- Surface area for given diameter
|
//- Surface area for given diameter
|
||||||
inline scalar areaS(const scalar d) const;
|
inline static scalar areaS(const scalar d);
|
||||||
|
|
||||||
//- Reynolds number
|
//- Reynolds number
|
||||||
inline scalar Re
|
inline scalar Re
|
||||||
|
|||||||
@ -91,6 +91,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
|
|||||||
typeId_(owner.parcelTypeId()),
|
typeId_(owner.parcelTypeId()),
|
||||||
nParticle_(0),
|
nParticle_(0),
|
||||||
d_(0.0),
|
d_(0.0),
|
||||||
|
dTarget_(0.0),
|
||||||
U_(vector::zero),
|
U_(vector::zero),
|
||||||
f_(vector::zero),
|
f_(vector::zero),
|
||||||
angularMomentum_(vector::zero),
|
angularMomentum_(vector::zero),
|
||||||
@ -116,6 +117,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -128,6 +130,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel
|
|||||||
typeId_(typeId),
|
typeId_(typeId),
|
||||||
nParticle_(nParticle0),
|
nParticle_(nParticle0),
|
||||||
d_(d0),
|
d_(d0),
|
||||||
|
dTarget_(dTarget0),
|
||||||
U_(U0),
|
U_(U0),
|
||||||
f_(f0),
|
f_(f0),
|
||||||
angularMomentum_(angularMomentum0),
|
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>
|
template <class ParcelType>
|
||||||
inline const Foam::vector& Foam::KinematicParcel<ParcelType>::U() const
|
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>
|
template <class ParcelType>
|
||||||
inline Foam::vector& Foam::KinematicParcel<ParcelType>::U()
|
inline Foam::vector& Foam::KinematicParcel<ParcelType>::U()
|
||||||
{
|
{
|
||||||
@ -504,7 +521,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume() const
|
|||||||
|
|
||||||
template <class ParcelType>
|
template <class ParcelType>
|
||||||
inline Foam::scalar
|
inline Foam::scalar
|
||||||
Foam::KinematicParcel<ParcelType>::volume(const scalar d) const
|
Foam::KinematicParcel<ParcelType>::volume(const scalar d)
|
||||||
{
|
{
|
||||||
return pi/6.0*pow3(d);
|
return pi/6.0*pow3(d);
|
||||||
}
|
}
|
||||||
@ -519,7 +536,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaP() const
|
|||||||
|
|
||||||
template <class ParcelType>
|
template <class ParcelType>
|
||||||
inline Foam::scalar
|
inline Foam::scalar
|
||||||
Foam::KinematicParcel<ParcelType>::areaP(const scalar d) const
|
Foam::KinematicParcel<ParcelType>::areaP(const scalar d)
|
||||||
{
|
{
|
||||||
return 0.25*areaS(d);
|
return 0.25*areaS(d);
|
||||||
}
|
}
|
||||||
@ -534,7 +551,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaS() const
|
|||||||
|
|
||||||
template <class ParcelType>
|
template <class ParcelType>
|
||||||
inline Foam::scalar
|
inline Foam::scalar
|
||||||
Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const
|
Foam::KinematicParcel<ParcelType>::areaS(const scalar d)
|
||||||
{
|
{
|
||||||
return pi*d*d;
|
return pi*d*d;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ Foam::string Foam::KinematicParcel<ParcelType>::propHeader =
|
|||||||
+ " typeId"
|
+ " typeId"
|
||||||
+ " nParticle"
|
+ " nParticle"
|
||||||
+ " d"
|
+ " d"
|
||||||
|
+ " dTarget "
|
||||||
+ " (Ux Uy Uz)"
|
+ " (Ux Uy Uz)"
|
||||||
+ " (fx fy fz)"
|
+ " (fx fy fz)"
|
||||||
+ " (angularMomentumx angularMomentumy angularMomentumz)"
|
+ " (angularMomentumx angularMomentumy angularMomentumz)"
|
||||||
@ -68,6 +69,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
|||||||
typeId_(0),
|
typeId_(0),
|
||||||
nParticle_(0.0),
|
nParticle_(0.0),
|
||||||
d_(0.0),
|
d_(0.0),
|
||||||
|
dTarget_(0.0),
|
||||||
U_(vector::zero),
|
U_(vector::zero),
|
||||||
f_(vector::zero),
|
f_(vector::zero),
|
||||||
angularMomentum_(vector::zero),
|
angularMomentum_(vector::zero),
|
||||||
@ -88,6 +90,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
|||||||
typeId_ = readLabel(is);
|
typeId_ = readLabel(is);
|
||||||
nParticle_ = readScalar(is);
|
nParticle_ = readScalar(is);
|
||||||
d_ = readScalar(is);
|
d_ = readScalar(is);
|
||||||
|
dTarget_ = readScalar(is);
|
||||||
is >> U_;
|
is >> U_;
|
||||||
is >> f_;
|
is >> f_;
|
||||||
is >> angularMomentum_;
|
is >> angularMomentum_;
|
||||||
@ -106,6 +109,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
|
|||||||
+ sizeof(typeId_)
|
+ sizeof(typeId_)
|
||||||
+ sizeof(nParticle_)
|
+ sizeof(nParticle_)
|
||||||
+ sizeof(d_)
|
+ sizeof(d_)
|
||||||
|
+ sizeof(dTarget_)
|
||||||
+ sizeof(U_)
|
+ sizeof(U_)
|
||||||
+ sizeof(f_)
|
+ sizeof(f_)
|
||||||
+ sizeof(angularMomentum_)
|
+ sizeof(angularMomentum_)
|
||||||
@ -150,6 +154,9 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
|
|||||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
|
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
|
||||||
c.checkFieldIOobject(c, d);
|
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));
|
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ));
|
||||||
c.checkFieldIOobject(c, U);
|
c.checkFieldIOobject(c, U);
|
||||||
|
|
||||||
@ -234,6 +241,7 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
|
|||||||
p.typeId_ = typeId[i];
|
p.typeId_ = typeId[i];
|
||||||
p.nParticle_ = nParticle[i];
|
p.nParticle_ = nParticle[i];
|
||||||
p.d_ = d[i];
|
p.d_ = d[i];
|
||||||
|
p.dTarget_ = dTarget[i];
|
||||||
p.U_ = U[i];
|
p.U_ = U[i];
|
||||||
p.f_ = f[i];
|
p.f_ = f[i];
|
||||||
p.angularMomentum_ = angularMomentum[i];
|
p.angularMomentum_ = angularMomentum[i];
|
||||||
@ -271,6 +279,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
|
|||||||
np
|
np
|
||||||
);
|
);
|
||||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), 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> U(c.fieldIOobject("U", IOobject::NO_READ), np);
|
||||||
IOField<vector> f(c.fieldIOobject("f", IOobject::NO_READ), np);
|
IOField<vector> f(c.fieldIOobject("f", IOobject::NO_READ), np);
|
||||||
IOField<vector> angularMomentum
|
IOField<vector> angularMomentum
|
||||||
@ -333,6 +342,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
|
|||||||
typeId[i] = p.typeId();
|
typeId[i] = p.typeId();
|
||||||
nParticle[i] = p.nParticle();
|
nParticle[i] = p.nParticle();
|
||||||
d[i] = p.d();
|
d[i] = p.d();
|
||||||
|
dTarget[i] = p.dTarget();
|
||||||
U[i] = p.U();
|
U[i] = p.U();
|
||||||
f[i] = p.f();
|
f[i] = p.f();
|
||||||
angularMomentum[i] = p.angularMomentum();
|
angularMomentum[i] = p.angularMomentum();
|
||||||
@ -357,6 +367,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
|
|||||||
typeId.write();
|
typeId.write();
|
||||||
nParticle.write();
|
nParticle.write();
|
||||||
d.write();
|
d.write();
|
||||||
|
dTarget.write();
|
||||||
U.write();
|
U.write();
|
||||||
f.write();
|
f.write();
|
||||||
angularMomentum.write();
|
angularMomentum.write();
|
||||||
@ -390,6 +401,7 @@ Foam::Ostream& Foam::operator<<
|
|||||||
<< token::SPACE << p.typeId()
|
<< token::SPACE << p.typeId()
|
||||||
<< token::SPACE << p.nParticle()
|
<< token::SPACE << p.nParticle()
|
||||||
<< token::SPACE << p.d()
|
<< token::SPACE << p.d()
|
||||||
|
<< token::SPACE << p.dTarget()
|
||||||
<< token::SPACE << p.U()
|
<< token::SPACE << p.U()
|
||||||
<< token::SPACE << p.f()
|
<< token::SPACE << p.f()
|
||||||
<< token::SPACE << p.angularMomentum()
|
<< token::SPACE << p.angularMomentum()
|
||||||
@ -409,6 +421,7 @@ Foam::Ostream& Foam::operator<<
|
|||||||
+ sizeof(p.typeId())
|
+ sizeof(p.typeId())
|
||||||
+ sizeof(p.nParticle())
|
+ sizeof(p.nParticle())
|
||||||
+ sizeof(p.d())
|
+ sizeof(p.d())
|
||||||
|
+ sizeof(p.dTarget())
|
||||||
+ sizeof(p.U())
|
+ sizeof(p.U())
|
||||||
+ sizeof(p.f())
|
+ sizeof(p.f())
|
||||||
+ sizeof(p.angularMomentum())
|
+ sizeof(p.angularMomentum())
|
||||||
|
|||||||
@ -306,6 +306,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
|
|||||||
@ -113,6 +113,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -134,6 +135,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
angularMomentum0,
|
angularMomentum0,
|
||||||
|
|||||||
@ -255,6 +255,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
|
|||||||
@ -98,6 +98,7 @@ inline Foam::ReactingParcel<ParcelType>::ReactingParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -116,6 +117,7 @@ inline Foam::ReactingParcel<ParcelType>::ReactingParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
angularMomentum0,
|
angularMomentum0,
|
||||||
|
|||||||
@ -268,6 +268,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
|
|||||||
@ -99,6 +99,7 @@ inline Foam::ThermoParcel<ParcelType>::ThermoParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -116,6 +117,7 @@ inline Foam::ThermoParcel<ParcelType>::ThermoParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
angularMomentum0,
|
angularMomentum0,
|
||||||
|
|||||||
@ -67,6 +67,7 @@ Foam::basicKinematicParcel::basicKinematicParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -84,6 +85,7 @@ Foam::basicKinematicParcel::basicKinematicParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
angularMomentum0,
|
angularMomentum0,
|
||||||
|
|||||||
@ -81,6 +81,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
|
|||||||
@ -57,6 +57,7 @@ Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -79,6 +80,7 @@ Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
angularMomentum0,
|
angularMomentum0,
|
||||||
|
|||||||
@ -82,6 +82,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
|
|||||||
@ -57,6 +57,7 @@ Foam::basicReactingParcel::basicReactingParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -75,6 +76,7 @@ Foam::basicReactingParcel::basicReactingParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
angularMomentum0,
|
angularMomentum0,
|
||||||
|
|||||||
@ -80,6 +80,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector& U0,
|
const vector& U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
|
|||||||
@ -60,6 +60,7 @@ Foam::basicThermoParcel::basicThermoParcel
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector U0,
|
const vector U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
@ -77,6 +78,7 @@ Foam::basicThermoParcel::basicThermoParcel
|
|||||||
typeId,
|
typeId,
|
||||||
nParticle0,
|
nParticle0,
|
||||||
d0,
|
d0,
|
||||||
|
dTarget0,
|
||||||
U0,
|
U0,
|
||||||
f0,
|
f0,
|
||||||
angularMomentum0,
|
angularMomentum0,
|
||||||
|
|||||||
@ -80,6 +80,7 @@ public:
|
|||||||
const label typeId,
|
const label typeId,
|
||||||
const scalar nParticle0,
|
const scalar nParticle0,
|
||||||
const scalar d0,
|
const scalar d0,
|
||||||
|
const scalar dTarget0,
|
||||||
const vector U0,
|
const vector U0,
|
||||||
const vector& f0,
|
const vector& f0,
|
||||||
const vector& angularMomentum0,
|
const vector& angularMomentum0,
|
||||||
|
|||||||
@ -33,11 +33,13 @@ License
|
|||||||
#include "ConeInjection.H"
|
#include "ConeInjection.H"
|
||||||
#include "ConeInjectionMP.H"
|
#include "ConeInjectionMP.H"
|
||||||
#include "FieldActivatedInjection.H"
|
#include "FieldActivatedInjection.H"
|
||||||
|
#include "InflationInjection.H"
|
||||||
#include "KinematicLookupTableInjection.H"
|
#include "KinematicLookupTableInjection.H"
|
||||||
#include "ManualInjection.H"
|
#include "ManualInjection.H"
|
||||||
#include "NoInjection.H"
|
#include "NoInjection.H"
|
||||||
#include "PatchInjection.H"
|
#include "PatchInjection.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#define makeParcelInjectionModels(ParcelType) \
|
#define makeParcelInjectionModels(ParcelType) \
|
||||||
@ -63,6 +65,12 @@ License
|
|||||||
ParcelType \
|
ParcelType \
|
||||||
); \
|
); \
|
||||||
makeInjectionModelType \
|
makeInjectionModelType \
|
||||||
|
( \
|
||||||
|
InflationInjection, \
|
||||||
|
KinematicCloud, \
|
||||||
|
ParcelType \
|
||||||
|
); \
|
||||||
|
makeInjectionModelType \
|
||||||
( \
|
( \
|
||||||
KinematicLookupTableInjection, \
|
KinematicLookupTableInjection, \
|
||||||
KinematicCloud, \
|
KinematicCloud, \
|
||||||
|
|||||||
@ -51,8 +51,6 @@ void Foam::PairCollision<CloudType>::preInteraction()
|
|||||||
|
|
||||||
p.torque() = vector::zero;
|
p.torque() = vector::zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildCellOccupancy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -61,7 +59,7 @@ void Foam::PairCollision<CloudType>::parcelInteraction()
|
|||||||
{
|
{
|
||||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
il_.sendReferredData(cellOccupancy_, pBufs);
|
il_.sendReferredData(this->owner().cellOccupancy(), pBufs);
|
||||||
|
|
||||||
realRealInteraction();
|
realRealInteraction();
|
||||||
|
|
||||||
@ -80,17 +78,20 @@ void Foam::PairCollision<CloudType>::realRealInteraction()
|
|||||||
typename CloudType::parcelType* pA_ptr = NULL;
|
typename CloudType::parcelType* pA_ptr = NULL;
|
||||||
typename CloudType::parcelType* pB_ptr = NULL;
|
typename CloudType::parcelType* pB_ptr = NULL;
|
||||||
|
|
||||||
|
List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
|
||||||
|
this->owner().cellOccupancy();
|
||||||
|
|
||||||
forAll(dil, realCellI)
|
forAll(dil, realCellI)
|
||||||
{
|
{
|
||||||
// Loop over all Parcels in cell A (a)
|
// Loop over all Parcels in cell A (a)
|
||||||
forAll(cellOccupancy_[realCellI], a)
|
forAll(cellOccupancy[realCellI], a)
|
||||||
{
|
{
|
||||||
pA_ptr = cellOccupancy_[realCellI][a];
|
pA_ptr = cellOccupancy[realCellI][a];
|
||||||
|
|
||||||
forAll(dil[realCellI], interactingCells)
|
forAll(dil[realCellI], interactingCells)
|
||||||
{
|
{
|
||||||
List<typename CloudType::parcelType*> cellBParcels =
|
List<typename CloudType::parcelType*> cellBParcels =
|
||||||
cellOccupancy_[dil[realCellI][interactingCells]];
|
cellOccupancy[dil[realCellI][interactingCells]];
|
||||||
|
|
||||||
// Loop over all Parcels in cell B (b)
|
// Loop over all Parcels in cell B (b)
|
||||||
forAll(cellBParcels, b)
|
forAll(cellBParcels, b)
|
||||||
@ -102,9 +103,9 @@ void Foam::PairCollision<CloudType>::realRealInteraction()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loop over the other Parcels in cell A (aO)
|
// Loop over the other Parcels in cell A (aO)
|
||||||
forAll(cellOccupancy_[realCellI], aO)
|
forAll(cellOccupancy[realCellI], aO)
|
||||||
{
|
{
|
||||||
pB_ptr = cellOccupancy_[realCellI][aO];
|
pB_ptr = cellOccupancy[realCellI][aO];
|
||||||
|
|
||||||
// Do not double-evaluate, compare pointers, arbitrary
|
// Do not double-evaluate, compare pointers, arbitrary
|
||||||
// order
|
// order
|
||||||
@ -127,6 +128,9 @@ void Foam::PairCollision<CloudType>::realReferredInteraction()
|
|||||||
List<IDLList<typename CloudType::parcelType> >& referredParticles =
|
List<IDLList<typename CloudType::parcelType> >& referredParticles =
|
||||||
il_.referredParticles();
|
il_.referredParticles();
|
||||||
|
|
||||||
|
List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
|
||||||
|
this->owner().cellOccupancy();
|
||||||
|
|
||||||
// Loop over all referred cells
|
// Loop over all referred cells
|
||||||
forAll(ril, refCellI)
|
forAll(ril, refCellI)
|
||||||
{
|
{
|
||||||
@ -150,7 +154,7 @@ void Foam::PairCollision<CloudType>::realReferredInteraction()
|
|||||||
forAll(realCells, realCellI)
|
forAll(realCells, realCellI)
|
||||||
{
|
{
|
||||||
List<typename CloudType::parcelType*> realCellParcels =
|
List<typename CloudType::parcelType*> realCellParcels =
|
||||||
cellOccupancy_[realCells[realCellI]];
|
cellOccupancy[realCells[realCellI]];
|
||||||
|
|
||||||
forAll(realCellParcels, realParcelI)
|
forAll(realCellParcels, realParcelI)
|
||||||
{
|
{
|
||||||
@ -179,6 +183,9 @@ void Foam::PairCollision<CloudType>::wallInteraction()
|
|||||||
|
|
||||||
const volVectorField& U = mesh.lookupObject<volVectorField>(il_.UName());
|
const volVectorField& U = mesh.lookupObject<volVectorField>(il_.UName());
|
||||||
|
|
||||||
|
List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
|
||||||
|
this->owner().cellOccupancy();
|
||||||
|
|
||||||
// Storage for the wall interaction sites
|
// Storage for the wall interaction sites
|
||||||
DynamicList<point> flatSitePoints;
|
DynamicList<point> flatSitePoints;
|
||||||
DynamicList<scalar> flatSiteExclusionDistancesSqr;
|
DynamicList<scalar> flatSiteExclusionDistancesSqr;
|
||||||
@ -196,7 +203,7 @@ void Foam::PairCollision<CloudType>::wallInteraction()
|
|||||||
const labelList& realWallFaces = directWallFaces[realCellI];
|
const labelList& realWallFaces = directWallFaces[realCellI];
|
||||||
|
|
||||||
// Loop over all Parcels in cell
|
// Loop over all Parcels in cell
|
||||||
forAll(cellOccupancy_[realCellI], cellParticleI)
|
forAll(cellOccupancy[realCellI], cellParticleI)
|
||||||
{
|
{
|
||||||
flatSitePoints.clear();
|
flatSitePoints.clear();
|
||||||
flatSiteExclusionDistancesSqr.clear();
|
flatSiteExclusionDistancesSqr.clear();
|
||||||
@ -209,7 +216,7 @@ void Foam::PairCollision<CloudType>::wallInteraction()
|
|||||||
sharpSiteData.clear();
|
sharpSiteData.clear();
|
||||||
|
|
||||||
typename CloudType::parcelType& p =
|
typename CloudType::parcelType& p =
|
||||||
*cellOccupancy_[realCellI][cellParticleI];
|
*cellOccupancy[realCellI][cellParticleI];
|
||||||
|
|
||||||
const point& pos = p.position();
|
const point& pos = p.position();
|
||||||
|
|
||||||
@ -482,21 +489,6 @@ void Foam::PairCollision<CloudType>::postInteraction()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
void Foam::PairCollision<CloudType>::buildCellOccupancy()
|
|
||||||
{
|
|
||||||
forAll(cellOccupancy_, cO)
|
|
||||||
{
|
|
||||||
cellOccupancy_[cO].clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
forAllIter(typename CloudType, this->owner(), iter)
|
|
||||||
{
|
|
||||||
cellOccupancy_[iter().cell()].append(&iter());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
void Foam::PairCollision<CloudType>::evaluatePair
|
void Foam::PairCollision<CloudType>::evaluatePair
|
||||||
(
|
(
|
||||||
@ -539,7 +531,6 @@ Foam::PairCollision<CloudType>::PairCollision
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
CollisionModel<CloudType>(dict, owner, typeName),
|
CollisionModel<CloudType>(dict, owner, typeName),
|
||||||
cellOccupancy_(owner.mesh().nCells()),
|
|
||||||
pairModel_
|
pairModel_
|
||||||
(
|
(
|
||||||
PairModel<CloudType>::New
|
PairModel<CloudType>::New
|
||||||
@ -560,7 +551,14 @@ Foam::PairCollision<CloudType>::PairCollision
|
|||||||
(
|
(
|
||||||
owner.mesh(),
|
owner.mesh(),
|
||||||
readScalar(this->coeffDict().lookup("maxInteractionDistance")),
|
readScalar(this->coeffDict().lookup("maxInteractionDistance")),
|
||||||
Switch(this->coeffDict().lookup("writeReferredParticleCloud")),
|
Switch
|
||||||
|
(
|
||||||
|
this->coeffDict().lookupOrDefault
|
||||||
|
(
|
||||||
|
"writeReferredParticleCloud",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
),
|
||||||
this->coeffDict().lookupOrDefault("UName", word("U"))
|
this->coeffDict().lookupOrDefault("UName", word("U"))
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -76,9 +76,6 @@ class PairCollision
|
|||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Cell occupancy information for each parcel
|
|
||||||
List<DynamicList<typename CloudType::parcelType*> > cellOccupancy_;
|
|
||||||
|
|
||||||
//- PairModel to calculate the interaction between two parcels
|
//- PairModel to calculate the interaction between two parcels
|
||||||
autoPtr<PairModel<CloudType> > pairModel_;
|
autoPtr<PairModel<CloudType> > pairModel_;
|
||||||
|
|
||||||
@ -124,9 +121,6 @@ class PairCollision
|
|||||||
//- Post collision tasks
|
//- Post collision tasks
|
||||||
void postInteraction();
|
void postInteraction();
|
||||||
|
|
||||||
//- Build the cell occupancy information for each parcel
|
|
||||||
void buildCellOccupancy();
|
|
||||||
|
|
||||||
//- Calculate the pair force between parcels
|
//- Calculate the pair force between parcels
|
||||||
void evaluatePair
|
void evaluatePair
|
||||||
(
|
(
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Foam::label Foam::ConeInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ Foam::scalar Foam::ConeInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -123,14 +123,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Number of parcels to introduce over the time step relative to SOI
|
//- Number of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Foam::label Foam::ConeInjectionMP<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@ Foam::scalar Foam::ConeInjectionMP<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -133,14 +133,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Number of parcels to introduce over the time step
|
//- Number of parcels to introduce over the time step
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Foam::label Foam::FieldActivatedInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if (sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
|
if (sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ Foam::scalar Foam::FieldActivatedInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if (sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
|
if (sum(nParcelsInjected_) < nParcelsPerInjector_*positions_.size())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -123,14 +123,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -0,0 +1,472 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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 "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 (selfSeed_ && !cellCentresUsed.found(cI))
|
||||||
|
{
|
||||||
|
scalar dNew = parcelPDF_().sample();
|
||||||
|
|
||||||
|
newParticles_.append
|
||||||
|
(
|
||||||
|
vectorPairScalarPair
|
||||||
|
(
|
||||||
|
Pair<vector>(mesh.cellCentres()[cI], vector::zero),
|
||||||
|
Pair<scalar>(dSeed_, 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),
|
||||||
|
selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)),
|
||||||
|
dSeed_(SMALL),
|
||||||
|
parcelPDF_
|
||||||
|
(
|
||||||
|
pdfs::pdf::New
|
||||||
|
(
|
||||||
|
this->coeffDict().subDict("parcelPDF"),
|
||||||
|
owner.rndGen()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (selfSeed_)
|
||||||
|
{
|
||||||
|
dSeed_ = readScalar(this->coeffDict().lookup("dSeed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
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,208 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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"
|
||||||
|
#include "Switch.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_;
|
||||||
|
|
||||||
|
//- 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
|
||||||
|
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>());
|
reduce(procI, maxOp<label>());
|
||||||
|
|
||||||
|
// Ensure that only one processor attempts to insert this Parcel
|
||||||
|
|
||||||
if (procI != Pstream::myProcNo())
|
if (procI != Pstream::myProcNo())
|
||||||
{
|
{
|
||||||
cellI = -1;
|
cellI = -1;
|
||||||
@ -166,11 +168,12 @@ bool Foam::InjectionModel<CloudType>::findCellAtPosition
|
|||||||
tetPtI = -1;
|
tetPtI = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last chance - find nearest cell and try that one
|
// Last chance - find nearest cell and try that one - the point is
|
||||||
// - the point is probably on an edge
|
// probably on an edge
|
||||||
if (procI == -1)
|
if (procI == -1)
|
||||||
{
|
{
|
||||||
cellI = owner_.mesh().findNearestCell(position);
|
cellI = owner_.mesh().findNearestCell(position);
|
||||||
|
|
||||||
if (cellI >= 0)
|
if (cellI >= 0)
|
||||||
{
|
{
|
||||||
position += SMALL*(cellCentres[cellI] - position);
|
position += SMALL*(cellCentres[cellI] - position);
|
||||||
@ -428,14 +431,15 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
|||||||
const scalar padTime = max(0.0, SOI_ - time0_);
|
const scalar padTime = max(0.0, SOI_ - time0_);
|
||||||
|
|
||||||
// Introduce new parcels linearly across carrier phase timestep
|
// 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))
|
if (validInjection(parcelI))
|
||||||
{
|
{
|
||||||
// Calculate the pseudo time of injection for parcel 'parcelI'
|
// Calculate the pseudo time of injection for parcel 'parcelI'
|
||||||
scalar timeInj = time0_ + padTime + deltaT*parcelI/newParcels;
|
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 cellI = -1;
|
||||||
label tetFaceI = -1;
|
label tetFaceI = -1;
|
||||||
label tetPtI = -1;
|
label tetPtI = -1;
|
||||||
|
|||||||
@ -156,14 +156,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const = 0;
|
) = 0;
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
virtual scalar volumeToInject
|
virtual scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const = 0;
|
) = 0;
|
||||||
|
|
||||||
//- Additional flag to identify whether or not injection of parcelI is
|
//- Additional flag to identify whether or not injection of parcelI is
|
||||||
// permitted
|
// permitted
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Foam::label Foam::KinematicLookupTableInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
@ -51,7 +51,7 @@ Foam::scalar Foam::KinematicLookupTableInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
scalar volume = 0.0;
|
scalar volume = 0.0;
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
|
|||||||
@ -100,14 +100,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Foam::label Foam::ManualInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((0.0 >= time0) && (0.0 < time1))
|
if ((0.0 >= time0) && (0.0 < time1))
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ Foam::scalar Foam::ManualInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
// All parcels introduced at SOI
|
// All parcels introduced at SOI
|
||||||
if ((0.0 >= time0) && (0.0 < time1))
|
if ((0.0 >= time0) && (0.0 < time1))
|
||||||
|
|||||||
@ -95,14 +95,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Foam::label Foam::NoInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar,
|
const scalar,
|
||||||
const scalar
|
const scalar
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ Foam::scalar Foam::NoInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar,
|
const scalar,
|
||||||
const scalar
|
const scalar
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,14 +60,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar,
|
const scalar,
|
||||||
const scalar
|
const scalar
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar,
|
const scalar,
|
||||||
const scalar
|
const scalar
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Foam::label Foam::PatchInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
@ -52,7 +52,7 @@ Foam::scalar Foam::PatchInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -101,14 +101,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -32,7 +32,7 @@ Foam::label Foam::ReactingLookupTableInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ Foam::scalar Foam::ReactingLookupTableInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
scalar volume = 0.0;
|
scalar volume = 0.0;
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
|
|||||||
@ -103,14 +103,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Foam::ReactingMultiphaseLookupTableInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
@ -52,7 +52,7 @@ Foam::ReactingMultiphaseLookupTableInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
scalar volume = 0.0;
|
scalar volume = 0.0;
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
|
|||||||
@ -106,14 +106,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Foam::label Foam::ThermoLookupTableInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
{
|
{
|
||||||
@ -51,7 +51,7 @@ Foam::scalar Foam::ThermoLookupTableInjection<CloudType>::volumeToInject
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
scalar volume = 0.0;
|
scalar volume = 0.0;
|
||||||
if ((time0 >= 0.0) && (time0 < duration_))
|
if ((time0 >= 0.0) && (time0 < duration_))
|
||||||
|
|||||||
@ -102,14 +102,14 @@ protected:
|
|||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
//- Volume of parcels to introduce over the time step relative to SOI
|
//- Volume of parcels to introduce over the time step relative to SOI
|
||||||
scalar volumeToInject
|
scalar volumeToInject
|
||||||
(
|
(
|
||||||
const scalar time0,
|
const scalar time0,
|
||||||
const scalar time1
|
const scalar time1
|
||||||
) const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -69,7 +69,8 @@ void Foam::reconstructLagrangianPositions
|
|||||||
(
|
(
|
||||||
lagrangianPositions,
|
lagrangianPositions,
|
||||||
ppi.position(),
|
ppi.position(),
|
||||||
cellMap[ppi.cell()]
|
cellMap[ppi.cell()],
|
||||||
|
false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -374,7 +374,6 @@ void Foam::sixDoFRigidBodyMotion::updatePosition
|
|||||||
centreOfMass() += deltaT*v();
|
centreOfMass() += deltaT*v();
|
||||||
|
|
||||||
// Leapfrog orientation adjustment
|
// Leapfrog orientation adjustment
|
||||||
|
|
||||||
rotate(Q(), pi(), deltaT);
|
rotate(Q(), pi(), deltaT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::restrain
|
|||||||
|
|
||||||
if (motion.report())
|
if (motion.report())
|
||||||
{
|
{
|
||||||
Info<< " attachmentPt - anchor " << r
|
Info<< " attachmentPt - anchor " << r*magR
|
||||||
<< " spring length " << magR
|
<< " spring length " << magR
|
||||||
<< " force " << restraintForce
|
<< " force " << restraintForce
|
||||||
<< " moment " << restraintMoment
|
<< " moment " << restraintMoment
|
||||||
|
|||||||
@ -62,13 +62,13 @@ Foam::scalar Foam::pdfs::fixedValue::fixedValue::sample() const
|
|||||||
|
|
||||||
Foam::scalar Foam::pdfs::fixedValue::fixedValue::minValue() const
|
Foam::scalar Foam::pdfs::fixedValue::fixedValue::minValue() const
|
||||||
{
|
{
|
||||||
return -VGREAT;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::fixedValue::fixedValue::maxValue() const
|
Foam::scalar Foam::pdfs::fixedValue::fixedValue::maxValue() const
|
||||||
{
|
{
|
||||||
return VGREAT;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -77,7 +77,7 @@ protected:
|
|||||||
//- Coefficients dictionary
|
//- Coefficients dictionary
|
||||||
const dictionary pdfDict_;
|
const dictionary pdfDict_;
|
||||||
|
|
||||||
//- Reference to the randmo number generator
|
//- Reference to the random number generator
|
||||||
Random& rndGen_;
|
Random& rndGen_;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,42 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object dynamicMeshDict;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dynamicFvMeshLib "libtopoChangerFvMesh.so";
|
|
||||||
|
|
||||||
dynamicFvMesh mixerFvMesh;
|
|
||||||
|
|
||||||
mixerFvMeshCoeffs
|
|
||||||
{
|
|
||||||
coordinateSystem
|
|
||||||
{
|
|
||||||
type cylindrical;
|
|
||||||
origin ( 0 0 0 );
|
|
||||||
axis ( 0 0 1 );
|
|
||||||
direction ( 1 0 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
rpm 10;
|
|
||||||
|
|
||||||
slider
|
|
||||||
{
|
|
||||||
inside insideSlider;
|
|
||||||
outside outsideSlider;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object dynamicMeshDict;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dynamicFvMeshLib "libtopoChangerFvMesh.so";
|
|
||||||
|
|
||||||
dynamicFvMesh mixerFvMesh;
|
|
||||||
|
|
||||||
mixerFvMeshCoeffs
|
|
||||||
{
|
|
||||||
coordinateSystem
|
|
||||||
{
|
|
||||||
type cylindrical;
|
|
||||||
origin ( 0 0 0 );
|
|
||||||
axis ( 0 0 1 );
|
|
||||||
direction ( 1 0 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
rpm 10;
|
|
||||||
|
|
||||||
slider
|
|
||||||
{
|
|
||||||
inside insideSlider;
|
|
||||||
outside outsideSlider;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user