Merge branch 'feature-lagrangian-source-terms' into 'develop'

ENH: Lagrangian: mass exchanges between parcels and carriers

See merge request Development/openfoam!631
This commit is contained in:
Andrew Heather 2023-11-10 13:36:07 +00:00
commit a833f9cc2e
40 changed files with 451 additions and 133 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -428,13 +428,29 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
isotropyModel_(nullptr),
UIntegrator_(nullptr),
rhokTrans_
(
new volScalarField::Internal
(
IOobject
(
IOobject::scopedName(this->name(), "rhokTrans"),
this->db().time().timeName(),
this->db(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar(dimMass, Zero)
)
),
UTrans_
(
new volVectorField::Internal
(
IOobject
(
this->name() + ":UTrans",
IOobject::scopedName(this->name(), "UTrans"),
this->db().time().timeName(),
this->db(),
IOobject::READ_IF_PRESENT,
@ -450,7 +466,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
(
IOobject
(
this->name() + ":UCoeff",
IOobject::scopedName(this->name(), "UCoeff"),
this->db().time().timeName(),
this->db(),
IOobject::READ_IF_PRESENT,
@ -517,13 +533,29 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
isotropyModel_(c.isotropyModel_->clone()),
UIntegrator_(c.UIntegrator_->clone()),
rhokTrans_
(
new volScalarField::Internal
(
IOobject
(
IOobject::scopedName(this->name(), "rhokTrans"),
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
c.rhokTrans_()
)
),
UTrans_
(
new volVectorField::Internal
(
IOobject
(
this->name() + ":UTrans",
IOobject::scopedName(this->name(), "UTrans"),
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
@ -614,6 +646,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
isotropyModel_(nullptr),
UIntegrator_(nullptr),
rhokTrans_(nullptr),
UTrans_(nullptr),
UCoeff_(nullptr),
log(c.log)
@ -687,8 +720,9 @@ void Foam::KinematicCloud<CloudType>::restoreState()
template<class CloudType>
void Foam::KinematicCloud<CloudType>::resetSourceTerms()
{
rhokTrans().field() = Zero;
UTrans().field() = Zero;
UCoeff().field() = 0.0;
UCoeff().field() = Zero;
}
@ -725,6 +759,7 @@ void Foam::KinematicCloud<CloudType>::relaxSources
const KinematicCloud<CloudType>& cloudOldTime
)
{
this->relax(rhokTrans_(), cloudOldTime.rhokTrans(), "rhok");
this->relax(UTrans_(), cloudOldTime.UTrans(), "U");
this->relax(UCoeff_(), cloudOldTime.UCoeff(), "U");
}
@ -733,6 +768,7 @@ void Foam::KinematicCloud<CloudType>::relaxSources
template<class CloudType>
void Foam::KinematicCloud<CloudType>::scaleSources()
{
this->scale(rhokTrans_(), "rhok");
this->scale(UTrans_(), "U");
this->scale(UCoeff_(), "U");
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -255,6 +255,9 @@ protected:
// Sources
//- Mass for kinematic cloud
autoPtr<volScalarField::Internal> rhokTrans_;
//- Momentum
autoPtr<volVectorField::Internal> UTrans_;
@ -524,21 +527,36 @@ public:
// Sources
//- Transfer the effect of parcel to the carrier phase
inline void transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// Momentum
//- Return reference to mass for kinematic source
inline volScalarField::Internal& rhokTrans();
//- Return const reference to mass for kinematic source
inline const volScalarField::Internal& rhokTrans() const;
//- Return reference to momentum source
inline volVectorField::Internal& UTrans();
//- Return const reference to momentum source
inline const volVectorField::Internal&
UTrans() const;
inline const volVectorField::Internal& UTrans() const;
//- Return coefficient for carrier phase U equation
inline volScalarField::Internal& UCoeff();
//- Return const coefficient for carrier phase U equation
inline const volScalarField::Internal&
UCoeff() const;
inline const volScalarField::Internal& UCoeff() const;
//- Return tmp mass source for kinematic
inline tmp<volScalarField::Internal> Srhok() const;
//- Return tmp momentum source term (compressible)
inline tmp<fvVectorMatrix> SU

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -434,6 +434,37 @@ Foam::KinematicCloud<CloudType>::cellLengthScale() const
}
template<class CloudType>
inline void Foam::KinematicCloud<CloudType>::transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
)
{
const scalar m = p.nParticle()*p.mass();
rhokTrans()[p.cell()] += m;
UTrans()[p.cell()] += m*p.U();
}
template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::KinematicCloud<CloudType>::rhokTrans()
{
return *rhokTrans_;
}
template<class CloudType>
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::KinematicCloud<CloudType>::rhokTrans() const
{
return *rhokTrans_;
}
template<class CloudType>
inline Foam::DimensionedField<Foam::vector, Foam::volMesh>&
Foam::KinematicCloud<CloudType>::UTrans()
@ -466,6 +497,45 @@ Foam::KinematicCloud<CloudType>::UCoeff() const
}
template<class CloudType>
inline Foam::tmp<Foam::volScalarField::Internal>
Foam::KinematicCloud<CloudType>::Srhok() const
{
label debug0 = debug;
debug = 1;
if (debug)
{
Pout<< "rhokTrans min/max = " << min(rhokTrans()).value() << ", "
<< max(rhokTrans()).value() << endl;
}
debug = debug0;
if (this->solution().coupled())
{
return rhokTrans()/this->db().time().deltaT()/this->mesh().V();
}
return
tmp<volScalarField::Internal>::New
(
IOobject
(
IOobject::scopedName(this->name(), "rhokTrans"),
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->mesh(),
dimensionedScalar
(
rhokTrans().dimensions()/dimTime/dimVolume, Zero
)
);
}
template<class CloudType>
inline Foam::tmp<Foam::fvVectorMatrix>
Foam::KinematicCloud<CloudType>::SU(volVectorField& U, bool incompressible)
@ -524,7 +594,7 @@ Foam::KinematicCloud<CloudType>::vDotSweep() const
(
IOobject
(
this->name() + ":vDotSweep",
IOobject::scopedName(this->name(), "vDotSweep"),
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
@ -562,7 +632,7 @@ Foam::KinematicCloud<CloudType>::theta() const
(
IOobject
(
this->name() + ":theta",
IOobject::scopedName(this->name(), "theta"),
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
@ -600,7 +670,7 @@ Foam::KinematicCloud<CloudType>::alpha() const
(
IOobject
(
this->name() + ":alpha",
IOobject::scopedName(this->name(), "alpha"),
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
@ -636,7 +706,7 @@ Foam::KinematicCloud<CloudType>::rhoEff() const
(
IOobject
(
this->name() + ":rhoEff",
IOobject::scopedName(this->name(), "rhoEff"),
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,

View File

@ -233,7 +233,15 @@ public:
// Sources
//- Mass
//- Transfer the effect of parcel to the carrier phase
inline void transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// Mass
//- Return reference to mass source for field i
inline volScalarField::Internal&

View File

@ -75,6 +75,39 @@ Foam::ReactingCloud<CloudType>::phaseChange()
}
template<class CloudType>
inline void Foam::ReactingCloud<CloudType>::transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
)
{
const auto& comp = this->composition();
const label celli = p.cell();
const scalar m = p.nParticle()*p.mass();
this->rhokTrans()[celli] += m;
this->UTrans()[celli] += m*p.U();
const scalar pc = td.pc();
const scalar T = p.T();
const auto& Y = p.Y();
forAll(Y, i)
{
const scalar dm = m*p.Y[i];
const label gid = comp.localToCarrierId(0, i);
const scalar hs = comp.carrier().Hs(gid, pc, T);
this->rhoTrans(gid)[celli] += dm;
this->hsTrans()[celli] += dm*hs;
}
}
template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::ReactingCloud<CloudType>::rhoTrans(const label i)

View File

@ -251,6 +251,16 @@ public:
surfaceReaction();
// Sources
//- Transfer the effect of parcel to the carrier phase
inline void transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// Cloud evolution functions
//- Set parcel thermo properties

View File

@ -95,4 +95,51 @@ Foam::ReactingMultiphaseCloud<CloudType>::surfaceReaction()
}
template<class CloudType>
inline void Foam::ReactingMultiphaseCloud<CloudType>::transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
)
{
const label celli = p.cell();
const scalar m = p.nParticle()*p.mass();
const scalar pc = td.pc();
const scalar T = p.T();
this->rhokTrans()[celli] += m;
this->UTrans()[celli] += m*p.U();
const auto& comp = this->composition();
const label idG = comp.idGas();
const label idL = comp.idLiquid();
// const label idS = composition.idSolid();
// Absorb parcel into carrier phase
auto transfer = [&]
(
const label phaseType,
const label phasei,
const scalarField& Y
)
{
const scalar YMix = p.Y()[phaseType];
forAll(Y, i)
{
const label gid = comp.localToCarrierId(phaseType, i);
this->rhoTrans(gid)[celli] += m*YMix*Y[i];
this->hsTrans()[celli] += m*YMix*comp.Hs(phasei, Y, pc, T);
}
};
transfer(parcelType::GAS, idG, p.YGas());
transfer(parcelType::LIQ, idL, p.YLiquid());
// No mapping between solid components and carrier phase
//transfer(parcelType::SLD, idS, p.YSolid());
}
// ************************************************************************* //

View File

@ -285,6 +285,14 @@ public:
// Sources
//- Transfer the effect of parcel to the carrier phase
inline void transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// Enthalpy
//- Sensible enthalpy transfer [J/kg]

View File

@ -190,6 +190,19 @@ Foam::ThermoCloud<CloudType>::radAreaPT4() const
}
template<class CloudType>
inline void Foam::ThermoCloud<CloudType>::transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
)
{
CloudType::transferToCarrier(p, td);
hsTrans()[p.cell()] += p.nParticle()*p.mass()*p.hs();
}
template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::ThermoCloud<CloudType>::hsTrans()

View File

@ -311,9 +311,8 @@ bool Foam::KinematicParcel<ParcelType>::move
const scalar trackTime
)
{
typename TrackCloudType::parcelType& p =
static_cast<typename TrackCloudType::parcelType&>(*this);
typename TrackCloudType::parcelType::trackingData& ttd =
auto& p = static_cast<typename TrackCloudType::parcelType&>(*this);
auto& ttd =
static_cast<typename TrackCloudType::parcelType::trackingData&>(td);
ttd.switchProcessor = false;
@ -383,9 +382,10 @@ bool Foam::KinematicParcel<ParcelType>::move
if (p.active() && p.onFace())
{
cloud.functions().postFace(p, ttd.keepParticle);
ttd.keepParticle = cloud.functions().postFace(p, ttd);
}
cloud.functions().postMove(p, dt, start, ttd.keepParticle);
ttd.keepParticle = cloud.functions().postMove(p, dt, start, ttd);
if (p.active() && p.onFace() && ttd.keepParticle)
{
@ -405,13 +405,14 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
trackingData& td
)
{
typename TrackCloudType::parcelType& p =
static_cast<typename TrackCloudType::parcelType&>(*this);
auto& p = static_cast<typename TrackCloudType::parcelType&>(*this);
auto& ttd =
static_cast<typename TrackCloudType::parcelType::trackingData&>(td);
const polyPatch& pp = p.mesh().boundaryMesh()[p.patch()];
// Invoke post-processing model
cloud.functions().postPatch(p, pp, td.keepParticle);
td.keepParticle = cloud.functions().postPatch(p, pp, ttd);
if (isA<processorPolyPatch>(pp))
{

View File

@ -109,33 +109,39 @@ void Foam::CloudFunctionObject<CloudType>::postEvolve
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::postMove
bool Foam::CloudFunctionObject<CloudType>::postMove
(
parcelType&,
const scalar,
const point&,
bool&
const typename parcelType::trackingData& td
)
{}
{
return true;
}
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::postPatch
bool Foam::CloudFunctionObject<CloudType>::postPatch
(
const parcelType&,
const polyPatch&,
bool&
const typename parcelType::trackingData& td
)
{}
{
return true;
}
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::postFace
bool Foam::CloudFunctionObject<CloudType>::postFace
(
const parcelType&,
bool&
const typename parcelType::trackingData& td
)
{}
{
return true;
}
template<class CloudType>

View File

@ -159,27 +159,27 @@ public:
);
//- Post-move hook
virtual void postMove
virtual bool postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
);
//- Post-patch hook
virtual void postPatch
virtual bool postPatch
(
const parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
);
//- Post-face hook
virtual void postFace
virtual bool postFace
(
const parcelType& p,
bool& keepParticle
const typename parcelType::trackingData& td
);

View File

@ -110,9 +110,9 @@ void Foam::CloudFunctionObjectList<CloudType>::preEvolve
const typename parcelType::trackingData& td
)
{
forAll(*this, i)
for (auto& cfo : *this)
{
this->operator[](i).preEvolve(td);
cfo.preEvolve(td);
}
}
@ -123,70 +123,71 @@ void Foam::CloudFunctionObjectList<CloudType>::postEvolve
const typename parcelType::trackingData& td
)
{
forAll(*this, i)
for (auto& cfo : *this)
{
this->operator[](i).postEvolve(td);
cfo.postEvolve(td);
}
}
template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::postMove
bool Foam::CloudFunctionObjectList<CloudType>::postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
)
{
forAll(*this, i)
for (auto& cfo : *this)
{
if (!keepParticle)
if (!cfo.postMove(p, dt, position0, td))
{
return;
return false;
}
}
this->operator[](i).postMove(p, dt, position0, keepParticle);
}
return true;
}
template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::postPatch
bool Foam::CloudFunctionObjectList<CloudType>::postPatch
(
const parcelType& p,
parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
)
{
forAll(*this, i)
for (auto& cfo : *this)
{
if (!keepParticle)
if (!cfo.postPatch(p, pp, td))
{
return;
return false;
}
}
this->operator[](i).postPatch(p, pp, keepParticle);
}
return true;
}
template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::postFace
bool Foam::CloudFunctionObjectList<CloudType>::postFace
(
const parcelType& p,
bool& keepParticle
parcelType& p,
const typename parcelType::trackingData& td
)
{
forAll(*this, i)
for (auto& cfo : *this)
{
if (!keepParticle)
if (!cfo.postFace(p, td))
{
return;
return false;
}
this->operator[](i).postFace(p, keepParticle);
}
return true;
}

View File

@ -125,27 +125,27 @@ public:
);
//- Post-move hook
virtual void postMove
virtual bool postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
);
//- Post-patch hook
virtual void postPatch
virtual bool postPatch
(
const parcelType& p,
parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
);
//- Post-face hook
virtual void postFace
virtual bool postFace
(
const parcelType& p,
bool& keepParticle
parcelType& p,
const typename parcelType::trackingData& td
);
};

View File

@ -263,12 +263,14 @@ Foam::FaceInteraction<CloudType>::FaceInteraction
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::FaceInteraction<CloudType>::postFace
bool Foam::FaceInteraction<CloudType>::postFace
(
const parcelType& p,
bool& keepParticle
const typename parcelType::trackingData& td
)
{
bool keepParticle = true;
const auto& fzm = this->owner().mesh().faceZones();
forAll(faceZoneIDs_, i)
@ -322,8 +324,9 @@ void Foam::FaceInteraction<CloudType>::postFace
}
}
}
return keepParticle;
}
// ************************************************************************* //

View File

@ -182,7 +182,11 @@ public:
// Member Functions
//- Post-face hook
virtual void postFace(const parcelType& p, bool& keepParticle);
virtual bool postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
);
};

View File

@ -350,7 +350,11 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::FacePostProcessing<CloudType>::postFace(const parcelType& p, bool&)
bool Foam::FacePostProcessing<CloudType>::postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
)
{
if
(
@ -380,6 +384,8 @@ void Foam::FacePostProcessing<CloudType>::postFace(const parcelType& p, bool&)
}
}
}
return true;
}

View File

@ -158,7 +158,11 @@ public:
inline bool resetOnWrite() const;
//- Post-face hook
virtual void postFace(const parcelType& p, bool& keepParticle);
virtual bool postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
);
};

View File

@ -629,17 +629,19 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::ParticleCollector<CloudType>::postMove
bool Foam::ParticleCollector<CloudType>::postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
)
{
bool keepParticle = true;
if ((parcelType_ != -1) && (parcelType_ != p.typeId()))
{
return;
return keepParticle;
}
hitFaceIDs_.clear();
@ -708,6 +710,8 @@ void Foam::ParticleCollector<CloudType>::postMove
keepParticle = false;
}
}
return keepParticle;
}

View File

@ -282,12 +282,12 @@ public:
inline bool resetOnWrite() const;
//- Post-move hook
virtual void postMove
virtual bool postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
);
};

