Commit 12386899 authored by andy's avatar andy
Browse files

ENH: Updated cloud post-processing models to cloudFunctionObject (list)

parent a7835efb
......@@ -25,12 +25,13 @@ License
#include "coalCloud.H"
#include "makeParcelCloudFunctionObjects.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
// Thermodynamic
#include "makeParcelHeatTransferModels.H"
......@@ -50,12 +51,13 @@ License
namespace Foam
{
makeParcelCloudFunctionObjects(coalCloud);
// Kinematic sub-models
makeThermoParcelForces(coalCloud);
makeParcelDispersionModels(coalCloud);
makeReactingMultiphaseParcelInjectionModels(coalCloud);
makeParcelPatchInteractionModels(coalCloud);
makeParcelPostProcessingModels(coalCloud);
// Thermo sub-models
makeParcelHeatTransferModels(coalCloud);
......
......@@ -31,7 +31,6 @@ License
#include "DispersionModel.H"
#include "InjectionModel.H"
#include "PatchInteractionModel.H"
#include "PostProcessingModel.H"
#include "SurfaceFilmModel.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
......@@ -66,15 +65,6 @@ void Foam::KinematicCloud<CloudType>::setModels()
).ptr()
);
postProcessingModel_.reset
(
PostProcessingModel<KinematicCloud<CloudType> >::New
(
subModelProperties_,
*this
).ptr()
);
surfaceFilmModel_.reset
(
SurfaceFilmModel<KinematicCloud<CloudType> >::New
......@@ -245,9 +235,10 @@ void Foam::KinematicCloud<CloudType>::postEvolve()
}
this->dispersion().cacheFields(false);
forces_.cacheFields(false);
this->postProcessing().post();
functions_.postEvolve();
solution_.nextIter();
}
......@@ -262,10 +253,11 @@ void Foam::KinematicCloud<CloudType>::cloudReset(KinematicCloud<CloudType>& c)
forces_.transfer(c.forces_);
functions_.transfer(c.functions_);
dispersionModel_.reset(c.dispersionModel_.ptr());
injectionModel_.reset(c.injectionModel_.ptr());
patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
postProcessingModel_.reset(c.postProcessingModel_.ptr());
surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr());
UIntegrator_.reset(c.UIntegrator_.ptr());
......@@ -309,7 +301,9 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
rndGen_
(
label(0),
solution_.steadyState() ?
particleProperties_.lookupOrDefault<label>("randomSampleSize", 100000)
: -1
),
cellOccupancyPtr_(),
rho_(rho),
......@@ -327,10 +321,19 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
),
solution_.active()
),
functions_
(
*this,
particleProperties_.subOrEmptyDict
(
"cloudFunctions",
solution_.active()
),
solution_.active()
),
dispersionModel_(NULL),
injectionModel_(NULL),
patchInteractionModel_(NULL),
postProcessingModel_(NULL),
surfaceFilmModel_(NULL),
UIntegrator_(NULL),
UTrans_
......@@ -405,10 +408,10 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
mu_(c.mu_),
g_(c.g_),
forces_(c.forces_),
functions_(c.functions_),
dispersionModel_(c.dispersionModel_->clone()),
injectionModel_(c.injectionModel_->clone()),
patchInteractionModel_(c.patchInteractionModel_->clone()),
postProcessingModel_(c.postProcessingModel_->clone()),
surfaceFilmModel_(c.surfaceFilmModel_->clone()),
UIntegrator_(c.UIntegrator_->clone()),
UTrans_
......@@ -480,10 +483,10 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
mu_(c.mu_),
g_(c.g_),
forces_(*this, mesh),
functions_(*this),
dispersionModel_(NULL),
injectionModel_(NULL),
patchInteractionModel_(NULL),
postProcessingModel_(NULL),
surfaceFilmModel_(NULL),
UIntegrator_(NULL),
UTrans_(NULL),
......
......@@ -27,17 +27,18 @@ Class
Description
Templated base class for kinematic cloud
- cloud function objects
- particle forces
- buoyancy
- drag
- pressure gradient
- sub-models:
- Dispersion model
- Injection model
- Patch interaction model
- Post-processing model
- Surface film model
- dispersion model
- injection model
- patch interaction model
- surface film model
SourceFiles
KinematicCloudI.H
......@@ -61,6 +62,7 @@ SourceFiles
#include "cloudSolution.H"
#include "ParticleForceList.H"
#include "CloudFunctionObjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -78,9 +80,6 @@ class InjectionModel;
template<class CloudType>
class PatchInteractionModel;
template<class CloudType>
class PostProcessingModel;
template<class CloudType>
class SurfaceFilmModel;
......@@ -108,9 +107,13 @@ public:
//- Convenience typedef for this cloud type
typedef KinematicCloud<CloudType> kinematicCloudType;
//- Force type
//- Force models type
typedef ParticleForceList<KinematicCloud<CloudType> > forceType;
//- Function object type
typedef CloudFunctionObjectList<KinematicCloud<CloudType> >
functionType;
private:
......@@ -176,6 +179,9 @@ protected:
//- Optional particle forces
forceType forces_;
//- Optional cloud function objects
functionType functions_;
// References to the cloud sub-models
......@@ -191,10 +197,6 @@ protected:
autoPtr<PatchInteractionModel<KinematicCloud<CloudType> > >
patchInteractionModel_;
//- Post-processing model
autoPtr<PostProcessingModel<KinematicCloud<CloudType> > >
postProcessingModel_;
//- Surface film model
autoPtr<SurfaceFilmModel<KinematicCloud<CloudType> > >
surfaceFilmModel_;
......@@ -369,6 +371,9 @@ public:
// inline const typename parcelType::forceType& forces() const;
inline const forceType& forces() const;
//- Optional cloud function objects
inline functionType& functions();
// Sub-models
......@@ -396,10 +401,6 @@ public:
inline PatchInteractionModel<KinematicCloud<CloudType> >&
patchInteraction();
//- Return reference to post-processing model
inline PostProcessingModel<KinematicCloud<CloudType> >&
postProcessing();
//- Return const-access to the surface film model
inline const SurfaceFilmModel<KinematicCloud<CloudType> >&
surfaceFilm() const;
......
......@@ -118,6 +118,14 @@ Foam::KinematicCloud<CloudType>::forces() const
}
template<class CloudType>
inline typename Foam::KinematicCloud<CloudType>::functionType&
Foam::KinematicCloud<CloudType>::functions()
{
return functions_;
}
template<class CloudType>
inline const Foam::DispersionModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::dispersion() const
......@@ -166,14 +174,6 @@ Foam::KinematicCloud<CloudType>::injection()
}
template<class CloudType>
inline Foam::PostProcessingModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::postProcessing()
{
return postProcessingModel_();
}
template<class CloudType>
inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >&
Foam::KinematicCloud<CloudType>::surfaceFilm() const
......
......@@ -337,7 +337,7 @@ void Foam::KinematicParcel<ParcelType>::hitFace(TrackData& td)
typename TrackData::cloudType::parcelType& p =
static_cast<typename TrackData::cloudType::parcelType&>(*this);
td.cloud().postProcessing().postFace(p);
td.cloud().functions().postFace(p);
}
......@@ -361,7 +361,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
static_cast<typename TrackData::cloudType::parcelType&>(*this);
// Invoke post-processing model
td.cloud().postProcessing().postPatch(p, patchI);
td.cloud().functions().postPatch(p, patchI);
// Invoke surface film model
if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle))
......
......@@ -25,26 +25,28 @@ License
#include "basicKinematicCollidingCloud.H"
#include "makeParcelCloudFunctionObjects.H"
// Kinematic
#include "makeParcelForces.H"
#include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
#include "makeParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeParcelCloudFunctionObjects(basicKinematicCollidingCloud);
// Kinematic sub-models
makeParcelForces(basicKinematicCollidingCloud);
makeParcelDispersionModels(basicKinematicCollidingCloud);
makeParcelInjectionModels(basicKinematicCollidingCloud);
makeParcelCollisionModels(basicKinematicCollidingCloud);
makeParcelPatchInteractionModels(basicKinematicCollidingCloud);
makeParcelPostProcessingModels(basicKinematicCollidingCloud);
makeParcelSurfaceFilmModels(basicKinematicCollidingCloud);
}
......
......@@ -25,24 +25,26 @@ License
#include "basicKinematicCloud.H"
#include "makeParcelCloudFunctionObjects.H"
// Kinematic
#include "makeParcelForces.H"
#include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
#include "makeParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeParcelCloudFunctionObjects(basicKinematicCloud);
// Kinematic sub-models
makeParcelForces(basicKinematicCloud);
makeParcelDispersionModels(basicKinematicCloud);
makeParcelInjectionModels(basicKinematicCloud);
makeParcelPatchInteractionModels(basicKinematicCloud);
makeParcelPostProcessingModels(basicKinematicCloud);
makeParcelSurfaceFilmModels(basicKinematicCloud);
}
......
......@@ -25,12 +25,13 @@ License
#include "basicReactingMultiphaseCloud.H"
#include "makeParcelCloudFunctionObjects.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
// Thermodynamic
#include "makeParcelHeatTransferModels.H"
......@@ -48,12 +49,13 @@ License
namespace Foam
{
makeParcelCloudFunctionObjects(basicReactingMultiphaseCloud);
// Kinematic sub-models
makeThermoParcelForces(basicReactingMultiphaseCloud);
makeParcelDispersionModels(basicReactingMultiphaseCloud);
makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud);
makeParcelPatchInteractionModels(basicReactingMultiphaseCloud);
makeParcelPostProcessingModels(basicReactingMultiphaseCloud);
// Thermo sub-models
makeParcelHeatTransferModels(basicReactingMultiphaseCloud);
......
......@@ -25,12 +25,13 @@ License
#include "basicReactingCloud.H"
#include "makeParcelCloudFunctionObjects.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeReactingParcelInjectionModels.H" // Reacting variant
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
// Thermodynamic
#include "makeParcelHeatTransferModels.H"
......@@ -47,12 +48,13 @@ namespace Foam
typedef basicReactingCloud::thermoCloudType thermoCloudType2;
typedef basicReactingCloud::kinematicCloudType kinematicCloudType2;
makeParcelCloudFunctionObjects(basicReactingCloud);
// Kinematic sub-models
makeThermoParcelForces(basicReactingCloud);
makeParcelDispersionModels(basicReactingCloud);
makeReactingParcelInjectionModels(basicReactingCloud);
makeParcelPatchInteractionModels(basicReactingCloud);
makeParcelPostProcessingModels(basicReactingCloud);
// Thermo sub-models
makeParcelHeatTransferModels(basicReactingCloud);
......
......@@ -25,12 +25,13 @@ License
#include "basicThermoCloud.H"
#include "makeParcelCloudFunctionObjects.H"
// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
// Thermodynamic
#include "makeParcelHeatTransferModels.H"
......@@ -40,12 +41,13 @@ License
namespace Foam
{
makeParcelCloudFunctionObjects(basicThermoCloud);
// Kinematic sub-models
makeThermoParcelForces(basicThermoCloud);
makeParcelDispersionModels(basicThermoCloud);
makeParcelInjectionModels(basicThermoCloud);
makeParcelPatchInteractionModels(basicThermoCloud);
makeParcelPostProcessingModels(basicThermoCloud);
// Thermo sub-models
makeParcelHeatTransferModels(basicThermoCloud);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -23,24 +23,22 @@ License
\*---------------------------------------------------------------------------*/
#ifndef makeParcelPostProcessingModels_H
#define makeParcelPostProcessingModels_H
#ifndef makeParcelCloudFunctionObjects_H
#define makeParcelCloudFunctionObjects_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NoPostProcessing.H"
#include "ParticleTracks.H"
#include "PatchPostProcessing.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelPostProcessingModels(CloudType) \
#define makeParcelCloudFunctionObjects(CloudType) \
\
makePostProcessingModel(CloudType); \
makeCloudFunctionObject(CloudType); \
\
makePostProcessingModelType(NoPostProcessing, CloudType); \
makePostProcessingModelType(ParticleTracks, CloudType); \
makePostProcessingModelType(PatchPostProcessing, CloudType);
makeCloudFunctionObjectType(ParticleTracks, CloudType); \
makeCloudFunctionObjectType(PatchPostProcessing, CloudType);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -23,42 +23,42 @@ License
\*---------------------------------------------------------------------------*/
#include "PostProcessingModel.H"
#include "CloudFunctionObject.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class CloudType>
void Foam::PostProcessingModel<CloudType>::write()
void Foam::CloudFunctionObject<CloudType>::write()
{
notImplemented("void Foam::PostProcessingModel<CloudType>::write()");
notImplemented("void Foam::CloudFunctionObject<CloudType>::write()");
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::PostProcessingModel<CloudType>::PostProcessingModel(CloudType& owner)
Foam::CloudFunctionObject<CloudType>::CloudFunctionObject(CloudType& owner)
:
SubModelBase<CloudType>(owner)
{}
template<class CloudType>
Foam::PostProcessingModel<CloudType>::PostProcessingModel
Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
(
const dictionary& dict,
CloudType& owner,
const word& type
)
:
SubModelBase<CloudType>(owner, dict, type)
SubModelBase<CloudType>(owner, dict, type, "")
{}
template<class CloudType>
Foam::PostProcessingModel<CloudType>::PostProcessingModel
Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
(
const PostProcessingModel<CloudType>& ppm
const CloudFunctionObject<CloudType>& ppm
)
:
SubModelBase<CloudType>(ppm)
......@@ -68,14 +68,14 @@ Foam::PostProcessingModel<CloudType>::PostProcessingModel
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::PostProcessingModel<CloudType>::~PostProcessingModel()
Foam::CloudFunctionObject<CloudType>::~CloudFunctionObject()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::PostProcessingModel<CloudType>::post()
void Foam::CloudFunctionObject<CloudType>::postEvolve()
{
if (this->owner().time().outputTime())
{
......@@ -85,7 +85,7 @@ void Foam::PostProcessingModel<CloudType>::post()
template<class CloudType>
void Foam::PostProcessingModel<CloudType>::postPatch
void Foam::CloudFunctionObject<CloudType>::postPatch
(
const typename CloudType::parcelType&,
const label
......@@ -93,7 +93,7 @@ void Foam::PostProcessingModel<CloudType>::postPatch
{
notImplemented
(
"void Foam::PostProcessingModel<CloudType>::postPatch"
"void Foam::CloudFunctionObject<CloudType>::postPatch"
"("
"const typename CloudType::parcelType&,"
"const label"
......@@ -103,14 +103,14 @@ void Foam::PostProcessingModel<CloudType>::postPatch
template<class CloudType>
void Foam::PostProcessingModel<CloudType>::postFace
void Foam::CloudFunctionObject<CloudType>::postFace
(
const typename CloudType::parcelType&
)
{
notImplemented
(
"void Foam::PostProcessingModel<CloudType>::postFace"
"void Foam::CloudFunctionObject<CloudType>::postFace"
"("
"const typename CloudType::parcelType&"
")"
......@@ -120,6 +120,6 @@ void Foam::PostProcessingModel<CloudType>::postFace
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "PostProcessingModelNew.C"
#include "CloudFunctionObjectNew.C"
// ************************************************************************* //