Commit fa911033 authored by andy's avatar andy
Browse files

BUG: corrected wallImpactDistance/hasWallImpactDistance functionality

ENH: Propagated virtual mechanism through to derived types
parent 67a819bc
......@@ -207,7 +207,7 @@ public:
//- Switch to specify if particles of the cloud can return
// non-zero wall distance values. By default, assume
// that they can't (default for wallImpactDistance in
// Particle is 0.0).
// particle is 0.0).
virtual bool hasWallImpactDistance() const
{
return false;
......
......@@ -130,6 +130,14 @@ void Foam::particle::transformProperties(const vector&)
{}
Foam::scalar Foam::particle::wallImpactDistance(const vector&) const
{
Info<< "particle::wallImpactDistance" << endl;
return 0.0;
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
bool Foam::operator==(const particle& pA, const particle& pB)
......
......@@ -38,7 +38,6 @@ Description
#include "labelList.H"
#include "pointField.H"
#include "faceList.H"
//#include "typeInfo.H"
#include "OFstream.H"
#include "tetPointRef.H"
#include "FixedList.H"
......@@ -445,10 +444,6 @@ public:
const label faceI
) const;
//- The nearest distance to a wall that
// the particle can be in the n direction
inline scalar wallImpactDistance(const vector& n) const;
//- Return the fraction of time-step completed
inline scalar& stepFraction();
......@@ -508,6 +503,10 @@ public:
// according to the given separation vector
virtual void transformProperties(const vector& separation);
//- The nearest distance to a wall that
// the particle can be in the n direction
virtual scalar wallImpactDistance(const vector& n) const;
// Parallel transfer
......
......@@ -888,7 +888,6 @@ bool Foam::particle::boundaryFace(const label faceI) const
inline Foam::label Foam::particle::patch(const label faceI) const
{
// return cloud_.facePatch(faceI);
return mesh_.boundaryMesh().whichPatch(faceI);
}
......@@ -899,18 +898,10 @@ inline Foam::label Foam::particle::patchFace
const label faceI
) const
{
// return cloud_.patchFace(patchI, faceI);
return mesh_.boundaryMesh()[patchI].whichFace(faceI);
}
inline Foam::scalar
Foam::particle::wallImpactDistance(const vector&) const
{
return 0.0;
}
inline Foam::label Foam::particle::faceInterpolation() const
{
return faceI_;
......
......@@ -689,11 +689,15 @@ void Foam::particle::hitWallFaces
tetIndices& closestTetIs
)
{
typedef typename CloudType::particleType particleType;
if (!(cloud.hasWallImpactDistance() && cloud.cellHasWallFaces()[cellI_]))
{
return;
}
particleType& p = static_cast<particleType&>(*this);
const faceList& pFaces = mesh_.faces();
const Foam::cell& thisCell = mesh_.cells()[cellI_];
......@@ -734,7 +738,7 @@ void Foam::particle::hitWallFaces
// triangle. Assuming that the wallImpactDistance
// does not change as the particle or the mesh moves
// forward in time.
scalar r = wallImpactDistance(nHat);
scalar r = p.wallImpactDistance(nHat);
vector toPlusRNHat = to + r*nHat;
......
......@@ -52,8 +52,9 @@ class parcel
{
// Private member data
// Reference to the names of the liquid components
List<word> liquidComponents_;
//- Reference to the names of the liquid components
List<word> liquidComponents_;
// Defining data (read and written to field files)
......@@ -384,11 +385,11 @@ public:
//- Transform the position and physical properties of the particle
// according to the given transformation tensor
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
//- Transform the position and physical properties of the particle
// according to the given separation vector
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
//- fix the 2D plane normal,
// when particle hits a face it is slightly perturbed
......
......@@ -293,11 +293,11 @@ public:
//- Transform the physical properties of the particle
// according to the given transformation tensor
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
//- Transform the physical properties of the particle
// according to the given separation vector
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
// I-O
......
......@@ -157,6 +157,13 @@ Foam::CollidingCloud<CloudType>::~CollidingCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::CollidingCloud<CloudType>::hasWallImpactDistance() const
{
return !collision().controlsWallInteraction();
}
template<class CloudType>
void Foam::CollidingCloud<CloudType>::storeState()
{
......
......@@ -180,7 +180,7 @@ public:
// then the wall impact distance should be zero.
// Otherwise, it should be allowed to be the value from
// the Parcel.
inline bool hasWallImpactDistance() const;
virtual bool hasWallImpactDistance() const;
// Sub-models
......
......@@ -33,13 +33,6 @@ Foam::CollidingCloud<CloudType>::cloudCopy() const
}
template<class CloudType>
inline bool Foam::CollidingCloud<CloudType>::hasWallImpactDistance() const
{
return !collision().controlsWallInteraction();
}
template<class CloudType>
inline const Foam::CollisionModel<Foam::CollidingCloud<CloudType> >&
Foam::CollidingCloud<CloudType>::collision() const
......
......@@ -491,6 +491,13 @@ Foam::KinematicCloud<CloudType>::~KinematicCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::KinematicCloud<CloudType>::hasWallImpactDistance() const
{
return true;
}
template<class CloudType>
void Foam::KinematicCloud<CloudType>::checkParcelProperties
(
......
......@@ -304,6 +304,10 @@ public:
//- Return a reference to the cloud copy
inline const KinematicCloud& cloudCopy() const;
//- Switch to specify if particles of the cloud can return
// non-zero wall distance values - true for kinematic parcels
virtual bool hasWallImpactDistance() const;
// References to the mesh and databases
......
......@@ -470,6 +470,16 @@ void Foam::KinematicParcel<ParcelType>::transformProperties
}
template<class ParcelType>
Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
(
const vector&
) const
{
return 0.5*d_;
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "KinematicParcelIO.C"
......
......@@ -496,10 +496,6 @@ public:
// Helper functions
//- The nearest distance to a wall that
// the particle can be in the n direction
inline scalar wallImpactDistance(const vector& n) const;
//- Return the index of the face to be used in the interpolation
// routine
inline label faceInterpolation() const;
......@@ -631,11 +627,15 @@ public:
//- Transform the physical properties of the particle
// according to the given transformation tensor
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
//- Transform the physical properties of the particle
// according to the given separation vector
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
//- The nearest distance to a wall that the particle can be
// in the n direction
virtual scalar wallImpactDistance(const vector& n) const;
// I-O
......
......@@ -421,16 +421,6 @@ inline Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb()
}
template<class ParcelType>
inline Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
(
const vector&
) const
{
return 0.5*d_;
}
template<class ParcelType>
inline Foam::label Foam::KinematicParcel<ParcelType>::faceInterpolation() const
{
......
......@@ -281,9 +281,9 @@ public:
bool move(trackingData&, const scalar trackTime);
void transformProperties(const tensor& T);
virtual void transformProperties(const tensor& T);
void transformProperties(const vector& separation);
virtual void transformProperties(const vector& separation);
void setSitePositions(const constantProperties& constProps);
......
......@@ -171,4 +171,10 @@ void Foam::solidParticle::transformProperties(const vector& separation)
}
Foam::scalar Foam::solidParticle::wallImpactDistance(const vector&) const
{
return 0.5*d_;
}
// ************************************************************************* //
......@@ -174,10 +174,6 @@ public:
//- Return velocity
inline const vector& U() const;
//- The nearest distance to a wall that
// the particle can be in the n direction
inline scalar wallImpactDistance(const vector& n) const;
// Tracking
......@@ -223,17 +219,15 @@ public:
//- Transform the physical properties of the particle
// according to the given transformation tensor
void transformProperties
(
const tensor& T
);
virtual void transformProperties(const tensor& T);
//- Transform the physical properties of the particle
// according to the given separation vector
void transformProperties
(
const vector& separation
);
virtual void transformProperties(const vector& separation);
//- The nearest distance to a wall that
// the particle can be in the n direction
virtual scalar wallImpactDistance(const vector& n) const;
// I-O
......
......@@ -28,14 +28,6 @@ License
#include "volFields.H"
#include "interpolationCellPoint.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// defineParticleTypeNameAndDebug(solidParticle, 0);
// defineTemplateTypeNameAndDebug(Cloud<solidParticle>, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidParticleCloud::solidParticleCloud
......@@ -71,6 +63,12 @@ Foam::solidParticleCloud::solidParticleCloud
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::solidParticleCloud::hasWallImpactDistance() const
{
return true;
}
void Foam::solidParticleCloud::move(const dimensionedVector& g)
{
const volScalarField& rho = mesh_.lookupObject<const volScalarField>("rho");
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -94,7 +94,7 @@ public:
// Access
inline bool hasWallImpactDistance() const;
virtual bool hasWallImpactDistance() const;
inline const fvMesh& mesh() const;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -25,12 +25,6 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::solidParticleCloud::hasWallImpactDistance() const
{
return true;
}
inline const Foam::fvMesh& Foam::solidParticleCloud::mesh() const
{
return mesh_;
......
......@@ -93,12 +93,6 @@ inline Foam::scalar Foam::solidParticle::d() const
}
inline Foam::scalar Foam::solidParticle::wallImpactDistance(const vector&) const
{
return 0.5*d_;
}
inline const Foam::vector& Foam::solidParticle::U() const
{
return U_;
......
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