View File

@ -159,11 +159,11 @@ void Foam::ParticleErosion<CloudType>::preEvolve
template<class CloudType>
void Foam::ParticleErosion<CloudType>::postPatch
bool Foam::ParticleErosion<CloudType>::postPatch
(
const parcelType& p,
const polyPatch& pp,
bool&
const typename parcelType::trackingData& td
)
{
const label patchi = pp.index();
@ -184,7 +184,7 @@ void Foam::ParticleErosion<CloudType>::postPatch
// quick reject if particle travelling away from the patch
if ((nw & U) < 0)
{
return;
return true;
}
const scalar magU = mag(U);
@ -206,6 +206,8 @@ void Foam::ParticleErosion<CloudType>::postPatch
Q += coeff*(K_*sqr(cos(alpha))/6.0);
}
}
return true;
}

View File

@ -140,11 +140,11 @@ public:
);
//- Post-patch hook
virtual void postPatch
virtual bool postPatch
(
const parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
);
};

View File

@ -136,16 +136,16 @@ Foam::ParticleHistogram<CloudType>::ParticleHistogram
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::ParticleHistogram<CloudType>::postPatch
bool Foam::ParticleHistogram<CloudType>::postPatch
(
const parcelType& p,
const polyPatch& pp,
bool&
const typename parcelType::trackingData& td
)
{
if (!collector_.isPatch())
{
return;
return true;
}
const label patchi = pp.index();
@ -160,19 +160,21 @@ void Foam::ParticleHistogram<CloudType>::postPatch
dParticles_[localPatchi].append(p.d());
nParticles_[localPatchi].append(p.nParticle());
}
return true;
}
template<class CloudType>
void Foam::ParticleHistogram<CloudType>::postFace
bool Foam::ParticleHistogram<CloudType>::postFace
(
const parcelType& p,
bool&
const typename parcelType::trackingData& td
)
{
if (collector_.isPatch())
{
return;
return true;
}
const labelList& IDs = collector_.IDs();
@ -200,6 +202,8 @@ void Foam::ParticleHistogram<CloudType>::postFace
nParticles_[i].append(p.nParticle());
}
}
return true;
}

