mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated utilities using lagrangian classes
This commit is contained in:
@ -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
|
||||||
@ -100,7 +100,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
|||||||
(
|
(
|
||||||
new passiveParticle
|
new passiveParticle
|
||||||
(
|
(
|
||||||
positions_,
|
procMesh,
|
||||||
ppi.position(),
|
ppi.position(),
|
||||||
procCelli,
|
procCelli,
|
||||||
false
|
false
|
||||||
@ -112,7 +112,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
|||||||
|
|
||||||
particleIndices_.setSize(pi);
|
particleIndices_.setSize(pi);
|
||||||
|
|
||||||
IOPosition<passiveParticle>(positions_).write();
|
IOPosition<Cloud<passiveParticle> >(positions_).write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
@ -24,8 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "MapLagrangianFields.H"
|
#include "MapLagrangianFields.H"
|
||||||
#include "Cloud.H"
|
#include "passiveParticleCloud.H"
|
||||||
#include "passiveParticle.H"
|
|
||||||
#include "meshSearch.H"
|
#include "meshSearch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -44,7 +43,9 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
|
|||||||
label tetFaceI = -1;
|
label tetFaceI = -1;
|
||||||
label tetPtI = -1;
|
label tetPtI = -1;
|
||||||
|
|
||||||
cloud.findCellFacePt(pt, cellI, tetFaceI, tetPtI);
|
const polyMesh& mesh = cloud.pMesh();
|
||||||
|
|
||||||
|
mesh.findCellFacePt(pt, cellI, tetFaceI, tetPtI);
|
||||||
|
|
||||||
if (cellI >= 0)
|
if (cellI >= 0)
|
||||||
{
|
{
|
||||||
@ -55,8 +56,6 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
|
|||||||
// See if particle on face by finding nearest face and shifting
|
// See if particle on face by finding nearest face and shifting
|
||||||
// particle.
|
// particle.
|
||||||
|
|
||||||
const polyMesh& mesh = cloud.pMesh();
|
|
||||||
|
|
||||||
meshSearch meshSearcher(mesh, false);
|
meshSearch meshSearcher(mesh, false);
|
||||||
|
|
||||||
label faceI = meshSearcher.findNearestBoundaryFace(pt);
|
label faceI = meshSearcher.findNearestBoundaryFace(pt);
|
||||||
@ -67,7 +66,7 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
|
|||||||
|
|
||||||
const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
|
const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
|
||||||
|
|
||||||
cloud.findCellFacePt(perturbPt, cellI, tetFaceI, tetPtI);
|
mesh.findCellFacePt(perturbPt, cellI, tetFaceI, tetPtI);
|
||||||
|
|
||||||
return cellI;
|
return cellI;
|
||||||
}
|
}
|
||||||
@ -124,7 +123,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
|||||||
Info<< nl << " processing cloud " << cloudDirs[cloudI] << endl;
|
Info<< nl << " processing cloud " << cloudDirs[cloudI] << endl;
|
||||||
|
|
||||||
// Read positions & cell
|
// Read positions & cell
|
||||||
Cloud<passiveParticle> sourceParcels
|
passiveParticleCloud sourceParcels
|
||||||
(
|
(
|
||||||
meshSource,
|
meshSource,
|
||||||
cloudDirs[cloudI],
|
cloudDirs[cloudI],
|
||||||
@ -134,13 +133,15 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
|||||||
<< " parcels from source mesh." << endl;
|
<< " parcels from source mesh." << endl;
|
||||||
|
|
||||||
// Construct empty target cloud
|
// Construct empty target cloud
|
||||||
Cloud<passiveParticle> targetParcels
|
passiveParticleCloud targetParcels
|
||||||
(
|
(
|
||||||
meshTarget,
|
meshTarget,
|
||||||
cloudDirs[cloudI],
|
cloudDirs[cloudI],
|
||||||
IDLList<passiveParticle>()
|
IDLList<passiveParticle>()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
particle::TrackingData<passiveParticleCloud> td(targetParcels);
|
||||||
|
|
||||||
label sourceParticleI = 0;
|
label sourceParticleI = 0;
|
||||||
|
|
||||||
// Indices of source particles that get added to targetParcels
|
// Indices of source particles that get added to targetParcels
|
||||||
@ -176,15 +177,14 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
|||||||
(
|
(
|
||||||
new passiveParticle
|
new passiveParticle
|
||||||
(
|
(
|
||||||
targetParcels,
|
meshTarget,
|
||||||
targetCc[targetCells[i]],
|
targetCc[targetCells[i]],
|
||||||
targetCells[i]
|
targetCells[i]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
passiveParticle& newP = newPtr();
|
passiveParticle& newP = newPtr();
|
||||||
|
|
||||||
scalar fraction = 0;
|
label faceI = newP.track(iter().position(), td);
|
||||||
label faceI = newP.track(iter().position(), fraction);
|
|
||||||
|
|
||||||
if (faceI < 0 && newP.cell() >= 0)
|
if (faceI < 0 && newP.cell() >= 0)
|
||||||
{
|
{
|
||||||
@ -246,7 +246,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
|||||||
|
|
||||||
if (addParticles.size())
|
if (addParticles.size())
|
||||||
{
|
{
|
||||||
IOPosition<passiveParticle>(targetParcels).write();
|
IOPosition<passiveParticleCloud>(targetParcels).write();
|
||||||
|
|
||||||
// addParticles now contains the indices of the sourceMesh
|
// addParticles now contains the indices of the sourceMesh
|
||||||
// particles that were appended to the target mesh.
|
// particles that were appended to the target mesh.
|
||||||
|
|||||||
@ -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
|
||||||
@ -283,7 +283,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement
|
|||||||
label tetFaceI = -1;
|
label tetFaceI = -1;
|
||||||
label tetPtI = -1;
|
label tetPtI = -1;
|
||||||
|
|
||||||
cloud.findCellFacePt(keepPoint, cellI, tetFaceI, tetPtI);
|
mesh_.findCellFacePt(keepPoint, cellI, tetFaceI, tetPtI);
|
||||||
|
|
||||||
if (cellI != -1)
|
if (cellI != -1)
|
||||||
{
|
{
|
||||||
@ -309,7 +309,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement
|
|||||||
(
|
(
|
||||||
new trackedParticle
|
new trackedParticle
|
||||||
(
|
(
|
||||||
cloud,
|
mesh_,
|
||||||
keepPoint,
|
keepPoint,
|
||||||
cellI,
|
cellI,
|
||||||
tetFaceI,
|
tetFaceI,
|
||||||
@ -330,7 +330,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement
|
|||||||
labelList maxFeatureLevel(mesh_.nCells(), -1);
|
labelList maxFeatureLevel(mesh_.nCells(), -1);
|
||||||
|
|
||||||
// Database to pass into trackedParticle::move
|
// Database to pass into trackedParticle::move
|
||||||
trackedParticle::trackData td(cloud, maxFeatureLevel);
|
trackedParticle::trackingData td(cloud, maxFeatureLevel);
|
||||||
|
|
||||||
// Track all particles to their end position (= starting feature point)
|
// Track all particles to their end position (= starting feature point)
|
||||||
cloud.move(td, GREAT);
|
cloud.move(td, GREAT);
|
||||||
|
|||||||
@ -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
|
||||||
@ -29,7 +29,7 @@ License
|
|||||||
|
|
||||||
Foam::trackedParticle::trackedParticle
|
Foam::trackedParticle::trackedParticle
|
||||||
(
|
(
|
||||||
const Cloud<trackedParticle>& c,
|
const polyMesh& mesh,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label tetFaceI,
|
const label tetFaceI,
|
||||||
@ -40,7 +40,7 @@ Foam::trackedParticle::trackedParticle
|
|||||||
const label j
|
const label j
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<trackedParticle>(c, position, cellI, tetFaceI, tetPtI),
|
particle(mesh, position, cellI, tetFaceI, tetPtI),
|
||||||
end_(end),
|
end_(end),
|
||||||
level_(level),
|
level_(level),
|
||||||
i_(i),
|
i_(i),
|
||||||
@ -50,12 +50,12 @@ Foam::trackedParticle::trackedParticle
|
|||||||
|
|
||||||
Foam::trackedParticle::trackedParticle
|
Foam::trackedParticle::trackedParticle
|
||||||
(
|
(
|
||||||
const Cloud<trackedParticle>& c,
|
const polyMesh& mesh,
|
||||||
Istream& is,
|
Istream& is,
|
||||||
bool readFields
|
bool readFields
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<trackedParticle>(c, is, readFields)
|
particle(mesh, is, readFields)
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
@ -89,7 +89,7 @@ Foam::trackedParticle::trackedParticle
|
|||||||
|
|
||||||
bool Foam::trackedParticle::move
|
bool Foam::trackedParticle::move
|
||||||
(
|
(
|
||||||
trackedParticle::trackData& td,
|
trackingData& td,
|
||||||
const scalar trackedParticle
|
const scalar trackedParticle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -120,7 +120,7 @@ bool Foam::trackedParticle::move
|
|||||||
bool Foam::trackedParticle::hitPatch
|
bool Foam::trackedParticle::hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch&,
|
const polyPatch&,
|
||||||
trackedParticle::trackData& td,
|
trackingData& td,
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const scalar trackFraction,
|
const scalar trackFraction,
|
||||||
const tetIndices& tetIs
|
const tetIndices& tetIs
|
||||||
@ -130,42 +130,10 @@ bool Foam::trackedParticle::hitPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::trackedParticle::hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch&,
|
|
||||||
int&,
|
|
||||||
const label,
|
|
||||||
const scalar trackFraction,
|
|
||||||
const tetIndices& tetIs
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitWedgePatch
|
void Foam::trackedParticle::hitWedgePatch
|
||||||
(
|
(
|
||||||
const wedgePolyPatch&,
|
const wedgePolyPatch&,
|
||||||
trackedParticle::trackData& td
|
trackingData& td
|
||||||
)
|
|
||||||
{
|
|
||||||
// Remove particle
|
|
||||||
td.keepParticle = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitWedgePatch
|
|
||||||
(
|
|
||||||
const wedgePolyPatch&,
|
|
||||||
int&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitSymmetryPatch
|
|
||||||
(
|
|
||||||
const symmetryPolyPatch&,
|
|
||||||
trackedParticle::trackData& td
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Remove particle
|
// Remove particle
|
||||||
@ -176,15 +144,7 @@ void Foam::trackedParticle::hitSymmetryPatch
|
|||||||
void Foam::trackedParticle::hitSymmetryPatch
|
void Foam::trackedParticle::hitSymmetryPatch
|
||||||
(
|
(
|
||||||
const symmetryPolyPatch&,
|
const symmetryPolyPatch&,
|
||||||
int&
|
trackingData& td
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitCyclicPatch
|
|
||||||
(
|
|
||||||
const cyclicPolyPatch&,
|
|
||||||
trackedParticle::trackData& td
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Remove particle
|
// Remove particle
|
||||||
@ -195,15 +155,18 @@ void Foam::trackedParticle::hitCyclicPatch
|
|||||||
void Foam::trackedParticle::hitCyclicPatch
|
void Foam::trackedParticle::hitCyclicPatch
|
||||||
(
|
(
|
||||||
const cyclicPolyPatch&,
|
const cyclicPolyPatch&,
|
||||||
int&
|
trackingData& td
|
||||||
)
|
)
|
||||||
{}
|
{
|
||||||
|
// Remove particle
|
||||||
|
td.keepParticle = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitProcessorPatch
|
void Foam::trackedParticle::hitProcessorPatch
|
||||||
(
|
(
|
||||||
const processorPolyPatch&,
|
const processorPolyPatch&,
|
||||||
trackedParticle::trackData& td
|
trackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Remove particle
|
// Remove particle
|
||||||
@ -211,18 +174,10 @@ void Foam::trackedParticle::hitProcessorPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitProcessorPatch
|
|
||||||
(
|
|
||||||
const processorPolyPatch&,
|
|
||||||
int&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitWallPatch
|
void Foam::trackedParticle::hitWallPatch
|
||||||
(
|
(
|
||||||
const wallPolyPatch& wpp,
|
const wallPolyPatch& wpp,
|
||||||
trackedParticle::trackData& td,
|
trackingData& td,
|
||||||
const tetIndices&
|
const tetIndices&
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -231,32 +186,15 @@ void Foam::trackedParticle::hitWallPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitWallPatch
|
|
||||||
(
|
|
||||||
const wallPolyPatch& wpp,
|
|
||||||
int&,
|
|
||||||
const tetIndices&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch& wpp,
|
|
||||||
trackedParticle::trackData& td
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Remove particle
|
|
||||||
td.keepParticle = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::trackedParticle::hitPatch
|
void Foam::trackedParticle::hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch& wpp,
|
const polyPatch& wpp,
|
||||||
int&
|
trackingData& td
|
||||||
)
|
)
|
||||||
{}
|
{
|
||||||
|
// Remove particle
|
||||||
|
td.keepParticle = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
@ -265,7 +203,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const trackedParticle& p)
|
|||||||
{
|
{
|
||||||
if (os.format() == IOstream::ASCII)
|
if (os.format() == IOstream::ASCII)
|
||||||
{
|
{
|
||||||
os << static_cast<const Particle<trackedParticle>&>(p)
|
os << static_cast<const particle&>(p)
|
||||||
<< token::SPACE << p.end_
|
<< token::SPACE << p.end_
|
||||||
<< token::SPACE << p.level_
|
<< token::SPACE << p.level_
|
||||||
<< token::SPACE << p.i_
|
<< token::SPACE << p.i_
|
||||||
@ -273,7 +211,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const trackedParticle& p)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
os << static_cast<const Particle<trackedParticle>&>(p);
|
os << static_cast<const particle&>(p);
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
reinterpret_cast<const char*>(&p.end_),
|
reinterpret_cast<const char*>(&p.end_),
|
||||||
|
|||||||
@ -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
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#ifndef trackedParticle_H
|
#ifndef trackedParticle_H
|
||||||
#define trackedParticle_H
|
#define trackedParticle_H
|
||||||
|
|
||||||
#include "Particle.H"
|
#include "particle.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -52,7 +52,7 @@ class trackedParticleCloud;
|
|||||||
|
|
||||||
class trackedParticle
|
class trackedParticle
|
||||||
:
|
:
|
||||||
public Particle<trackedParticle>
|
public particle
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -74,35 +74,26 @@ public:
|
|||||||
friend class Cloud<trackedParticle>;
|
friend class Cloud<trackedParticle>;
|
||||||
|
|
||||||
//- Class used to pass tracking data to the trackToFace function
|
//- Class used to pass tracking data to the trackToFace function
|
||||||
class trackData
|
class trackingData
|
||||||
|
:
|
||||||
|
public particle::TrackingData<Cloud<trackedParticle> >
|
||||||
{
|
{
|
||||||
//- Reference to the cloud containing this particle
|
|
||||||
Cloud<trackedParticle>& cloud_;
|
|
||||||
|
|
||||||
labelList& maxLevel_;
|
labelList& maxLevel_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool switchProcessor;
|
|
||||||
bool keepParticle;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
trackData(Cloud<trackedParticle>& cloud, labelList& maxLevel)
|
trackingData(Cloud<trackedParticle>& cloud, labelList& maxLevel)
|
||||||
:
|
:
|
||||||
cloud_(cloud),
|
particle::TrackingData<Cloud<trackedParticle> >(cloud),
|
||||||
maxLevel_(maxLevel)
|
maxLevel_(maxLevel)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
Cloud<trackedParticle>& cloud()
|
|
||||||
{
|
|
||||||
return cloud_;
|
|
||||||
}
|
|
||||||
|
|
||||||
labelList& maxLevel()
|
labelList& maxLevel()
|
||||||
{
|
{
|
||||||
return maxLevel_;
|
return maxLevel_;
|
||||||
@ -116,7 +107,7 @@ public:
|
|||||||
//- Construct from components
|
//- Construct from components
|
||||||
trackedParticle
|
trackedParticle
|
||||||
(
|
(
|
||||||
const Cloud<trackedParticle>& c,
|
const polyMesh& mesh,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label tetFaceI,
|
const label tetFaceI,
|
||||||
@ -130,20 +121,39 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
trackedParticle
|
trackedParticle
|
||||||
(
|
(
|
||||||
const Cloud<trackedParticle>& c,
|
const polyMesh& mesh,
|
||||||
Istream& is,
|
Istream& is,
|
||||||
bool readFields = true
|
bool readFields = true
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
autoPtr<Particle<trackedParticle> > clone() const
|
autoPtr<particle> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<Particle<trackedParticle> >
|
return autoPtr<particle>(new trackedParticle(*this));
|
||||||
(
|
|
||||||
new trackedParticle(*this)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Factory class to read-construct particles used for
|
||||||
|
// parallel transfer
|
||||||
|
class iNew
|
||||||
|
{
|
||||||
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
iNew(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
mesh_(mesh)
|
||||||
|
{}
|
||||||
|
|
||||||
|
autoPtr<trackedParticle> operator()(Istream& is) const
|
||||||
|
{
|
||||||
|
return autoPtr<trackedParticle>
|
||||||
|
(
|
||||||
|
new trackedParticle(mesh_, is, true)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
@ -170,7 +180,7 @@ public:
|
|||||||
// Tracking
|
// Tracking
|
||||||
|
|
||||||
//- Track all particles to their end point
|
//- Track all particles to their end point
|
||||||
bool move(trackData&, const scalar);
|
bool move(trackingData&, const scalar);
|
||||||
|
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a patch
|
//- Overridable function to handle the particle hitting a patch
|
||||||
@ -178,30 +188,17 @@ public:
|
|||||||
bool hitPatch
|
bool hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch&,
|
const polyPatch&,
|
||||||
trackedParticle::trackData& td,
|
trackingData& td,
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const scalar trackFraction,
|
const scalar trackFraction,
|
||||||
const tetIndices& tetIs
|
const tetIndices& tetIs
|
||||||
);
|
);
|
||||||
bool hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch&,
|
|
||||||
int&,
|
|
||||||
const label patchI,
|
|
||||||
const scalar trackFraction,
|
|
||||||
const tetIndices& tetIs
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a wedge
|
//- Overridable function to handle the particle hitting a wedge
|
||||||
void hitWedgePatch
|
void hitWedgePatch
|
||||||
(
|
(
|
||||||
const wedgePolyPatch&,
|
const wedgePolyPatch&,
|
||||||
trackedParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitWedgePatch
|
|
||||||
(
|
|
||||||
const wedgePolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a
|
//- Overridable function to handle the particle hitting a
|
||||||
@ -209,24 +206,14 @@ public:
|
|||||||
void hitSymmetryPatch
|
void hitSymmetryPatch
|
||||||
(
|
(
|
||||||
const symmetryPolyPatch&,
|
const symmetryPolyPatch&,
|
||||||
trackedParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitSymmetryPatch
|
|
||||||
(
|
|
||||||
const symmetryPolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a cyclic
|
//- Overridable function to handle the particle hitting a cyclic
|
||||||
void hitCyclicPatch
|
void hitCyclicPatch
|
||||||
(
|
(
|
||||||
const cyclicPolyPatch&,
|
const cyclicPolyPatch&,
|
||||||
trackedParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitCyclicPatch
|
|
||||||
(
|
|
||||||
const cyclicPolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a
|
//- Overridable function to handle the particle hitting a
|
||||||
@ -234,25 +221,14 @@ public:
|
|||||||
void hitProcessorPatch
|
void hitProcessorPatch
|
||||||
(
|
(
|
||||||
const processorPolyPatch&,
|
const processorPolyPatch&,
|
||||||
trackedParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitProcessorPatch
|
|
||||||
(
|
|
||||||
const processorPolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a wallPatch
|
//- Overridable function to handle the particle hitting a wallPatch
|
||||||
void hitWallPatch
|
void hitWallPatch
|
||||||
(
|
(
|
||||||
const wallPolyPatch&,
|
const wallPolyPatch&,
|
||||||
trackedParticle::trackData& td,
|
trackingData& td,
|
||||||
const tetIndices&
|
|
||||||
);
|
|
||||||
void hitWallPatch
|
|
||||||
(
|
|
||||||
const wallPolyPatch&,
|
|
||||||
int&,
|
|
||||||
const tetIndices&
|
const tetIndices&
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -260,20 +236,13 @@ public:
|
|||||||
void hitPatch
|
void hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch&,
|
const polyPatch&,
|
||||||
trackedParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
// Ostream Operator
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const trackedParticle&);
|
friend Ostream& operator<<(Ostream&, const trackedParticle&);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
@ -33,7 +33,7 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineParticleTypeNameAndDebug(trackedParticle, 0);
|
//defineParticleTypeNameAndDebug(trackedParticle, 0);
|
||||||
defineTemplateTypeNameAndDebug(Cloud<trackedParticle>, 0);
|
defineTemplateTypeNameAndDebug(Cloud<trackedParticle>, 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -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,8 +25,7 @@ License
|
|||||||
|
|
||||||
#include "reconstructLagrangian.H"
|
#include "reconstructLagrangian.H"
|
||||||
#include "labelIOList.H"
|
#include "labelIOList.H"
|
||||||
#include "Cloud.H"
|
#include "passiveParticleCloud.H"
|
||||||
#include "passiveParticle.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ void Foam::reconstructLagrangianPositions
|
|||||||
const PtrList<labelIOList>& cellProcAddressing
|
const PtrList<labelIOList>& cellProcAddressing
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Cloud<passiveParticle> lagrangianPositions
|
passiveParticleCloud lagrangianPositions
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
cloudName,
|
cloudName,
|
||||||
@ -67,7 +66,7 @@ void Foam::reconstructLagrangianPositions
|
|||||||
(
|
(
|
||||||
new passiveParticle
|
new passiveParticle
|
||||||
(
|
(
|
||||||
lagrangianPositions,
|
mesh,
|
||||||
ppi.position(),
|
ppi.position(),
|
||||||
cellMap[ppi.cell()],
|
cellMap[ppi.cell()],
|
||||||
false
|
false
|
||||||
@ -76,7 +75,7 @@ void Foam::reconstructLagrangianPositions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IOPosition<passiveParticle>(lagrangianPositions).write();
|
IOPosition<Cloud<passiveParticle> >(lagrangianPositions).write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
@ -61,7 +61,7 @@ void Foam::streamLine::track()
|
|||||||
(
|
(
|
||||||
new streamLineParticle
|
new streamLineParticle
|
||||||
(
|
(
|
||||||
particles,
|
mesh,
|
||||||
seedPoints[i],
|
seedPoints[i],
|
||||||
seedPoints.cells()[i],
|
seedPoints.cells()[i],
|
||||||
lifeTime_ // lifetime
|
lifeTime_ // lifetime
|
||||||
@ -215,7 +215,7 @@ void Foam::streamLine::track()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// additional particle info
|
// additional particle info
|
||||||
streamLineParticle::trackData td
|
streamLineParticle::trackingData td
|
||||||
(
|
(
|
||||||
particles,
|
particles,
|
||||||
vsInterp,
|
vsInterp,
|
||||||
|
|||||||
@ -30,16 +30,15 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineParticleTypeNameAndDebug(streamLineParticle, 0);
|
// defineParticleTypeNameAndDebug(streamLineParticle, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Estimate dt to cross cell in a few steps
|
|
||||||
Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
|
Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
|
||||||
(
|
(
|
||||||
streamLineParticle::trackData& td,
|
trackingData& td,
|
||||||
const scalar dt,
|
const scalar dt,
|
||||||
const vector& U
|
const vector& U
|
||||||
) const
|
) const
|
||||||
@ -58,7 +57,7 @@ Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
|
|||||||
|
|
||||||
Foam::vector Foam::streamLineParticle::interpolateFields
|
Foam::vector Foam::streamLineParticle::interpolateFields
|
||||||
(
|
(
|
||||||
const streamLineParticle::trackData& td,
|
const trackingData& td,
|
||||||
const point& position,
|
const point& position,
|
||||||
const label cellI
|
const label cellI
|
||||||
)
|
)
|
||||||
@ -103,29 +102,27 @@ Foam::vector Foam::streamLineParticle::interpolateFields
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
Foam::streamLineParticle::streamLineParticle
|
Foam::streamLineParticle::streamLineParticle
|
||||||
(
|
(
|
||||||
const Cloud<streamLineParticle>& c,
|
const polyMesh& mesh,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label lifeTime
|
const label lifeTime
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<streamLineParticle>(c, position, cellI),
|
particle(mesh, position, cellI),
|
||||||
lifeTime_(lifeTime)
|
lifeTime_(lifeTime)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
Foam::streamLineParticle::streamLineParticle
|
Foam::streamLineParticle::streamLineParticle
|
||||||
(
|
(
|
||||||
const Cloud<streamLineParticle>& c,
|
const polyMesh& mesh,
|
||||||
Istream& is,
|
Istream& is,
|
||||||
bool readFields
|
bool readFields
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<streamLineParticle>(c, is, readFields)
|
particle(mesh, is, readFields)
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
@ -157,16 +154,15 @@ Foam::streamLineParticle::streamLineParticle
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct copy
|
|
||||||
Foam::streamLineParticle::streamLineParticle
|
Foam::streamLineParticle::streamLineParticle
|
||||||
(
|
(
|
||||||
const streamLineParticle& c
|
const streamLineParticle& p
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<streamLineParticle>(c),
|
particle(p),
|
||||||
lifeTime_(c.lifeTime_),
|
lifeTime_(p.lifeTime_),
|
||||||
sampledPositions_(c.sampledPositions_),
|
sampledPositions_(p.sampledPositions_),
|
||||||
sampledScalars_(c.sampledScalars_)
|
sampledScalars_(p.sampledScalars_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -174,15 +170,17 @@ Foam::streamLineParticle::streamLineParticle
|
|||||||
|
|
||||||
bool Foam::streamLineParticle::move
|
bool Foam::streamLineParticle::move
|
||||||
(
|
(
|
||||||
streamLineParticle::trackData& td,
|
trackingData& td,
|
||||||
const scalar trackTime
|
const scalar trackTime
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
streamLineParticle& p = static_cast<streamLineParticle&>(*this);
|
||||||
|
|
||||||
td.switchProcessor = false;
|
td.switchProcessor = false;
|
||||||
td.keepParticle = true;
|
td.keepParticle = true;
|
||||||
|
|
||||||
scalar tEnd = (1.0 - stepFraction())*trackTime;
|
scalar tEnd = (1.0 - stepFraction())*trackTime;
|
||||||
scalar maxDt = cloud_.pMesh().bounds().mag();
|
scalar maxDt = mesh_.bounds().mag();
|
||||||
|
|
||||||
while
|
while
|
||||||
(
|
(
|
||||||
@ -266,8 +264,7 @@ bool Foam::streamLineParticle::move
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "streamLineParticle : Removing stagnant particle:"
|
Pout<< "streamLineParticle : Removing stagnant particle:"
|
||||||
<< static_cast<Particle<streamLineParticle> >(*this)
|
<< p << " sampled positions:" << sampledPositions_.size()
|
||||||
<< " sampled positions:" << sampledPositions_.size()
|
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
td.keepParticle = false;
|
td.keepParticle = false;
|
||||||
@ -281,13 +278,12 @@ bool Foam::streamLineParticle::move
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "streamLineParticle : Removing particle:"
|
Pout<< "streamLineParticle : Removing particle:"
|
||||||
<< static_cast<Particle<streamLineParticle> >(*this)
|
<< p << " sampled positions:" << sampledPositions_.size()
|
||||||
<< " sampled positions:" << sampledPositions_.size()
|
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transfer particle data into trackData.
|
// Transfer particle data into trackingData.
|
||||||
//td.allPositions_.append(sampledPositions_);
|
//td.allPositions_.append(sampledPositions_);
|
||||||
td.allPositions_.append(vectorList());
|
td.allPositions_.append(vectorList());
|
||||||
vectorList& top = td.allPositions_.last();
|
vectorList& top = td.allPositions_.last();
|
||||||
@ -316,7 +312,7 @@ bool Foam::streamLineParticle::move
|
|||||||
bool Foam::streamLineParticle::hitPatch
|
bool Foam::streamLineParticle::hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch&,
|
const polyPatch&,
|
||||||
streamLineParticle::trackData& td,
|
trackingData& td,
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const scalar trackFraction,
|
const scalar trackFraction,
|
||||||
const tetIndices& tetIs
|
const tetIndices& tetIs
|
||||||
@ -327,24 +323,10 @@ bool Foam::streamLineParticle::hitPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::streamLineParticle::hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch&,
|
|
||||||
int&,
|
|
||||||
const label,
|
|
||||||
const scalar,
|
|
||||||
const tetIndices&
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Disable generic patch interaction
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitWedgePatch
|
void Foam::streamLineParticle::hitWedgePatch
|
||||||
(
|
(
|
||||||
const wedgePolyPatch& pp,
|
const wedgePolyPatch& pp,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Remove particle
|
// Remove particle
|
||||||
@ -352,18 +334,10 @@ void Foam::streamLineParticle::hitWedgePatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitWedgePatch
|
|
||||||
(
|
|
||||||
const wedgePolyPatch&,
|
|
||||||
int&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitSymmetryPatch
|
void Foam::streamLineParticle::hitSymmetryPatch
|
||||||
(
|
(
|
||||||
const symmetryPolyPatch& pp,
|
const symmetryPolyPatch& pp,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Remove particle
|
// Remove particle
|
||||||
@ -371,18 +345,10 @@ void Foam::streamLineParticle::hitSymmetryPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitSymmetryPatch
|
|
||||||
(
|
|
||||||
const symmetryPolyPatch&,
|
|
||||||
int&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitCyclicPatch
|
void Foam::streamLineParticle::hitCyclicPatch
|
||||||
(
|
(
|
||||||
const cyclicPolyPatch& pp,
|
const cyclicPolyPatch& pp,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Remove particle
|
// Remove particle
|
||||||
@ -390,18 +356,10 @@ void Foam::streamLineParticle::hitCyclicPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitCyclicPatch
|
|
||||||
(
|
|
||||||
const cyclicPolyPatch&,
|
|
||||||
int&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitProcessorPatch
|
void Foam::streamLineParticle::hitProcessorPatch
|
||||||
(
|
(
|
||||||
const processorPolyPatch&,
|
const processorPolyPatch&,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Switch particle
|
// Switch particle
|
||||||
@ -409,18 +367,10 @@ void Foam::streamLineParticle::hitProcessorPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitProcessorPatch
|
|
||||||
(
|
|
||||||
const processorPolyPatch&,
|
|
||||||
int&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitWallPatch
|
void Foam::streamLineParticle::hitWallPatch
|
||||||
(
|
(
|
||||||
const wallPolyPatch& wpp,
|
const wallPolyPatch& wpp,
|
||||||
streamLineParticle::trackData& td,
|
trackingData& td,
|
||||||
const tetIndices&
|
const tetIndices&
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -429,32 +379,15 @@ void Foam::streamLineParticle::hitWallPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitWallPatch
|
|
||||||
(
|
|
||||||
const wallPolyPatch& wpp,
|
|
||||||
int&,
|
|
||||||
const tetIndices&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch& wpp,
|
|
||||||
streamLineParticle::trackData& td
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Remove particle
|
|
||||||
td.keepParticle = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::hitPatch
|
void Foam::streamLineParticle::hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch& wpp,
|
const polyPatch& wpp,
|
||||||
int&
|
trackingData& td
|
||||||
)
|
)
|
||||||
{}
|
{
|
||||||
|
// Remove particle
|
||||||
|
td.keepParticle = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLineParticle::readFields(Cloud<streamLineParticle>& c)
|
void Foam::streamLineParticle::readFields(Cloud<streamLineParticle>& c)
|
||||||
@ -464,6 +397,8 @@ void Foam::streamLineParticle::readFields(Cloud<streamLineParticle>& c)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
particle::readFields(c);
|
||||||
|
|
||||||
IOField<label> lifeTime
|
IOField<label> lifeTime
|
||||||
(
|
(
|
||||||
c.fieldIOobject("lifeTime", IOobject::MUST_READ)
|
c.fieldIOobject("lifeTime", IOobject::MUST_READ)
|
||||||
@ -495,7 +430,7 @@ void Foam::streamLineParticle::readFields(Cloud<streamLineParticle>& c)
|
|||||||
|
|
||||||
void Foam::streamLineParticle::writeFields(const Cloud<streamLineParticle>& c)
|
void Foam::streamLineParticle::writeFields(const Cloud<streamLineParticle>& c)
|
||||||
{
|
{
|
||||||
Particle<streamLineParticle>::writeFields(c);
|
particle::writeFields(c);
|
||||||
|
|
||||||
label np = c.size();
|
label np = c.size();
|
||||||
|
|
||||||
@ -534,7 +469,7 @@ void Foam::streamLineParticle::writeFields(const Cloud<streamLineParticle>& c)
|
|||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const streamLineParticle& p)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const streamLineParticle& p)
|
||||||
{
|
{
|
||||||
os << static_cast<const Particle<streamLineParticle>&>(p)
|
os << static_cast<const particle&>(p)
|
||||||
<< token::SPACE << p.lifeTime_
|
<< token::SPACE << p.lifeTime_
|
||||||
<< token::SPACE << p.sampledPositions_
|
<< token::SPACE << p.sampledPositions_
|
||||||
<< token::SPACE << p.sampledScalars_
|
<< token::SPACE << p.sampledScalars_
|
||||||
|
|||||||
@ -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
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#ifndef streamLineParticle_H
|
#ifndef streamLineParticle_H
|
||||||
#define streamLineParticle_H
|
#define streamLineParticle_H
|
||||||
|
|
||||||
#include "Particle.H"
|
#include "particle.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "interpolationCellPoint.H"
|
#include "interpolationCellPoint.H"
|
||||||
#include "vectorList.H"
|
#include "vectorList.H"
|
||||||
@ -49,20 +49,20 @@ namespace Foam
|
|||||||
class streamLineParticleCloud;
|
class streamLineParticleCloud;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class streamLineParticle Declaration
|
Class streamLineParticle Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class streamLineParticle
|
class streamLineParticle
|
||||||
:
|
:
|
||||||
public Particle<streamLineParticle>
|
public particle
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Class used to pass tracking data to the trackToFace function
|
//- Class used to pass tracking data to the trackToFace function
|
||||||
class trackData
|
class trackingData
|
||||||
:
|
:
|
||||||
public Particle<streamLineParticle>::trackData
|
public particle::TrackingData<Cloud<streamLineParticle> >
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -81,7 +81,7 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
trackData
|
trackingData
|
||||||
(
|
(
|
||||||
Cloud<streamLineParticle>& cloud,
|
Cloud<streamLineParticle>& cloud,
|
||||||
const PtrList<interpolationCellPoint<scalar> >& vsInterp,
|
const PtrList<interpolationCellPoint<scalar> >& vsInterp,
|
||||||
@ -94,7 +94,7 @@ public:
|
|||||||
List<DynamicList<vectorList> >& allVectors
|
List<DynamicList<vectorList> >& allVectors
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<streamLineParticle>::trackData(cloud),
|
particle::TrackingData<Cloud<streamLineParticle> >(cloud),
|
||||||
vsInterp_(vsInterp),
|
vsInterp_(vsInterp),
|
||||||
vvInterp_(vvInterp),
|
vvInterp_(vvInterp),
|
||||||
UIndex_(UIndex),
|
UIndex_(UIndex),
|
||||||
@ -130,7 +130,7 @@ private:
|
|||||||
// steps.
|
// steps.
|
||||||
scalar calcSubCycleDeltaT
|
scalar calcSubCycleDeltaT
|
||||||
(
|
(
|
||||||
streamLineParticle::trackData& td,
|
trackingData& td,
|
||||||
const scalar dt,
|
const scalar dt,
|
||||||
const vector& U
|
const vector& U
|
||||||
) const;
|
) const;
|
||||||
@ -138,7 +138,7 @@ private:
|
|||||||
//- Interpolate all quantities; return interpolated velocity.
|
//- Interpolate all quantities; return interpolated velocity.
|
||||||
vector interpolateFields
|
vector interpolateFields
|
||||||
(
|
(
|
||||||
const streamLineParticle::trackData&,
|
const trackingData&,
|
||||||
const point&,
|
const point&,
|
||||||
const label cellI
|
const label cellI
|
||||||
);
|
);
|
||||||
@ -151,7 +151,7 @@ public:
|
|||||||
//- Construct from components
|
//- Construct from components
|
||||||
streamLineParticle
|
streamLineParticle
|
||||||
(
|
(
|
||||||
const Cloud<streamLineParticle>& c,
|
const polyMesh& c,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label lifeTime
|
const label lifeTime
|
||||||
@ -160,32 +160,49 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
streamLineParticle
|
streamLineParticle
|
||||||
(
|
(
|
||||||
const Cloud<streamLineParticle>& c,
|
const polyMesh& c,
|
||||||
Istream& is,
|
Istream& is,
|
||||||
bool readFields = true
|
bool readFields = true
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
streamLineParticle(const streamLineParticle& c);
|
streamLineParticle(const streamLineParticle& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
autoPtr<Particle<streamLineParticle> > clone() const
|
autoPtr<particle> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<Particle<streamLineParticle> >
|
return autoPtr<particle>(new streamLineParticle(*this));
|
||||||
(
|
|
||||||
new streamLineParticle(*this)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Factory class to read-construct particles used for
|
||||||
|
// parallel transfer
|
||||||
|
class iNew
|
||||||
|
{
|
||||||
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
iNew(const polyMesh& mesh)
|
||||||
|
:
|
||||||
|
mesh_(mesh)
|
||||||
|
{}
|
||||||
|
|
||||||
|
autoPtr<streamLineParticle> operator()(Istream& is) const
|
||||||
|
{
|
||||||
|
return autoPtr<streamLineParticle>
|
||||||
|
(
|
||||||
|
new streamLineParticle(mesh_, is, true)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Tracking
|
// Tracking
|
||||||
|
|
||||||
//- Track all particles to their end point
|
//- Track all particles to their end point
|
||||||
bool move(trackData&, const scalar trackTime);
|
bool move(trackingData&, const scalar trackTime);
|
||||||
|
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a patch
|
//- Overridable function to handle the particle hitting a patch
|
||||||
@ -193,31 +210,17 @@ public:
|
|||||||
bool hitPatch
|
bool hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch&,
|
const polyPatch&,
|
||||||
streamLineParticle::trackData& td,
|
trackingData& td,
|
||||||
const label patchI,
|
const label patchI,
|
||||||
const scalar trackFraction,
|
const scalar trackFraction,
|
||||||
const tetIndices& tetIs
|
const tetIndices& tetIs
|
||||||
);
|
);
|
||||||
|
|
||||||
bool hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch&,
|
|
||||||
int&,
|
|
||||||
const label,
|
|
||||||
const scalar,
|
|
||||||
const tetIndices&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a wedge
|
//- Overridable function to handle the particle hitting a wedge
|
||||||
void hitWedgePatch
|
void hitWedgePatch
|
||||||
(
|
(
|
||||||
const wedgePolyPatch&,
|
const wedgePolyPatch&,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitWedgePatch
|
|
||||||
(
|
|
||||||
const wedgePolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a
|
//- Overridable function to handle the particle hitting a
|
||||||
@ -225,24 +228,14 @@ public:
|
|||||||
void hitSymmetryPatch
|
void hitSymmetryPatch
|
||||||
(
|
(
|
||||||
const symmetryPolyPatch&,
|
const symmetryPolyPatch&,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitSymmetryPatch
|
|
||||||
(
|
|
||||||
const symmetryPolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a cyclic
|
//- Overridable function to handle the particle hitting a cyclic
|
||||||
void hitCyclicPatch
|
void hitCyclicPatch
|
||||||
(
|
(
|
||||||
const cyclicPolyPatch&,
|
const cyclicPolyPatch&,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitCyclicPatch
|
|
||||||
(
|
|
||||||
const cyclicPolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a
|
//- Overridable function to handle the particle hitting a
|
||||||
@ -250,25 +243,14 @@ public:
|
|||||||
void hitProcessorPatch
|
void hitProcessorPatch
|
||||||
(
|
(
|
||||||
const processorPolyPatch&,
|
const processorPolyPatch&,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitProcessorPatch
|
|
||||||
(
|
|
||||||
const processorPolyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Overridable function to handle the particle hitting a wallPatch
|
//- Overridable function to handle the particle hitting a wallPatch
|
||||||
void hitWallPatch
|
void hitWallPatch
|
||||||
(
|
(
|
||||||
const wallPolyPatch&,
|
const wallPolyPatch&,
|
||||||
streamLineParticle::trackData& td,
|
trackingData& td,
|
||||||
const tetIndices&
|
|
||||||
);
|
|
||||||
void hitWallPatch
|
|
||||||
(
|
|
||||||
const wallPolyPatch&,
|
|
||||||
int&,
|
|
||||||
const tetIndices&
|
const tetIndices&
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -276,12 +258,7 @@ public:
|
|||||||
void hitPatch
|
void hitPatch
|
||||||
(
|
(
|
||||||
const polyPatch&,
|
const polyPatch&,
|
||||||
streamLineParticle::trackData& td
|
trackingData& td
|
||||||
);
|
|
||||||
void hitPatch
|
|
||||||
(
|
|
||||||
const polyPatch&,
|
|
||||||
int&
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -297,8 +274,6 @@ public:
|
|||||||
// Ostream Operator
|
// Ostream Operator
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const streamLineParticle&);
|
friend Ostream& operator<<(Ostream&, const streamLineParticle&);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
@ -28,10 +28,6 @@ License
|
|||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
|
|
||||||
#include "Cloud.H"
|
|
||||||
#include "passiveParticle.H"
|
|
||||||
#include "IDLList.H"
|
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -45,11 +41,9 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// Sample singly connected segment. Returns false if end_ reached.
|
|
||||||
bool Foam::faceOnlySet::trackToBoundary
|
bool Foam::faceOnlySet::trackToBoundary
|
||||||
(
|
(
|
||||||
Particle<passiveParticle>& singleParticle,
|
passiveParticleCloud& particles,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
DynamicList<label>& samplingFaces,
|
DynamicList<label>& samplingFaces,
|
||||||
@ -61,6 +55,10 @@ bool Foam::faceOnlySet::trackToBoundary
|
|||||||
const vector smallVec = tol*offset;
|
const vector smallVec = tol*offset;
|
||||||
const scalar smallDist = mag(smallVec);
|
const scalar smallDist = mag(smallVec);
|
||||||
|
|
||||||
|
passiveParticle& singleParticle = *particles.first();
|
||||||
|
|
||||||
|
particle::TrackingData<passiveParticleCloud> trackData(particles);
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
|
|
||||||
@ -68,7 +66,7 @@ bool Foam::faceOnlySet::trackToBoundary
|
|||||||
{
|
{
|
||||||
point oldPoint = trackPt;
|
point oldPoint = trackPt;
|
||||||
|
|
||||||
singleParticle.trackToFace(end_);
|
singleParticle.trackToFace(end_, trackData);
|
||||||
|
|
||||||
if (singleParticle.face() != -1 && mag(oldPoint - trackPt) > smallDist)
|
if (singleParticle.face() != -1 && mag(oldPoint - trackPt) > smallDist)
|
||||||
{
|
{
|
||||||
@ -212,18 +210,20 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize tracking starting from trackPt
|
// Initialize tracking starting from trackPt
|
||||||
Cloud<passiveParticle> particles(mesh(), IDLList<passiveParticle>());
|
passiveParticleCloud particles(mesh());
|
||||||
|
|
||||||
passiveParticle singleParticle
|
passiveParticle singleParticle
|
||||||
(
|
(
|
||||||
particles,
|
mesh(),
|
||||||
trackPt,
|
trackPt,
|
||||||
trackCellI
|
trackCellI
|
||||||
);
|
);
|
||||||
|
|
||||||
|
particles.addParticle(&singleParticle);
|
||||||
|
|
||||||
bool reachedBoundary = trackToBoundary
|
bool reachedBoundary = trackToBoundary
|
||||||
(
|
(
|
||||||
singleParticle,
|
particles,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
samplingCells,
|
samplingCells,
|
||||||
samplingFaces,
|
samplingFaces,
|
||||||
|
|||||||
@ -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
|
||||||
@ -36,16 +36,13 @@ SourceFiles
|
|||||||
|
|
||||||
#include "sampledSet.H"
|
#include "sampledSet.H"
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
|
#include "passiveParticleCloud.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class passiveParticle;
|
|
||||||
template<class Type> class Particle;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class faceOnlySet Declaration
|
Class faceOnlySet Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -71,7 +68,7 @@ class faceOnlySet
|
|||||||
// reached
|
// reached
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
Particle<passiveParticle>& singleParticle,
|
passiveParticleCloud& particles,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
DynamicList<label>& samplingFaces,
|
DynamicList<label>& samplingFaces,
|
||||||
|
|||||||
@ -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
|
||||||
@ -38,8 +38,6 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Rework faceOnlySet samples.
|
|
||||||
// Take two consecutive samples
|
|
||||||
void Foam::midPointSet::genSamples()
|
void Foam::midPointSet::genSamples()
|
||||||
{
|
{
|
||||||
// Generate midpoints.
|
// Generate midpoints.
|
||||||
@ -112,6 +110,7 @@ void Foam::midPointSet::genSamples()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::midPointSet::midPointSet
|
Foam::midPointSet::midPointSet
|
||||||
|
|||||||
@ -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
|
||||||
@ -42,8 +42,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward declaration of classes
|
||||||
class passiveParticle;
|
|
||||||
template<class Type> class particle;
|
|
||||||
class meshSearch;
|
class meshSearch;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
|
|||||||
@ -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
|
||||||
@ -42,8 +42,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward declaration of classes
|
||||||
class passiveParticle;
|
|
||||||
template<class Type> class particle;
|
|
||||||
class meshSearch;
|
class meshSearch;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
|
|||||||
@ -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
|
||||||
@ -28,10 +28,6 @@ License
|
|||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
|
|
||||||
#include "Cloud.H"
|
|
||||||
#include "passiveParticle.H"
|
|
||||||
#include "IDLList.H"
|
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -48,7 +44,7 @@ namespace Foam
|
|||||||
// Sample till hits boundary.
|
// Sample till hits boundary.
|
||||||
bool Foam::polyLineSet::trackToBoundary
|
bool Foam::polyLineSet::trackToBoundary
|
||||||
(
|
(
|
||||||
Particle<passiveParticle>& singleParticle,
|
passiveParticleCloud& particles,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
@ -56,6 +52,10 @@ bool Foam::polyLineSet::trackToBoundary
|
|||||||
DynamicList<scalar>& samplingCurveDist
|
DynamicList<scalar>& samplingCurveDist
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
passiveParticle& singleParticle = *particles.first();
|
||||||
|
|
||||||
|
particle::TrackingData<passiveParticleCloud> trackData(particles);
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ bool Foam::polyLineSet::trackToBoundary
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
singleParticle.stepFraction() = 0;
|
singleParticle.stepFraction() = 0;
|
||||||
singleParticle.track(sampleCoords_[sampleI+1]);
|
singleParticle.track(sampleCoords_[sampleI+1], trackData);
|
||||||
}
|
}
|
||||||
while
|
while
|
||||||
(
|
(
|
||||||
@ -260,18 +260,18 @@ void Foam::polyLineSet::calcSamples
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Initialize tracking starting from sampleI
|
// Initialize tracking starting from sampleI
|
||||||
Cloud<passiveParticle> particles(mesh(), IDLList<passiveParticle>());
|
passiveParticleCloud particles(mesh());
|
||||||
|
|
||||||
passiveParticle singleParticle
|
passiveParticle singleParticle
|
||||||
(
|
(
|
||||||
particles,
|
mesh(),
|
||||||
trackPt,
|
trackPt,
|
||||||
trackCellI
|
trackCellI
|
||||||
);
|
);
|
||||||
|
|
||||||
bool bReached = trackToBoundary
|
bool bReached = trackToBoundary
|
||||||
(
|
(
|
||||||
singleParticle,
|
particles,
|
||||||
sampleI,
|
sampleI,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
samplingCells,
|
samplingCells,
|
||||||
|
|||||||
@ -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
|
||||||
@ -37,16 +37,13 @@ SourceFiles
|
|||||||
|
|
||||||
#include "sampledSet.H"
|
#include "sampledSet.H"
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
|
#include "passiveParticleCloud.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class passiveParticle;
|
|
||||||
template<class Type> class Particle;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class polyLineSet Declaration
|
Class polyLineSet Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -68,7 +65,7 @@ class polyLineSet
|
|||||||
// Returns false if end of samples reached.
|
// Returns false if end of samples reached.
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
Particle<passiveParticle>& singleParticle,
|
passiveParticleCloud& particles,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
|
|||||||
@ -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
|
||||||
@ -28,10 +28,6 @@ License
|
|||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
|
|
||||||
#include "Cloud.H"
|
|
||||||
#include "passiveParticle.H"
|
|
||||||
#include "IDLList.H"
|
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -45,9 +41,6 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Finds along line (samplePt + t * offset) next sample beyond or equal to
|
|
||||||
// currentPt.
|
|
||||||
// Updates samplePt, sampleI
|
|
||||||
bool Foam::uniformSet::nextSample
|
bool Foam::uniformSet::nextSample
|
||||||
(
|
(
|
||||||
const point& currentPt,
|
const point& currentPt,
|
||||||
@ -82,10 +75,9 @@ bool Foam::uniformSet::nextSample
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Sample singly connected segment. Returns false if end_ reached.
|
|
||||||
bool Foam::uniformSet::trackToBoundary
|
bool Foam::uniformSet::trackToBoundary
|
||||||
(
|
(
|
||||||
Particle<passiveParticle>& singleParticle,
|
passiveParticleCloud& particles,
|
||||||
point& samplePt,
|
point& samplePt,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
@ -99,9 +91,13 @@ bool Foam::uniformSet::trackToBoundary
|
|||||||
const vector smallVec = tol*offset;
|
const vector smallVec = tol*offset;
|
||||||
const scalar smallDist = mag(smallVec);
|
const scalar smallDist = mag(smallVec);
|
||||||
|
|
||||||
|
passiveParticle& singleParticle = *particles.first();
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
const point& trackPt = singleParticle.position();
|
const point& trackPt = singleParticle.position();
|
||||||
|
|
||||||
|
particle::TrackingData<passiveParticleCloud> trackData(particles);
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
// Find next samplePt on/after trackPt. Update samplePt, sampleI
|
// Find next samplePt on/after trackPt. Update samplePt, sampleI
|
||||||
@ -161,7 +157,7 @@ bool Foam::uniformSet::trackToBoundary
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
singleParticle.stepFraction() = 0;
|
singleParticle.stepFraction() = 0;
|
||||||
singleParticle.track(samplePt);
|
singleParticle.track(samplePt, trackData);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -309,19 +305,16 @@ void Foam::uniformSet::calcSamples
|
|||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
// Initialize tracking starting from trackPt
|
passiveParticleCloud particles(mesh());
|
||||||
Cloud<passiveParticle> particles(mesh(), IDLList<passiveParticle>());
|
|
||||||
|
|
||||||
passiveParticle singleParticle
|
// Initialize tracking starting from trackPt
|
||||||
(
|
passiveParticle singleParticle(mesh(), trackPt, trackCellI);
|
||||||
particles,
|
|
||||||
trackPt,
|
particles.addParticle(&singleParticle);
|
||||||
trackCellI
|
|
||||||
);
|
|
||||||
|
|
||||||
bool reachedBoundary = trackToBoundary
|
bool reachedBoundary = trackToBoundary
|
||||||
(
|
(
|
||||||
singleParticle,
|
particles,
|
||||||
samplePt,
|
samplePt,
|
||||||
sampleI,
|
sampleI,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
|
|||||||
@ -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
|
||||||
@ -34,6 +34,7 @@ SourceFiles
|
|||||||
#ifndef uniformSet_H
|
#ifndef uniformSet_H
|
||||||
#define uniformSet_H
|
#define uniformSet_H
|
||||||
|
|
||||||
|
#include "passiveParticleCloud.H"
|
||||||
#include "sampledSet.H"
|
#include "sampledSet.H"
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
|
|
||||||
@ -42,10 +43,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class passiveParticle;
|
|
||||||
template<class Type> class Particle;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class uniformSet Declaration
|
Class uniformSet Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -85,7 +82,7 @@ class uniformSet
|
|||||||
// reached
|
// reached
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
Particle<passiveParticle>& singleParticle,
|
passiveParticleCloud& particles,
|
||||||
point& samplePt,
|
point& samplePt,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
|
|||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
#include "treeDataCell.H"
|
#include "treeDataCell.H"
|
||||||
#include "treeDataFace.H"
|
#include "treeDataFace.H"
|
||||||
|
#include "meshTools.H"
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user