BUG: Corrected lagrangian function object postPatch normal dir - mantis #580

This commit is contained in:
andy
2012-08-01 15:42:51 +01:00
parent 7d5b4d8000
commit e1d2e82ddc
10 changed files with 48 additions and 34 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -363,7 +363,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
static_cast<typename TrackData::cloudType::parcelType&>(*this);
// Invoke post-processing model
td.cloud().functions().postPatch(p, patchI, pp.whichFace(p.face()));
td.cloud().functions().postPatch(p, pp, trackFraction, tetIs);
// Invoke surface film model
if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle))

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,8 +107,9 @@ template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::postPatch
(
const typename CloudType::parcelType&,
const label,
const label
const polyPatch&,
const scalar,
const tetIndices&
)
{
// do nothing

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -141,8 +141,9 @@ public:
virtual void postPatch
(
const typename CloudType::parcelType& p,
const label patchI,
const label patchFaceI
const polyPatch& pp,
const scalar trackFraction,
const tetIndices& testIs
);
//- Post-face hook

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -146,13 +146,14 @@ template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::postPatch
(
const typename CloudType::parcelType& p,
const label patchI,
const label patchFaceI
const polyPatch& pp,
const scalar trackFraction,
const tetIndices& tetIs
)
{
forAll(*this, i)
{
this->operator[](i).postPatch(p, patchI, patchFaceI);
this->operator[](i).postPatch(p, pp, trackFraction, tetIs);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -121,8 +121,9 @@ public:
virtual void postPatch
(
const typename CloudType::parcelType& p,
const label patchI,
const label patchFaceI
const polyPatch& pp,
const scalar trackFraction,
const tetIndices& tetIs
);
//- Post-face hook

View File

@ -166,29 +166,32 @@ template<class CloudType>
void Foam::ParticleErosion<CloudType>::postPatch
(
const parcelType& p,
const label patchI,
const label patchFaceI
const polyPatch& pp,
const scalar trackFraction,
const tetIndices& tetIs
)
{
const label patchI = pp.index();
const label localPatchI = applyToPatch(patchI);
if (localPatchI != -1)
{
const fvMesh& mesh = this->owner().mesh();
vector nw;
vector Up;
// patch-normal direction
vector nw = p.currentTetIndices().faceTri(mesh).normal();
this->owner().patchData(p, pp, trackFraction, tetIs, nw, Up);
// particle direction of travel
const vector& U = p.U();
// particle velocity reletive to patch
const vector& U = p.U() - Up;
// quick reject if particle travelling away from the patch
if ((-nw & U) < 0)
if ((nw & U) < 0)
{
return;
}
nw /= mag(nw);
const scalar magU = mag(U);
const vector Udir = U/magU;
@ -197,6 +200,7 @@ void Foam::ParticleErosion<CloudType>::postPatch
const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_);
const label patchFaceI = pp.whichFace(p.face());
scalar& Q = QPtr_->boundaryField()[patchI][patchFaceI];
if (tan(alpha) < K_/6.0)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -126,8 +126,9 @@ public:
virtual void postPatch
(
const parcelType& p,
const label patchI,
const label patchFaceI
const polyPatch& pp,
const scalar trackFraction,
const tetIndices& tetIs
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -218,11 +218,14 @@ template<class CloudType>
void Foam::PatchPostProcessing<CloudType>::postPatch
(
const parcelType& p,
const label patchI,
const label
const polyPatch& pp,
const scalar,
const tetIndices& tetIs
)
{
const label patchI = pp.index();
const label localPatchI = applyToPatch(patchI);
if (localPatchI != -1 && patchData_[localPatchI].size() < maxStoredParcels_)
{
times_[localPatchI].append(this->owner().time().value());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -127,8 +127,9 @@ public:
virtual void postPatch
(
const parcelType& p,
const label patchI,
const label patchFaceI
const polyPatch& pp,
const scalar trackFraction,
const tetIndices& tetIs
);
};

View File

@ -306,8 +306,9 @@ void Foam::PairCollision<CloudType>::wallInteraction()
this->owner().functions().postPatch
(
p,
patchI,
patchFaceI
mesh.boundaryMesh()[patchI],
1.0,
p.currentTetIndices()
);
}
}