View File

@ -200,15 +200,19 @@ public:
// Evaluation
//- Post-patch hook
virtual void postPatch
virtual bool postPatch
(
const parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
);
//- Post-face hook
virtual void postFace(const parcelType& p, bool& keepParticle);
virtual bool postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// I-O

View File

@ -111,16 +111,16 @@ Foam::ParticlePostProcessing<CloudType>::ParticlePostProcessing
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::ParticlePostProcessing<CloudType>::postPatch
bool Foam::ParticlePostProcessing<CloudType>::postPatch
(
const parcelType& p,
const polyPatch& pp,
bool&
const typename parcelType::trackingData& td
)
{
if (!collector_.isPatch())
{
return;
return true;
}
const label patchi = pp.index();
@ -143,19 +143,21 @@ void Foam::ParticlePostProcessing<CloudType>::postPatch
data_[localPatchi].append(data.str());
}
return true;
}
template<class CloudType>
void Foam::ParticlePostProcessing<CloudType>::postFace
bool Foam::ParticlePostProcessing<CloudType>::postFace
(
const parcelType& p,
bool&
const typename parcelType::trackingData& td
)
{
if (collector_.isPatch())
{
return;
return true;
}
const labelList& IDs = collector_.IDs();
@ -191,6 +193,8 @@ void Foam::ParticlePostProcessing<CloudType>::postFace
data_[i].append(data.str());
}
}
return true;
}

