Commit c1b07cd1 authored by sergio's avatar sergio
Browse files

BUG: post-processing of parcels on patch interaction models

    Adding check for p.active at the end of KinematicParcel::move.
    p.hitFace() is called only for active parcels.

    Setting to zero the initialization for stored lists of stick and
escape parcels
    in LocalInteraction and StandardWallInteraction models

    NOTE: KinematicParcel::hitPatch counts overall system escaped
    parcels and mass based on polyPatch type and not on type of
    patchInteractionModel. Thus, if a patch is a Wall for fluid
    but escape for parcel the overall report will be wrong but
    the local report for each patch is correct
parent f45c7fb7
......@@ -353,14 +353,14 @@ bool Foam::KinematicParcel<ParcelType>::move
p.age() += dt;
if (p.onFace())
if (p.active() && p.onFace())
{
cloud.functions().postFace(p, ttd.keepParticle);
}
cloud.functions().postMove(p, dt, start, ttd.keepParticle);
if (p.onFace() && ttd.keepParticle)
if (p.active() && p.onFace() && ttd.keepParticle)
{
p.hitFace(s, cloud, ttd);
}
......@@ -399,6 +399,9 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
}
else
{
// This does not take into account the wall interation model
// Just the polyPatch type. Then, a patch type which has 'rebound'
// interation model will count as escaped parcel while it is not
if (!isA<wallPolyPatch>(pp) && !polyPatch::constraintType(pp.type()))
{
cloud.patchInteraction().addToEscapedParcels(nParticle_*mass());
......
......@@ -470,7 +470,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::Eo
)
{
const vector dir = U/max(mag(U), ROOTVSMALL);
return mag(g & dir)*(rho - rhoc)*sqr(d)/max(sigma, ROOTVSMALL);
return mag(g & dir)*mag(rho - rhoc)*sqr(d)/max(sigma, ROOTVSMALL);
}
......
......@@ -334,16 +334,24 @@ void Foam::LocalInteraction<CloudType>::info(Ostream& os)
PatchInteractionModel<CloudType>::info(os);
// retrieve any stored data
labelListList npe0(nEscape_);
this->getModelProperty("nEscape", npe0);
labelListList npe0(patchData_.size());
labelListList mpe0(patchData_.size());
labelListList nps0(patchData_.size());
labelListList mps0(patchData_.size());
forAll(patchData_, patchi)
{
label lsd = nEscape_[patchi].size();
npe0[patchi].setSize(lsd, Zero);
mpe0[patchi].setSize(lsd, Zero);
nps0[patchi].setSize(lsd, Zero);
mps0[patchi].setSize(lsd, Zero);
}
scalarListList mpe0(massEscape_);
this->getModelProperty("nEscape", npe0);
this->getModelProperty("massEscape", mpe0);
labelListList nps0(nStick_);
this->getModelProperty("nStick", nps0);
scalarListList mps0(massStick_);
this->getModelProperty("massStick", mps0);
// accumulate current data
......
......@@ -248,16 +248,23 @@ void Foam::StandardWallInteraction<CloudType>::info(Ostream& os)
{
PatchInteractionModel<CloudType>::info(os);
labelListList npe0(nEscape_);
labelListList npe0(nEscape_.size());
labelListList mpe0(nEscape_.size());
labelListList nps0(nEscape_.size());
labelListList mps0(nEscape_.size());
forAll(nEscape_, patchi)
{
label lsd = nEscape_[patchi].size();
npe0[patchi].setSize(lsd, Zero);
mpe0[patchi].setSize(lsd, Zero);
nps0[patchi].setSize(lsd, Zero);
mps0[patchi].setSize(lsd, Zero);
}
this->getModelProperty("nEscape", npe0);
scalarListList mpe0(massEscape_);
this->getModelProperty("massEscape", mpe0);
labelListList nps0(nStick_);
this->getModelProperty("nStick", nps0);
scalarListList mps0(massStick_);
this->getModelProperty("massStick", mps0);
// Accumulate current data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment