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