View File

@ -191,15 +191,19 @@ public:
// Evaluation
//- Post-patch hook
virtual void postPatch
virtual bool postPatch
(
const parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
);
//- Post-face hook
virtual void postFace(const parcelType& p, bool& keepParticle);
virtual bool postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// I-O

View File

@ -105,7 +105,11 @@ void Foam::ParticleTracks<CloudType>::preEvolve
template<class CloudType>
void Foam::ParticleTracks<CloudType>::postFace(const parcelType& p, bool&)
bool Foam::ParticleTracks<CloudType>::postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
)
{
if
(
@ -132,6 +136,8 @@ void Foam::ParticleTracks<CloudType>::postFace(const parcelType& p, bool&)
);
}
}
return true;
}

View File

@ -150,7 +150,11 @@ public:
);
//- Post-face hook
virtual void postFace(const parcelType& p, bool& keepParticle);
virtual bool postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
);
};

View File

@ -103,12 +103,12 @@ void Foam::ParticleTrap<CloudType>::postEvolve
template<class CloudType>
void Foam::ParticleTrap<CloudType>::postMove
bool Foam::ParticleTrap<CloudType>::postMove
(
parcelType& p,
const scalar,
const point&,
bool&
const typename parcelType::trackingData& td
)
{
if (alphaPtr_->primitiveField()[p.cell()] < threshold_)
@ -122,6 +122,8 @@ void Foam::ParticleTrap<CloudType>::postMove
p.U() -= 2*nHat*nHatU;
}
}
return true;
}

