mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated cloud function objects
This commit is contained in:
@ -39,7 +39,8 @@ void Foam::CloudFunctionObject<CloudType>::write()
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::CloudFunctionObject<CloudType>::CloudFunctionObject(CloudType& owner)
|
Foam::CloudFunctionObject<CloudType>::CloudFunctionObject(CloudType& owner)
|
||||||
:
|
:
|
||||||
SubModelBase<CloudType>(owner)
|
CloudSubModelBase<CloudType>(owner),
|
||||||
|
outputDir_()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -48,11 +49,28 @@ Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
|
|||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner,
|
CloudType& owner,
|
||||||
const word& type
|
const word& modelName,
|
||||||
|
const word& objectType
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
SubModelBase<CloudType>(owner, dict, typeName, type, "")
|
CloudSubModelBase<CloudType>(modelName, owner, dict, typeName, objectType),
|
||||||
{}
|
outputDir_(owner.mesh().time().path())
|
||||||
|
{
|
||||||
|
const fileName relPath =
|
||||||
|
"postProcessing"/cloud::prefix/owner.name()/this->modelName();
|
||||||
|
|
||||||
|
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
// Put in undecomposed case (Note: gives problems for
|
||||||
|
// distributed data running)
|
||||||
|
outputDir_ = outputDir_/".."/relPath;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outputDir_ = outputDir_/relPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -61,7 +79,7 @@ Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
|
|||||||
const CloudFunctionObject<CloudType>& ppm
|
const CloudFunctionObject<CloudType>& ppm
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
SubModelBase<CloudType>(ppm)
|
CloudSubModelBase<CloudType>(ppm)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -131,6 +149,13 @@ void Foam::CloudFunctionObject<CloudType>::postFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
const Foam::fileName& Foam::CloudFunctionObject<CloudType>::outputDir() const
|
||||||
|
{
|
||||||
|
return outputDir_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "CloudFunctionObjectNew.C"
|
#include "CloudFunctionObjectNew.C"
|
||||||
|
|||||||
@ -39,7 +39,7 @@ SourceFiles
|
|||||||
#include "IOdictionary.H"
|
#include "IOdictionary.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
#include "SubModelBase.H"
|
#include "CloudSubModelBase.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -56,9 +56,15 @@ class tetIndices;
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
class CloudFunctionObject
|
class CloudFunctionObject
|
||||||
:
|
:
|
||||||
public SubModelBase<CloudType>
|
public CloudSubModelBase<CloudType>
|
||||||
{
|
{
|
||||||
// Protected Member Functions
|
// Private data
|
||||||
|
|
||||||
|
//- Output path
|
||||||
|
fileName outputDir_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
//- Write post-processing info
|
//- Write post-processing info
|
||||||
virtual void write();
|
virtual void write();
|
||||||
@ -77,9 +83,10 @@ public:
|
|||||||
dictionary,
|
dictionary,
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
),
|
),
|
||||||
(dict, owner)
|
(dict, owner, modelName)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +100,8 @@ public:
|
|||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner,
|
CloudType& owner,
|
||||||
const word& modelType
|
const word& objectType,
|
||||||
|
const word& modelName
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
@ -118,7 +126,8 @@ public:
|
|||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner,
|
CloudType& owner,
|
||||||
const word& modelType
|
const word& objectType,
|
||||||
|
const word& modelName
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -159,6 +168,12 @@ public:
|
|||||||
const label faceI,
|
const label faceI,
|
||||||
bool& keepParticle
|
bool& keepParticle
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Input/output
|
||||||
|
|
||||||
|
//- Return the output path
|
||||||
|
const fileName& outputDir() 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) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -33,13 +33,15 @@ Foam::CloudFunctionObject<CloudType>::New
|
|||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner,
|
CloudType& owner,
|
||||||
const word& modelType
|
const word& objectType,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< " Selecting cloud function " << modelType << endl;
|
Info<< " Selecting cloud function " << modelName << " of type "
|
||||||
|
<< objectType << endl;
|
||||||
|
|
||||||
typename dictionaryConstructorTable::iterator cstrIter =
|
typename dictionaryConstructorTable::iterator cstrIter =
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
dictionaryConstructorTablePtr_->find(objectType);
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
@ -48,16 +50,26 @@ Foam::CloudFunctionObject<CloudType>::New
|
|||||||
"CloudFunctionObject<CloudType>::New"
|
"CloudFunctionObject<CloudType>::New"
|
||||||
"("
|
"("
|
||||||
"const dictionary&, "
|
"const dictionary&, "
|
||||||
"CloudType&"
|
"CloudType&, "
|
||||||
|
"const word&, "
|
||||||
|
"const word&"
|
||||||
")"
|
")"
|
||||||
) << "Unknown cloud function type "
|
) << "Unknown cloud function type "
|
||||||
<< modelType << nl << nl
|
<< objectType << nl << nl
|
||||||
<< "Valid cloud function types are:" << nl
|
<< "Valid cloud function types are:" << nl
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<CloudFunctionObject<CloudType> >(cstrIter()(dict, owner));
|
return autoPtr<CloudFunctionObject<CloudType> >
|
||||||
|
(
|
||||||
|
cstrIter()
|
||||||
|
(
|
||||||
|
dict,
|
||||||
|
owner,
|
||||||
|
modelName
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -66,13 +66,19 @@ Foam::CloudFunctionObjectList<CloudType>::CloudFunctionObjectList
|
|||||||
{
|
{
|
||||||
const word& modelName = modelNames[i];
|
const word& modelName = modelNames[i];
|
||||||
|
|
||||||
|
const dictionary& modelDict(dict.subDict(modelName));
|
||||||
|
|
||||||
|
// read the type of the function object
|
||||||
|
const word objectType(modelDict.lookup("type"));
|
||||||
|
|
||||||
this->set
|
this->set
|
||||||
(
|
(
|
||||||
i,
|
i,
|
||||||
CloudFunctionObject<CloudType>::New
|
CloudFunctionObject<CloudType>::New
|
||||||
(
|
(
|
||||||
dict,
|
modelDict,
|
||||||
owner,
|
owner,
|
||||||
|
objectType,
|
||||||
modelName
|
modelName
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -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) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -50,16 +50,17 @@ void Foam::FacePostProcessing<CloudType>::makeLogFile
|
|||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
const fileName logDir = outputDir_/this->owner().time().timeName();
|
|
||||||
|
|
||||||
// Create directory if does not exist
|
// Create directory if does not exist
|
||||||
mkDir(logDir);
|
mkDir(this->outputDir());
|
||||||
|
|
||||||
// Open new file at start up
|
// Open new file at start up
|
||||||
outputFilePtr_.set
|
outputFilePtr_.set
|
||||||
(
|
(
|
||||||
zoneI,
|
zoneI,
|
||||||
new OFstream(logDir/(type() + '_' + zoneName + ".dat"))
|
new OFstream
|
||||||
|
(
|
||||||
|
this->outputDir()/(type() + '_' + zoneName + ".dat")
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
outputFilePtr_[zoneI]
|
outputFilePtr_[zoneI]
|
||||||
@ -201,7 +202,7 @@ void Foam::FacePostProcessing<CloudType>::write()
|
|||||||
|
|
||||||
writer->write
|
writer->write
|
||||||
(
|
(
|
||||||
outputDir_/time.timeName(),
|
this->outputDir()/time.timeName(),
|
||||||
fZone.name(),
|
fZone.name(),
|
||||||
allPoints,
|
allPoints,
|
||||||
allFaces,
|
allFaces,
|
||||||
@ -212,7 +213,7 @@ void Foam::FacePostProcessing<CloudType>::write()
|
|||||||
|
|
||||||
writer->write
|
writer->write
|
||||||
(
|
(
|
||||||
outputDir_/time.timeName(),
|
this->outputDir()/time.timeName(),
|
||||||
fZone.name(),
|
fZone.name(),
|
||||||
allPoints,
|
allPoints,
|
||||||
allFaces,
|
allFaces,
|
||||||
@ -250,10 +251,11 @@ template<class CloudType>
|
|||||||
Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CloudFunctionObject<CloudType>(dict, owner, typeName),
|
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||||
faceZoneIDs_(),
|
faceZoneIDs_(),
|
||||||
surfaceFormat_(this->coeffDict().lookup("surfaceFormat")),
|
surfaceFormat_(this->coeffDict().lookup("surfaceFormat")),
|
||||||
resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
|
resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
|
||||||
@ -263,7 +265,6 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
|||||||
massFlowRate_(),
|
massFlowRate_(),
|
||||||
log_(this->coeffDict().lookup("log")),
|
log_(this->coeffDict().lookup("log")),
|
||||||
outputFilePtr_(),
|
outputFilePtr_(),
|
||||||
outputDir_(owner.mesh().time().path()),
|
|
||||||
timeOld_(owner.mesh().time().value())
|
timeOld_(owner.mesh().time().value())
|
||||||
{
|
{
|
||||||
wordList faceZoneNames(this->coeffDict().lookup("faceZones"));
|
wordList faceZoneNames(this->coeffDict().lookup("faceZones"));
|
||||||
@ -273,19 +274,6 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
|||||||
|
|
||||||
outputFilePtr_.setSize(faceZoneNames.size());
|
outputFilePtr_.setSize(faceZoneNames.size());
|
||||||
|
|
||||||
if (Pstream::parRun())
|
|
||||||
{
|
|
||||||
// Put in undecomposed case (Note: gives problems for
|
|
||||||
// distributed data running)
|
|
||||||
outputDir_ =
|
|
||||||
outputDir_/".."/"postProcessing"/cloud::prefix/owner.name();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outputDir_ =
|
|
||||||
outputDir_/"postProcessing"/cloud::prefix/owner.name();
|
|
||||||
}
|
|
||||||
|
|
||||||
DynamicList<label> zoneIDs;
|
DynamicList<label> zoneIDs;
|
||||||
const faceZoneMesh& fzm = owner.mesh().faceZones();
|
const faceZoneMesh& fzm = owner.mesh().faceZones();
|
||||||
const surfaceScalarField& magSf = owner.mesh().magSf();
|
const surfaceScalarField& magSf = owner.mesh().magSf();
|
||||||
@ -358,7 +346,6 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
|||||||
massFlowRate_(pff.massFlowRate_),
|
massFlowRate_(pff.massFlowRate_),
|
||||||
log_(pff.log_),
|
log_(pff.log_),
|
||||||
outputFilePtr_(),
|
outputFilePtr_(),
|
||||||
outputDir_(pff.outputDir_),
|
|
||||||
timeOld_(0.0)
|
timeOld_(0.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) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,9 +91,6 @@ class FacePostProcessing
|
|||||||
//- Output file pointer per zone
|
//- Output file pointer per zone
|
||||||
PtrList<OFstream> outputFilePtr_;
|
PtrList<OFstream> outputFilePtr_;
|
||||||
|
|
||||||
//- Output directory
|
|
||||||
fileName outputDir_;
|
|
||||||
|
|
||||||
//- Last calculation time
|
//- Last calculation time
|
||||||
scalar timeOld_;
|
scalar timeOld_;
|
||||||
|
|
||||||
@ -127,7 +124,12 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
FacePostProcessing(const dictionary& dict, CloudType& owner);
|
FacePostProcessing
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
FacePostProcessing(const FacePostProcessing<CloudType>& ppm);
|
FacePostProcessing(const FacePostProcessing<CloudType>& ppm);
|
||||||
|
|||||||
@ -51,15 +51,13 @@ void Foam::ParticleCollector<CloudType>::makeLogFile
|
|||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
const fileName logDir = outputDir_/this->owner().time().timeName();
|
|
||||||
|
|
||||||
// Create directory if does not exist
|
// Create directory if does not exist
|
||||||
mkDir(logDir);
|
mkDir(this->outputDir());
|
||||||
|
|
||||||
// Open new file at start up
|
// Open new file at start up
|
||||||
outputFilePtr_.reset
|
outputFilePtr_.reset
|
||||||
(
|
(
|
||||||
new OFstream(logDir/(type() + ".dat"))
|
new OFstream(this->outputDir()/(type() + ".dat"))
|
||||||
);
|
);
|
||||||
|
|
||||||
outputFilePtr_()
|
outputFilePtr_()
|
||||||
@ -463,7 +461,7 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
|
|
||||||
writer->write
|
writer->write
|
||||||
(
|
(
|
||||||
outputDir_/time.timeName(),
|
this->outputDir()/time.timeName(),
|
||||||
"collector",
|
"collector",
|
||||||
points_,
|
points_,
|
||||||
faces_,
|
faces_,
|
||||||
@ -474,7 +472,7 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
|
|
||||||
writer->write
|
writer->write
|
||||||
(
|
(
|
||||||
outputDir_/time.timeName(),
|
this->outputDir()/time.timeName(),
|
||||||
"collector",
|
"collector",
|
||||||
points_,
|
points_,
|
||||||
faces_,
|
faces_,
|
||||||
@ -516,10 +514,11 @@ template<class CloudType>
|
|||||||
Foam::ParticleCollector<CloudType>::ParticleCollector
|
Foam::ParticleCollector<CloudType>::ParticleCollector
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CloudFunctionObject<CloudType>(dict, owner, typeName),
|
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||||
mode_(mtUnknown),
|
mode_(mtUnknown),
|
||||||
parcelType_(this->coeffDict().lookupOrDefault("parcelType", -1)),
|
parcelType_(this->coeffDict().lookupOrDefault("parcelType", -1)),
|
||||||
removeCollected_(this->coeffDict().lookup("removeCollected")),
|
removeCollected_(this->coeffDict().lookup("removeCollected")),
|
||||||
@ -542,22 +541,8 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
|
|||||||
massFlowRate_(),
|
massFlowRate_(),
|
||||||
log_(this->coeffDict().lookup("log")),
|
log_(this->coeffDict().lookup("log")),
|
||||||
outputFilePtr_(),
|
outputFilePtr_(),
|
||||||
outputDir_(owner.mesh().time().path()),
|
|
||||||
timeOld_(owner.mesh().time().value())
|
timeOld_(owner.mesh().time().value())
|
||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
|
||||||
{
|
|
||||||
// Put in undecomposed case (Note: gives problems for
|
|
||||||
// distributed data running)
|
|
||||||
outputDir_ =
|
|
||||||
outputDir_/".."/"postProcessing"/cloud::prefix/owner.name();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outputDir_ =
|
|
||||||
outputDir_/"postProcessing"/cloud::prefix/owner.name();
|
|
||||||
}
|
|
||||||
|
|
||||||
normal_ /= mag(normal_);
|
normal_ /= mag(normal_);
|
||||||
|
|
||||||
word mode(this->coeffDict().lookup("mode"));
|
word mode(this->coeffDict().lookup("mode"));
|
||||||
@ -618,7 +603,6 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
|
|||||||
massFlowRate_(pc.massFlowRate_),
|
massFlowRate_(pc.massFlowRate_),
|
||||||
log_(pc.log_),
|
log_(pc.log_),
|
||||||
outputFilePtr_(),
|
outputFilePtr_(),
|
||||||
outputDir_(pc.outputDir_),
|
|
||||||
timeOld_(0.0)
|
timeOld_(0.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -143,9 +143,6 @@ private:
|
|||||||
//- Output file pointer
|
//- Output file pointer
|
||||||
autoPtr<OFstream> outputFilePtr_;
|
autoPtr<OFstream> outputFilePtr_;
|
||||||
|
|
||||||
//- Output directory
|
|
||||||
fileName outputDir_;
|
|
||||||
|
|
||||||
//- Last calculation time
|
//- Last calculation time
|
||||||
scalar timeOld_;
|
scalar timeOld_;
|
||||||
|
|
||||||
@ -198,7 +195,12 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
ParticleCollector(const dictionary& dict, CloudType& owner);
|
ParticleCollector
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
ParticleCollector(const ParticleCollector<CloudType>& pc);
|
ParticleCollector(const ParticleCollector<CloudType>& pc);
|
||||||
|
|||||||
@ -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) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,10 +66,11 @@ template<class CloudType>
|
|||||||
Foam::ParticleErosion<CloudType>::ParticleErosion
|
Foam::ParticleErosion<CloudType>::ParticleErosion
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CloudFunctionObject<CloudType>(dict, owner, typeName),
|
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||||
QPtr_(NULL),
|
QPtr_(NULL),
|
||||||
patchIDs_(),
|
patchIDs_(),
|
||||||
p_(readScalar(this->coeffDict().lookup("p"))),
|
p_(readScalar(this->coeffDict().lookup("p"))),
|
||||||
|
|||||||
@ -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) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -96,7 +96,12 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
ParticleErosion(const dictionary& dict, CloudType& owner);
|
ParticleErosion
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
ParticleErosion(const ParticleErosion<CloudType>& pe);
|
ParticleErosion(const ParticleErosion<CloudType>& pe);
|
||||||
|
|||||||
@ -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) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -59,10 +59,11 @@ template<class CloudType>
|
|||||||
Foam::ParticleTracks<CloudType>::ParticleTracks
|
Foam::ParticleTracks<CloudType>::ParticleTracks
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CloudFunctionObject<CloudType>(dict, owner, typeName),
|
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||||
trackInterval_(readLabel(this->coeffDict().lookup("trackInterval"))),
|
trackInterval_(readLabel(this->coeffDict().lookup("trackInterval"))),
|
||||||
maxSamples_(readLabel(this->coeffDict().lookup("maxSamples"))),
|
maxSamples_(readLabel(this->coeffDict().lookup("maxSamples"))),
|
||||||
resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
|
resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
|
||||||
|
|||||||
@ -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) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,7 +95,12 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
ParticleTracks(const dictionary& dict, CloudType& owner);
|
ParticleTracks
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
ParticleTracks(const ParticleTracks<CloudType>& ppm);
|
ParticleTracks(const ParticleTracks<CloudType>& ppm);
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,10 +32,11 @@ template<class CloudType>
|
|||||||
Foam::ParticleTrap<CloudType>::ParticleTrap
|
Foam::ParticleTrap<CloudType>::ParticleTrap
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CloudFunctionObject<CloudType>(dict, owner, typeName),
|
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||||
alphaName_
|
alphaName_
|
||||||
(
|
(
|
||||||
this->coeffDict().template lookupOrDefault<word>("alphaName", "alpha")
|
this->coeffDict().template lookupOrDefault<word>("alphaName", "alpha")
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,8 +29,9 @@ Description
|
|||||||
|
|
||||||
Model is activated using:
|
Model is activated using:
|
||||||
|
|
||||||
particleTrap
|
particleTrap1
|
||||||
{
|
{
|
||||||
|
type particleTrap;
|
||||||
alphaName alpha; // name volume fraction field
|
alphaName alpha; // name volume fraction field
|
||||||
threshold 0.95; // alpha value below which model is active
|
threshold 0.95; // alpha value below which model is active
|
||||||
}
|
}
|
||||||
@ -91,7 +92,12 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
ParticleTrap(const dictionary& dict, CloudType& owner);
|
ParticleTrap
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
ParticleTrap(const ParticleTrap<CloudType>& pe);
|
ParticleTrap(const ParticleTrap<CloudType>& pe);
|
||||||
|
|||||||
@ -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) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -68,22 +68,7 @@ void Foam::PatchPostProcessing<CloudType>::write()
|
|||||||
{
|
{
|
||||||
const fvMesh& mesh = this->owner().mesh();
|
const fvMesh& mesh = this->owner().mesh();
|
||||||
|
|
||||||
fileName outputDir = mesh.time().path();
|
fileName outputDir = this->outputDir()/mesh.time().timeName();
|
||||||
|
|
||||||
if (Pstream::parRun())
|
|
||||||
{
|
|
||||||
// Put in undecomposed case (Note: gives problems for
|
|
||||||
// distributed data running)
|
|
||||||
outputDir =
|
|
||||||
outputDir/".."/"postProcessing"/cloud::prefix/
|
|
||||||
this->owner().name()/mesh.time().timeName();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outputDir =
|
|
||||||
outputDir/"postProcessing"/cloud::prefix/
|
|
||||||
this->owner().name()/mesh.time().timeName();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create directory if it doesn't exist
|
// Create directory if it doesn't exist
|
||||||
mkDir(outputDir);
|
mkDir(outputDir);
|
||||||
@ -141,10 +126,11 @@ template<class CloudType>
|
|||||||
Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
|
Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CloudFunctionObject<CloudType>(dict, owner, typeName),
|
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||||
maxStoredParcels_(readScalar(this->coeffDict().lookup("maxStoredParcels"))),
|
maxStoredParcels_(readScalar(this->coeffDict().lookup("maxStoredParcels"))),
|
||||||
patchIDs_(),
|
patchIDs_(),
|
||||||
times_(),
|
times_(),
|
||||||
|
|||||||
@ -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) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,7 +91,12 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
PatchPostProcessing(const dictionary& dict, CloudType& owner);
|
PatchPostProcessing
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
PatchPostProcessing(const PatchPostProcessing<CloudType>& ppm);
|
PatchPostProcessing(const PatchPostProcessing<CloudType>& ppm);
|
||||||
|
|||||||
@ -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) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -48,10 +48,11 @@ template<class CloudType>
|
|||||||
Foam::VoidFraction<CloudType>::VoidFraction
|
Foam::VoidFraction<CloudType>::VoidFraction
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
CloudType& owner
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
CloudFunctionObject<CloudType>(owner),
|
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||||
thetaPtr_(NULL)
|
thetaPtr_(NULL)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -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) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -81,7 +81,12 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
VoidFraction(const dictionary& dict, CloudType& owner);
|
VoidFraction
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner,
|
||||||
|
const word& modelName
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
VoidFraction(const VoidFraction<CloudType>& vf);
|
VoidFraction(const VoidFraction<CloudType>& vf);
|
||||||
|
|||||||
Reference in New Issue
Block a user