Commit b8440c42 authored by Will Bainbridge's avatar Will Bainbridge Committed by Andrew Heather
Browse files

lagrangian: Removed unnecessary patch argument from hit methods

The patch can be determined from the particle when it is needed. Most of
the time it is not.
parent d8782db6
......@@ -121,12 +121,7 @@ bool Foam::findCellParticle::move
}
bool Foam::findCellParticle::hitPatch
(
const polyPatch&,
Cloud<findCellParticle>& cloud,
trackingData& td
)
bool Foam::findCellParticle::hitPatch(Cloud<findCellParticle>&, trackingData&)
{
return false;
}
......@@ -134,8 +129,7 @@ bool Foam::findCellParticle::hitPatch
void Foam::findCellParticle::hitWedgePatch
(
const wedgePolyPatch&,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td
)
{
......@@ -146,8 +140,7 @@ void Foam::findCellParticle::hitWedgePatch
void Foam::findCellParticle::hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td
)
{
......@@ -158,8 +151,7 @@ void Foam::findCellParticle::hitSymmetryPlanePatch
void Foam::findCellParticle::hitSymmetryPatch
(
const symmetryPolyPatch&,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td
)
{
......@@ -170,8 +162,7 @@ void Foam::findCellParticle::hitSymmetryPatch
void Foam::findCellParticle::hitCyclicPatch
(
const cyclicPolyPatch&,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td
)
{
......@@ -182,8 +173,7 @@ void Foam::findCellParticle::hitCyclicPatch
void Foam::findCellParticle::hitCyclicAMIPatch
(
const cyclicAMIPolyPatch&,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td,
const vector&
)
......@@ -195,8 +185,7 @@ void Foam::findCellParticle::hitCyclicAMIPatch
void Foam::findCellParticle::hitCyclicACMIPatch
(
const cyclicACMIPolyPatch&,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td,
const vector&
)
......@@ -208,8 +197,7 @@ void Foam::findCellParticle::hitCyclicACMIPatch
void Foam::findCellParticle::hitProcessorPatch
(
const processorPolyPatch&,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td
)
{
......@@ -220,8 +208,7 @@ void Foam::findCellParticle::hitProcessorPatch
void Foam::findCellParticle::hitWallPatch
(
const wallPolyPatch& wpp,
Cloud<findCellParticle>& cloud,
Cloud<findCellParticle>&,
trackingData& td
)
{
......
......@@ -222,84 +222,46 @@ public:
//- Track all particles to their end point
bool move(Cloud<findCellParticle>&, trackingData&, const scalar);
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
bool hitPatch
(
const polyPatch&,
Cloud<findCellParticle>&,
trackingData& td
);
bool hitPatch(Cloud<findCellParticle>&, trackingData&);
//- Overridable function to handle the particle hitting a wedge
void hitWedgePatch
(
const wedgePolyPatch&,
Cloud<findCellParticle>&,
trackingData& td
);
void hitWedgePatch(Cloud<findCellParticle>&, trackingData&);
//- Overridable function to handle the particle hitting a
// symmetry plane
void hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
Cloud<findCellParticle>&,
trackingData& td
);
void hitSymmetryPlanePatch(Cloud<findCellParticle>&, trackingData&);
//- Overridable function to handle the particle hitting a
// symmetry patch
void hitSymmetryPatch
(
const symmetryPolyPatch&,
Cloud<findCellParticle>&,
trackingData& td
);
void hitSymmetryPatch(Cloud<findCellParticle>&, trackingData&);
//- Overridable function to handle the particle hitting a cyclic
void hitCyclicPatch
(
const cyclicPolyPatch&,
Cloud<findCellParticle>&,
trackingData& td
);
void hitCyclicPatch(Cloud<findCellParticle>&, trackingData&);
//- Overridable function to handle the particle hitting a cyclicAMI
void hitCyclicAMIPatch
(
const cyclicAMIPolyPatch&,
Cloud<findCellParticle>& cloud,
trackingData& td,
Cloud<findCellParticle>&,
trackingData&,
const vector&
);
//- Overridable function to handle the particle hitting a cyclicACMI
void hitCyclicACMIPatch
(
const cyclicACMIPolyPatch&,
Cloud<findCellParticle>& cloud,
trackingData& td,
Cloud<findCellParticle>&,
trackingData&,
const vector&
);
//- Overridable function to handle the particle hitting a
//- processorPatch
void hitProcessorPatch
(
const processorPolyPatch&,
Cloud<findCellParticle>&,
trackingData& td
);
void hitProcessorPatch(Cloud<findCellParticle>&, trackingData&);
//- Overridable function to handle the particle hitting a wallPatch
void hitWallPatch
(
const wallPolyPatch&,
Cloud<findCellParticle>&,
trackingData& td
);
void hitWallPatch(Cloud<findCellParticle>&, trackingData&);
// Ostream Operator
......
......@@ -265,12 +265,7 @@ bool Foam::streamLineParticle::move
}
bool Foam::streamLineParticle::hitPatch
(
const polyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
)
bool Foam::streamLineParticle::hitPatch(streamLineParticleCloud&, trackingData&)
{
// Disable generic patch interaction
return false;
......@@ -279,8 +274,7 @@ bool Foam::streamLineParticle::hitPatch
void Foam::streamLineParticle::hitWedgePatch
(
const wedgePolyPatch& pp,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td
)
{
......@@ -291,8 +285,7 @@ void Foam::streamLineParticle::hitWedgePatch
void Foam::streamLineParticle::hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch& pp,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td
)
{
......@@ -303,8 +296,7 @@ void Foam::streamLineParticle::hitSymmetryPlanePatch
void Foam::streamLineParticle::hitSymmetryPatch
(
const symmetryPolyPatch& pp,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td
)
{
......@@ -315,8 +307,7 @@ void Foam::streamLineParticle::hitSymmetryPatch
void Foam::streamLineParticle::hitCyclicPatch
(
const cyclicPolyPatch& pp,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td
)
{
......@@ -327,8 +318,7 @@ void Foam::streamLineParticle::hitCyclicPatch
void Foam::streamLineParticle::hitCyclicAMIPatch
(
const cyclicAMIPolyPatch&,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td,
const vector&
)
......@@ -340,8 +330,7 @@ void Foam::streamLineParticle::hitCyclicAMIPatch
void Foam::streamLineParticle::hitCyclicACMIPatch
(
const cyclicACMIPolyPatch&,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td,
const vector&
)
......@@ -353,8 +342,7 @@ void Foam::streamLineParticle::hitCyclicACMIPatch
void Foam::streamLineParticle::hitProcessorPatch
(
const processorPolyPatch&,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td
)
{
......@@ -365,8 +353,7 @@ void Foam::streamLineParticle::hitProcessorPatch
void Foam::streamLineParticle::hitWallPatch
(
const wallPolyPatch& wpp,
streamLineParticleCloud& cloud,
streamLineParticleCloud&,
trackingData& td
)
{
......
......@@ -207,63 +207,32 @@ public:
// Tracking
//- Track all particles to their end point
bool move
(
streamLineParticleCloud& cloud,
trackingData&,
const scalar
);
bool move(streamLineParticleCloud&, trackingData&, const scalar);
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
bool hitPatch
(
const polyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
);
bool hitPatch(streamLineParticleCloud&, trackingData&);
//- Overridable function to handle the particle hitting a wedge
void hitWedgePatch
(
const wedgePolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
);
void hitWedgePatch(streamLineParticleCloud&, trackingData&);
//- Overridable function to handle the particle hitting a
// symmetry plane
void hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
);
void hitSymmetryPlanePatch(streamLineParticleCloud&, trackingData&);
//- Overridable function to handle the particle hitting a
// symmetry patch
void hitSymmetryPatch
(
const symmetryPolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
);
void hitSymmetryPatch(streamLineParticleCloud&, trackingData&);
//- Overridable function to handle the particle hitting a cyclic
void hitCyclicPatch
(
const cyclicPolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
);
void hitCyclicPatch(streamLineParticleCloud&, trackingData&);
//- Overridable function to handle the particle hitting a
// cyclicAMIPatch
void hitCyclicAMIPatch
(
const cyclicAMIPolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td,
streamLineParticleCloud&,
trackingData&,
const vector& direction
);
......@@ -271,28 +240,17 @@ public:
// cyclicACMIPatch
void hitCyclicACMIPatch
(
const cyclicACMIPolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td,
streamLineParticleCloud&,
trackingData&,
const vector& direction
);
//- Overridable function to handle the particle hitting a
//- processorPatch
void hitProcessorPatch
(
const processorPolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
);
void hitProcessorPatch(streamLineParticleCloud&, trackingData&);
//- Overridable function to handle the particle hitting a wallPatch
void hitWallPatch
(
const wallPolyPatch&,
streamLineParticleCloud& cloud,
trackingData& td
);
void hitWallPatch(streamLineParticleCloud&, trackingData&);
// I-O
......
......@@ -81,12 +81,7 @@ bool Foam::DSMCParcel<ParcelType>::move
template<class ParcelType>
template<class TrackCloudType>
bool Foam::DSMCParcel<ParcelType>::hitPatch
(
const polyPatch&,
TrackCloudType& cloud,
trackingData& td
)
bool Foam::DSMCParcel<ParcelType>::hitPatch(TrackCloudType&, trackingData&)
{
return false;
}
......@@ -96,8 +91,7 @@ template<class ParcelType>
template<class TrackCloudType>
void Foam::DSMCParcel<ParcelType>::hitProcessorPatch
(
const processorPolyPatch&,
TrackCloudType& cloud,
TrackCloudType&,
trackingData& td
)
{
......@@ -109,14 +103,19 @@ template<class ParcelType>
template<class TrackCloudType>
void Foam::DSMCParcel<ParcelType>::hitWallPatch
(
const wallPolyPatch& wpp,
TrackCloudType& cloud,
trackingData& td
trackingData&
)
{
label wppIndex = wpp.index();
const label wppIndex = this->patch();
label wppLocalFace = wpp.whichFace(this->face());
const wallPolyPatch& wpp =
static_cast<const wallPolyPatch&>
(
this->mesh().boundaryMesh()[wppIndex]
);
const label wppLocalFace = wpp.whichFace(this->face());
const scalar fA = mag(wpp.faceAreas()[wppLocalFace]);
......@@ -155,11 +154,7 @@ void Foam::DSMCParcel<ParcelType>::hitWallPatch
// pre-interaction momentum
vector preIMom = m*U_;
cloud.wallInteraction().correct
(
static_cast<DSMCParcel<ParcelType> &>(*this),
wpp
);
cloud.wallInteraction().correct(*this);
U_dot_nw = U_ & nw;
......@@ -194,7 +189,6 @@ void Foam::DSMCParcel<ParcelType>::hitWallPatch
cloud.qBF()[wppIndex][wppLocalFace] += deltaQ;
cloud.fDBF()[wppIndex][wppLocalFace] += deltaFD;
}
......
......@@ -260,31 +260,16 @@ public:
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
template<class TrackCloudType>
bool hitPatch
(
const polyPatch&,
TrackCloudType& cloud,
trackingData& td
);
bool hitPatch(TrackCloudType&, trackingData&);
//- Overridable function to handle the particle hitting a
// processorPatch
template<class TrackCloudType>
void hitProcessorPatch
(
const processorPolyPatch&,
TrackCloudType& cloud,
trackingData& td
);
void hitProcessorPatch(TrackCloudType&, trackingData&);
//- Overridable function to handle the particle hitting a wallPatch
template<class TrackCloudType>
void hitWallPatch
(
const wallPolyPatch&,
TrackCloudType& cloud,
trackingData& td
);
void hitWallPatch(TrackCloudType&, trackingData&);
//- Transform the physical properties of the particle
// according to the given transformation tensor
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -53,8 +53,7 @@ Foam::MaxwellianThermal<CloudType>::~MaxwellianThermal()
template<class CloudType>
void Foam::MaxwellianThermal<CloudType>::correct
(
typename CloudType::parcelType& p,
const wallPolyPatch& wpp
typename CloudType::parcelType& p
)
{
vector& U = p.U();
......@@ -63,7 +62,9 @@ void Foam::MaxwellianThermal<CloudType>::correct
label typeId = p.typeId();
label wppIndex = wpp.index();
const label wppIndex = p.patch();
const polyPatch& wpp = p.mesh().boundaryMesh()[wppIndex];
label wppLocalFace = wpp.whichFace(p.face());
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -72,11 +72,7 @@ public:
// Member Functions
//- Apply wall correction
virtual void correct
(
typename CloudType::parcelType& p,
const wallPolyPatch& wpp
);
virtual void correct(typename CloudType::parcelType& p);
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -51,8 +51,7 @@ Foam::MixedDiffuseSpecular<CloudType>::~MixedDiffuseSpecular()
template<class CloudType>
void Foam::MixedDiffuseSpecular<CloudType>::correct
(
typename CloudType::parcelType& p,
const wallPolyPatch& wpp
typename CloudType::parcelType& p
)
{
vector& U = p.U();
......@@ -61,7 +60,9 @@ void Foam::MixedDiffuseSpecular<CloudType>::correct
label typeId = p.typeId();
label wppIndex = wpp.index();
const label wppIndex = p.patch();
const polyPatch& wpp = p.mesh().boundaryMesh()[wppIndex];
label wppLocalFace = wpp.whichFace(p.face());
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -80,11 +80,7 @@ public:
// Member Functions
//- Apply wall correction
virtual void correct
(
typename CloudType::parcelType& p,
const wallPolyPatch& wpp
);
virtual void correct(typename CloudType::parcelType& p);
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -52,8 +52,7 @@ Foam::SpecularReflection<CloudType>::~SpecularReflection()
template<class CloudType>
void Foam::SpecularReflection<CloudType>::correct
(
typename CloudType::parcelType& p,