View File

@ -140,12 +140,12 @@ public:
);
//- Post-move hook
virtual void postMove
virtual bool postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
);
};

View File

@ -323,12 +323,12 @@ void Foam::ParticleZoneInfo<CloudType>::postEvolve
template<class CloudType>
void Foam::ParticleZoneInfo<CloudType>::postMove
bool Foam::ParticleZoneInfo<CloudType>::postMove
(
parcelType& p,
const scalar dt,
const point&,
bool&
const typename parcelType::trackingData& td
)
{
if (inZone(p.cell()))
@ -346,6 +346,8 @@ void Foam::ParticleZoneInfo<CloudType>::postMove
movedParticles_.append(newData);
}
return true;
}

View File

@ -301,12 +301,12 @@ public:
);
//- Post-move hook
virtual void postMove
virtual bool postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
);
//- Write

View File

@ -139,11 +139,11 @@ Foam::PatchCollisionDensity<CloudType>::PatchCollisionDensity
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::PatchCollisionDensity<CloudType>::postPatch
bool Foam::PatchCollisionDensity<CloudType>::postPatch
(
const parcelType& p,
const polyPatch& pp,
bool&
const typename parcelType::trackingData& td
)
{
const label patchi = pp.index();
@ -158,6 +158,8 @@ void Foam::PatchCollisionDensity<CloudType>::postPatch
collisionDensity_[patchi][patchFacei] +=
1/this->owner().mesh().magSf().boundaryField()[patchi][patchFacei];
}
return true;
}

View File

@ -126,11 +126,11 @@ public:
// Member Functions
//- Post-patch hook
virtual void postPatch
virtual bool postPatch
(
const parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
);
};

View File

@ -170,11 +170,11 @@ void Foam::PatchInteractionFields<CloudType>::preEvolve
template<class CloudType>
void Foam::PatchInteractionFields<CloudType>::postPatch
bool Foam::PatchInteractionFields<CloudType>::postPatch
(
const parcelType& p,
const polyPatch& pp,
bool&
const typename parcelType::trackingData& td
)
{
const label patchi = pp.index();
@ -182,6 +182,8 @@ void Foam::PatchInteractionFields<CloudType>::postPatch
massPtr_->boundaryFieldRef()[patchi][facei] += p.nParticle()*p.mass();
countPtr_->boundaryFieldRef()[patchi][facei] += 1;
return true;
}

View File

@ -173,11 +173,11 @@ public:
);
//- Post-patch hook
virtual void postPatch
virtual bool postPatch
(
const parcelType& p,
const polyPatch& pp,
bool& keepParticle
const typename parcelType::trackingData& td
);
};

View File

@ -248,16 +248,18 @@ Foam::RemoveParcels<CloudType>::RemoveParcels
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::RemoveParcels<CloudType>::postFace
bool Foam::RemoveParcels<CloudType>::postFace
(
const parcelType& p,
bool& keepParticle
const typename parcelType::trackingData& td
)
{
bool keepParticle = true;
if ((typeId_ >= 0) && (p.typeId() != typeId_))
{
// Not processing this particle type
return;
return keepParticle;
}
if
@ -280,6 +282,8 @@ void Foam::RemoveParcels<CloudType>::postFace
}
}
}
return keepParticle;
}

View File

@ -163,7 +163,11 @@ public:
);
//- Post-face hook
virtual void postFace(const parcelType& p, bool& keepParticle);
virtual bool postFace
(
const parcelType& p,
const typename parcelType::trackingData& td
);
};

View File

@ -124,17 +124,19 @@ void Foam::VoidFraction<CloudType>::postEvolve
template<class CloudType>
void Foam::VoidFraction<CloudType>::postMove
bool Foam::VoidFraction<CloudType>::postMove
(
parcelType& p,
const scalar dt,
const point&,
bool&
const typename parcelType::trackingData& td
)
{
volScalarField& theta = thetaPtr_();
theta[p.cell()] += dt*p.nParticle()*p.volume();
return true;
}

View File

@ -128,12 +128,12 @@ public:
);
//- Post-move hook
virtual void postMove
virtual bool postMove
(
parcelType& p,
const scalar dt,
const point& position0,
bool& keepParticle
const typename parcelType::trackingData& td
);
};