mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added nParcels argument to functions
This commit is contained in:
@ -174,6 +174,7 @@ Foam::scalar Foam::ConeInjection<CloudType>::timeEnd() const
|
||||
template<class CloudType>
|
||||
void Foam::ConeInjection<CloudType>::setPositionAndCell
|
||||
(
|
||||
const label,
|
||||
const label,
|
||||
const scalar,
|
||||
vector& position,
|
||||
@ -189,6 +190,7 @@ template<class CloudType>
|
||||
void Foam::ConeInjection<CloudType>::setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType* pPtr
|
||||
)
|
||||
|
||||
@ -158,6 +158,7 @@ public:
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
@ -166,6 +167,7 @@ public:
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType* pPtr
|
||||
);
|
||||
|
||||
@ -170,6 +170,7 @@ template<class CloudType>
|
||||
void Foam::FieldActivatedInjection<CloudType>::setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
@ -184,6 +185,7 @@ template<class CloudType>
|
||||
void Foam::FieldActivatedInjection<CloudType>::setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar,
|
||||
typename CloudType::parcelType* pPtr
|
||||
)
|
||||
@ -206,8 +208,8 @@ bool Foam::FieldActivatedInjection<CloudType>::validInjection
|
||||
|
||||
if
|
||||
(
|
||||
nParcelsInjected_[parcelI] < nParcelsPerInjector_
|
||||
&& factor_*referenceField_[cellI] > thresholdField_[cellI]
|
||||
nParcelsInjected_[parcelI] < nParcelsPerInjector_
|
||||
&& factor_*referenceField_[cellI] > thresholdField_[cellI]
|
||||
)
|
||||
{
|
||||
nParcelsInjected_[parcelI]++;
|
||||
|
||||
@ -163,6 +163,7 @@ public:
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
@ -171,6 +172,7 @@ public:
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType* pPtr
|
||||
);
|
||||
|
||||
@ -375,7 +375,8 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
||||
const scalar volFraction = volumeFraction(newVolume);
|
||||
|
||||
// Duration of injection period during this timestep
|
||||
const scalar deltaT = min(carrierDt, min(time - SOI_, timeEnd() - time0_));
|
||||
const scalar deltaT =
|
||||
max(0.0, min(carrierDt, min(time - SOI_, timeEnd() - time0_)));
|
||||
|
||||
// Pad injection time if injection starts during this timestep
|
||||
const scalar padTime = max(0.0, SOI_ - time0_);
|
||||
@ -392,7 +393,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
||||
// Determine the injection position and owner cell
|
||||
label cellI = -1;
|
||||
vector pos = vector::zero;
|
||||
setPositionAndCell(parcelI, timeInj, pos, cellI);
|
||||
setPositionAndCell(parcelI, newParcels, timeInj, pos, cellI);
|
||||
|
||||
if (cellI > -1)
|
||||
{
|
||||
@ -406,7 +407,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
||||
parcelType* pPtr = new parcelType(td.cloud(), pos, cellI);
|
||||
|
||||
// Assign new parcel properties in injection model
|
||||
setProperties(parcelI, timeInj, pPtr);
|
||||
setProperties(parcelI, newParcels, timeInj, pPtr);
|
||||
|
||||
// Check new parcel properties
|
||||
td.cloud().checkParcelProperties(pPtr, dt, fullyDescribed());
|
||||
|
||||
@ -288,6 +288,7 @@ public:
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
@ -296,6 +297,7 @@ public:
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType* pPtr
|
||||
) = 0;
|
||||
|
||||
@ -138,6 +138,7 @@ template<class CloudType>
|
||||
void Foam::ManualInjection<CloudType>::setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
@ -152,6 +153,7 @@ template<class CloudType>
|
||||
void Foam::ManualInjection<CloudType>::setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const scalar,
|
||||
typename CloudType::parcelType* pPtr
|
||||
)
|
||||
|
||||
@ -40,8 +40,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef manualInjection_H
|
||||
#define manualInjection_H
|
||||
#ifndef ManualInjection_H
|
||||
#define ManualInjection_H
|
||||
|
||||
#include "InjectionModel.H"
|
||||
#include "pdf.H"
|
||||
@ -135,6 +135,7 @@ public:
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
@ -143,6 +144,7 @@ public:
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType* pPtr
|
||||
);
|
||||
|
||||
@ -90,6 +90,7 @@ Foam::scalar Foam::NoInjection<CloudType>::timeEnd() const
|
||||
template<class CloudType>
|
||||
void Foam::NoInjection<CloudType>::setPositionAndCell
|
||||
(
|
||||
const label,
|
||||
const label,
|
||||
const scalar,
|
||||
vector&,
|
||||
@ -101,7 +102,8 @@ void Foam::NoInjection<CloudType>::setPositionAndCell
|
||||
template<class CloudType>
|
||||
void Foam::NoInjection<CloudType>::setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label,
|
||||
const label,
|
||||
const scalar,
|
||||
typename CloudType::parcelType* pPtr
|
||||
)
|
||||
|
||||
@ -33,8 +33,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef noInjection_H
|
||||
#define noInjection_H
|
||||
#ifndef NoInjection_H
|
||||
#define NoInjection_H
|
||||
|
||||
#include "InjectionModel.H"
|
||||
|
||||
@ -106,6 +106,7 @@ public:
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
@ -114,6 +115,7 @@ public:
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType* pPtr
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user