diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 2a1ea126f0a9d5b62c9393c4360218dcc77201e9..a9577d66cf6dab5442b056ddee28c4f442df75af 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -7,10 +7,6 @@ BASECLOUDS=$(CLOUDS)/baseClasses DERIVEDCLOUDS=$(CLOUDS)/derived -/* Parcels */ -$(BASEPARCELS)/reactingParcel/reactingParcel.C - - /* Cloud base classes */ $(BASECLOUDS)/kinematicCloud/kinematicCloud.C $(BASECLOUDS)/thermoCloud/thermoCloud.C @@ -20,28 +16,24 @@ $(BASECLOUDS)/reactingMultiphaseCloud/reactingMultiphaseCloud.C /* kinematic parcel sub-models */ KINEMATICPARCEL=$(DERIVEDPARCELS)/basicKinematicParcel -$(KINEMATICPARCEL)/basicKinematicParcel.C $(KINEMATICPARCEL)/defineBasicKinematicParcel.C $(KINEMATICPARCEL)/makeBasicKinematicParcelSubmodels.C /* thermo parcel sub-models */ THERMOPARCEL=$(DERIVEDPARCELS)/basicThermoParcel -$(THERMOPARCEL)/basicThermoParcel.C $(THERMOPARCEL)/defineBasicThermoParcel.C $(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C /* reacting parcel sub-models */ REACTINGPARCEL=$(DERIVEDPARCELS)/basicReactingParcel -$(REACTINGPARCEL)/basicReactingParcel.C $(REACTINGPARCEL)/defineBasicReactingParcel.C $(REACTINGPARCEL)/makeBasicReactingParcelSubmodels.C /* reacting multiphase parcel sub-models */ REACTINGMPPARCEL=$(DERIVEDPARCELS)/basicReactingMultiphaseParcel -$(REACTINGMPPARCEL)/basicReactingMultiphaseParcel.C $(REACTINGMPPARCEL)/defineBasicReactingMultiphaseParcel.C $(REACTINGMPPARCEL)/makeBasicReactingMultiphaseParcelSubmodels.C diff --git a/src/lagrangian/intermediate/Make/files.old b/src/lagrangian/intermediate/Make/files.old new file mode 100644 index 0000000000000000000000000000000000000000..b5ccca4ed27866215b182f6806698db3c39222ea --- /dev/null +++ b/src/lagrangian/intermediate/Make/files.old @@ -0,0 +1,70 @@ +PARCELS=parcels +BASEPARCELS=$(PARCELS)/baseClasses +DERIVEDPARCELS=$(PARCELS)/derived + + +CLOUDS=clouds +BASECLOUDS=$(CLOUDS)/baseClasses +DERIVEDCLOUDS=$(CLOUDS)/derived + + +/* Parcels */ +$(BASEPARCELS)/reactingParcel/reactingParcel.C + + +/* Cloud base classes */ +$(BASECLOUDS)/kinematicCloud/kinematicCloud.C +$(BASECLOUDS)/thermoCloud/thermoCloud.C +$(BASECLOUDS)/reactingCloud/reactingCloud.C + + +/* kinematic parcel sub-models */ +KINEMATICPARCEL=$(DERIVEDPARCELS)/basicKinematicParcel +$(KINEMATICPARCEL)/basicKinematicParcel.C +$(KINEMATICPARCEL)/defineBasicKinematicParcel.C +$(KINEMATICPARCEL)/makeBasicKinematicParcelSubmodels.C + +/* thermo parcel sub-models */ +THERMOPARCEL=$(DERIVEDPARCELS)/basicThermoParcel +$(THERMOPARCEL)/basicThermoParcel.C +$(THERMOPARCEL)/defineBasicThermoParcel.C +$(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C + +/* reacting parcel sub-models */ +REACTINGPARCEL=$(DERIVEDPARCELS)/basicReactingParcel +$(REACTINGPARCEL)/basicReactingParcel.C +$(REACTINGPARCEL)/defineBasicReactingParcel.C +$(REACTINGPARCEL)/makeBasicReactingParcelSubmodels.C + + +/* bolt-on models */ + +submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionData.C + +KINEMATICINJECTION=submodels/Kinematic/InjectionModel +$(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionData.C +$(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionDataIO.C +$(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.C + +THERMOINJECTION=submodels/Thermodynamic/InjectionModel +$(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionData.C +$(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionDataIO.C +$(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.C + +REACTINGINJECTION=submodels/Reacting/InjectionModel +$(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionData.C +$(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionDataIO.C +$(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.C + + +/* integration schemes */ +IntegrationScheme/makeIntegrationSchemes.C + + +/* phase properties */ +phaseProperties/phaseProperties/phaseProperties.C +phaseProperties/phaseProperties/phasePropertiesIO.C +phaseProperties/phasePropertiesList/phasePropertiesList.C + + +LIB = $(FOAM_LIBBIN)/liblagrangianIntermediate diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index d48136443d0f5d1e5df02c8d104147e017023a94..c087188b4883f3ecffe756d2019e95c5375ee530 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -37,8 +37,8 @@ License // * * * * * * * * * * * * * * cloudSolution * * * * * * * * * * * * * * * * // -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::cloudSolution::read() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::cloudSolution::read() { dict_.lookup("transient") >> transient_; dict_.lookup("coupled") >> coupled_; @@ -55,8 +55,8 @@ void Foam::KinematicCloud<ParcelType>::cloudSolution::read() } -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution +template<class CloudType> +Foam::KinematicCloud<CloudType>::cloudSolution::cloudSolution ( const fvMesh& mesh, const dictionary& dict @@ -82,8 +82,8 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution } -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution +template<class CloudType> +Foam::KinematicCloud<CloudType>::cloudSolution::cloudSolution ( const cloudSolution& cs ) @@ -103,8 +103,8 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution {} -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution +template<class CloudType> +Foam::KinematicCloud<CloudType>::cloudSolution::cloudSolution ( const fvMesh& mesh ) @@ -124,13 +124,13 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution {} -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::cloudSolution::~cloudSolution() +template<class CloudType> +Foam::KinematicCloud<CloudType>::cloudSolution::~cloudSolution() {} -template<class ParcelType> -Foam::scalar Foam::KinematicCloud<ParcelType>::cloudSolution::relaxCoeff +template<class CloudType> +Foam::scalar Foam::KinematicCloud<CloudType>::cloudSolution::relaxCoeff ( const word& fieldName ) const @@ -139,8 +139,8 @@ Foam::scalar Foam::KinematicCloud<ParcelType>::cloudSolution::relaxCoeff } -template<class ParcelType> -bool Foam::KinematicCloud<ParcelType>::cloudSolution::semiImplicit +template<class CloudType> +bool Foam::KinematicCloud<CloudType>::cloudSolution::semiImplicit ( const word& fieldName ) const @@ -149,8 +149,8 @@ bool Foam::KinematicCloud<ParcelType>::cloudSolution::semiImplicit } -template<class ParcelType> -bool Foam::KinematicCloud<ParcelType>::cloudSolution::solveThisStep() const +template<class CloudType> +bool Foam::KinematicCloud<CloudType>::cloudSolution::solveThisStep() const { return active_ @@ -161,8 +161,8 @@ bool Foam::KinematicCloud<ParcelType>::cloudSolution::solveThisStep() const } -template<class ParcelType> -bool Foam::KinematicCloud<ParcelType>::cloudSolution::canEvolve() +template<class CloudType> +bool Foam::KinematicCloud<CloudType>::cloudSolution::canEvolve() { // Set the calculation time step if (transient_) @@ -178,8 +178,8 @@ bool Foam::KinematicCloud<ParcelType>::cloudSolution::canEvolve() } -template<class ParcelType> -bool Foam::KinematicCloud<ParcelType>::cloudSolution::output() const +template<class CloudType> +bool Foam::KinematicCloud<CloudType>::cloudSolution::output() const { return active_ && mesh_.time().outputTime(); } @@ -187,12 +187,12 @@ bool Foam::KinematicCloud<ParcelType>::cloudSolution::output() const // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::setModels() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::setModels() { collisionModel_.reset ( - CollisionModel<KinematicCloud<ParcelType> >::New + CollisionModel<KinematicCloud<CloudType> >::New ( subModelProperties_, *this @@ -201,7 +201,7 @@ void Foam::KinematicCloud<ParcelType>::setModels() dispersionModel_.reset ( - DispersionModel<KinematicCloud<ParcelType> >::New + DispersionModel<KinematicCloud<CloudType> >::New ( subModelProperties_, *this @@ -210,7 +210,7 @@ void Foam::KinematicCloud<ParcelType>::setModels() injectionModel_.reset ( - InjectionModel<KinematicCloud<ParcelType> >::New + InjectionModel<KinematicCloud<CloudType> >::New ( subModelProperties_, *this @@ -219,7 +219,7 @@ void Foam::KinematicCloud<ParcelType>::setModels() patchInteractionModel_.reset ( - PatchInteractionModel<KinematicCloud<ParcelType> >::New + PatchInteractionModel<KinematicCloud<CloudType> >::New ( subModelProperties_, *this @@ -228,7 +228,7 @@ void Foam::KinematicCloud<ParcelType>::setModels() postProcessingModel_.reset ( - PostProcessingModel<KinematicCloud<ParcelType> >::New + PostProcessingModel<KinematicCloud<CloudType> >::New ( subModelProperties_, *this @@ -237,7 +237,7 @@ void Foam::KinematicCloud<ParcelType>::setModels() surfaceFilmModel_.reset ( - SurfaceFilmModel<KinematicCloud<ParcelType> >::New + SurfaceFilmModel<KinematicCloud<CloudType> >::New ( subModelProperties_, *this, @@ -256,11 +256,9 @@ void Foam::KinematicCloud<ParcelType>::setModels() } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::solve -( - typename ParcelType::trackData& td -) +template<class CloudType> +template<class TrackData> +void Foam::KinematicCloud<CloudType>::solve(TrackData& td) { if (solution_.transient()) { @@ -290,8 +288,8 @@ void Foam::KinematicCloud<ParcelType>::solve } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::preEvolve() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::preEvolve() { Info<< "\nSolving cloud " << this->name() << endl; @@ -301,14 +299,14 @@ void Foam::KinematicCloud<ParcelType>::preEvolve() } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::buildCellOccupancy() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::buildCellOccupancy() { if (cellOccupancyPtr_.empty()) { cellOccupancyPtr_.reset ( - new List<DynamicList<ParcelType*> >(mesh_.nCells()) + new List<DynamicList<parcelType*> >(mesh_.nCells()) ); } else if (cellOccupancyPtr_().size() != mesh_.nCells()) @@ -319,22 +317,22 @@ void Foam::KinematicCloud<ParcelType>::buildCellOccupancy() cellOccupancyPtr_().setSize(mesh_.nCells()); } - List<DynamicList<ParcelType*> >& cellOccupancy = cellOccupancyPtr_(); + List<DynamicList<parcelType*> >& cellOccupancy = cellOccupancyPtr_(); forAll(cellOccupancy, cO) { cellOccupancy[cO].clear(); } - forAllIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllIter(typename KinematicCloud<CloudType>, *this, iter) { cellOccupancy[iter().cell()].append(&iter()); } } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::updateCellOccupancy() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::updateCellOccupancy() { // Only build the cellOccupancy if the pointer is set, i.e. it has // been requested before. @@ -346,11 +344,9 @@ void Foam::KinematicCloud<ParcelType>::updateCellOccupancy() } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::evolveCloud -( - typename ParcelType::trackData& td -) +template<class CloudType> +template<class TrackData> +void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td) { if (solution_.coupled()) { @@ -384,17 +380,15 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud this->injection().injectSteadyState(td, solution_.deltaT()); - td.part() = ParcelType::trackData::tpLinearTrack; - Cloud<ParcelType>::move(td, solution_.deltaT()); + td.part() = TrackData::tpLinearTrack; + CloudType::move(td, solution_.deltaT()); } } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::motion -( - typename ParcelType::trackData& td -) +template<class CloudType> +template<class TrackData> +void Foam::KinematicCloud<CloudType>::motion(TrackData& td) { // Sympletic leapfrog integration of particle forces: // + apply half deltaV with stored force @@ -428,32 +422,30 @@ void Foam::KinematicCloud<ParcelType>::motion } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::moveCollide -( - typename ParcelType::trackData& td -) +template<class CloudType> +template<class TrackData> +void Foam::KinematicCloud<CloudType>::moveCollide(TrackData& td) { - td.part() = ParcelType::trackData::tpVelocityHalfStep; - Cloud<ParcelType>::move(td, solution_.deltaT()); + td.part() = TrackData::tpVelocityHalfStep; + CloudType::move(td, solution_.deltaT()); - td.part() = ParcelType::trackData::tpLinearTrack; - Cloud<ParcelType>::move(td, solution_.deltaT()); + td.part() = TrackData::tpLinearTrack; + CloudType::move(td, solution_.deltaT()); - // td.part() = ParcelType::trackData::tpRotationalTrack; - // Cloud<ParcelType>::move(td); + // td.part() = TrackData::tpRotationalTrack; + // CloudType::move(td); updateCellOccupancy(); this->collision().collide(); - td.part() = ParcelType::trackData::tpVelocityHalfStep; - Cloud<ParcelType>::move(td, solution_.deltaT()); + td.part() = TrackData::tpVelocityHalfStep; + CloudType::move(td, solution_.deltaT()); } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::postEvolve() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::postEvolve() { Info<< endl; @@ -471,10 +463,10 @@ void Foam::KinematicCloud<ParcelType>::postEvolve() } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::cloudReset(KinematicCloud<ParcelType>& c) +template<class CloudType> +void Foam::KinematicCloud<CloudType>::cloudReset(KinematicCloud<CloudType>& c) { - Cloud<ParcelType>::cloudReset(c); + CloudType::cloudReset(c); rndGen_ = c.rndGen_; @@ -492,8 +484,8 @@ void Foam::KinematicCloud<ParcelType>::cloudReset(KinematicCloud<ParcelType>& c) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::KinematicCloud +template<class CloudType> +Foam::KinematicCloud<CloudType>::KinematicCloud ( const word& cloudName, const volScalarField& rho, @@ -503,7 +495,7 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud bool readFields ) : - Cloud<ParcelType>(rho.mesh(), cloudName, false), + CloudType(rho.mesh(), cloudName, false), kinematicCloud(), cloudCopyPtr_(NULL), mesh_(rho.mesh()), @@ -592,7 +584,7 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud if (readFields) { - ParcelType::readFields(*this); + parcelType::readFields(*this); } if (solution_.resetSourcesOnStartup()) @@ -602,14 +594,14 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud } -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::KinematicCloud +template<class CloudType> +Foam::KinematicCloud<CloudType>::KinematicCloud ( - KinematicCloud<ParcelType>& c, + KinematicCloud<CloudType>& c, const word& name ) : - Cloud<ParcelType>(c.mesh_, name, c), + CloudType(c.mesh_, name, c), kinematicCloud(), cloudCopyPtr_(NULL), mesh_(c.mesh_), @@ -666,15 +658,15 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud {} -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::KinematicCloud +template<class CloudType> +Foam::KinematicCloud<CloudType>::KinematicCloud ( const fvMesh& mesh, const word& name, - const KinematicCloud<ParcelType>& c + const KinematicCloud<CloudType>& c ) : - Cloud<ParcelType>(mesh, name, IDLList<ParcelType>()), + CloudType(mesh, name, IDLList<parcelType>()), kinematicCloud(), cloudCopyPtr_(NULL), mesh_(mesh), @@ -714,17 +706,17 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::KinematicCloud<ParcelType>::~KinematicCloud() +template<class CloudType> +Foam::KinematicCloud<CloudType>::~KinematicCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::checkParcelProperties +template<class CloudType> +void Foam::KinematicCloud<CloudType>::checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) @@ -739,12 +731,12 @@ void Foam::KinematicCloud<ParcelType>::checkParcelProperties } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::storeState() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::storeState() { cloudCopyPtr_.reset ( - static_cast<KinematicCloud<ParcelType>*> + static_cast<KinematicCloud<CloudType>*> ( clone(this->name() + "Copy").ptr() ) @@ -752,25 +744,25 @@ void Foam::KinematicCloud<ParcelType>::storeState() } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::restoreState() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::restoreState() { cloudReset(cloudCopyPtr_()); cloudCopyPtr_.clear(); } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::resetSourceTerms() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::resetSourceTerms() { UTrans().field() = vector::zero; UCoeff().field() = 0.0; } -template<class ParcelType> +template<class CloudType> template<class Type> -void Foam::KinematicCloud<ParcelType>::relax +void Foam::KinematicCloud<CloudType>::relax ( DimensionedField<Type, volMesh>& field, const DimensionedField<Type, volMesh>& field0, @@ -783,30 +775,31 @@ void Foam::KinematicCloud<ParcelType>::relax } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::relaxSources +template<class CloudType> +void Foam::KinematicCloud<CloudType>::relaxSources ( - const KinematicCloud<ParcelType>& cloudOldTime + const KinematicCloud<CloudType>& cloudOldTime ) { this->relax(UTrans_(), cloudOldTime.UTrans(), "U"); } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::evolve() +template<class CloudType> +void Foam::KinematicCloud<CloudType>::evolve() { if (solution_.canEvolve()) { - typename ParcelType::trackData td(*this); + typename parcelType::template + TrackingData<KinematicCloud<CloudType> > td(*this); solve(td); } } -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::info() const +template<class CloudType> +void Foam::KinematicCloud<CloudType>::info() const { vector linearMomentum = linearMomentumOfSystem(); reduce(linearMomentum, sumOp<vector>()); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 50e8d182aa3abf0589996a8be935e08bea987341..e003469aedcfba9ffdb24a983ad5e77e90c343fa 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -51,6 +51,7 @@ SourceFiles #ifndef KinematicCloud_H #define KinematicCloud_H +#include "particle.H" #include "Cloud.H" #include "kinematicCloud.H" #include "IOdictionary.H" @@ -62,6 +63,9 @@ SourceFiles #include "IntegrationSchemesFwd.H" + +#include "ParticleForceList.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -92,16 +96,21 @@ class SurfaceFilmModel; Class KinematicCloud Declaration \*---------------------------------------------------------------------------*/ -template<class ParcelType> +template<class CloudType> class KinematicCloud : - public Cloud<ParcelType>, + public CloudType, public kinematicCloud { public: - //- Type of parcel the cloud was instantiated for - typedef ParcelType parcelType; + // Public typedefs + + //- Redefine particle type as parcel type + typedef typename CloudType::particleType parcelType; + + //- Force type + typedef ParticleForceList<KinematicCloud<CloudType> > forceType; private: @@ -109,7 +118,7 @@ private: // Private data //- Cloud copy pointer - autoPtr<KinematicCloud<ParcelType> > cloudCopyPtr_; + autoPtr<KinematicCloud<CloudType> > cloudCopyPtr_; // Private Member Functions @@ -293,7 +302,7 @@ protected: cloudSolution solution_; //- Parcel constant properties - typename ParcelType::constantProperties constProps_; + typename parcelType::constantProperties constProps_; //- Sub-models dictionary const dictionary subModelProperties_; @@ -302,7 +311,7 @@ protected: cachedRandom rndGen_; //- Cell occupancy information for each parcel, (demand driven) - autoPtr<List<DynamicList<ParcelType*> > > cellOccupancyPtr_; + autoPtr<List<DynamicList<parcelType*> > > cellOccupancyPtr_; // References to the carrier gas fields @@ -324,33 +333,33 @@ protected: //- Optional particle forces - typename ParcelType::forceType forces_; + forceType forces_; // References to the cloud sub-models //- Collision model - autoPtr<CollisionModel<KinematicCloud<ParcelType> > > + autoPtr<CollisionModel<KinematicCloud<CloudType> > > collisionModel_; //- Dispersion model - autoPtr<DispersionModel<KinematicCloud<ParcelType> > > + autoPtr<DispersionModel<KinematicCloud<CloudType> > > dispersionModel_; //- Injector model - autoPtr<InjectionModel<KinematicCloud<ParcelType> > > + autoPtr<InjectionModel<KinematicCloud<CloudType> > > injectionModel_; //- Patch interaction model - autoPtr<PatchInteractionModel<KinematicCloud<ParcelType> > > + autoPtr<PatchInteractionModel<KinematicCloud<CloudType> > > patchInteractionModel_; //- Post-processing model - autoPtr<PostProcessingModel<KinematicCloud<ParcelType> > > + autoPtr<PostProcessingModel<KinematicCloud<CloudType> > > postProcessingModel_; //- Surface film model - autoPtr<SurfaceFilmModel<KinematicCloud<ParcelType> > > + autoPtr<SurfaceFilmModel<KinematicCloud<CloudType> > > surfaceFilmModel_; @@ -378,7 +387,8 @@ protected: // Cloud evolution functions //- Solve the cloud - calls all evolution functions - void solve(typename ParcelType::trackData& td); + template<class TrackData> + void solve(TrackData& td); //- Pre-evolve void preEvolve(); @@ -391,23 +401,28 @@ protected: void updateCellOccupancy(); //- Evolve the cloud - void evolveCloud(typename ParcelType::trackData& td); + template<class TrackData> + void evolveCloud(TrackData& td); //- Particle motion - void motion(typename ParcelType::trackData& td); + template<class TrackData> + void motion(TrackData& td); //- Move-collide particles - void moveCollide(typename ParcelType::trackData& td); + template<class TrackData> + void moveCollide(TrackData& td); //- Post-evolve void postEvolve(); //- Reset state of cloud - void cloudReset(KinematicCloud<ParcelType>& c); + void cloudReset(KinematicCloud<CloudType>& c); public: + typedef CloudType cloudType; + // Constructors //- Construct given carrier gas fields @@ -422,29 +437,33 @@ public: ); //- Copy constructor with new name - KinematicCloud(KinematicCloud<ParcelType>& c, const word& name); + KinematicCloud + ( + KinematicCloud<CloudType>& c, + const word& name + ); //- Copy constructor with new name - creates bare cloud KinematicCloud ( const fvMesh& mesh, const word& name, - const KinematicCloud<ParcelType>& c + const KinematicCloud<CloudType>& c ); //- Construct and return clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > clone(const word& name) + virtual autoPtr<Cloud<parcelType> > clone(const word& name) { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new KinematicCloud(*this, name) ); } //- Construct and return bare clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > cloneBare(const word& name) const + virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new KinematicCloud(this->mesh(), name, *this) ); @@ -471,7 +490,7 @@ public: // References to the mesh and databases - //- Return refernce to the mesh + //- Return reference to the mesh inline const fvMesh& mesh() const; //- Return particle properties dictionary @@ -484,7 +503,7 @@ public: inline cloudSolution& solution(); //- Return the constant properties - inline const typename ParcelType::constantProperties& + inline const typename parcelType::constantProperties& constProps() const; //- Return reference to the sub-models dictionary @@ -493,14 +512,14 @@ public: // Cloud data - //- Return refernce to the random object + //- Return reference to the random object inline cachedRandom& rndGen(); //- Return the cell occupancy information for each // parcel, non-const access, the caller is // responsible for updating it for its own purposes // if particles are removed or created. - inline List<DynamicList<ParcelType*> >& cellOccupancy(); + inline List<DynamicList<parcelType*> >& cellOccupancy(); // References to the carrier gas fields @@ -522,53 +541,54 @@ public: //- Optional particle forces - inline const typename ParcelType::forceType& forces() const; +// inline const typename parcelType::forceType& forces() const; + inline const forceType& forces() const; // Sub-models //- Return const access to the collision model - inline const CollisionModel<KinematicCloud<ParcelType> >& + inline const CollisionModel<KinematicCloud<CloudType> >& collision() const; //- Return reference to the collision model - inline CollisionModel<KinematicCloud<ParcelType> >& + inline CollisionModel<KinematicCloud<CloudType> >& collision(); //- Return const-access to the dispersion model - inline const DispersionModel<KinematicCloud<ParcelType> >& + inline const DispersionModel<KinematicCloud<CloudType> >& dispersion() const; //- Return reference to the dispersion model - inline DispersionModel<KinematicCloud<ParcelType> >& + inline DispersionModel<KinematicCloud<CloudType> >& dispersion(); //- Return const access to the injection model - inline const InjectionModel<KinematicCloud<ParcelType> >& + inline const InjectionModel<KinematicCloud<CloudType> >& injection() const; //- Return reference to the injection model - inline InjectionModel<KinematicCloud<ParcelType> >& + inline InjectionModel<KinematicCloud<CloudType> >& injection(); //- Return const-access to the patch interaction model - inline const PatchInteractionModel<KinematicCloud<ParcelType> >& + inline const PatchInteractionModel<KinematicCloud<CloudType> >& patchInteraction() const; //- Return reference to the patch interaction model - inline PatchInteractionModel<KinematicCloud<ParcelType> >& + inline PatchInteractionModel<KinematicCloud<CloudType> >& patchInteraction(); //- Return reference to post-processing model - inline PostProcessingModel<KinematicCloud<ParcelType> >& + inline PostProcessingModel<KinematicCloud<CloudType> >& postProcessing(); //- Return const-access to the surface film model - inline const SurfaceFilmModel<KinematicCloud<ParcelType> >& + inline const SurfaceFilmModel<KinematicCloud<CloudType> >& surfaceFilm() const; //- Return reference to the surface film model - inline SurfaceFilmModel<KinematicCloud<ParcelType> >& + inline SurfaceFilmModel<KinematicCloud<CloudType> >& surfaceFilm(); @@ -638,7 +658,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); @@ -662,7 +682,7 @@ public: ) const; //- Apply relaxation to (steady state) cloud sources - void relaxSources(const KinematicCloud<ParcelType>& cloudOldTime); + void relaxSources(const KinematicCloud<CloudType>& cloudOldTime); //- Evolve the cloud void evolve(); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index 4c710fa797be98039fb4f54133792df801dcecc4..87a7e9b534f7ccd74526628d5b1f143eb57418cc 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -27,136 +27,136 @@ License // * * * * * * * * * * * cloudSolution Member Functions * * * * * * * * * * // -template<class ParcelType> +template<class CloudType> inline const Foam::fvMesh& -Foam::KinematicCloud<ParcelType>::cloudSolution::mesh() const +Foam::KinematicCloud<CloudType>::cloudSolution::mesh() const { return mesh_; } -template<class ParcelType> +template<class CloudType> inline const Foam::dictionary& -Foam::KinematicCloud<ParcelType>::cloudSolution::dict() const +Foam::KinematicCloud<CloudType>::cloudSolution::dict() const { return dict_; } -template<class ParcelType> +template<class CloudType> inline const Foam::Switch -Foam::KinematicCloud<ParcelType>::cloudSolution::active() const +Foam::KinematicCloud<CloudType>::cloudSolution::active() const { return active_; } -template<class ParcelType> +template<class CloudType> inline const Foam::dictionary& -Foam::KinematicCloud<ParcelType>::cloudSolution::sourceTermDict() const +Foam::KinematicCloud<CloudType>::cloudSolution::sourceTermDict() const { return dict_.subDict("sourceTerms"); } -template<class ParcelType> +template<class CloudType> inline const Foam::dictionary& -Foam::KinematicCloud<ParcelType>::cloudSolution::interpolationSchemes() const +Foam::KinematicCloud<CloudType>::cloudSolution::interpolationSchemes() const { return dict_.subDict("interpolationSchemes"); } -template<class ParcelType> +template<class CloudType> inline const Foam::dictionary& -Foam::KinematicCloud<ParcelType>::cloudSolution::integrationSchemes() const +Foam::KinematicCloud<CloudType>::cloudSolution::integrationSchemes() const { return dict_.subDict("integrationSchemes"); } -template<class ParcelType> +template<class CloudType> inline const Foam::Switch -Foam::KinematicCloud<ParcelType>::cloudSolution::transient() const +Foam::KinematicCloud<CloudType>::cloudSolution::transient() const { return transient_; } -template<class ParcelType> +template<class CloudType> inline const Foam::Switch -Foam::KinematicCloud<ParcelType>::cloudSolution::steadyState() const +Foam::KinematicCloud<CloudType>::cloudSolution::steadyState() const { return !transient_; } -template<class ParcelType> +template<class CloudType> inline Foam::label -Foam::KinematicCloud<ParcelType>::cloudSolution::calcFrequency() const +Foam::KinematicCloud<CloudType>::cloudSolution::calcFrequency() const { return calcFrequency_; } -template<class ParcelType> +template<class CloudType> inline Foam::scalar -Foam::KinematicCloud<ParcelType>::cloudSolution::maxCo() const +Foam::KinematicCloud<CloudType>::cloudSolution::maxCo() const { return maxCo_; } -template<class ParcelType> -inline Foam::label Foam::KinematicCloud<ParcelType>::cloudSolution::iter() const +template<class CloudType> +inline Foam::label Foam::KinematicCloud<CloudType>::cloudSolution::iter() const { return iter_; } -template<class ParcelType> -inline Foam::label Foam::KinematicCloud<ParcelType>::cloudSolution::nextIter() +template<class CloudType> +inline Foam::label Foam::KinematicCloud<CloudType>::cloudSolution::nextIter() { return ++iter_; } -template<class ParcelType> +template<class CloudType> inline Foam::scalar -Foam::KinematicCloud<ParcelType>::cloudSolution::deltaT() const +Foam::KinematicCloud<CloudType>::cloudSolution::deltaT() const { return deltaT_; } -template<class ParcelType> +template<class CloudType> inline const Foam::Switch -Foam::KinematicCloud<ParcelType>::cloudSolution::coupled() const +Foam::KinematicCloud<CloudType>::cloudSolution::coupled() const { return coupled_; } -template<class ParcelType> +template<class CloudType> inline const Foam::Switch -Foam::KinematicCloud<ParcelType>::cloudSolution::cellValueSourceCorrection() +Foam::KinematicCloud<CloudType>::cloudSolution::cellValueSourceCorrection() const { return cellValueSourceCorrection_; } -template<class ParcelType> +template<class CloudType> inline Foam::scalar -Foam::KinematicCloud<ParcelType>::cloudSolution::maxTrackTime() const +Foam::KinematicCloud<CloudType>::cloudSolution::maxTrackTime() const { return maxTrackTime_; } -template<class ParcelType> +template<class CloudType> inline const Foam::Switch -Foam::KinematicCloud<ParcelType>::cloudSolution::resetSourcesOnStartup() const +Foam::KinematicCloud<CloudType>::cloudSolution::resetSourcesOnStartup() const { return resetSourcesOnStartup_; } @@ -164,209 +164,208 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::resetSourcesOnStartup() const // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -inline const Foam::KinematicCloud<ParcelType>& -Foam::KinematicCloud<ParcelType>::cloudCopy() const +template<class CloudType> +inline const Foam::KinematicCloud<CloudType>& +Foam::KinematicCloud<CloudType>::cloudCopy() const { return cloudCopyPtr_(); } -template<class ParcelType> -inline bool Foam::KinematicCloud<ParcelType>::hasWallImpactDistance() const +template<class CloudType> +inline bool Foam::KinematicCloud<CloudType>::hasWallImpactDistance() const { return !collision().controlsWallInteraction(); } -template<class ParcelType> -inline const Foam::fvMesh& Foam::KinematicCloud<ParcelType>::mesh() const +template<class CloudType> +inline const Foam::fvMesh& Foam::KinematicCloud<CloudType>::mesh() const { return mesh_; } -template<class ParcelType> +template<class CloudType> inline const Foam::IOdictionary& -Foam::KinematicCloud<ParcelType>::particleProperties() const +Foam::KinematicCloud<CloudType>::particleProperties() const { return particleProperties_; } -template<class ParcelType> -inline const typename Foam::KinematicCloud<ParcelType>::cloudSolution& -Foam::KinematicCloud<ParcelType>::solution() const +template<class CloudType> +inline const typename Foam::KinematicCloud<CloudType>::cloudSolution& +Foam::KinematicCloud<CloudType>::solution() const { return solution_; } -template<class ParcelType> -inline typename Foam::KinematicCloud<ParcelType>::cloudSolution& -Foam::KinematicCloud<ParcelType>::solution() +template<class CloudType> +inline typename Foam::KinematicCloud<CloudType>::cloudSolution& +Foam::KinematicCloud<CloudType>::solution() { return solution_; } -template<class ParcelType> -inline const typename ParcelType::constantProperties& -Foam::KinematicCloud<ParcelType>::constProps() const +template<class CloudType> +inline const typename CloudType::particleType::constantProperties& +Foam::KinematicCloud<CloudType>::constProps() const { return constProps_; } -template<class ParcelType> +template<class CloudType> inline const Foam::dictionary& -Foam::KinematicCloud<ParcelType>::subModelProperties() const +Foam::KinematicCloud<CloudType>::subModelProperties() const { return subModelProperties_; } -template<class ParcelType> -inline const Foam::volScalarField& -Foam::KinematicCloud<ParcelType>::rho() const +template<class CloudType> +inline const Foam::volScalarField& Foam::KinematicCloud<CloudType>::rho() const { return rho_; } -template<class ParcelType> -inline const Foam::volVectorField& Foam::KinematicCloud<ParcelType>::U() const +template<class CloudType> +inline const Foam::volVectorField& Foam::KinematicCloud<CloudType>::U() const { return U_; } -template<class ParcelType> -inline const Foam::volScalarField& Foam::KinematicCloud<ParcelType>::mu() const +template<class CloudType> +inline const Foam::volScalarField& Foam::KinematicCloud<CloudType>::mu() const { return mu_; } -template<class ParcelType> -inline const Foam::dimensionedVector& -Foam::KinematicCloud<ParcelType>::g() const +template<class CloudType> +inline const Foam::dimensionedVector& Foam::KinematicCloud<CloudType>::g() const { return g_; } -template<class ParcelType> -inline const typename ParcelType::forceType& -Foam::KinematicCloud<ParcelType>::forces() const +template<class CloudType> +//inline const typename CloudType::parcelType::forceType& +inline const typename Foam::KinematicCloud<CloudType>::forceType& +Foam::KinematicCloud<CloudType>::forces() const { return forces_; } -template<class ParcelType> -inline const Foam::CollisionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::collision() const +template<class CloudType> +inline const Foam::CollisionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::collision() const { return collisionModel_(); } -template<class ParcelType> -inline Foam::CollisionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::collision() +template<class CloudType> +inline Foam::CollisionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::collision() { return collisionModel_(); } -template<class ParcelType> -inline const Foam::DispersionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::dispersion() const +template<class CloudType> +inline const Foam::DispersionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::dispersion() const { return dispersionModel_; } -template<class ParcelType> -inline Foam::DispersionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::dispersion() +template<class CloudType> +inline Foam::DispersionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::dispersion() { return dispersionModel_(); } -template<class ParcelType> -inline const Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::injection() const +template<class CloudType> +inline const Foam::InjectionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::injection() const { return injectionModel_; } -template<class ParcelType> -inline const Foam::PatchInteractionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::patchInteraction() const +template<class CloudType> +inline const Foam::PatchInteractionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::patchInteraction() const { return patchInteractionModel_; } -template<class ParcelType> -inline Foam::PatchInteractionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::patchInteraction() +template<class CloudType> +inline Foam::PatchInteractionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::patchInteraction() { return patchInteractionModel_(); } -template<class ParcelType> -inline Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::injection() +template<class CloudType> +inline Foam::InjectionModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::injection() { return injectionModel_(); } -template<class ParcelType> -inline Foam::PostProcessingModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::postProcessing() +template<class CloudType> +inline Foam::PostProcessingModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::postProcessing() { return postProcessingModel_(); } -template<class ParcelType> -inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::surfaceFilm() const +template<class CloudType> +inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::surfaceFilm() const { return surfaceFilmModel_(); } -template<class ParcelType> -inline Foam::SurfaceFilmModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::surfaceFilm() +template<class CloudType> +inline Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType> >& +Foam::KinematicCloud<CloudType>::surfaceFilm() { return surfaceFilmModel_(); } -template<class ParcelType> +template<class CloudType> inline const Foam::vectorIntegrationScheme& -Foam::KinematicCloud<ParcelType>::UIntegrator() const +Foam::KinematicCloud<CloudType>::UIntegrator() const { return UIntegrator_; } -template<class ParcelType> -inline Foam::scalar Foam::KinematicCloud<ParcelType>::massInSystem() const +template<class CloudType> +inline Foam::scalar Foam::KinematicCloud<CloudType>::massInSystem() const { scalar sysMass = 0.0; - forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); sysMass += p.mass()*p.nParticle(); } @@ -374,15 +373,15 @@ inline Foam::scalar Foam::KinematicCloud<ParcelType>::massInSystem() const } -template<class ParcelType> +template<class CloudType> inline Foam::vector -Foam::KinematicCloud<ParcelType>::linearMomentumOfSystem() const +Foam::KinematicCloud<CloudType>::linearMomentumOfSystem() const { vector linearMomentum(vector::zero); - forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); linearMomentum += p.mass()*p.U(); } @@ -391,15 +390,15 @@ Foam::KinematicCloud<ParcelType>::linearMomentumOfSystem() const } -template<class ParcelType> +template<class CloudType> inline Foam::scalar -Foam::KinematicCloud<ParcelType>::linearKineticEnergyOfSystem() const +Foam::KinematicCloud<CloudType>::linearKineticEnergyOfSystem() const { scalar linearKineticEnergy = 0.0; - forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); linearKineticEnergy += 0.5*p.mass()*(p.U() & p.U()); } @@ -408,16 +407,15 @@ Foam::KinematicCloud<ParcelType>::linearKineticEnergyOfSystem() const } -template<class ParcelType> +template<class CloudType> inline Foam::scalar -Foam::KinematicCloud<ParcelType>:: -rotationalKineticEnergyOfSystem() const +Foam::KinematicCloud<CloudType>::rotationalKineticEnergyOfSystem() const { scalar rotationalKineticEnergy = 0.0; - forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); rotationalKineticEnergy += 0.5*p.momentOfInertia()*(p.omega() & p.omega()); @@ -427,16 +425,16 @@ rotationalKineticEnergyOfSystem() const } -template<class ParcelType> -inline Foam::cachedRandom& Foam::KinematicCloud<ParcelType>::rndGen() +template<class CloudType> +inline Foam::cachedRandom& Foam::KinematicCloud<CloudType>::rndGen() { return rndGen_; } -template<class ParcelType> -inline Foam::List<Foam::DynamicList<ParcelType*> >& -Foam::KinematicCloud<ParcelType>::cellOccupancy() +template<class CloudType> +inline Foam::List<Foam::DynamicList<typename CloudType::particleType*> >& +Foam::KinematicCloud<CloudType>::cellOccupancy() { if (cellOccupancyPtr_.empty()) { @@ -447,41 +445,41 @@ Foam::KinematicCloud<ParcelType>::cellOccupancy() } -template<class ParcelType> +template<class CloudType> inline Foam::DimensionedField<Foam::vector, Foam::volMesh>& -Foam::KinematicCloud<ParcelType>::UTrans() +Foam::KinematicCloud<CloudType>::UTrans() { return UTrans_(); } -template<class ParcelType> +template<class CloudType> inline const Foam::DimensionedField<Foam::vector, Foam::volMesh>& -Foam::KinematicCloud<ParcelType>::UTrans() const +Foam::KinematicCloud<CloudType>::UTrans() const { return UTrans_(); } -template<class ParcelType> +template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& -Foam::KinematicCloud<ParcelType>::UCoeff() +Foam::KinematicCloud<CloudType>::UCoeff() { return UCoeff_(); } -template<class ParcelType> +template<class CloudType> inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>& -Foam::KinematicCloud<ParcelType>::UCoeff() const +Foam::KinematicCloud<CloudType>::UCoeff() const { return UCoeff_(); } -template<class ParcelType> +template<class CloudType> inline Foam::tmp<Foam::fvVectorMatrix> -Foam::KinematicCloud<ParcelType>::SU(volVectorField& U) const +Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const { if (debug) { @@ -515,9 +513,9 @@ Foam::KinematicCloud<ParcelType>::SU(volVectorField& U) const } -template<class ParcelType> +template<class CloudType> inline const Foam::tmp<Foam::volScalarField> -Foam::KinematicCloud<ParcelType>::theta() const +Foam::KinematicCloud<CloudType>::theta() const { tmp<volScalarField> ttheta ( @@ -538,9 +536,9 @@ Foam::KinematicCloud<ParcelType>::theta() const ); scalarField& theta = ttheta().internalField(); - forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); const label cellI = p.cell(); theta[cellI] += p.nParticle()*p.volume(); @@ -552,9 +550,9 @@ Foam::KinematicCloud<ParcelType>::theta() const } -template<class ParcelType> +template<class CloudType> inline const Foam::tmp<Foam::volScalarField> -Foam::KinematicCloud<ParcelType>::alpha() const +Foam::KinematicCloud<CloudType>::alpha() const { tmp<volScalarField> talpha ( @@ -575,9 +573,9 @@ Foam::KinematicCloud<ParcelType>::alpha() const ); scalarField& alpha = talpha().internalField(); - forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); const label cellI = p.cell(); alpha[cellI] += p.nParticle()*p.mass(); @@ -589,9 +587,9 @@ Foam::KinematicCloud<ParcelType>::alpha() const } -template<class ParcelType> +template<class CloudType> inline const Foam::tmp<Foam::volScalarField> -Foam::KinematicCloud<ParcelType>::rhoEff() const +Foam::KinematicCloud<CloudType>::rhoEff() const { tmp<volScalarField> trhoEff ( @@ -612,9 +610,9 @@ Foam::KinematicCloud<ParcelType>::rhoEff() const ); scalarField& rhoEff = trhoEff().internalField(); - forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter) + forAllConstIter(typename KinematicCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); const label cellI = p.cell(); rhoEff[cellI] += p.nParticle()*p.mass(); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index fdbf5247814bd026c1a83bbff754f457a94490d2..1c465fc4507353cb63d7125ce6dceb2634d5f9cd 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -30,12 +30,12 @@ License // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::setModels() +template<class CloudType> +void Foam::ReactingCloud<CloudType>::setModels() { compositionModel_.reset ( - CompositionModel<ReactingCloud<ParcelType> >::New + CompositionModel<ReactingCloud<CloudType> >::New ( this->subModelProperties(), *this @@ -44,7 +44,7 @@ void Foam::ReactingCloud<ParcelType>::setModels() phaseChangeModel_.reset ( - PhaseChangeModel<ReactingCloud<ParcelType> >::New + PhaseChangeModel<ReactingCloud<CloudType> >::New ( this->subModelProperties(), *this @@ -53,8 +53,8 @@ void Foam::ReactingCloud<ParcelType>::setModels() } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::checkSuppliedComposition +template<class CloudType> +void Foam::ReactingCloud<CloudType>::checkSuppliedComposition ( const scalarField& YSupplied, const scalarField& Y, @@ -65,7 +65,7 @@ void Foam::ReactingCloud<ParcelType>::checkSuppliedComposition { FatalErrorIn ( - "ReactingCloud<ParcelType>::checkSuppliedComposition" + "ReactingCloud<CloudType>::checkSuppliedComposition" "(" "const scalarField&, " "const scalarField&, " @@ -80,10 +80,10 @@ void Foam::ReactingCloud<ParcelType>::checkSuppliedComposition } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::cloudReset(ReactingCloud<ParcelType>& c) +template<class CloudType> +void Foam::ReactingCloud<CloudType>::cloudReset(ReactingCloud<CloudType>& c) { - ThermoCloud<ParcelType>::cloudReset(c); + CloudType::cloudReset(c); compositionModel_.reset(c.compositionModel_.ptr()); phaseChangeModel_.reset(c.phaseChangeModel_.ptr()); @@ -94,8 +94,8 @@ void Foam::ReactingCloud<ParcelType>::cloudReset(ReactingCloud<ParcelType>& c) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ReactingCloud<ParcelType>::ReactingCloud +template<class CloudType> +Foam::ReactingCloud<CloudType>::ReactingCloud ( const word& cloudName, const volScalarField& rho, @@ -105,7 +105,7 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud bool readFields ) : - ThermoCloud<ParcelType>(cloudName, rho, U, g, thermo, false), + CloudType(cloudName, rho, U, g, thermo, false), reactingCloud(), cloudCopyPtr_(NULL), constProps_(this->particleProperties(), this->solution().active()), @@ -144,7 +144,7 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud if (readFields) { - ParcelType::readFields(*this); + parcelType::readFields(*this, this->composition()); } if (this->solution().resetSourcesOnStartup()) @@ -154,14 +154,14 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud } -template<class ParcelType> -Foam::ReactingCloud<ParcelType>::ReactingCloud +template<class CloudType> +Foam::ReactingCloud<CloudType>::ReactingCloud ( - ReactingCloud<ParcelType>& c, + ReactingCloud<CloudType>& c, const word& name ) : - ThermoCloud<ParcelType>(c, name), + CloudType(c, name), reactingCloud(), cloudCopyPtr_(NULL), constProps_(c.constProps_), @@ -194,15 +194,15 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud } -template<class ParcelType> -Foam::ReactingCloud<ParcelType>::ReactingCloud +template<class CloudType> +Foam::ReactingCloud<CloudType>::ReactingCloud ( const fvMesh& mesh, const word& name, - const ReactingCloud<ParcelType>& c + const ReactingCloud<CloudType>& c ) : - ThermoCloud<ParcelType>(mesh, name, c), + CloudType(mesh, name, c), reactingCloud(), cloudCopyPtr_(NULL), constProps_(), @@ -216,22 +216,22 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ReactingCloud<ParcelType>::~ReactingCloud() +template<class CloudType> +Foam::ReactingCloud<CloudType>::~ReactingCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::checkParcelProperties +template<class CloudType> +void Foam::ReactingCloud<CloudType>::checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) { - ThermoCloud<ParcelType>::checkParcelProperties + CloudType::checkParcelProperties ( parcel, lagrangianDt, @@ -257,12 +257,12 @@ void Foam::ReactingCloud<ParcelType>::checkParcelProperties } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::storeState() +template<class CloudType> +void Foam::ReactingCloud<CloudType>::storeState() { cloudCopyPtr_.reset ( - static_cast<ReactingCloud<ParcelType>*> + static_cast<ReactingCloud<CloudType>*> ( clone(this->name() + "Copy").ptr() ) @@ -270,18 +270,18 @@ void Foam::ReactingCloud<ParcelType>::storeState() } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::restoreState() +template<class CloudType> +void Foam::ReactingCloud<CloudType>::restoreState() { cloudReset(cloudCopyPtr_()); cloudCopyPtr_.clear(); } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::resetSourceTerms() +template<class CloudType> +void Foam::ReactingCloud<CloudType>::resetSourceTerms() { - ThermoCloud<ParcelType>::resetSourceTerms(); + CloudType::resetSourceTerms(); forAll(rhoTrans_, i) { rhoTrans_[i].field() = 0.0; @@ -289,15 +289,15 @@ void Foam::ReactingCloud<ParcelType>::resetSourceTerms() } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::relaxSources +template<class CloudType> +void Foam::ReactingCloud<CloudType>::relaxSources ( - const ReactingCloud<ParcelType>& cloudOldTime + const ReactingCloud<CloudType>& cloudOldTime ) { typedef DimensionedField<scalar, volMesh> dsfType; - ThermoCloud<ParcelType>::relaxSources(cloudOldTime); + CloudType::relaxSources(cloudOldTime); forAll(rhoTrans_, fieldI) { @@ -308,33 +308,44 @@ void Foam::ReactingCloud<ParcelType>::relaxSources } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::evolve() +template<class CloudType> +void Foam::ReactingCloud<CloudType>::evolve() { if (this->solution().canEvolve()) { - typename ParcelType::trackData td(*this); + typename parcelType::template + TrackingData<ReactingCloud<CloudType> > td(*this); this->solve(td); } } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::addToMassPhaseChange(const scalar dMass) +template<class CloudType> +void Foam::ReactingCloud<CloudType>::addToMassPhaseChange(const scalar dMass) { dMassPhaseChange_ += dMass; } -template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::info() const +template<class CloudType> +void Foam::ReactingCloud<CloudType>::info() const { - ThermoCloud<ParcelType>::info(); + CloudType::info(); Info<< " Mass transfer phase change = " << returnReduce(dMassPhaseChange_, sumOp<scalar>()) << nl; } +template<class CloudType> +void Foam::ReactingCloud<CloudType>::writeFields() const +{ + if (this->size()) + { + CloudType::particleType::writeFields(*this, this->composition()); + } +} + + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index 9db309ff096963bb2d6076d1abaa8ca1b64c9431..6b67a737214168510ffd2b846fca4d64fbe8b052 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -40,7 +40,6 @@ SourceFiles #ifndef ReactingCloud_H #define ReactingCloud_H -#include "ThermoCloud.H" #include "reactingCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,19 +59,24 @@ class PhaseChangeModel; Class ReactingCloud Declaration \*---------------------------------------------------------------------------*/ -template<class ParcelType> +template<class CloudType> class ReactingCloud : - public ThermoCloud<ParcelType>, + public CloudType, public reactingCloud { +public: + + //- Type of parcel the cloud was instantiated for + typedef typename CloudType::particleType parcelType; + private: // Private data //- Cloud copy pointer - autoPtr<ReactingCloud<ParcelType> > cloudCopyPtr_; + autoPtr<ReactingCloud<CloudType> > cloudCopyPtr_; // Private member functions @@ -89,17 +93,17 @@ protected: // Protected data //- Parcel constant properties - typename ParcelType::constantProperties constProps_; + typename parcelType::constantProperties constProps_; // References to the cloud sub-models //- Reacting composition model - autoPtr<CompositionModel<ReactingCloud<ParcelType> > > + autoPtr<CompositionModel<ReactingCloud<CloudType> > > compositionModel_; //- Reacting phase change model - autoPtr<PhaseChangeModel<ReactingCloud<ParcelType> > > + autoPtr<PhaseChangeModel<ReactingCloud<CloudType> > > phaseChangeModel_; @@ -137,11 +141,13 @@ protected: // Cloud evolution functions //- Reset state of cloud - void cloudReset(ReactingCloud<ParcelType>& c); + void cloudReset(ReactingCloud<CloudType>& c); public: + typedef CloudType cloudType; + // Constructors //- Construct given carrier gas fields @@ -156,29 +162,29 @@ public: ); //- Copy constructor with new name - ReactingCloud(ReactingCloud<ParcelType>& c, const word& name); + ReactingCloud(ReactingCloud<CloudType>& c, const word& name); //- Copy constructor with new name - creates bare cloud ReactingCloud ( const fvMesh& mesh, const word& name, - const ReactingCloud<ParcelType>& c + const ReactingCloud<CloudType>& c ); //- Construct and return clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > clone(const word& name) + virtual autoPtr<Cloud<parcelType> > clone(const word& name) { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new ReactingCloud(*this, name) ); } //- Construct and return bare clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > cloneBare(const word& name) const + virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new ReactingCloud(this->mesh(), name, *this) ); @@ -189,10 +195,6 @@ public: virtual ~ReactingCloud(); - //- Type of parcel the cloud was instantiated for - typedef ParcelType parcelType; - - // Member Functions // Access @@ -201,18 +203,18 @@ public: inline const ReactingCloud& cloudCopy() const; //- Return the constant properties - inline const typename ParcelType::constantProperties& + inline const typename parcelType::constantProperties& constProps() const; // Sub-models //- Return reference to reacting composition model - inline const CompositionModel<ReactingCloud<ParcelType> >& + inline const CompositionModel<ReactingCloud<CloudType> >& composition() const; //- Return reference to reacting phase change model - inline const PhaseChangeModel<ReactingCloud<ParcelType> >& + inline const PhaseChangeModel<ReactingCloud<CloudType> >& phaseChange() const; @@ -262,7 +264,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); @@ -277,13 +279,19 @@ public: void resetSourceTerms(); //- Apply relaxation to (steady state) cloud sources - void relaxSources(const ReactingCloud<ParcelType>& cloudOldTime); + void relaxSources(const ReactingCloud<CloudType>& cloudOldTime); //- Evolve the cloud void evolve(); //- Print cloud information void info() const; + + + // I-O + + //- Write the field data for the cloud + virtual void writeFields() const; }; diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H index 9d32a24134fe33d4e05d1c7699a1f825cfc7bde4..79b66f87ff079e8636423e11dc290396e12bd893 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -25,66 +25,65 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -inline const Foam::ReactingCloud<ParcelType>& -Foam::ReactingCloud<ParcelType>::cloudCopy() const +template<class CloudType> +inline const Foam::ReactingCloud<CloudType>& +Foam::ReactingCloud<CloudType>::cloudCopy() const { return cloudCopyPtr_(); } -template<class ParcelType> -inline const typename ParcelType::constantProperties& -Foam::ReactingCloud<ParcelType>::constProps() const +template<class CloudType> +inline const typename CloudType::particleType::constantProperties& +Foam::ReactingCloud<CloudType>::constProps() const { return constProps_; } -template<class ParcelType> -inline const Foam::CompositionModel<Foam::ReactingCloud<ParcelType> >& -Foam::ReactingCloud<ParcelType>::composition() const +template<class CloudType> +inline const Foam::CompositionModel<Foam::ReactingCloud<CloudType> >& +Foam::ReactingCloud<CloudType>::composition() const { return compositionModel_; } -template<class ParcelType> -inline const Foam::PhaseChangeModel<Foam::ReactingCloud<ParcelType> >& -Foam::ReactingCloud<ParcelType>::phaseChange() const +template<class CloudType> +inline const Foam::PhaseChangeModel<Foam::ReactingCloud<CloudType> >& +Foam::ReactingCloud<CloudType>::phaseChange() const { return phaseChangeModel_; } -template<class ParcelType> +template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& -Foam::ReactingCloud<ParcelType>::rhoTrans(const label i) +Foam::ReactingCloud<CloudType>::rhoTrans(const label i) { return rhoTrans_[i]; } -template<class ParcelType> +template<class CloudType> inline const Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >& -Foam::ReactingCloud<ParcelType>::rhoTrans() const +Foam::ReactingCloud<CloudType>::rhoTrans() const { return rhoTrans_; } -template<class ParcelType> +template<class CloudType> inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >& -Foam::ReactingCloud<ParcelType>::rhoTrans() +Foam::ReactingCloud<CloudType>::rhoTrans() { return rhoTrans_; } -template<class ParcelType> -inline Foam::tmp<Foam::fvScalarMatrix> -Foam::ReactingCloud<ParcelType>::SYi +template<class CloudType> +inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi ( const label i, volScalarField& Yi @@ -138,9 +137,9 @@ Foam::ReactingCloud<ParcelType>::SYi } -template<class ParcelType> +template<class CloudType> inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::ReactingCloud<ParcelType>::Srho(const label i) const +Foam::ReactingCloud<CloudType>::Srho(const label i) const { tmp<DimensionedField<scalar, volMesh> > tRhoi ( @@ -175,9 +174,9 @@ Foam::ReactingCloud<ParcelType>::Srho(const label i) const } -template<class ParcelType> +template<class CloudType> inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::ReactingCloud<ParcelType>::Srho() const +Foam::ReactingCloud<CloudType>::Srho() const { tmp<DimensionedField<scalar, volMesh> > trhoTrans ( @@ -217,9 +216,9 @@ Foam::ReactingCloud<ParcelType>::Srho() const } -template<class ParcelType> +template<class CloudType> inline Foam::tmp<Foam::fvScalarMatrix> -Foam::ReactingCloud<ParcelType>::Srho(volScalarField& rho) const +Foam::ReactingCloud<CloudType>::Srho(volScalarField& rho) const { if (this->solution().coupled()) { diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index 7cd42b7355c001061dd6bebe2c5f42a3954498b8..89374ecb48e7cd361299dde82eeb52ade99929cf 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -30,12 +30,12 @@ License // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::setModels() +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::setModels() { devolatilisationModel_.reset ( - DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> >::New + DevolatilisationModel<ReactingMultiphaseCloud<CloudType> >::New ( this->subModelProperties(), *this @@ -44,7 +44,7 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::setModels() surfaceReactionModel_.reset ( - SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> >::New + SurfaceReactionModel<ReactingMultiphaseCloud<CloudType> >::New ( this->subModelProperties(), *this @@ -53,13 +53,13 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::setModels() } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::cloudReset +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::cloudReset ( - ReactingMultiphaseCloud<ParcelType>& c + ReactingMultiphaseCloud<CloudType>& c ) { - ReactingCloud<ParcelType>::cloudReset(c); + CloudType::cloudReset(c); devolatilisationModel_.reset(c.devolatilisationModel_.ptr()); surfaceReactionModel_.reset(c.surfaceReactionModel_.ptr()); @@ -71,8 +71,8 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::cloudReset // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud +template<class CloudType> +Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud ( const word& cloudName, const volScalarField& rho, @@ -82,7 +82,7 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud bool readFields ) : - ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo, false), + CloudType(cloudName, rho, U, g, thermo, false), reactingMultiphaseCloud(), cloudCopyPtr_(NULL), constProps_(this->particleProperties(), this->solution().active()), @@ -98,7 +98,7 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud if (readFields) { - ParcelType::readFields(*this); + parcelType::readFields(*this, this->composition()); } if (this->solution().resetSourcesOnStartup()) @@ -108,14 +108,14 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud } -template<class ParcelType> -Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud +template<class CloudType> +Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud ( - ReactingMultiphaseCloud<ParcelType>& c, + ReactingMultiphaseCloud<CloudType>& c, const word& name ) : - ReactingCloud<ParcelType>(c, name), + CloudType(c, name), reactingMultiphaseCloud(), cloudCopyPtr_(NULL), constProps_(c.constProps_), @@ -126,15 +126,15 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud {} -template<class ParcelType> -Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud +template<class CloudType> +Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud ( const fvMesh& mesh, const word& name, - const ReactingMultiphaseCloud<ParcelType>& c + const ReactingMultiphaseCloud<CloudType>& c ) : - ReactingCloud<ParcelType>(mesh, name, c), + CloudType(mesh, name, c), reactingMultiphaseCloud(), cloudCopyPtr_(NULL), constProps_(), @@ -147,22 +147,22 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud() +template<class CloudType> +Foam::ReactingMultiphaseCloud<CloudType>::~ReactingMultiphaseCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) { - ReactingCloud<ParcelType>::checkParcelProperties + CloudType::checkParcelProperties ( parcel, lagrangianDt, @@ -203,12 +203,12 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::storeState() +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::storeState() { cloudCopyPtr_.reset ( - static_cast<ReactingMultiphaseCloud<ParcelType>*> + static_cast<ReactingMultiphaseCloud<CloudType>*> ( clone(this->name() + "Copy").ptr() ) @@ -216,35 +216,36 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::storeState() } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::restoreState() +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::restoreState() { cloudReset(cloudCopyPtr_()); cloudCopyPtr_.clear(); } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms() +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::resetSourceTerms() { - ReactingCloud<ParcelType>::resetSourceTerms(); + CloudType::resetSourceTerms(); } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::evolve() +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::evolve() { if (this->solution().canEvolve()) { - typename ParcelType::trackData td(*this); + typename parcelType::template + TrackingData<ReactingMultiphaseCloud<CloudType> > td(*this); this->solve(td); } } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassDevolatilisation +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::addToMassDevolatilisation ( const scalar dMass ) @@ -253,8 +254,8 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassDevolatilisation } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassSurfaceReaction +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::addToMassSurfaceReaction ( const scalar dMass ) @@ -263,10 +264,10 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassSurfaceReaction } -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::info() const +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::info() const { - ReactingCloud<ParcelType>::info(); + CloudType::info(); Info<< " Mass transfer devolatilisation = " << returnReduce(dMassDevolatilisation_, sumOp<scalar>()) << nl; Info<< " Mass transfer surface reaction = " @@ -274,4 +275,14 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::info() const } +template<class CloudType> +void Foam::ReactingMultiphaseCloud<CloudType>::writeFields() const +{ + if (this->size()) + { + CloudType::particleType::writeFields(*this, this->composition()); + } +} + + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index 2c71a6b4758d282b27c6cc0a6c7d442c3051cf45..f2e13b02a6fc62c6338ca0b2c56372242a4da5ba 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -61,16 +61,24 @@ class SurfaceReactionModel; Class ReactingMultiphaseCloud Declaration \*---------------------------------------------------------------------------*/ -template<class ParcelType> +template<class CloudType> class ReactingMultiphaseCloud : - public ReactingCloud<ParcelType>, + public CloudType, public reactingMultiphaseCloud { +public: + + //- Type of parcel the cloud was instantiated for + typedef typename CloudType::particleType parcelType; + + +private: + // Private data //- Cloud copy pointer - autoPtr<ReactingMultiphaseCloud<ParcelType> > cloudCopyPtr_; + autoPtr<ReactingMultiphaseCloud<CloudType> > cloudCopyPtr_; // Private member functions @@ -87,7 +95,7 @@ protected: // Protected data //- Parcel constant properties - typename ParcelType::constantProperties constProps_; + typename parcelType::constantProperties constProps_; // References to the cloud sub-models @@ -95,14 +103,14 @@ protected: //- Devolatilisation model autoPtr < - DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> > + DevolatilisationModel<ReactingMultiphaseCloud<CloudType> > > devolatilisationModel_; //- Surface reaction model autoPtr < - SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> > + SurfaceReactionModel<ReactingMultiphaseCloud<CloudType> > > surfaceReactionModel_; @@ -128,11 +136,13 @@ protected: // Cloud evolution functions //- Reset state of cloud - void cloudReset(ReactingMultiphaseCloud<ParcelType>& c); + void cloudReset(ReactingMultiphaseCloud<CloudType>& c); public: + typedef CloudType cloudType; + // Constructors //- Construct given carrier gas fields @@ -150,7 +160,7 @@ public: //- Copy constructor with new name ReactingMultiphaseCloud ( - ReactingMultiphaseCloud<ParcelType>& c, + ReactingMultiphaseCloud<CloudType>& c, const word& name ); @@ -159,22 +169,22 @@ public: ( const fvMesh& mesh, const word& name, - const ReactingMultiphaseCloud<ParcelType>& c + const ReactingMultiphaseCloud<CloudType>& c ); //- Construct and return clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > clone(const word& name) + virtual autoPtr<Cloud<parcelType> > clone(const word& name) { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new ReactingMultiphaseCloud(*this, name) ); } //- Construct and return bare clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > cloneBare(const word& name) const + virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new ReactingMultiphaseCloud(this->mesh(), name, *this) ); @@ -185,10 +195,6 @@ public: virtual ~ReactingMultiphaseCloud(); - //- Type of parcel the cloud was instantiated for - typedef ParcelType parcelType; - - // Member Functions // Access @@ -197,7 +203,7 @@ public: inline const ReactingMultiphaseCloud& cloudCopy() const; //- Return the constant properties - inline const typename ParcelType::constantProperties& + inline const typename parcelType::constantProperties& constProps() const; @@ -206,14 +212,14 @@ public: //- Return reference to devolatilisation model inline const DevolatilisationModel < - ReactingMultiphaseCloud<ParcelType> + ReactingMultiphaseCloud<CloudType> >& devolatilisation() const; //- Return reference to reacting surface reaction model inline const SurfaceReactionModel < - ReactingMultiphaseCloud<ParcelType> + ReactingMultiphaseCloud<CloudType> >& surfaceReaction() const; @@ -232,7 +238,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); @@ -251,6 +257,12 @@ public: //- Print cloud information void info() const; + + + // I-O + + //- Write the field data for the cloud + virtual void writeFields() const; }; diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H index e02b49094d43f2b3cc362e27d219870989e7cfad..00615f19240ff70e952a058be09f868da11df7b1 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,39 +25,39 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -inline const Foam::ReactingMultiphaseCloud<ParcelType>& -Foam::ReactingMultiphaseCloud<ParcelType>::cloudCopy() const +template<class CloudType> +inline const Foam::ReactingMultiphaseCloud<CloudType>& +Foam::ReactingMultiphaseCloud<CloudType>::cloudCopy() const { return cloudCopyPtr_(); } -template<class ParcelType> -inline const typename ParcelType::constantProperties& -Foam::ReactingMultiphaseCloud<ParcelType>::constProps() const +template<class CloudType> +inline const typename CloudType::particleType::constantProperties& +Foam::ReactingMultiphaseCloud<CloudType>::constProps() const { return constProps_; } -template<class ParcelType> +template<class CloudType> inline const Foam::DevolatilisationModel < - Foam::ReactingMultiphaseCloud<ParcelType> + Foam::ReactingMultiphaseCloud<CloudType> >& -Foam::ReactingMultiphaseCloud<ParcelType>::devolatilisation() const +Foam::ReactingMultiphaseCloud<CloudType>::devolatilisation() const { return devolatilisationModel_; } -template<class ParcelType> +template<class CloudType> inline const Foam::SurfaceReactionModel < - Foam::ReactingMultiphaseCloud<ParcelType> + Foam::ReactingMultiphaseCloud<CloudType> >& -Foam::ReactingMultiphaseCloud<ParcelType>::surfaceReaction() const +Foam::ReactingMultiphaseCloud<CloudType>::surfaceReaction() const { return surfaceReactionModel_; } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index 1bd69843b7fbd56ef8082e3a55e75f530244ac92..d2ce89b5c478849cc3ffedf0abdf1a88c704538e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -30,12 +30,12 @@ License // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::setModels() +template<class CloudType> +void Foam::ThermoCloud<CloudType>::setModels() { heatTransferModel_.reset ( - HeatTransferModel<ThermoCloud<ParcelType> >::New + HeatTransferModel<ThermoCloud<CloudType> >::New ( this->subModelProperties(), *this @@ -55,10 +55,10 @@ void Foam::ThermoCloud<ParcelType>::setModels() } -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::cloudReset(ThermoCloud<ParcelType>& c) +template<class CloudType> +void Foam::ThermoCloud<CloudType>::cloudReset(ThermoCloud<CloudType>& c) { - KinematicCloud<ParcelType>::cloudReset(c); + CloudType::cloudReset(c); heatTransferModel_.reset(c.heatTransferModel_.ptr()); TIntegrator_.reset(c.TIntegrator_.ptr()); @@ -69,8 +69,8 @@ void Foam::ThermoCloud<ParcelType>::cloudReset(ThermoCloud<ParcelType>& c) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ThermoCloud<ParcelType>::ThermoCloud +template<class CloudType> +Foam::ThermoCloud<CloudType>::ThermoCloud ( const word& cloudName, const volScalarField& rho, @@ -80,7 +80,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud bool readFields ) : - KinematicCloud<ParcelType> + CloudType ( cloudName, rho, @@ -139,7 +139,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud if (readFields) { - ParcelType::readFields(*this); + parcelType::readFields(*this); } if (this->solution().resetSourcesOnStartup()) @@ -149,14 +149,14 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud } -template<class ParcelType> -Foam::ThermoCloud<ParcelType>::ThermoCloud +template<class CloudType> +Foam::ThermoCloud<CloudType>::ThermoCloud ( - ThermoCloud<ParcelType>& c, + ThermoCloud<CloudType>& c, const word& name ) : - KinematicCloud<ParcelType>(c, name), + CloudType(c, name), thermoCloud(), cloudCopyPtr_(NULL), constProps_(c.constProps_), @@ -201,15 +201,15 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud {} -template<class ParcelType> -Foam::ThermoCloud<ParcelType>::ThermoCloud +template<class CloudType> +Foam::ThermoCloud<CloudType>::ThermoCloud ( const fvMesh& mesh, const word& name, - const ThermoCloud<ParcelType>& c + const ThermoCloud<CloudType>& c ) : - KinematicCloud<ParcelType>(mesh, name, c), + CloudType(mesh, name, c), thermoCloud(), cloudCopyPtr_(NULL), constProps_(), @@ -226,27 +226,22 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ThermoCloud<ParcelType>::~ThermoCloud() +template<class CloudType> +Foam::ThermoCloud<CloudType>::~ThermoCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::checkParcelProperties +template<class CloudType> +void Foam::ThermoCloud<CloudType>::checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) { - KinematicCloud<ParcelType>::checkParcelProperties - ( - parcel, - lagrangianDt, - fullyDescribed - ); + CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed); if (!fullyDescribed) { @@ -256,12 +251,12 @@ void Foam::ThermoCloud<ParcelType>::checkParcelProperties } -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::storeState() +template<class CloudType> +void Foam::ThermoCloud<CloudType>::storeState() { cloudCopyPtr_.reset ( - static_cast<ThermoCloud<ParcelType>*> + static_cast<ThermoCloud<CloudType>*> ( clone(this->name() + "Copy").ptr() ) @@ -269,51 +264,52 @@ void Foam::ThermoCloud<ParcelType>::storeState() } -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::restoreState() +template<class CloudType> +void Foam::ThermoCloud<CloudType>::restoreState() { cloudReset(cloudCopyPtr_()); cloudCopyPtr_.clear(); } -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::resetSourceTerms() +template<class CloudType> +void Foam::ThermoCloud<CloudType>::resetSourceTerms() { - KinematicCloud<ParcelType>::resetSourceTerms(); + CloudType::resetSourceTerms(); hsTrans_->field() = 0.0; hsCoeff_->field() = 0.0; } -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::relaxSources +template<class CloudType> +void Foam::ThermoCloud<CloudType>::relaxSources ( - const ThermoCloud<ParcelType>& cloudOldTime + const ThermoCloud<CloudType>& cloudOldTime ) { - KinematicCloud<ParcelType>::relaxSources(cloudOldTime); + CloudType::relaxSources(cloudOldTime); this->relax(hsTrans_(), cloudOldTime.hsTrans(), "hs"); } -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::evolve() +template<class CloudType> +void Foam::ThermoCloud<CloudType>::evolve() { if (this->solution().canEvolve()) { - typename ParcelType::trackData td(*this); + typename parcelType::template + TrackingData<ThermoCloud<CloudType> > td(*this); this->solve(td); } } -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::info() const +template<class CloudType> +void Foam::ThermoCloud<CloudType>::info() const { - KinematicCloud<ParcelType>::info(); + CloudType::info(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index a9daf9c22d8b480167386b628fa74ce1eb3e8c83..f2ad4661794ee1d622bb5d989fe7188941bec9b2 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -57,16 +57,23 @@ class HeatTransferModel; Class ThermoCloud Declaration \*---------------------------------------------------------------------------*/ -template<class ParcelType> +template<class CloudType> class ThermoCloud : - public KinematicCloud<ParcelType>, + public CloudType, public thermoCloud { +public: + + //- Type of parcel the cloud was instantiated for + typedef typename CloudType::particleType parcelType; + +private: + // Private data //- Cloud copy pointer - autoPtr<ThermoCloud<ParcelType> > cloudCopyPtr_; + autoPtr<ThermoCloud<CloudType> > cloudCopyPtr_; // Private member functions @@ -83,7 +90,7 @@ protected: // Protected data //- Thermo parcel constant properties - typename ParcelType::constantProperties constProps_; + typename parcelType::constantProperties constProps_; // References to the carrier gas fields @@ -101,7 +108,7 @@ protected: // References to the cloud sub-models //- Heat transfer model - autoPtr<HeatTransferModel<ThermoCloud<ParcelType> > > + autoPtr<HeatTransferModel<ThermoCloud<CloudType> > > heatTransferModel_; @@ -137,11 +144,13 @@ protected: // Cloud evolution functions //- Reset state of cloud - void cloudReset(ThermoCloud<ParcelType>& c); + void cloudReset(ThermoCloud<CloudType>& c); public: + typedef CloudType cloudType; + // Constructors //- Construct given carrier gas fields @@ -156,29 +165,29 @@ public: ); //- Copy constructor with new name - ThermoCloud(ThermoCloud<ParcelType>& c, const word& name); + ThermoCloud(ThermoCloud<CloudType>& c, const word& name); //- Copy constructor with new name - creates bare cloud ThermoCloud ( const fvMesh& mesh, const word& name, - const ThermoCloud<ParcelType>& c + const ThermoCloud<CloudType>& c ); //- Construct and return clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > clone(const word& name) + virtual autoPtr<Cloud<parcelType> > clone(const word& name) { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new ThermoCloud(*this, name) ); } //- Construct and return bare clone based on (this) with new name - virtual autoPtr<Cloud<ParcelType> > cloneBare(const word& name) const + virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const { - return autoPtr<Cloud<ParcelType> > + return autoPtr<Cloud<parcelType> > ( new ThermoCloud(this->mesh(), name, *this) ); @@ -189,10 +198,6 @@ public: virtual ~ThermoCloud(); - //- Type of parcel the cloud was instantiated for - typedef ParcelType parcelType; - - // Member Functions // Access @@ -201,7 +206,7 @@ public: inline const ThermoCloud& cloudCopy() const; //- Return the constant properties - inline const typename ParcelType::constantProperties& + inline const typename parcelType::constantProperties& constProps() const; //- Return const access to thermo package @@ -217,7 +222,7 @@ public: // Sub-models //- Return reference to heat transfer model - inline const HeatTransferModel<ThermoCloud<ParcelType> >& + inline const HeatTransferModel<ThermoCloud<CloudType> >& heatTransfer() const; @@ -272,7 +277,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); @@ -287,7 +292,7 @@ public: void resetSourceTerms(); //- Apply relaxation to (steady state) cloud sources - void relaxSources(const ThermoCloud<ParcelType>& cloudOldTime); + void relaxSources(const ThermoCloud<CloudType>& cloudOldTime); //- Evolve the cloud void evolve(); @@ -297,7 +302,6 @@ public: //- Print cloud information void info() const; - }; diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index f0d08a8216fc0b70c3a2bf28cf4d71a59f19e979..36166041eaf384e77bf813e788a776418774e387 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -29,101 +29,101 @@ using namespace Foam::constant; // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -inline const Foam::ThermoCloud<ParcelType>& -Foam::ThermoCloud<ParcelType>::cloudCopy() const +template<class CloudType> +inline const Foam::ThermoCloud<CloudType>& +Foam::ThermoCloud<CloudType>::cloudCopy() const { return cloudCopyPtr_(); } -template<class ParcelType> -inline const typename ParcelType::constantProperties& -Foam::ThermoCloud<ParcelType>::constProps() const +template<class CloudType> +inline const typename CloudType::particleType::constantProperties& +Foam::ThermoCloud<CloudType>::constProps() const { return constProps_; } -template<class ParcelType> -inline const Foam::SLGThermo& Foam::ThermoCloud<ParcelType>::thermo() const +template<class CloudType> +inline const Foam::SLGThermo& Foam::ThermoCloud<CloudType>::thermo() const { return thermo_; } -template<class ParcelType> -inline const Foam::volScalarField& Foam::ThermoCloud<ParcelType>::T() const +template<class CloudType> +inline const Foam::volScalarField& Foam::ThermoCloud<CloudType>::T() const { return T_; } -template<class ParcelType> -inline const Foam::volScalarField& Foam::ThermoCloud<ParcelType>::p() const +template<class CloudType> +inline const Foam::volScalarField& Foam::ThermoCloud<CloudType>::p() const { return p_; } -template<class ParcelType> -inline const Foam::HeatTransferModel<Foam::ThermoCloud<ParcelType> >& -Foam::ThermoCloud<ParcelType>::heatTransfer() const +template<class CloudType> +inline const Foam::HeatTransferModel<Foam::ThermoCloud<CloudType> >& +Foam::ThermoCloud<CloudType>::heatTransfer() const { return heatTransferModel_; } -template<class ParcelType> +template<class CloudType> inline const Foam::scalarIntegrationScheme& -Foam::ThermoCloud<ParcelType>::TIntegrator() const +Foam::ThermoCloud<CloudType>::TIntegrator() const { return TIntegrator_; } -template<class ParcelType> -inline bool Foam::ThermoCloud<ParcelType>::radiation() const +template<class CloudType> +inline bool Foam::ThermoCloud<CloudType>::radiation() const { return radiation_; } -template<class ParcelType> +template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& -Foam::ThermoCloud<ParcelType>::hsTrans() +Foam::ThermoCloud<CloudType>::hsTrans() { return hsTrans_(); } -template<class ParcelType> +template<class CloudType> inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>& -Foam::ThermoCloud<ParcelType>::hsTrans() const +Foam::ThermoCloud<CloudType>::hsTrans() const { return hsTrans_(); } -template<class ParcelType> +template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& -Foam::ThermoCloud<ParcelType>::hsCoeff() +Foam::ThermoCloud<CloudType>::hsCoeff() { return hsCoeff_(); } -template<class ParcelType> +template<class CloudType> inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>& -Foam::ThermoCloud<ParcelType>::hsCoeff() const +Foam::ThermoCloud<CloudType>::hsCoeff() const { return hsCoeff_(); } -template<class ParcelType> +template<class CloudType> inline Foam::tmp<Foam::fvScalarMatrix> -Foam::ThermoCloud<ParcelType>::Sh(volScalarField& hs) const +Foam::ThermoCloud<CloudType>::Sh(volScalarField& hs) const { if (debug) { @@ -159,9 +159,8 @@ Foam::ThermoCloud<ParcelType>::Sh(volScalarField& hs) const } -template<class ParcelType> -inline Foam::tmp<Foam::volScalarField> -Foam::ThermoCloud<ParcelType>::Ep() const +template<class CloudType> +inline Foam::tmp<Foam::volScalarField> Foam::ThermoCloud<CloudType>::Ep() const { tmp<volScalarField> tEp ( @@ -188,9 +187,9 @@ Foam::ThermoCloud<ParcelType>::Ep() const const scalarField& V = this->mesh().V(); const scalar epsilon = constProps_.epsilon0(); - forAllConstIter(typename ThermoCloud<ParcelType>, *this, iter) + forAllConstIter(typename ThermoCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); const label cellI = p.cell(); Ep[cellI] += p.nParticle()*p.areaP()*pow4(p.T()); } @@ -202,9 +201,8 @@ Foam::ThermoCloud<ParcelType>::Ep() const } -template<class ParcelType> -inline Foam::tmp<Foam::volScalarField> -Foam::ThermoCloud<ParcelType>::ap() const +template<class CloudType> +inline Foam::tmp<Foam::volScalarField> Foam::ThermoCloud<CloudType>::ap() const { tmp<volScalarField> tap ( @@ -231,9 +229,9 @@ Foam::ThermoCloud<ParcelType>::ap() const const scalarField& V = this->mesh().V(); const scalar epsilon = constProps_.epsilon0(); - forAllConstIter(typename ThermoCloud<ParcelType>, *this, iter) + forAllConstIter(typename ThermoCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); const label cellI = p.cell(); ap[cellI] += p.nParticle()*p.areaP(); } @@ -245,9 +243,9 @@ Foam::ThermoCloud<ParcelType>::ap() const } -template<class ParcelType> +template<class CloudType> inline Foam::tmp<Foam::volScalarField> -Foam::ThermoCloud<ParcelType>::sigmap() const +Foam::ThermoCloud<CloudType>::sigmap() const { tmp<volScalarField> tsigmap ( @@ -276,9 +274,9 @@ Foam::ThermoCloud<ParcelType>::sigmap() const const scalar epsilon = constProps_.epsilon0(); const scalar f = constProps_.f0(); - forAllConstIter(typename ThermoCloud<ParcelType>, *this, iter) + forAllConstIter(typename ThermoCloud<CloudType>, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); const label cellI = p.cell(); sigmap[cellI] += p.nParticle()*p.areaP(); } diff --git a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H index 7770dbb68d008a5513de4ce983a24455893be413..a990a09c9fd687d984dd20a46dafecaca4771c80 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H @@ -27,14 +27,12 @@ Class Description Cloud class to introduce kinematic parcels -SourceFiles - basicKinematicCloud.C - \*---------------------------------------------------------------------------*/ #ifndef basicKinematicCloud_H #define basicKinematicCloud_H +#include "Cloud.H" #include "KinematicCloud.H" #include "basicKinematicParcel.H" @@ -42,7 +40,7 @@ SourceFiles namespace Foam { - typedef KinematicCloud<basicKinematicParcel> basicKinematicCloud; + typedef KinematicCloud<Cloud<basicKinematicParcel> > basicKinematicCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H index b93b0eda05ec5ce62e41f05d8b2c2cb22666f9a3..65f30549b243169dd49d1f507c4816ff28dc7fb5 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H @@ -27,14 +27,14 @@ Class Description Cloud class to introduce reacting parcels -SourceFiles - BasicReactingCloud.C - \*---------------------------------------------------------------------------*/ #ifndef basicReactingCloud_H #define basicReactingCloud_H +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" #include "ReactingCloud.H" #include "basicReactingParcel.H" @@ -42,7 +42,19 @@ SourceFiles namespace Foam { - typedef ReactingCloud<basicReactingParcel> basicReactingCloud; + typedef ReactingCloud + < + ThermoCloud + < + KinematicCloud + < + Cloud + < + basicReactingParcel + > + > + > + > basicReactingCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H index f56c60d1fafa32a456df88b6446a69b5a88a47bd..af97c96ae3bdc51fde7f03cd7271df8cf394dc5f 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,10 @@ Description #ifndef basicReactingMultiphaseCloud_H #define basicReactingMultiphaseCloud_H +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" +#include "ReactingCloud.H" #include "ReactingMultiphaseCloud.H" #include "basicReactingMultiphaseParcel.H" @@ -40,10 +44,21 @@ Description namespace Foam { typedef ReactingMultiphaseCloud + < + ReactingCloud < - basicReactingMultiphaseParcel + ThermoCloud + < + KinematicCloud + < + Cloud + < + basicReactingMultiphaseParcel + > + > + > > - basicReactingMultiphaseCloud; + > basicReactingMultiphaseCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H index df00dc82cb6d8f037ddc1c05c3f59042f66f1045..92527df2160a0e104feaba84fa3b341ae6354c68 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H @@ -27,9 +27,6 @@ Class Description Cloud class to introduce thermodynamic parcels -SourceFiles - basicThermoCloud.C - \*---------------------------------------------------------------------------*/ #ifndef basicThermoCloud_H @@ -42,7 +39,16 @@ SourceFiles namespace Foam { - typedef ThermoCloud<basicThermoParcel> basicThermoCloud; + typedef ThermoCloud + < + KinematicCloud + < + Cloud + < + basicThermoParcel + > + > + > basicThermoCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index 1fe4aa29d017debe72cc64b51818c433dae8ef6c..608a2d3df700bd393b9cabf0e56129cef8794ae1 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -179,10 +179,14 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity scalar& Cud ) const { - const typename ParcelType::forceType& forces = td.cloud().forces(); + typedef typename TrackData::cloudType cloudType; + typedef typename cloudType::parcelType parcelType; + typedef typename cloudType::forceType forceType; + + const forceType& forces = td.cloud().forces(); // Momentum source due to particle forces - const ParcelType& p = static_cast<const ParcelType&>(*this); + const parcelType& p = static_cast<const parcelType&>(*this); const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, mu); const forceSuSp Fncp = forces.calcNonCoupled(p, dt, mass, Re, mu); const forceSuSp Feff = Fcp + Fncp; @@ -205,7 +209,7 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity dUTrans += dt*(Feff.Sp()*(Ures.average() - Uc_) - Fcp.Su()); // Apply correction to velocity and dUTrans for reduced-D cases - const polyMesh& mesh = this->cloud().pMesh(); + const polyMesh& mesh = td.cloud().pMesh(); meshTools::constrainDirection(mesh, mesh.solutionD(), Unew); meshTools::constrainDirection(mesh, mesh.solutionD(), dUTrans); @@ -221,7 +225,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel const KinematicParcel<ParcelType>& p ) : - Particle<ParcelType>(p), + ParcelType(p), active_(p.active_), typeId_(p.typeId_), nParticle_(p.nParticle_), @@ -246,10 +250,10 @@ template<class ParcelType> Foam::KinematicParcel<ParcelType>::KinematicParcel ( const KinematicParcel<ParcelType>& p, - const KinematicCloud<ParcelType>& c + const polyMesh& mesh ) : - Particle<ParcelType>(p, c), + ParcelType(p, mesh), active_(p.active_), typeId_(p.typeId_), nParticle_(p.nParticle_), @@ -280,7 +284,8 @@ bool Foam::KinematicParcel<ParcelType>::move const scalar trackTime ) { - ParcelType& p = static_cast<ParcelType&>(*this); + typename TrackData::cloudType::parcelType& p = + static_cast<typename TrackData::cloudType::parcelType&>(*this); td.switchProcessor = false; td.keepParticle = true; @@ -385,7 +390,9 @@ template<class ParcelType> template<class TrackData> void Foam::KinematicParcel<ParcelType>::hitFace(TrackData& td) { - ParcelType& p = static_cast<ParcelType&>(*this); + typename TrackData::cloudType::parcelType& p = + static_cast<typename TrackData::cloudType::parcelType&>(*this); + td.cloud().postProcessing().postFace(p); } @@ -406,7 +413,8 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch const tetIndices& tetIs ) { - ParcelType& p = static_cast<ParcelType&>(*this); + typename TrackData::cloudType::parcelType& p = + static_cast<typename TrackData::cloudType::parcelType&>(*this); // Invoke post-processing model td.cloud().postProcessing().postPatch(p, patchI); @@ -422,7 +430,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch // Invoke patch interaction model return td.cloud().patchInteraction().correct ( - static_cast<ParcelType&>(*this), + p, pp, td.keepParticle, trackFraction, @@ -432,20 +440,6 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch } -template<class ParcelType> -bool Foam::KinematicParcel<ParcelType>::hitPatch -( - const polyPatch& pp, - int& td, - const label patchI, - const scalar trackFraction, - const tetIndices& tetIs -) -{ - return false; -} - - template<class ParcelType> template<class TrackData> void Foam::KinematicParcel<ParcelType>::hitProcessorPatch @@ -458,15 +452,6 @@ void Foam::KinematicParcel<ParcelType>::hitProcessorPatch } -template<class ParcelType> -void Foam::KinematicParcel<ParcelType>::hitProcessorPatch -( - const processorPolyPatch&, - int& -) -{} - - template<class ParcelType> template<class TrackData> void Foam::KinematicParcel<ParcelType>::hitWallPatch @@ -480,16 +465,6 @@ void Foam::KinematicParcel<ParcelType>::hitWallPatch } -template<class ParcelType> -void Foam::KinematicParcel<ParcelType>::hitWallPatch -( - const wallPolyPatch&, - int&, - const tetIndices& -) -{} - - template<class ParcelType> template<class TrackData> void Foam::KinematicParcel<ParcelType>::hitPatch @@ -502,19 +477,10 @@ void Foam::KinematicParcel<ParcelType>::hitPatch } -template<class ParcelType> -void Foam::KinematicParcel<ParcelType>::hitPatch -( - const polyPatch&, - int& -) -{} - - template<class ParcelType> void Foam::KinematicParcel<ParcelType>::transformProperties(const tensor& T) { - Particle<ParcelType>::transformProperties(T); + ParcelType::transformProperties(T); U_ = transform(T, U_); @@ -532,7 +498,7 @@ void Foam::KinematicParcel<ParcelType>::transformProperties const vector& separation ) { - Particle<ParcelType>::transformProperties(separation); + ParcelType::transformProperties(separation); } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 838c8bf9d6a8a75026ddf15bf92866f397ddbcc7..92a6b4038d897b4679fffa3067668e36dbdacc4f 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -45,7 +45,7 @@ SourceFiles #ifndef KinematicParcel_H #define KinematicParcel_H -#include "Particle.H" +#include "particle.H" #include "IOstream.H" #include "autoPtr.H" #include "interpolation.H" @@ -56,7 +56,7 @@ SourceFiles #include "labelFieldIOField.H" #include "vectorFieldIOField.H" -#include "ParticleForceList.H" +// #include "ParticleForceList.H" // TODO // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -86,14 +86,10 @@ Ostream& operator<< template<class ParcelType> class KinematicParcel : - public Particle<ParcelType> + public ParcelType { public: - //- Type of force to be used by this parcel type - typedef ParticleForceList<KinematicCloud<ParcelType> > forceType; - - //- Class to hold kinematic particle constant properties class constantProperties { @@ -165,10 +161,10 @@ public: }; - //- Class used to pass kinematic tracking data to the trackToFace function - class trackData + template<class CloudType> + class TrackingData : - public Particle<ParcelType>::trackData + public ParcelType::template TrackingData<CloudType> { public: @@ -184,10 +180,6 @@ public: // Private data - //- Reference to the cloud containing this particle - KinematicCloud<ParcelType>& cloud_; - - // Interpolators for continuous phase fields //- Density interpolator @@ -208,23 +200,20 @@ public: trackPart part_; - public: + public: // Constructors //- Construct from components - inline trackData + inline TrackingData ( - KinematicCloud<ParcelType>& cloud, + CloudType& cloud, trackPart part = tpLinearTrack ); // Member functions - //- Return access to the owner cloud - inline KinematicCloud<ParcelType>& cloud(); - //- Return conat access to the interpolator for continuous // phase density field inline const interpolation<scalar>& rhoInterp() const; @@ -343,16 +332,13 @@ public: TypeName("KinematicParcel"); - friend class Cloud<ParcelType>; - - // Constructors //- Construct from owner, position, and cloud owner // Other properties initialised as null inline KinematicParcel ( - KinematicCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -362,7 +348,7 @@ public: //- Construct from components inline KinematicParcel ( - KinematicCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -381,7 +367,7 @@ public: //- Construct from Istream KinematicParcel ( - const Cloud<ParcelType>& c, + const polyMesh& mesh, Istream& is, bool readFields = true ); @@ -390,34 +376,42 @@ public: KinematicParcel(const KinematicParcel& p); //- Construct as a copy - KinematicParcel - ( - const KinematicParcel& p, - const KinematicCloud<ParcelType>& c - ); + KinematicParcel(const KinematicParcel& p, const polyMesh& mesh); //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone() const + virtual autoPtr<particle> clone() const { - return autoPtr<Particle<ParcelType> >(new KinematicParcel(*this)); + return autoPtr<particle>(new KinematicParcel(*this)); } //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone - ( - const Cloud<ParcelType>& c - ) const + virtual autoPtr<particle> clone(const polyMesh& mesh) const { - return autoPtr<Particle<ParcelType> > - ( - new KinematicParcel - ( - *this, - static_cast<const KinematicCloud<ParcelType>&>(c) - ) - ); + return autoPtr<particle>(new KinematicParcel(*this, mesh)); } + //- Factory class to read-construct particles used for + // parallel transfer + class iNew + { + const polyMesh& mesh_; + + public: + + iNew(const polyMesh& mesh) + : + mesh_(mesh) + {} + + autoPtr<KinematicParcel<ParcelType> > operator()(Istream& is) const + { + return autoPtr<KinematicParcel<ParcelType> > + ( + new KinematicParcel<ParcelType>(mesh_, is, true) + ); + } + }; + // Member Functions @@ -629,17 +623,6 @@ public: const tetIndices& tetIs ); - //- Overridable function to handle the particle hitting a patch - // Executed before other patch-hitting functions without trackData - bool hitPatch - ( - const polyPatch& p, - int& td, - const label patchI, - const scalar trackFraction, - const tetIndices& tetIs - ); - //- Overridable function to handle the particle hitting a // processorPatch template<class TrackData> @@ -649,14 +632,6 @@ public: TrackData& td ); - //- Overridable function to handle the particle hitting a - // processorPatch without trackData - void hitProcessorPatch - ( - const processorPolyPatch&, - int& - ); - //- Overridable function to handle the particle hitting a wallPatch template<class TrackData> void hitWallPatch @@ -666,15 +641,6 @@ public: const tetIndices& ); - //- Overridable function to handle the particle hitting a wallPatch - // without trackData - void hitWallPatch - ( - const wallPolyPatch&, - int&, - const tetIndices& - ); - //- Overridable function to handle the particle hitting a polyPatch template<class TrackData> void hitPatch @@ -683,14 +649,6 @@ public: TrackData& td ); - //- Overridable function to handle the particle hitting a polyPatch - //- without trackData - void hitPatch - ( - const polyPatch&, - int& - ); - //- Transform the physical properties of the particle // according to the given transformation tensor void transformProperties(const tensor& T); @@ -703,10 +661,12 @@ public: // I-O //- Read - static void readFields(Cloud<ParcelType>& c); + template<class CloudType> + static void readFields(CloudType& c); //- Write - static void writeFields(const Cloud<ParcelType>& c); + template<class CloudType> + static void writeFields(const CloudType& c); // Ostream Operator @@ -726,6 +686,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "KinematicParcelI.H" +#include "KinematicParcelTrackingDataI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index c4cd31b5d3ad15be6127e100f5ec69d19aeac508..b5466ca5d38ccc15c4642fc676f5a45d424eb34b 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -86,57 +86,20 @@ inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties } -template<class ParcelType> -inline Foam::KinematicParcel<ParcelType>::trackData::trackData -( - KinematicCloud<ParcelType>& cloud, - trackPart part -) -: - Particle<ParcelType>::trackData(cloud), - cloud_(cloud), - rhoInterp_ - ( - interpolation<scalar>::New - ( - cloud.solution().interpolationSchemes(), - cloud.rho() - ) - ), - UInterp_ - ( - interpolation<vector>::New - ( - cloud.solution().interpolationSchemes(), - cloud.U() - ) - ), - muInterp_ - ( - interpolation<scalar>::New - ( - cloud.solution().interpolationSchemes(), - cloud.mu() - ) - ), - g_(cloud.g().value()), - part_(part) -{} - - template<class ParcelType> inline Foam::KinematicParcel<ParcelType>::KinematicParcel ( - KinematicCloud<ParcelType>& owner, + const polyMesh& owner, const vector& position, const label cellI, const label tetFaceI, const label tetPtI ) : - Particle<ParcelType>(owner, position, cellI, tetFaceI, tetPtI), + ParcelType(owner, position, cellI, tetFaceI, tetPtI), active_(true), - typeId_(owner.constProps().parcelTypeId()), +// typeId_(owner.constProps().parcelTypeId()), + typeId_(-1), nParticle_(0), d_(0.0), dTarget_(0.0), @@ -152,13 +115,17 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel rhoc_(0.0), Uc_(vector::zero), muc_(0.0) -{} +{ + // TODO + WarningIn("inline Foam::KinematicParcel<ParcelType>::KinematicParcel") + << "typeId set to -1 instead of constProps value" << endl; +} template<class ParcelType> inline Foam::KinematicParcel<ParcelType>::KinematicParcel ( - KinematicCloud<ParcelType>& owner, + const polyMesh& owner, const vector& position, const label cellI, const label tetFaceI, @@ -174,7 +141,7 @@ inline Foam::KinematicParcel<ParcelType>::KinematicParcel const constantProperties& constProps ) : - Particle<ParcelType>(owner, position, cellI, tetFaceI, tetPtI), + ParcelType(owner, position, cellI, tetFaceI, tetPtI), active_(true), typeId_(typeId), nParticle_(nParticle0), @@ -239,8 +206,7 @@ Foam::KinematicParcel<ParcelType>::constantProperties::minParticleMass() const template<class ParcelType> inline Foam::scalar -Foam::KinematicParcel<ParcelType>:: -constantProperties::youngsModulus() const +Foam::KinematicParcel<ParcelType>::constantProperties::youngsModulus() const { return youngsModulus_; } @@ -248,71 +214,12 @@ constantProperties::youngsModulus() const template<class ParcelType> inline Foam::scalar -Foam::KinematicParcel<ParcelType>:: -constantProperties::poissonsRatio() const +Foam::KinematicParcel<ParcelType>::constantProperties::poissonsRatio() const { return poissonsRatio_; } -// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // - -template<class ParcelType> -inline Foam::KinematicCloud<ParcelType>& -Foam::KinematicParcel<ParcelType>::trackData::cloud() -{ - return cloud_; -} - - -template<class ParcelType> -inline const Foam::interpolation<Foam::scalar>& -Foam::KinematicParcel<ParcelType>::trackData::rhoInterp() const -{ - return rhoInterp_(); -} - - -template<class ParcelType> -inline const Foam::interpolation<Foam::vector>& -Foam::KinematicParcel<ParcelType>::trackData::UInterp() const -{ - return UInterp_(); -} - - -template<class ParcelType> -inline const Foam::interpolation<Foam::scalar>& -Foam::KinematicParcel<ParcelType>::trackData::muInterp() const -{ - return muInterp_(); -} - - -template<class ParcelType> -inline const Foam::vector& -Foam::KinematicParcel<ParcelType>::trackData::g() const -{ - return g_; -} - - -template<class ParcelType> -inline typename Foam::KinematicParcel<ParcelType>::trackData::trackPart -Foam::KinematicParcel<ParcelType>::trackData::part() const -{ - return part_; -} - - -template<class ParcelType> -inline typename Foam::KinematicParcel<ParcelType>::trackData::trackPart& -Foam::KinematicParcel<ParcelType>::trackData::part() -{ - return part_; -} - - // * * * * * * * KinematicParcel Member Functions * * * * * * * // template<class ParcelType> @@ -568,7 +475,7 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::massCell const label cellI ) const { - return rhoc_*this->cloud().pMesh().cellVolumes()[cellI]; + return rhoc_*this->mesh().cellVolumes()[cellI]; } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C index b2b4dd822def66dc6cbda4b25fcb0af774398a0e..9fcf07610b4e2f6aabce6c161b4352a1e7835954 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C @@ -32,7 +32,7 @@ License template<class ParcelType> Foam::string Foam::KinematicParcel<ParcelType>::propHeader = - Particle<ParcelType>::propHeader + ParcelType::propHeader + " active" + " typeId" + " nParticle" @@ -60,12 +60,12 @@ Foam::string Foam::KinematicParcel<ParcelType>::propHeader = template<class ParcelType> Foam::KinematicParcel<ParcelType>::KinematicParcel ( - const Cloud<ParcelType>& cloud, + const polyMesh& mesh, Istream& is, bool readFields ) : - Particle<ParcelType>(cloud, is, readFields), + ParcelType(mesh, is, readFields), active_(false), typeId_(0), nParticle_(0.0), @@ -130,20 +130,21 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel is.check ( "KinematicParcel<ParcelType>::KinematicParcel" - "(const Cloud<ParcelType>&, Istream&, bool)" + "(const polyMesh&, Istream&, bool)" ); } template<class ParcelType> -void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c) +template<class CloudType> +void Foam::KinematicParcel<ParcelType>::readFields(CloudType& c) { if (!c.size()) { return; } - Particle<ParcelType>::readFields(c); + ParcelType::readFields(c); IOField<label> active(c.fieldIOobject("active", IOobject::MUST_READ)); c.checkFieldIOobject(c, active); @@ -240,9 +241,9 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c) label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter(typename CloudType, c, iter) { - ParcelType& p = iter(); + KinematicParcel<ParcelType>& p = iter(); p.active_ = active[i]; p.typeId_ = typeId[i]; @@ -273,9 +274,10 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c) template<class ParcelType> -void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c) +template<class CloudType> +void Foam::KinematicParcel<ParcelType>::writeFields(const CloudType& c) { - Particle<ParcelType>::writeFields(c); + ParcelType::writeFields(c); label np = c.size(); @@ -343,7 +345,7 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c) label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) + forAllConstIter(typename CloudType, c, iter) { const KinematicParcel<ParcelType>& p = iter(); @@ -407,7 +409,7 @@ Foam::Ostream& Foam::operator<< { if (os.format() == IOstream::ASCII) { - os << static_cast<const Particle<ParcelType>&>(p) + os << static_cast<const ParcelType&>(p) << token::SPACE << p.active() << token::SPACE << p.typeId() << token::SPACE << p.nParticle() @@ -425,7 +427,7 @@ Foam::Ostream& Foam::operator<< } else { - os << static_cast<const Particle<ParcelType>&>(p); + os << static_cast<const ParcelType&>(p); os.write ( reinterpret_cast<const char*>(&p.active_), diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelTrackingDataI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelTrackingDataI.H new file mode 100644 index 0000000000000000000000000000000000000000..bb61fc2b995a3f9dfe05d6836723cdaf2aadabdb --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelTrackingDataI.H @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +template<class ParcelType> +template<class CloudType> +inline Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::TrackingData +( + CloudType& cloud, + trackPart part +) +: + ParcelType::template TrackingData<CloudType>(cloud), + rhoInterp_ + ( + interpolation<scalar>::New + ( + cloud.solution().interpolationSchemes(), + cloud.rho() + ) + ), + UInterp_ + ( + interpolation<vector>::New + ( + cloud.solution().interpolationSchemes(), + cloud.U() + ) + ), + muInterp_ + ( + interpolation<scalar>::New + ( + cloud.solution().interpolationSchemes(), + cloud.mu() + ) + ), + g_(cloud.g().value()), + part_(part) +{} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::interpolation<Foam::scalar>& +Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::rhoInterp() const +{ + return rhoInterp_(); +} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::interpolation<Foam::vector>& +Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::UInterp() const +{ + return UInterp_(); +} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::interpolation<Foam::scalar>& +Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::muInterp() const +{ + return muInterp_(); +} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::vector& +Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::g() const +{ + return g_; +} + + +template<class ParcelType> +template<class CloudType> +inline typename Foam::KinematicParcel<ParcelType>::template +TrackingData<CloudType>::trackPart +Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::part() const +{ + return part_; +} + + +template<class ParcelType> +template<class CloudType> +inline typename Foam::KinematicParcel<ParcelType>::template +TrackingData<CloudType>::trackPart& +Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::part() +{ + return part_; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index e610f956b6d32415673c44942fd4528a92ecd0ef..48f3545f9133c6406fe50453497b8770783edd78 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -138,7 +138,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::setCellValues const label cellI ) { - ReactingParcel<ParcelType>::setCellValues(td, dt, cellI); + ParcelType::setCellValues(td, dt, cellI); } @@ -152,7 +152,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::cellValueSourceCorrection ) { // Re-use correction from reacting parcel - ReactingParcel<ParcelType>::cellValueSourceCorrection(td, dt, cellI); + ParcelType::cellValueSourceCorrection(td, dt, cellI); } @@ -165,9 +165,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc const label cellI ) { - typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType; - const CompositionModel<cloudType>& composition = td.cloud().composition(); - // Define local properties at beginning of timestep // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const scalar np0 = this->nParticle_; @@ -181,16 +178,15 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc const scalar pc = this->pc_; const scalarField& YMix = this->Y_; - const label idG = composition.idGas(); - const label idL = composition.idLiquid(); - const label idS = composition.idSolid(); + const label idG = td.cloud().composition().idGas(); + const label idL = td.cloud().composition().idLiquid(); + const label idS = td.cloud().composition().idSolid(); // Calc surface values // ~~~~~~~~~~~~~~~~~~~ scalar Ts, rhos, mus, Prs, kappas; - ThermoParcel<ParcelType>:: - calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Prs, kappas); + this->calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Prs, kappas); // Reynolds number scalar Res = this->Re(U0, d0, rhos, mus); @@ -225,7 +221,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc scalar NCpW = 0.0; // Surface concentrations of emitted species - scalarField Cs(composition.carrier().species().size(), 0.0); + scalarField Cs(td.cloud().composition().carrier().species().size(), 0.0); // Calc mass and enthalpy transfer due to phase change this->calcPhaseChange @@ -287,7 +283,11 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc scalarField dMassSRGas(YGas_.size(), 0.0); scalarField dMassSRLiquid(YLiquid_.size(), 0.0); scalarField dMassSRSolid(YSolid_.size(), 0.0); - scalarField dMassSRCarrier(composition.carrier().species().size(), 0.0); + scalarField dMassSRCarrier + ( + td.cloud().composition().carrier().species().size(), + 0.0 + ); // Clac mass and enthalpy transfer due to surface reactions calcSurfaceReactions @@ -382,33 +382,36 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Transfer mass lost from particle to carrier mass source forAll(YGas_, i) { - label gid = composition.localToGlobalCarrierId(GAS, i); + label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i]; td.cloud().hsTrans()[cellI] += - np0*dMassGas[i]*composition.carrier().Hs(gid, T0); + np0*dMassGas[i]*td.cloud().composition().carrier().Hs(gid, T0); } forAll(YLiquid_, i) { - label gid = composition.localToGlobalCarrierId(LIQ, i); + label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i]; td.cloud().hsTrans()[cellI] += - np0*dMassLiquid[i]*composition.carrier().Hs(gid, T0); + np0*dMassLiquid[i] + *td.cloud().composition().carrier().Hs(gid, T0); } /* // No mapping between solid components and carrier phase forAll(YSolid_, i) { - label gid = composition.localToGlobalCarrierId(SLD, i); + label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i]; td.cloud().hsTrans()[cellI] += - np0*dMassSolid[i]*composition.carrier().Hs(gid, T0); + np0*dMassSolid[i] + *td.cloud().composition().carrier().Hs(gid, T0); } */ forAll(dMassSRCarrier, i) { td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i]; td.cloud().hsTrans()[cellI] += - np0*dMassSRCarrier[i]*composition.carrier().Hs(i, T0); + np0*dMassSRCarrier[i] + *td.cloud().composition().carrier().Hs(i, T0); } // Update momentum transfer @@ -437,12 +440,14 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Absorb parcel into carrier phase forAll(YGas_, i) { - label gid = composition.localToGlobalCarrierId(GAS, i); + label gid = + td.cloud().composition().localToGlobalCarrierId(GAS, i); td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[GAS]*YGas_[i]; } forAll(YLiquid_, i) { - label gid = composition.localToGlobalCarrierId(LIQ, i); + label gid = + td.cloud().composition().localToGlobalCarrierId(LIQ, i); td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[LIQ]*YLiquid_[i]; } @@ -450,7 +455,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // No mapping between solid components and carrier phase forAll(YSolid_, i) { - label gid = composition.localToGlobalCarrierId(SLD, i); + label gid = + td.cloud().composition().localToGlobalCarrierId(SLD, i); td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[SLD]*YSolid_[i]; } @@ -515,9 +521,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation return; } - typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType; - const CompositionModel<cloudType>& composition = td.cloud().composition(); - // Total mass of volatiles evolved td.cloud().devolatilisation().calculate ( @@ -545,9 +548,10 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation // Note: hardcoded gaseous diffusivities for now // TODO: add to carrier thermo const scalar beta = sqr(cbrt(15.0) + cbrt(15.0)); - const label id = composition.localToGlobalCarrierId(GAS, i); - const scalar Cp = composition.carrier().Cp(id, Ts); - const scalar W = composition.carrier().W(id); + const label id = + td.cloud().composition().localToGlobalCarrierId(GAS, i); + const scalar Cp = td.cloud().composition().carrier().Cp(id, Ts); + const scalar W = td.cloud().composition().carrier().W(id); const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W); // Dab calc'd using API vapour mass diffusivity function @@ -637,7 +641,7 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel const ReactingMultiphaseParcel<ParcelType>& p ) : - ReactingParcel<ParcelType>(p), + ParcelType(p), YGas_(p.YGas_), YLiquid_(p.YLiquid_), YSolid_(p.YSolid_) @@ -648,10 +652,10 @@ template<class ParcelType> Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ( const ReactingMultiphaseParcel<ParcelType>& p, - const ReactingMultiphaseCloud<ParcelType>& c + const polyMesh& mesh ) : - ReactingParcel<ParcelType>(p, c), + ParcelType(p, mesh), YGas_(p.YGas_), YLiquid_(p.YLiquid_), YSolid_(p.YSolid_) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index 04b6525f6609c286dd233b3ca222fe4a92fe6442..cbb6bb8ead05e7351c20f549bc61890e01af834e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -63,7 +63,7 @@ Ostream& operator<< template<class ParcelType> class ReactingMultiphaseParcel : - public ReactingParcel<ParcelType> + public ParcelType { public: @@ -77,7 +77,7 @@ public: //- Class to hold reacting multiphase particle constant properties class constantProperties : - public ReactingParcel<ParcelType>::constantProperties + public ParcelType::constantProperties { // Private data @@ -118,37 +118,6 @@ public: }; - //- Class used to pass reacting tracking data to the trackToFace function - class trackData - : - public ReactingParcel<ParcelType>::trackData - { - // Private data - - //- Reference to the cloud containing this particle - ReactingMultiphaseCloud<ParcelType>& cloud_; - - - public: - - // Constructors - - //- Construct from components - inline trackData - ( - ReactingMultiphaseCloud<ParcelType>& cloud, - typename ReactingParcel<ParcelType>::trackData::trackPart - part = ReactingParcel<ParcelType>::trackData::tpLinearTrack - ); - - - // Member functions - - //- Return access to the owner cloud - inline ReactingMultiphaseCloud<ParcelType>& cloud(); - }; - - private: // Private Member Functions @@ -277,16 +246,13 @@ public: TypeName("ReactingMultiphaseParcel"); - friend class Cloud<ParcelType>; - - // Constructors //- Construct from owner, position, and cloud owner // Other properties initialised as null inline ReactingMultiphaseParcel ( - ReactingMultiphaseCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -297,7 +263,7 @@ public: //- Construct from components inline ReactingMultiphaseParcel ( - ReactingMultiphaseCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -320,7 +286,7 @@ public: //- Construct from Istream ReactingMultiphaseParcel ( - const Cloud<ParcelType>& c, + const polyMesh& mesh, Istream& is, bool readFields = true ); @@ -332,33 +298,45 @@ public: ReactingMultiphaseParcel ( const ReactingMultiphaseParcel& p, - const ReactingMultiphaseCloud<ParcelType>& c + const polyMesh& mesh ); //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone() const + virtual autoPtr<particle> clone() const { - return autoPtr<Particle<ParcelType> > - ( - new ReactingMultiphaseParcel(*this) - ); + return autoPtr<particle>(new ReactingMultiphaseParcel(*this)); } //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone - ( - const Cloud<ParcelType>& c - ) const + virtual autoPtr<particle> clone(const polyMesh& mesh) const { - return autoPtr<Particle<ParcelType> > + return autoPtr<particle>(new ReactingMultiphaseParcel(*this, mesh)); + } + + //- Factory class to read-construct particles used for + // parallel transfer + class iNew + { + const polyMesh& mesh_; + + public: + + iNew(const polyMesh& mesh) + : + mesh_(mesh) + {} + + autoPtr<ReactingMultiphaseParcel<ParcelType> > operator() ( - new ReactingMultiphaseParcel + Istream& is + ) const + { + return autoPtr<ReactingMultiphaseParcel<ParcelType> > ( - *this, - static_cast<const ReactingMultiphaseCloud<ParcelType>&>(c) - ) - ); - } + new ReactingMultiphaseParcel<ParcelType>(mesh_, is, true) + ); + } + }; // Member Functions @@ -426,10 +404,28 @@ public: // I-O //- Read - static void readFields(Cloud<ParcelType>& c); + template<class CloudType, class CompositionType> + static void readFields + ( + CloudType& c, + const CompositionType& compModel + ); + + //- Read - no composition + template<class CloudType> + static void readFields(CloudType& c); //- Write - static void writeFields(const Cloud<ParcelType>& c); + template<class CloudType, class CompositionType> + static void writeFields + ( + const CloudType& c, + const CompositionType& compModel + ); + + //- Read - composition supplied + template<class CloudType> + static void writeFields(const CloudType& c); // Ostream Operator diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H index cc574ef5a3e1e81649b9d219f7f91e8105ddd0b4..48ef87864ea779b4afe604c3494c573ea326d599 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H @@ -30,7 +30,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::constantProperties:: constantProperties() : - ReactingParcel<ParcelType>::constantProperties(), + ParcelType::constantProperties(), LDevol_(0.0), hRetentionCoeff_(0.0) {} @@ -44,7 +44,7 @@ constantProperties const constantProperties& cp ) : - ReactingParcel<ParcelType>::constantProperties(cp), + ParcelType::constantProperties(cp), LDevol_(cp.LDevol_), hRetentionCoeff_(cp.hRetentionCoeff_) {} @@ -58,7 +58,7 @@ constantProperties const bool readFields ) : - ReactingParcel<ParcelType>::constantProperties(parentDict, readFields), + ParcelType::constantProperties(parentDict, readFields), LDevol_(0.0), hRetentionCoeff_(0.0) { @@ -82,29 +82,17 @@ constantProperties } -template<class ParcelType> -inline Foam::ReactingMultiphaseParcel<ParcelType>::trackData::trackData -( - ReactingMultiphaseCloud<ParcelType>& cloud, - typename ReactingParcel<ParcelType>::trackData::trackPart part -) -: - ReactingParcel<ParcelType>::trackData(cloud, part), - cloud_(cloud) -{} - - template<class ParcelType> inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ( - ReactingMultiphaseCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, const label tetPtI ) : - ReactingParcel<ParcelType>(owner, position, cellI, tetFaceI, tetPtI), + ParcelType(mesh, position, cellI, tetFaceI, tetPtI), YGas_(0), YLiquid_(0), YSolid_(0), @@ -115,7 +103,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel template<class ParcelType> inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ( - ReactingMultiphaseCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -135,9 +123,9 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel const constantProperties& constProps ) : - ReactingParcel<ParcelType> + ParcelType ( - owner, + mesh, position, cellI, tetFaceI, @@ -179,16 +167,6 @@ hRetentionCoeff() const } -// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // - -template<class ParcelType> -inline Foam::ReactingMultiphaseCloud<ParcelType>& -Foam::ReactingMultiphaseParcel<ParcelType>::trackData::cloud() -{ - return cloud_; -} - - // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * // template<class ParcelType> diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C index d0e8e130d44ff43247c27a3e3869ddc129c20747..7f5eb1cd3b4441028cc5281d1ba3c8d1b1dcfa4b 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ License template<class ParcelType> Foam::string Foam::ReactingMultiphaseParcel<ParcelType>::propHeader = - ReactingParcel<ParcelType>::propHeader + ParcelType::propHeader + " nGas(Y1..YN)" + " nLiquid(Y1..YN)" + " nSolid(Y1..YN)"; @@ -41,12 +41,12 @@ Foam::string Foam::ReactingMultiphaseParcel<ParcelType>::propHeader = template<class ParcelType> Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ( - const Cloud<ParcelType>& cloud, + const polyMesh& mesh, Istream& is, bool readFields ) : - ReactingParcel<ParcelType>(cloud, is, readFields), + ParcelType(mesh, is, readFields), YGas_(0), YLiquid_(0), YSolid_(0), @@ -54,21 +54,15 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel { if (readFields) { - const ReactingMultiphaseCloud<ParcelType>& cR = - dynamic_cast<const ReactingMultiphaseCloud<ParcelType>&>(cloud); + DynamicList<scalar> Yg; + DynamicList<scalar> Yl; + DynamicList<scalar> Ys; - const label idGas = cR.composition().idGas(); - const label nGas = cR.composition().componentNames(idGas).size(); - const label idLiquid = cR.composition().idLiquid(); - const label nLiquid = cR.composition().componentNames(idLiquid).size(); - const label idSolid = cR.composition().idGas(); - const label nSolid = cR.composition().componentNames(idSolid).size(); + is >> Yg >> Yl >> Ys; - YGas_.setSize(nGas); - YLiquid_.setSize(nLiquid); - YSolid_.setSize(nSolid); - - is >> YGas_ >> YLiquid_ >> YSolid_; + YGas_.transfer(Yg); + YLiquid_.transfer(Yl); + YSolid_.transfer(Ys); // scale the mass fractions const scalarField& YMix = this->Y_; @@ -82,7 +76,7 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ( "ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel" "(" - "const Cloud<ParcelType>&, " + "const polyMesh&, " "Istream&, " "bool" ")" @@ -91,32 +85,44 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel template<class ParcelType> +template<class CloudType> +void Foam::ReactingMultiphaseParcel<ParcelType>::readFields(CloudType& c) +{ + if (!c.size()) + { + return; + } + + ParcelType::readFields(c); +} + + +template<class ParcelType> +template<class CloudType, class CompositionType> void Foam::ReactingMultiphaseParcel<ParcelType>::readFields ( - Cloud<ParcelType>& cIn + CloudType& c, + const CompositionType& compModel ) { - if (!cIn.size()) + if (!c.size()) { return; } - ReactingMultiphaseCloud<ParcelType>& c = - dynamic_cast<ReactingMultiphaseCloud<ParcelType>&>(cIn); - - ReactingParcel<ParcelType>::readFields(c); + ParcelType::readFields(c, compModel); // Get names and sizes for each Y... - const label idGas = c.composition().idGas(); - const wordList& gasNames = c.composition().componentNames(idGas); - const label idLiquid = c.composition().idLiquid(); - const wordList& liquidNames = c.composition().componentNames(idLiquid); - const label idSolid = c.composition().idSolid(); - const wordList& solidNames = c.composition().componentNames(idSolid); - const wordList& stateLabels = c.composition().stateLabels(); + const label idGas = compModel.idGas(); + const wordList& gasNames = compModel.componentNames(idGas); + const label idLiquid = compModel.idLiquid(); + const wordList& liquidNames = compModel.componentNames(idLiquid); + const label idSolid = compModel.idSolid(); + const wordList& solidNames = compModel.componentNames(idSolid); + const wordList& stateLabels = compModel.stateLabels(); // Set storage for each Y... for each parcel - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter(typename Cloud<ReactingMultiphaseParcel<ParcelType> >, c, iter) { ReactingMultiphaseParcel<ParcelType>& p = iter(); p.YGas_.setSize(gasNames.size(), 0.0); @@ -137,7 +143,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields ); label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter + ( + typename Cloud<ReactingMultiphaseParcel<ParcelType> >, + c, + iter + ) { ReactingMultiphaseParcel<ParcelType>& p = iter(); p.YGas_[j] = YGas[i++]/(p.Y()[GAS] + ROOTVSMALL); @@ -156,7 +167,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields ); label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter + ( + typename Cloud<ReactingMultiphaseParcel<ParcelType> >, + c, + iter + ) { ReactingMultiphaseParcel<ParcelType>& p = iter(); p.YLiquid_[j] = YLiquid[i++]/(p.Y()[LIQ] + ROOTVSMALL); @@ -175,7 +191,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields ); label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter + ( + typename Cloud<ReactingMultiphaseParcel<ParcelType> >, + c, + iter + ) { ReactingMultiphaseParcel<ParcelType>& p = iter(); p.YSolid_[j] = YSolid[i++]/(p.Y()[SLD] + ROOTVSMALL); @@ -185,25 +206,32 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::readFields template<class ParcelType> +template<class CloudType> +void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields(const CloudType& c) +{ + ParcelType::writeFields(c); +} + + +template<class ParcelType> +template<class CloudType, class CompositionType> void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields ( - const Cloud<ParcelType>& cIn + const CloudType& c, + const CompositionType& compModel ) { - const ReactingMultiphaseCloud<ParcelType>& c = - dynamic_cast<const ReactingMultiphaseCloud<ParcelType>&>(cIn); - - ReactingParcel<ParcelType>::writeFields(c); + ParcelType::writeFields(c, compModel); - label np = c.size(); + label np = c.size(); // Write the composition fractions if (np > 0) { - const wordList& stateLabels = c.composition().stateLabels(); + const wordList& stateLabels = compModel.stateLabels(); - const label idGas = c.composition().idGas(); - const wordList& gasNames = c.composition().componentNames(idGas); + const label idGas = compModel.idGas(); + const wordList& gasNames = compModel.componentNames(idGas); forAll(gasNames, j) { IOField<scalar> YGas @@ -217,7 +245,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields ); label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) + forAllConstIter + ( + typename Cloud<ReactingMultiphaseParcel<ParcelType> >, + c, + iter + ) { const ReactingMultiphaseParcel<ParcelType>& p0 = iter(); YGas[i++] = p0.YGas()[j]*p0.Y()[GAS]; @@ -226,8 +259,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields YGas.write(); } - const label idLiquid = c.composition().idLiquid(); - const wordList& liquidNames = c.composition().componentNames(idLiquid); + const label idLiquid = compModel.idLiquid(); + const wordList& liquidNames = compModel.componentNames(idLiquid); forAll(liquidNames, j) { IOField<scalar> YLiquid @@ -241,7 +274,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields ); label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) + forAllConstIter + ( + typename Cloud<ReactingMultiphaseParcel<ParcelType> >, + c, + iter + ) { const ReactingMultiphaseParcel<ParcelType>& p0 = iter(); YLiquid[i++] = p0.YLiquid()[j]*p0.Y()[LIQ]; @@ -250,8 +288,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields YLiquid.write(); } - const label idSolid = c.composition().idSolid(); - const wordList& solidNames = c.composition().componentNames(idSolid); + const label idSolid = compModel.idSolid(); + const wordList& solidNames = compModel.componentNames(idSolid); forAll(solidNames, j) { IOField<scalar> YSolid @@ -265,7 +303,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::writeFields ); label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) + forAllConstIter + ( + typename Cloud<ReactingMultiphaseParcel<ParcelType> >, + c, + iter + ) { const ReactingMultiphaseParcel<ParcelType>& p0 = iter(); YSolid[i++] = p0.YSolid()[j]*p0.Y()[SLD]; @@ -291,14 +334,14 @@ Foam::Ostream& Foam::operator<< scalarField YSolidLoc(p.YSolid()*p.Y()[2]); if (os.format() == IOstream::ASCII) { - os << static_cast<const ReactingParcel<ParcelType>&>(p) + os << static_cast<const ParcelType&>(p) << token::SPACE << YGasLoc << token::SPACE << YLiquidLoc << token::SPACE << YSolidLoc; } else { - os << static_cast<const ReactingParcel<ParcelType>&>(p); + os << static_cast<const ParcelType&>(p); os << YGasLoc << YLiquidLoc << YSolidLoc; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index c8e625b9196ce136b66d0a2f22f235f16f3504d0..64e2506a811a7886cd5934bd5334a770cd3b733d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -40,7 +40,7 @@ void Foam::ReactingParcel<ParcelType>::setCellValues const label cellI ) { - ThermoParcel<ParcelType>::setCellValues(td, dt, cellI); + ParcelType::setCellValues(td, dt, cellI); pc_ = td.pInterp().interpolate ( @@ -252,9 +252,6 @@ void Foam::ReactingParcel<ParcelType>::calc const label cellI ) { - typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType; - const CompositionModel<cloudType>& composition = td.cloud().composition(); - // Define local properties at beginning of time step // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const scalar np0 = this->nParticle_; @@ -304,7 +301,7 @@ void Foam::ReactingParcel<ParcelType>::calc scalar NCpW = 0.0; // Surface concentrations of emitted species - scalarField Cs(composition.carrier().species().size(), 0.0); + scalarField Cs(td.cloud().composition().carrier().species().size(), 0.0); // Calc mass and enthalpy transfer due to phase change calcPhaseChange @@ -392,10 +389,10 @@ void Foam::ReactingParcel<ParcelType>::calc // Transfer mass lost from particle to carrier mass source forAll(dMassPC, i) { - label gid = composition.localToGlobalCarrierId(0, i); + label gid = td.cloud().composition().localToGlobalCarrierId(0, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i]; td.cloud().hsTrans()[cellI] += - np0*dMassPC[i]*composition.carrier().Hs(gid, T0); + np0*dMassPC[i]*td.cloud().composition().carrier().Hs(gid, T0); } // Update momentum transfer @@ -423,12 +420,13 @@ void Foam::ReactingParcel<ParcelType>::calc // Absorb parcel into carrier phase forAll(Y_, i) { - label gid = composition.localToGlobalCarrierId(0, i); + label gid = + td.cloud().composition().localToGlobalCarrierId(0, i); td.cloud().rhoTrans(gid)[cellI] += np0*mass1*Y_[i]; } td.cloud().UTrans()[cellI] += np0*mass1*U1; td.cloud().hsTrans()[cellI] += - np0*mass1*composition.H(0, Y_, pc_, T1); + np0*mass1*td.cloud().composition().H(0, Y_, pc_, T1); } } @@ -438,7 +436,7 @@ void Foam::ReactingParcel<ParcelType>::calc else { - this->Cp_ = composition.Cp(0, Y_, pc_, T1); + this->Cp_ = td.cloud().composition().Cp(0, Y_, pc_, T1); this->T_ = T1; this->U_ = U1; @@ -478,11 +476,6 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange scalarField& Cs ) { - typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType; - typedef PhaseChangeModel<cloudType> phaseChangeModelType; - const CompositionModel<cloudType>& composition = td.cloud().composition(); - - if ( !td.cloud().phaseChange().active() @@ -520,35 +513,19 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange forAll(YComponents, i) { - const label idc = composition.localToGlobalCarrierId(idPhase, i); - const label idl = composition.globalIds(idPhase)[i]; - - // Calculate enthalpy transfer - if - ( - td.cloud().phaseChange().enthalpyTransfer() - == phaseChangeModelType::etLatentHeat - ) - { - scalar hlp = composition.liquids().properties()[idl].hl(pc_, T); + const label idc = + td.cloud().composition().localToGlobalCarrierId(idPhase, i); + const label idl = td.cloud().composition().globalIds(idPhase)[i]; - Sh -= dMassPC[i]*hlp/dt; - } - else - { - // Note: enthalpies of both phases must use the same reference - scalar hc = composition.carrier().H(idc, T); - scalar hp = composition.liquids().properties()[idl].h(pc_, T); - - Sh -= dMassPC[i]*(hc - hp)/dt; - } + const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, T); + Sh -= dMassPC[i]*dh/dt; // Update particle surface thermo properties const scalar Dab = - composition.liquids().properties()[idl].D(pc_, Ts, Wc); + td.cloud().composition().liquids().properties()[idl].D(pc_, Ts, Wc); - const scalar Cp = composition.carrier().Cp(idc, Ts); - const scalar W = composition.carrier().W(idc); + const scalar Cp = td.cloud().composition().carrier().Cp(idc, Ts); + const scalar W = td.cloud().composition().carrier().W(idc); const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W); // Molar flux of species coming from the particle (kmol/m^2/s) @@ -571,7 +548,7 @@ Foam::ReactingParcel<ParcelType>::ReactingParcel const ReactingParcel<ParcelType>& p ) : - ThermoParcel<ParcelType>(p), + ParcelType(p), mass0_(p.mass0_), Y_(p.Y_), pc_(p.pc_) @@ -582,10 +559,10 @@ template<class ParcelType> Foam::ReactingParcel<ParcelType>::ReactingParcel ( const ReactingParcel<ParcelType>& p, - const ReactingCloud<ParcelType>& c + const polyMesh& mesh ) : - ThermoParcel<ParcelType>(p, c), + ParcelType(p, mesh), mass0_(p.mass0_), Y_(p.Y_), pc_(p.pc_) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index c6caeaa2bd194c866cb14d6723968b1e72cb3914..dc0a9faa9f13c6e7382332b5832c320d882626cb 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -40,7 +40,6 @@ SourceFiles #include "ThermoParcel.H" #include "ReactingCloud.H" -#include "reactingParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -64,15 +63,14 @@ Ostream& operator<< template<class ParcelType> class ReactingParcel : - public reactingParcel, - public ThermoParcel<ParcelType> + public ParcelType { public: //- Class to hold reacting particle constant properties class constantProperties : - public ThermoParcel<ParcelType>::constantProperties + public ParcelType::constantProperties { // Private data @@ -120,47 +118,45 @@ public: //- Return const access to the boiling point inline scalar Tbp() const; - }; + }; - //- Class used to pass reacting tracking data to the trackToFace function - class trackData + template<class CloudType> + class TrackingData : - public ThermoParcel<ParcelType>::trackData + public ParcelType::template TrackingData<CloudType> { + private: // Private data - //- Reference to the cloud containing this particle - ReactingCloud<ParcelType>& cloud_; + // Interpolators for continuous phase fields - //- Interpolator for continuous phase pressure field - autoPtr<interpolation<scalar> > pInterp_; + //- Interpolator for continuous phase pressure field + autoPtr<interpolation<scalar> > pInterp_; - public: - typedef ReactingCloud<ParcelType> cloudType; + public: + typedef typename ParcelType::template TrackingData<CloudType>::trackPart + trackPart; // Constructors //- Construct from components - inline trackData + inline TrackingData ( - ReactingCloud<ParcelType>& cloud, - typename ThermoParcel<ParcelType>::trackData::trackPart - part = ThermoParcel<ParcelType>::trackData::tpLinearTrack + CloudType& cloud, + trackPart part = ParcelType::template + TrackingData<CloudType>::tpLinearTrack ); // Member functions - //- Return access to the owner cloud - inline ReactingCloud<ParcelType>& cloud(); - - //- Return const access to the interpolator for continuous - // phase pressure field + //- Return const access to the interpolator for continuous phase + // pressure field inline const interpolation<scalar>& pInterp() const; }; @@ -229,16 +225,13 @@ public: TypeName("ReactingParcel"); - friend class Cloud<ParcelType>; - - // Constructors //- Construct from owner, position, and cloud owner // Other properties initialised as null inline ReactingParcel ( - ReactingCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -248,7 +241,7 @@ public: //- Construct from components inline ReactingParcel ( - ReactingCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -268,7 +261,7 @@ public: //- Construct from Istream ReactingParcel ( - const Cloud<ParcelType>& c, + const polyMesh& mesh, Istream& is, bool readFields = true ); @@ -277,37 +270,49 @@ public: ReactingParcel ( const ReactingParcel& p, - const ReactingCloud<ParcelType>& c + const polyMesh& mesh ); //- Construct as a copy ReactingParcel(const ReactingParcel& p); //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone() const + virtual autoPtr<particle> clone() const { - return autoPtr<Particle<ParcelType> > - ( - new ReactingParcel<ParcelType>(*this) - ); + return autoPtr<particle>(new ReactingParcel<ParcelType>(*this)); } //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone - ( - const Cloud<ParcelType>& c - ) const + virtual autoPtr<particle> clone(const polyMesh& mesh) const { - return autoPtr<Particle<ParcelType> > + return autoPtr<particle> ( - new ReactingParcel<ParcelType> - ( - *this, - static_cast<const ReactingCloud<ParcelType>&>(c) - ) + new ReactingParcel<ParcelType>(*this, mesh) ); } + //- Factory class to read-construct particles used for + // parallel transfer + class iNew + { + const polyMesh& mesh_; + + public: + + iNew(const polyMesh& mesh) + : + mesh_(mesh) + {} + + autoPtr<ReactingParcel<ParcelType> > operator()(Istream& is) const + { + return autoPtr<ReactingParcel<ParcelType> > + ( + new ReactingParcel<ParcelType>(mesh_, is, true) + ); + } + }; + // Member Functions @@ -379,10 +384,28 @@ public: // I-O //- Read - static void readFields(Cloud<ParcelType>& c); + template<class CloudType, class CompositionType> + static void readFields + ( + CloudType& c, + const CompositionType& compModel + ); + + //- Read - no composition + template<class CloudType> + static void readFields(CloudType& c); //- Write - static void writeFields(const Cloud<ParcelType>& c); + template<class CloudType, class CompositionType> + static void writeFields + ( + const CloudType& c, + const CompositionType& compModel + ); + + //- Read - composition supplied + template<class CloudType> + static void writeFields(const CloudType& c); // Ostream Operator @@ -402,6 +425,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "ReactingParcelI.H" +#include "ReactingParcelTrackingDataI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H index beee35182037ed1ffc146200718f91591ca10712..a765308d55f194f0b95d2fafed584301df6b8af7 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H @@ -26,10 +26,9 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParcelType> -inline -Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties() +inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties() : - ThermoParcel<ParcelType>::constantProperties(), + ParcelType::constantProperties(), pMin_(0.0), constantVolume_(false), Tvap_(0.0), @@ -43,7 +42,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties const constantProperties& cp ) : - ThermoParcel<ParcelType>::constantProperties(cp), + ParcelType::constantProperties(cp), pMin_(cp.pMin_), constantVolume_(cp.constantVolume_), Tvap_(cp.Tvap_), @@ -58,7 +57,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties const bool readFields ) : - ThermoParcel<ParcelType>::constantProperties(parentDict, readFields), + ParcelType::constantProperties(parentDict, readFields), pMin_(0.0), constantVolume_(false), Tvap_(0.0), @@ -74,37 +73,17 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties } -template<class ParcelType> -inline Foam::ReactingParcel<ParcelType>::trackData::trackData -( - ReactingCloud<ParcelType>& cloud, - typename ThermoParcel<ParcelType>::trackData::trackPart part -) -: - ThermoParcel<ParcelType>::trackData(cloud, part), - cloud_(cloud), - pInterp_ - ( - interpolation<scalar>::New - ( - cloud.solution().interpolationSchemes(), - cloud.p() - ) - ) -{} - - template<class ParcelType> inline Foam::ReactingParcel<ParcelType>::ReactingParcel ( - ReactingCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, const label tetPtI ) : - ThermoParcel<ParcelType>(owner, position, cellI, tetFaceI, tetPtI), + ParcelType(mesh, position, cellI, tetFaceI, tetPtI), mass0_(0.0), Y_(0), pc_(0.0) @@ -114,7 +93,7 @@ inline Foam::ReactingParcel<ParcelType>::ReactingParcel template<class ParcelType> inline Foam::ReactingParcel<ParcelType>::ReactingParcel ( - ReactingCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -131,9 +110,9 @@ inline Foam::ReactingParcel<ParcelType>::ReactingParcel const constantProperties& constProps ) : - ThermoParcel<ParcelType> + ParcelType ( - owner, + mesh, position, cellI, tetFaceI, @@ -191,24 +170,6 @@ Foam::ReactingParcel<ParcelType>::constantProperties::Tbp() const } -// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // - -template<class ParcelType> -inline Foam::ReactingCloud<ParcelType>& -Foam::ReactingParcel<ParcelType>::trackData::cloud() -{ - return cloud_; -} - - -template<class ParcelType> -inline const Foam::interpolation<Foam::scalar>& -Foam::ReactingParcel<ParcelType>::trackData::pInterp() const -{ - return pInterp_(); -} - - // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * // template<class ParcelType> diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C index cea90982383875b88f72bb8e16e5ff9c408fca43..b0366c5d78e73d9ced13e2b49b5219821133f015 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C @@ -40,27 +40,23 @@ Foam::string Foam::ReactingParcel<ParcelType>::propHeader = template<class ParcelType> Foam::ReactingParcel<ParcelType>::ReactingParcel ( - const Cloud<ParcelType>& cloud, + const polyMesh& mesh, Istream& is, bool readFields ) : - ThermoParcel<ParcelType>(cloud, is, readFields), + ParcelType(mesh, is, readFields), mass0_(0.0), Y_(0), pc_(0.0) { if (readFields) { - const ReactingCloud<ParcelType>& cR = - dynamic_cast<const ReactingCloud<ParcelType>&>(cloud); - - const label nMixture = cR.composition().phaseTypes().size(); - Y_.setSize(nMixture); + DynamicList<scalar> Ymix; if (is.format() == IOstream::ASCII) { - is >> mass0_ >> Y_; + is >> mass0_ >> Ymix; } else { @@ -69,8 +65,10 @@ Foam::ReactingParcel<ParcelType>::ReactingParcel reinterpret_cast<char*>(&mass0_), + sizeof(mass0_) ); - is >> Y_; + is >> Ymix; } + + Y_.transfer(Ymix); } // Check state of Istream @@ -78,7 +76,7 @@ Foam::ReactingParcel<ParcelType>::ReactingParcel ( "ReactingParcel<ParcelType>::ReactingParcel" "(" - "const Cloud<ParcelType>&, " + "const polyMesh&, " "Istream&, " "bool" ")" @@ -87,40 +85,55 @@ Foam::ReactingParcel<ParcelType>::ReactingParcel template<class ParcelType> -void Foam::ReactingParcel<ParcelType>::readFields(Cloud<ParcelType>& cIn) +template<class CloudType> +void Foam::ReactingParcel<ParcelType>::readFields(CloudType& c) { - if (!cIn.size()) + if (!c.size()) { return; } - ReactingCloud<ParcelType>& c = - dynamic_cast<ReactingCloud<ParcelType>&>(cIn); + ParcelType::readFields(c); +} + - ThermoParcel<ParcelType>::readFields(c); +template<class ParcelType> +template<class CloudType, class CompositionType> +void Foam::ReactingParcel<ParcelType>::readFields +( + CloudType& c, + const CompositionType& compModel +) +{ + if (!c.size()) + { + return; + } + + ParcelType::readFields(c); IOField<scalar> mass0(c.fieldIOobject("mass0", IOobject::MUST_READ)); c.checkFieldIOobject(c, mass0); label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter(typename Cloud<ReactingParcel<ParcelType> >, c, iter) { ReactingParcel<ParcelType>& p = iter(); p.mass0_ = mass0[i++]; } // Get names and sizes for each Y... - const wordList& phaseTypes = c.composition().phaseTypes(); + const wordList& phaseTypes = compModel.phaseTypes(); const label nPhases = phaseTypes.size(); wordList stateLabels(nPhases, ""); - if (c.composition().nPhase() == 1) + if (compModel.nPhase() == 1) { - stateLabels = c.composition().stateLabels(); + stateLabels = compModel.stateLabels(); } // Set storage for each Y... for each parcel - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter(typename Cloud<ReactingParcel<ParcelType> >, c, iter) { ReactingParcel<ParcelType>& p = iter(); p.Y_.setSize(nPhases, 0.0); @@ -139,7 +152,7 @@ void Foam::ReactingParcel<ParcelType>::readFields(Cloud<ParcelType>& cIn) ); label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter(typename Cloud<ReactingParcel<ParcelType> >, c, iter) { ReactingParcel<ParcelType>& p = iter(); p.Y_[j] = Y[i++]; @@ -149,15 +162,22 @@ void Foam::ReactingParcel<ParcelType>::readFields(Cloud<ParcelType>& cIn) template<class ParcelType> +template<class CloudType> +void Foam::ReactingParcel<ParcelType>::writeFields(const CloudType& c) +{ + ParcelType::writeFields(c); +} + + +template<class ParcelType> +template<class CloudType, class CompositionType> void Foam::ReactingParcel<ParcelType>::writeFields ( - const Cloud<ParcelType>& cIn + const CloudType& c, + const CompositionType& compModel ) { - const ReactingCloud<ParcelType>& c = - dynamic_cast<const ReactingCloud<ParcelType>&>(cIn); - - ThermoParcel<ParcelType>::writeFields(c); + ParcelType::writeFields(c); const label np = c.size(); @@ -166,7 +186,7 @@ void Foam::ReactingParcel<ParcelType>::writeFields IOField<scalar> mass0(c.fieldIOobject("mass0", IOobject::NO_READ), np); label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) + forAllConstIter(typename Cloud<ReactingParcel<ParcelType> >, c, iter) { const ReactingParcel<ParcelType>& p = iter(); mass0[i++] = p.mass0_; @@ -174,11 +194,11 @@ void Foam::ReactingParcel<ParcelType>::writeFields mass0.write(); // Write the composition fractions - const wordList& phaseTypes = c.composition().phaseTypes(); + const wordList& phaseTypes = compModel.phaseTypes(); wordList stateLabels(phaseTypes.size(), ""); - if (c.composition().nPhase() == 1) + if (compModel.nPhase() == 1) { - stateLabels = c.composition().stateLabels(); + stateLabels = compModel.stateLabels(); } forAll(phaseTypes, j) @@ -192,12 +212,16 @@ void Foam::ReactingParcel<ParcelType>::writeFields ), np ); - label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) + forAllConstIter + ( + typename Cloud<ReactingParcel<ParcelType> >, + c, + iter + ) { - const ReactingParcel<ParcelType>& p0 = iter(); - Y[i++] = p0.Y()[j]; + const ReactingParcel<ParcelType>& p = iter(); + Y[i++] = p.Y()[j]; } Y.write(); @@ -217,13 +241,13 @@ Foam::Ostream& Foam::operator<< { if (os.format() == IOstream::ASCII) { - os << static_cast<const ThermoParcel<ParcelType>&>(p) + os << static_cast<const ParcelType&>(p) << token::SPACE << p.mass0() << token::SPACE << p.Y(); } else { - os << static_cast<const ThermoParcel<ParcelType>&>(p); + os << static_cast<const ParcelType&>(p); os.write ( reinterpret_cast<const char*>(&p.mass0_), diff --git a/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelTrackingDataI.H similarity index 64% rename from src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.C rename to src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelTrackingDataI.H index 9adeb208383203c700c02492296829c547616f61..dd49f0284ae0952a5e0a8c500182f3403b4a4e93 100644 --- a/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelTrackingDataI.H @@ -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,26 +23,33 @@ License \*---------------------------------------------------------------------------*/ -#include "reactingParcel.H" +template<class ParcelType> +template<class CloudType> +inline Foam::ReactingParcel<ParcelType>::TrackingData<CloudType>::TrackingData +( + CloudType& cloud, + trackPart part +) +: + ParcelType::template TrackingData<CloudType>(cloud, part), + pInterp_ + ( + interpolation<scalar>::New + ( + cloud.solution().interpolationSchemes(), + cloud.p() + ) + ) +{} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam +template<class ParcelType> +template<class CloudType> +inline const Foam::interpolation<Foam::scalar>& +Foam::ReactingParcel<ParcelType>::TrackingData<CloudType>::pInterp() const { - defineTypeNameAndDebug(reactingParcel, 0); + return pInterp_(); } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::reactingParcel::reactingParcel() -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -Foam::reactingParcel::~reactingParcel() -{} - - // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 06b6f45cd4da877e98a46e0232bc72040b783193..c284ac45ff012a1da23333efd36ec9b26eabaf50 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -39,7 +39,7 @@ void Foam::ThermoParcel<ParcelType>::setCellValues const label cellI ) { - KinematicParcel<ParcelType>::setCellValues(td, dt, cellI); + ParcelType::setCellValues(td, dt, cellI); tetIndices tetIs = this->currentTetIndices(); @@ -353,7 +353,7 @@ Foam::ThermoParcel<ParcelType>::ThermoParcel const ThermoParcel<ParcelType>& p ) : - KinematicParcel<ParcelType>(p), + ParcelType(p), T_(p.T_), Cp_(p.Cp_), Tc_(p.Tc_), @@ -365,10 +365,10 @@ template<class ParcelType> Foam::ThermoParcel<ParcelType>::ThermoParcel ( const ThermoParcel<ParcelType>& p, - const ThermoCloud<ParcelType>& c + const polyMesh& mesh ) : - KinematicParcel<ParcelType>(p, c), + ParcelType(p, mesh), T_(p.T_), Cp_(p.Cp_), Tc_(p.Tc_), diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H index ff74006c10bc074a17438e9230acb70e7d3a14dc..e47e1da48a60ba7ca4153b9fa7629484fea7a5b2 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H @@ -64,14 +64,14 @@ Ostream& operator<< template<class ParcelType> class ThermoParcel : - public KinematicParcel<ParcelType> + public ParcelType { public: //- Class to hold thermo particle constant properties class constantProperties : - public KinematicParcel<ParcelType>::constantProperties + public ParcelType::constantProperties { // Private data @@ -140,17 +140,15 @@ public: }; - //- Class used to pass thermo tracking data to the trackToFace function - class trackData + template<class CloudType> + class TrackingData : - public KinematicParcel<ParcelType>::trackData + public ParcelType::template TrackingData<CloudType> { + private: // Private data - //- Reference to the cloud containing this particle - ThermoCloud<ParcelType>& cloud_; - //- Local copy of carrier specific heat field // Cp not stored on acrrier thermo, but returned as tmp<...> const volScalarField Cp_; @@ -168,24 +166,25 @@ public: autoPtr<interpolation<scalar> > GInterp_; + public: + typedef typename ParcelType::template TrackingData<CloudType>::trackPart + trackPart; + // Constructors //- Construct from components - inline trackData + inline TrackingData ( - ThermoCloud<ParcelType>& cloud, - typename KinematicParcel<ParcelType>::trackData::trackPart - part = KinematicParcel<ParcelType>::trackData::tpLinearTrack + CloudType& cloud, + trackPart part = ParcelType::template + TrackingData<CloudType>::tpLinearTrack ); // Member functions - //- Return access to the owner cloud - inline ThermoCloud<ParcelType>& cloud(); - //- Return access to the locally stored carrier Cp field inline const volScalarField& Cp() const; @@ -259,16 +258,13 @@ public: TypeName("ThermoParcel"); - friend class Cloud<ParcelType>; - - // Constructors //- Construct from owner, position, and cloud owner // Other properties initialised as null inline ThermoParcel ( - ThermoCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -278,7 +274,7 @@ public: //- Construct from components inline ThermoParcel ( - ThermoCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -297,7 +293,7 @@ public: //- Construct from Istream ThermoParcel ( - const Cloud<ParcelType>& c, + const polyMesh& mesh, Istream& is, bool readFields = true ); @@ -306,30 +302,42 @@ public: ThermoParcel(const ThermoParcel& p); //- Construct as a copy - ThermoParcel(const ThermoParcel& p, const ThermoCloud<ParcelType>& c); + ThermoParcel(const ThermoParcel& p, const polyMesh& mesh); //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone() const + virtual autoPtr<particle> clone() const { - return autoPtr<Particle<ParcelType> >(new ThermoParcel(*this)); + return autoPtr<particle>(new ThermoParcel(*this)); } //- Construct and return a (basic particle) clone - virtual autoPtr<Particle<ParcelType> > clone - ( - const Cloud<ParcelType>& c - ) const + virtual autoPtr<particle> clone(const polyMesh& mesh) const { - return autoPtr<Particle<ParcelType> > - ( - new ThermoParcel - ( - *this, - static_cast<const ThermoCloud<ParcelType>&>(c) - ) - ); + return autoPtr<particle>(new ThermoParcel(*this, mesh)); } + //- Factory class to read-construct particles used for + // parallel transfer + class iNew + { + const polyMesh& mesh_; + + public: + + iNew(const polyMesh& mesh) + : + mesh_(mesh) + {} + + autoPtr<ThermoParcel<ParcelType> > operator()(Istream& is) const + { + return autoPtr<ThermoParcel<ParcelType> > + ( + new ThermoParcel<ParcelType>(mesh_, is, true) + ); + } + }; + // Member Functions @@ -407,10 +415,12 @@ public: // I-O //- Read - static void readFields(Cloud<ParcelType>& c); + template<class CloudType> + static void readFields(CloudType& c); //- Write - static void writeFields(const Cloud<ParcelType>& c); + template<class CloudType> + static void writeFields(const CloudType& c); // Ostream Operator @@ -430,6 +440,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "ThermoParcelI.H" +#include "ThermoParcelTrackingDataI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H index 8a7d37d9caafd2cd8a49ed9607212537bfc36954..d350390a9e132a0e1cb1c0e6e28d8b7aa0cd5e01 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H @@ -28,7 +28,7 @@ License template<class ParcelType> inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties() : - KinematicParcel<ParcelType>::constantProperties(), + ParcelType::constantProperties(), T0_(0.0), TMin_(0.0), Cp0_(0.0), @@ -44,7 +44,7 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties const constantProperties& cp ) : - KinematicParcel<ParcelType>::constantProperties(cp), + ParcelType::constantProperties(cp), T0_(cp.T0_), TMin_(cp.TMin_), Cp0_(cp.Cp0_), @@ -61,7 +61,7 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties const bool readFields ) : - KinematicParcel<ParcelType>::constantProperties(parentDict, readFields), + ParcelType::constantProperties(parentDict, readFields), T0_(0.0), TMin_(0.0), Cp0_(0.0), @@ -81,71 +81,17 @@ inline Foam::ThermoParcel<ParcelType>::constantProperties::constantProperties } -template<class ParcelType> -inline Foam::ThermoParcel<ParcelType>::trackData::trackData -( - ThermoCloud<ParcelType>& cloud, - typename KinematicParcel<ParcelType>::trackData::trackPart part -) -: - KinematicParcel<ParcelType>::trackData(cloud, part), - cloud_(cloud), - Cp_ - ( - IOobject - ( - "Cp", - cloud.db().time().timeName(), - cloud.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - cloud.thermo().thermo().Cp() - ), - TInterp_ - ( - interpolation<scalar>::New - ( - cloud.solution().interpolationSchemes(), - cloud.T() - ) - ), - CpInterp_ - ( - interpolation<scalar>::New - ( - cloud.solution().interpolationSchemes(), - Cp_ - ) - ), - GInterp_(NULL) -{ - if (cloud.radiation()) - { - GInterp_.reset - ( - interpolation<scalar>::New - ( - cloud.solution().interpolationSchemes(), - cloud.mesh().objectRegistry::template - lookupObject<volScalarField>("G") - ).ptr() - ); - } -} - - template<class ParcelType> inline Foam::ThermoParcel<ParcelType>::ThermoParcel ( - ThermoCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, const label tetPtI ) : - KinematicParcel<ParcelType>(owner, position, cellI, tetFaceI, tetPtI), + ParcelType(mesh, position, cellI, tetFaceI, tetPtI), T_(0.0), Cp_(0.0), Tc_(0.0), @@ -156,7 +102,7 @@ inline Foam::ThermoParcel<ParcelType>::ThermoParcel template<class ParcelType> inline Foam::ThermoParcel<ParcelType>::ThermoParcel ( - ThermoCloud<ParcelType>& owner, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -172,9 +118,9 @@ inline Foam::ThermoParcel<ParcelType>::ThermoParcel const constantProperties& constProps ) : - KinematicParcel<ParcelType> + ParcelType ( - owner, + mesh, position, cellI, tetFaceI, @@ -246,58 +192,6 @@ Foam::ThermoParcel<ParcelType>::constantProperties::Pr() const } -// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // - -template<class ParcelType> -inline Foam::ThermoCloud<ParcelType>& -Foam::ThermoParcel<ParcelType>::trackData::cloud() -{ - return cloud_; -} - - -template<class ParcelType> -inline const Foam::volScalarField& -Foam::ThermoParcel<ParcelType>::trackData::Cp() const -{ - return Cp_; -} - - -template<class ParcelType> -inline const Foam::interpolation<Foam::scalar>& -Foam::ThermoParcel<ParcelType>::trackData::TInterp() const -{ - return TInterp_(); -} - - -template<class ParcelType> -inline const Foam::interpolation<Foam::scalar>& -Foam::ThermoParcel<ParcelType>::trackData::CpInterp() const -{ - return CpInterp_(); -} - - -template<class ParcelType> -inline const Foam::interpolation<Foam::scalar>& -Foam::ThermoParcel<ParcelType>::trackData::GInterp() const -{ - if (!GInterp_.valid()) - { - FatalErrorIn - ( - "inline const Foam::interpolation<Foam::scalar>&" - "Foam::ThermoParcel<ParcelType>::trackData::GInterp() const" - ) << "Radiation G interpolation object not set" - << abort(FatalError); - } - - return GInterp_(); -} - - // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * // template<class ParcelType> diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C index d052abebae2a33233c0ee73035f0bf8a425015ae..583d3d0c8c4deda5f1e722d7536b64fedd4b6696 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C @@ -30,7 +30,7 @@ License template<class ParcelType> Foam::string Foam::ThermoParcel<ParcelType>::propHeader = - KinematicParcel<ParcelType>::propHeader + ParcelType::propHeader + " T" + " Cp"; @@ -40,12 +40,12 @@ Foam::string Foam::ThermoParcel<ParcelType>::propHeader = template<class ParcelType> Foam::ThermoParcel<ParcelType>::ThermoParcel ( - const Cloud<ParcelType>& cloud, + const polyMesh& mesh, Istream& is, bool readFields ) : - KinematicParcel<ParcelType>(cloud, is, readFields), + ParcelType(mesh, is, readFields), T_(0.0), Cp_(0.0), Tc_(0.0), @@ -72,20 +72,21 @@ Foam::ThermoParcel<ParcelType>::ThermoParcel // Check state of Istream is.check ( - "ThermoParcel::ThermoParcel(const Cloud<ParcelType>&, Istream&, bool)" + "ThermoParcel::ThermoParcel(const polyMesh&, Istream&, bool)" ); } template<class ParcelType> -void Foam::ThermoParcel<ParcelType>::readFields(Cloud<ParcelType>& c) +template<class CloudType> +void Foam::ThermoParcel<ParcelType>::readFields(CloudType& c) { if (!c.size()) { return; } - KinematicParcel<ParcelType>::readFields(c); + ParcelType::readFields(c); IOField<scalar> T(c.fieldIOobject("T", IOobject::MUST_READ)); c.checkFieldIOobject(c, T); @@ -95,7 +96,7 @@ void Foam::ThermoParcel<ParcelType>::readFields(Cloud<ParcelType>& c) label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) + forAllIter(typename Cloud<ThermoParcel<ParcelType> >, c, iter) { ThermoParcel<ParcelType>& p = iter(); @@ -107,9 +108,10 @@ void Foam::ThermoParcel<ParcelType>::readFields(Cloud<ParcelType>& c) template<class ParcelType> -void Foam::ThermoParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c) +template<class CloudType> +void Foam::ThermoParcel<ParcelType>::writeFields(const CloudType& c) { - KinematicParcel<ParcelType>::writeFields(c); + ParcelType::writeFields(c); label np = c.size(); @@ -117,7 +119,7 @@ void Foam::ThermoParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c) IOField<scalar> Cp(c.fieldIOobject("Cp", IOobject::NO_READ), np); label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) + forAllConstIter(typename Cloud<ThermoParcel<ParcelType> >, c, iter) { const ThermoParcel<ParcelType>& p = iter(); @@ -142,13 +144,13 @@ Foam::Ostream& Foam::operator<< { if (os.format() == IOstream::ASCII) { - os << static_cast<const KinematicParcel<ParcelType>&>(p) + os << static_cast<const ParcelType&>(p) << token::SPACE << p.T() << token::SPACE << p.Cp(); } else { - os << static_cast<const KinematicParcel<ParcelType>&>(p); + os << static_cast<const ParcelType&>(p); os.write ( reinterpret_cast<const char*>(&p.T_), diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H new file mode 100644 index 0000000000000000000000000000000000000000..d7e2e9a05285b78158608860252074986a43c6eb --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +template<class ParcelType> +template<class CloudType> +inline Foam::ThermoParcel<ParcelType>::TrackingData<CloudType>::TrackingData +( + CloudType& cloud, + trackPart part +) +: + ParcelType::template TrackingData<CloudType>(cloud, part), + Cp_ + ( + IOobject + ( + "Cp", + cloud.db().time().timeName(), + cloud.db(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + cloud.thermo().thermo().Cp() + ), + TInterp_ + ( + interpolation<scalar>::New + ( + cloud.solution().interpolationSchemes(), + cloud.T() + ) + ), + CpInterp_ + ( + interpolation<scalar>::New + ( + cloud.solution().interpolationSchemes(), + Cp_ + ) + ), + GInterp_(NULL) +{ + if (cloud.radiation()) + { + GInterp_.reset + ( + interpolation<scalar>::New + ( + cloud.solution().interpolationSchemes(), + cloud.mesh().objectRegistry::template + lookupObject<volScalarField>("G") + ).ptr() + ); + } +} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::volScalarField& +Foam::ThermoParcel<ParcelType>::TrackingData<CloudType>::Cp() const +{ + return Cp_; +} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::interpolation<Foam::scalar>& +Foam::ThermoParcel<ParcelType>::TrackingData<CloudType>::TInterp() const +{ + return TInterp_(); +} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::interpolation<Foam::scalar>& +Foam::ThermoParcel<ParcelType>::TrackingData<CloudType>::CpInterp() const +{ + return CpInterp_(); +} + + +template<class ParcelType> +template<class CloudType> +inline const Foam::interpolation<Foam::scalar>& +Foam::ThermoParcel<ParcelType>::TrackingData<CloudType>::GInterp() const +{ + if (!GInterp_.valid()) + { + FatalErrorIn + ( + "inline const Foam::interpolation<Foam::scalar>&" + "Foam::ThermoParcel<ParcelType>::TrackingData<CloudType>::" + "GInterp() const" + ) << "Radiation G interpolation object not set" + << abort(FatalError); + } + + return GInterp_(); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.H b/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.H deleted file mode 100644 index 8cd6865a7c9f26a3584e2c3dd3e63b3e9f7a061b..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.H +++ /dev/null @@ -1,80 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::basicReactingParcel - -Description - Base class for reacting parcel - simply used to set the contiguous flag - -SourceFiles - reactingParcel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef reactingParcel_H -#define reactingParcel_H - -#include "typeInfo.H" -#include "contiguous.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class reactingParcel Declaration -\*---------------------------------------------------------------------------*/ - -class reactingParcel -{ -public: - - //- Run-time type information - TypeName("reactingParcel"); - - //- Construct null - reactingParcel(); - - //- Destructor - virtual ~reactingParcel(); -}; - - -template<> -inline bool contiguous<reactingParcel>() -{ - return false; // Derived classes include scalar lists/fields -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.C deleted file mode 100644 index b24d5b8cf3a230465a80d2ffbb32b7c836ace540..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.C +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "basicKinematicParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::basicKinematicParcel::basicKinematicParcel -( - KinematicCloud<basicKinematicParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI -) -: - KinematicParcel<basicKinematicParcel> - ( - owner, - position, - cellI, - tetFaceI, - tetPtI - ) -{} - - -Foam::basicKinematicParcel::basicKinematicParcel -( - KinematicCloud<basicKinematicParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector& U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const constantProperties& constProps -) -: - KinematicParcel<basicKinematicParcel> - ( - owner, - position, - cellI, - tetFaceI, - tetPtI, - typeId, - nParticle0, - d0, - dTarget0, - U0, - f0, - angularMomentum0, - torque0, - constProps - ) -{} - - -Foam::basicKinematicParcel::basicKinematicParcel -( - const Cloud<basicKinematicParcel>& cloud, - Istream& is, - bool readFields -) -: - KinematicParcel<basicKinematicParcel>(cloud, is, readFields) -{} - - -Foam::basicKinematicParcel::basicKinematicParcel -( - const basicKinematicParcel& p -) -: - KinematicParcel<basicKinematicParcel>(p) -{} - - -Foam::basicKinematicParcel::basicKinematicParcel -( - const basicKinematicParcel& p, - const KinematicCloud<basicKinematicParcel>& c -) -: - KinematicParcel<basicKinematicParcel>(p, c) -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -Foam::basicKinematicParcel::~basicKinematicParcel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H index 38c1a2fbf780336d809f6d0c794a02ed713bd8b2..b4c3923ace72d33b5e08e7a9515e7b04aa1d29df 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H @@ -25,130 +25,33 @@ Class Foam::basicKinematicParcel Description - + Definition of basic kinematic parcel SourceFiles - basicKinematicParcel.C + basicKinematicParcel.H \*---------------------------------------------------------------------------*/ #ifndef basicKinematicParcel_H #define basicKinematicParcel_H +#include "contiguous.H" +#include "particle.H" #include "KinematicParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + typedef KinematicParcel<particle> basicKinematicParcel; -/*---------------------------------------------------------------------------*\ - Class basicKinematicParcel Declaration -\*---------------------------------------------------------------------------*/ - -class basicKinematicParcel -: - public KinematicParcel<basicKinematicParcel> -{ - -public: - - //- Run-time type information - TypeName("basicKinematicParcel"); - - - // Constructors - - //- Construct from owner, position, and cloud owner - // Other properties initialised as null - basicKinematicParcel - ( - KinematicCloud<basicKinematicParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI - ); - - //- Construct from components - basicKinematicParcel - ( - KinematicCloud<basicKinematicParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector& U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const constantProperties& constProps - ); - - //- Construct from Istream - basicKinematicParcel - ( - const Cloud<basicKinematicParcel>& c, - Istream& is, - bool readFields = true - ); - - //- Construct as a copy - basicKinematicParcel(const basicKinematicParcel& p); - - //- Construct as a copy - basicKinematicParcel - ( - const basicKinematicParcel& p, - const KinematicCloud<basicKinematicParcel>& c - ); - - //- Construct and return a clone - virtual autoPtr<Particle<basicKinematicParcel> > clone() const - { - return autoPtr<Particle<basicKinematicParcel> > - ( - new basicKinematicParcel(*this) - ); - } - - //- Construct and return a clone - virtual autoPtr<Particle<basicKinematicParcel> > clone - ( - const Cloud<basicKinematicParcel>& c - ) const - { - return autoPtr<Particle<basicKinematicParcel> > - ( - new basicKinematicParcel - ( - *this, - static_cast<const KinematicCloud<basicKinematicParcel>&>(c) - ) - ); - } - - - //- Destructor - virtual ~basicKinematicParcel(); -}; - - -template<> -inline bool contiguous<basicKinematicParcel>() -{ - return true; + template<> + inline bool contiguous<basicKinematicParcel>() + { + return true; + } } - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C index 6fbffda440f4ac592d836f324d415eb152f65660..826cbc3172cec7565fbaf512e6e112db28f5f08c 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C @@ -24,13 +24,14 @@ License \*---------------------------------------------------------------------------*/ #include "basicKinematicParcel.H" -#include "createKinematicParcelTypes.H" +#include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createKinematicParcelTypes(basicKinematicParcel); + defineTemplateTypeNameAndDebug(basicKinematicParcel, 0); + defineTemplateTypeNameAndDebug(Cloud<basicKinematicParcel>, 0); } diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C deleted file mode 100644 index 9d37e132199c2db67604517e86df417716ee5ef5..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C +++ /dev/null @@ -1,138 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "basicReactingMultiphaseParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel -( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI -) -: - ReactingMultiphaseParcel<basicReactingMultiphaseParcel> - ( - owner, - position, - cellI, - tetFaceI, - tetPtI - ) -{} - - -Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel -( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector& U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const scalarField& YGas0, - const scalarField& YLiquid0, - const scalarField& YSolid0, - const scalarField& Y0, - const ReactingMultiphaseParcel<basicReactingMultiphaseParcel>:: - constantProperties& constProps -) -: - ReactingMultiphaseParcel<basicReactingMultiphaseParcel> - ( - owner, - position, - cellI, - tetFaceI, - tetPtI, - typeId, - nParticle0, - d0, - dTarget0, - U0, - f0, - angularMomentum0, - torque0, - YGas0, - YLiquid0, - YSolid0, - Y0, - constProps - ) -{} - - -Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel -( - const Cloud<basicReactingMultiphaseParcel>& cloud, - Istream& is, - bool readFields -) -: - ReactingMultiphaseParcel<basicReactingMultiphaseParcel> - ( - cloud, - is, - readFields - ) -{} - - -Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel -( - const basicReactingMultiphaseParcel& p -) -: - ReactingMultiphaseParcel<basicReactingMultiphaseParcel>(p) -{} - - -Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel -( - const basicReactingMultiphaseParcel& p, - const ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& c -) -: - ReactingMultiphaseParcel<basicReactingMultiphaseParcel>(p, c) -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -Foam::basicReactingMultiphaseParcel::~basicReactingMultiphaseParcel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H index 54ed924392f91f8df061be363e6360ec22e61f88..0289d1ca0f1de521012773ee673366994c8a8ee5 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::BasicReactingMultiphaseParcel Description - + Definition of basic reacting parcel SourceFiles basicReactingMultiphaseParcel.C @@ -36,123 +36,38 @@ SourceFiles #ifndef basicReactingMultiphaseParcel_H #define basicReactingMultiphaseParcel_H +#include "contiguous.H" +#include "particle.H" +#include "KinematicParcel.H" +#include "ThermoParcel.H" +#include "ReactingParcel.H" #include "ReactingMultiphaseParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - namespace Foam { + typedef ReactingMultiphaseParcel + < + ReactingParcel + < + ThermoParcel + < + KinematicParcel + < + particle + > + > + > + > basicReactingMultiphaseParcel; + + template<> + inline bool contiguous<basicReactingMultiphaseParcel>() + { + return false; + } +} -/*---------------------------------------------------------------------------*\ - Class basicReactingMultiphaseParcel Declaration -\*---------------------------------------------------------------------------*/ - -class basicReactingMultiphaseParcel -: - public ReactingMultiphaseParcel<basicReactingMultiphaseParcel> -{ - -public: - - //- Run-time type information - TypeName("basicReactingMultiphaseParcel"); - - // Constructors - - //- Construct from owner, position, and cloud owner - // Other properties initialised as null - basicReactingMultiphaseParcel - ( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI - ); - - //- Construct from components - basicReactingMultiphaseParcel - ( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector& U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const scalarField& YGas0, - const scalarField& YLiquid0, - const scalarField& YSolid0, - const scalarField& Y0, - const ReactingMultiphaseParcel<basicReactingMultiphaseParcel>:: - constantProperties& constProps - ); - - //- Construct from Istream - basicReactingMultiphaseParcel - ( - const Cloud<basicReactingMultiphaseParcel>& c, - Istream& is, - bool readFields = true - ); - - //- Construct as a copy - basicReactingMultiphaseParcel(const basicReactingMultiphaseParcel& p); - - //- Construct as a copy - basicReactingMultiphaseParcel - ( - const basicReactingMultiphaseParcel& p, - const ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& c - ); - - //- Construct and return a clone - virtual autoPtr<Particle<basicReactingMultiphaseParcel> > clone() const - { - return autoPtr<Particle<basicReactingMultiphaseParcel> > - ( - new basicReactingMultiphaseParcel(*this) - ); - } - - //- Construct and return a clone - virtual autoPtr<Particle<basicReactingMultiphaseParcel> > clone - ( - const Cloud<basicReactingMultiphaseParcel>& c - ) const - { - return autoPtr<Particle<basicReactingMultiphaseParcel> > - ( - new basicReactingMultiphaseParcel - ( - *this, - static_cast - < - const ReactingMultiphaseCloud - < - basicReactingMultiphaseParcel - >& - >(c) - ) - ); - } - - - //- Destructor - virtual ~basicReactingMultiphaseParcel(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C index 78de4affcc6b78397e53d6bd65f4df2f31fb6142..ccd0a9c8e6fd38f9aa47e4e17433d45e26a7c907 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,14 +23,15 @@ License \*---------------------------------------------------------------------------*/ -#include "createReactingMultiphaseParcelTypes.H" #include "basicReactingMultiphaseParcel.H" +#include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createReactingMultiphaseParcelTypes(basicReactingMultiphaseParcel); + defineTemplateTypeNameAndDebug(basicReactingMultiphaseParcel, 0); + defineTemplateTypeNameAndDebug(Cloud<basicReactingMultiphaseParcel>, 0); } diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C deleted file mode 100644 index d5b6285842600197368ab88b6c7e0200e6a033fa..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "basicReactingParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::basicReactingParcel::basicReactingParcel -( - ReactingCloud<basicReactingParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI -) -: - ReactingParcel<basicReactingParcel> - ( - owner, - position, - cellI, - tetFaceI, - tetPtI - ) -{} - - -Foam::basicReactingParcel::basicReactingParcel -( - ReactingCloud<basicReactingParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector& U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const scalarField& Y0, - const ReactingParcel<basicReactingParcel>::constantProperties& constProps -) -: - ReactingParcel<basicReactingParcel> - ( - owner, - position, - cellI, - tetFaceI, - tetPtI, - typeId, - nParticle0, - d0, - dTarget0, - U0, - f0, - angularMomentum0, - torque0, - Y0, - constProps - ) -{} - - -Foam::basicReactingParcel::basicReactingParcel -( - const Cloud<basicReactingParcel>& cloud, - Istream& is, - bool readFields -) -: - ReactingParcel<basicReactingParcel>(cloud, is, readFields) -{} - - -Foam::basicReactingParcel::basicReactingParcel -( - const basicReactingParcel& p -) -: - ReactingParcel<basicReactingParcel>(p) -{} - - -Foam::basicReactingParcel::basicReactingParcel -( - const basicReactingParcel& p, - const ReactingCloud<basicReactingParcel>& c -) -: - ReactingParcel<basicReactingParcel>(p, c) -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -Foam::basicReactingParcel::~basicReactingParcel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H index 3302aa5150698c4be6c957f2ef37d888ace4a3b4..a9645f85bff82ed50cade38325c3f05df897f25b 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H @@ -25,7 +25,7 @@ Class Foam::basicReactingParcel Description - + Definition of basic reacting parcel SourceFiles basicReactingParcel.C @@ -35,121 +35,26 @@ SourceFiles #ifndef basicReactingParcel_H #define basicReactingParcel_H +#include "contiguous.H" +#include "particle.H" +#include "KinematicParcel.H" +#include "ThermoParcel.H" #include "ReactingParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -/*---------------------------------------------------------------------------*\ - Class basicReactingParcel Declaration -\*---------------------------------------------------------------------------*/ - -class basicReactingParcel -: - public ReactingParcel<basicReactingParcel> -{ - -public: - - //- Run-time type information - TypeName("basicReactingParcel"); - - // Constructors - - //- Construct from owner, position, and cloud owner - // Other properties initialised as null - basicReactingParcel - ( - ReactingCloud<basicReactingParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI - ); - - //- Construct from components - basicReactingParcel - ( - ReactingCloud<basicReactingParcel>& owner, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector& U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const scalarField& Y0, - const ReactingParcel<basicReactingParcel>::constantProperties& - constProps - ); - - //- Construct from Istream - basicReactingParcel - ( - const Cloud<basicReactingParcel>& c, - Istream& is, - bool readFields = true - ); - - //- Construct as a copy - basicReactingParcel(const basicReactingParcel& p); - - //- Construct as a copy - basicReactingParcel - ( - const basicReactingParcel& p, - const ReactingCloud<basicReactingParcel>& c - ); - - //- Construct and return a clone - virtual autoPtr<Particle<basicReactingParcel> > clone() const - { - return autoPtr<Particle<basicReactingParcel> > - ( - new basicReactingParcel(*this) - ); - } - - //- Construct and return a clone - virtual autoPtr<Particle<basicReactingParcel> > clone - ( - const Cloud<basicReactingParcel>& c - ) const - { - return autoPtr<Particle<basicReactingParcel> > - ( - new basicReactingParcel - ( - *this, - static_cast<const ReactingCloud<basicReactingParcel>&>(c) - ) - ); - } - - - //- Destructor - virtual ~basicReactingParcel(); -}; - - -template<> -inline bool contiguous<basicReactingParcel>() -{ - return false; + typedef ReactingParcel<ThermoParcel<KinematicParcel<particle> > > + basicReactingParcel; + + template<> + inline bool contiguous<basicReactingParcel>() + { + return false; + } } - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C index 98bab313c4a81c2c4a91fba0bed5e1b89d89093d..9bebda1c2655883b7f224f13ca68ad5ecf7939e3 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C @@ -24,13 +24,14 @@ License \*---------------------------------------------------------------------------*/ #include "basicReactingParcel.H" -#include "createReactingParcelTypes.H" +#include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createReactingParcelTypes(basicReactingParcel); + defineTemplateTypeNameAndDebug(basicReactingParcel, 0); + defineTemplateTypeNameAndDebug(Cloud<basicReactingParcel>, 0); } diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.C deleted file mode 100644 index 2c26932342c5d9bc19e6d9ea131190e1f0757503..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.C +++ /dev/null @@ -1,117 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "basicThermoParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::basicThermoParcel::basicThermoParcel -( - ThermoCloud<basicThermoParcel>& owner, - const vector position, - const label cellI, - const label tetFaceI, - const label tetPtI -) -: - ThermoParcel<basicThermoParcel>(owner, position, cellI, tetFaceI, tetPtI) -{} - - -Foam::basicThermoParcel::basicThermoParcel -( - ThermoCloud<basicThermoParcel>& owner, - const vector position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const constantProperties& constProps -) -: - ThermoParcel<basicThermoParcel> - ( - owner, - position, - cellI, - tetFaceI, - tetPtI, - typeId, - nParticle0, - d0, - dTarget0, - U0, - f0, - angularMomentum0, - torque0, - constProps - ) -{} - - -Foam::basicThermoParcel::basicThermoParcel -( - const Cloud<basicThermoParcel>& cloud, - Istream& is, - bool readFields -) -: - ThermoParcel<basicThermoParcel>(cloud, is, readFields) -{} - - -Foam::basicThermoParcel::basicThermoParcel -( - const basicThermoParcel& p -) -: - ThermoParcel<basicThermoParcel>(p) -{} - - -Foam::basicThermoParcel::basicThermoParcel -( - const basicThermoParcel& p, - const ThermoCloud<basicThermoParcel>& c -) -: - ThermoParcel<basicThermoParcel>(p, c) -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -Foam::basicThermoParcel::~basicThermoParcel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H index f48a1b32565effbb14f5efe98082b557248db98c..67bb66956dde9415dbb6e45d98d879b64ee18305 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H @@ -25,7 +25,7 @@ Class Foam::basicThermoParcel Description - + Definition of basic thermo parcel SourceFiles basicThermoParcel.C @@ -35,119 +35,24 @@ SourceFiles #ifndef basicThermoParcel_H #define basicThermoParcel_H +#include "contiguous.H" +#include "particle.H" +#include "KinematicParcel.H" #include "ThermoParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + typedef ThermoParcel<KinematicParcel<particle> > basicThermoParcel; -/*---------------------------------------------------------------------------*\ - Class basicThermoParcel Declaration -\*---------------------------------------------------------------------------*/ - -class basicThermoParcel -: - public ThermoParcel<basicThermoParcel> -{ - -public: - - //- Runtime type information - TypeName("basicThermoParcel"); - - // Constructors - - //- Construct from owner, position, and cloud owner - // Other properties initialised as null - basicThermoParcel - ( - ThermoCloud<basicThermoParcel>& owner, - const vector position, - const label cellI, - const label tetFaceI, - const label tetPtI - ); - - //- Construct from components - basicThermoParcel - ( - ThermoCloud<basicThermoParcel>& owner, - const vector position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const scalar dTarget0, - const vector U0, - const vector& f0, - const vector& angularMomentum0, - const vector& torque0, - const constantProperties& constProps - ); - - //- Construct from Istream - basicThermoParcel - ( - const Cloud<basicThermoParcel>& c, - Istream& is, - bool readFields = true - ); - - //- Construct as a copy - basicThermoParcel(const basicThermoParcel& p); - - //- Construct as a copy - basicThermoParcel - ( - const basicThermoParcel& p, - const ThermoCloud<basicThermoParcel>& c - ); - - //- Construct and return a clone - virtual autoPtr<Particle<basicThermoParcel> > clone() const - { - return autoPtr<Particle<basicThermoParcel> > - ( - new basicThermoParcel(*this) - ); - } - - //- Construct and return a clone - virtual autoPtr<Particle<basicThermoParcel> > clone - ( - const Cloud<basicThermoParcel>& c - ) const - { - return autoPtr<Particle<basicThermoParcel> > - ( - new basicThermoParcel - ( - *this, - static_cast<const ThermoCloud<basicThermoParcel>&>(c) - ) - ); - } - - - //- Destructor - virtual ~basicThermoParcel(); -}; - - -template<> -inline bool contiguous<basicThermoParcel>() -{ - return true; + template<> + inline bool contiguous<basicThermoParcel>() + { + return true; + } } - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C index 660081b993895c1a3ed5efe205585092a791948f..5578d45e2390b328ca31a875701822409a7bbec5 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ #include "basicThermoParcel.H" -#include "createThermoParcelTypes.H" +#include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createThermoParcelTypes(basicThermoParcel); + defineTemplateTypeNameAndDebug(basicThermoParcel, 0); + defineTemplateTypeNameAndDebug(Cloud<basicThermoParcel>, 0); } - // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H index d48969ca748356eda4aef02a96c7c57516c84f6c..af347cce7a2edc9783a7086df10d08d80afdd9a4 100644 --- a/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,11 +26,24 @@ License #ifndef createKinematicParcelTypes_H #define createKinematicParcelTypes_H -#include "KinematicParcel.H" -#include "KinematicCloud.H" +#include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#define createKinematicParcelTypes(ParcelType) \ + \ + defineTemplateTypeNameAndDebug(ParcelType, 0); \ + \ + defineTemplateTypeNameAndDebug(Cloud<ParcelType>, 0); + +/* + defineTemplateTypeNameAndDebug(KinematicParcel<particle>, 0); \ + \ + typedef KinematicParcel<particle> KinematicParcelType; \ + defineTemplateTypeNameAndDebug(Cloud<KinematicParcelType>, 0); +*/ + +/* #define createKinematicParcelTypes(ParcelType) \ \ defineTypeNameAndDebug(ParcelType, 0); \ @@ -39,7 +52,10 @@ License \ defineParcelTypeNameAndDebug(KinematicParcel<ParcelType>, 0); \ defineTemplateTypeNameAndDebug(KinematicParcel<ParcelType>, 0); \ - defineParcelTypeNameAndDebug(KinematicCloud<ParcelType>, 0); + typedef Cloud<ParcelType> cloudParcelType \ + defineParcelTypeNameAndDebug(KinematicCloud<cloudParcelType>, 0); +*/ + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H index 1cbab2a4bb092d34f5f39cf4a052807491c31702..d286f44d9d45eea9a18350bc1fce1f9022ab1ff6 100644 --- a/src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,9 +26,6 @@ License #ifndef createThermoParcelTypes_H #define createThermoParcelTypes_H -#include "ThermoParcel.H" -#include "ThermoCloud.H" - #include "createKinematicParcelTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -37,10 +34,20 @@ License \ createKinematicParcelTypes(ParcelType); \ \ + defineTemplateTypeNameAndDebug(Cloud<ParcelType>, 0); \ + +/* + createKinematicParcelTypes(ParcelType); \ + \ + typedef ThermoParcel<KinematicParcel<particle> > ThermoParcelType; \ + defineTemplateTypeNameAndDebug(Cloud<ThermoParcelType>, 0); +*/ + +/* defineParcelTypeNameAndDebug(ThermoParcel<ParcelType>, 0); \ defineTemplateTypeNameAndDebug(ThermoParcel<ParcelType>, 0); \ defineParcelTypeNameAndDebug(ThermoCloud<ParcelType>, 0); - +*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelCollisionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelCollisionModels.H index 0c84d934bde9c4047d4a9e73f8ac40ef029c8c84..9106f4f859da5e98d805d9644c436e9ce890f4aa 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelCollisionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelCollisionModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "NoCollision.H" @@ -42,46 +43,18 @@ License #define makeParcelCollisionModels(ParcelType) \ \ - makeCollisionModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeCollisionModelType \ - ( \ - NoCollision, \ - KinematicCloud, \ - ParcelType \ - ); \ + makeCollisionModel(KC##ParcelType); \ + makeCollisionModelType(NoCollision, KC##ParcelType); \ + makeCollisionModelType(PairCollision, KC##ParcelType); \ \ - makeCollisionModelType \ - ( \ - PairCollision, \ - KinematicCloud, \ - ParcelType \ - ); \ + makePairModel(KC##ParcelType); \ + makePairModelType(PairSpringSliderDashpot, KC##ParcelType); \ \ - makePairModel(KinematicCloud<ParcelType>); \ - \ - makePairModelType \ - ( \ - PairSpringSliderDashpot, \ - KinematicCloud, \ - ParcelType \ - ); \ - \ - makeWallModel(KinematicCloud<ParcelType>); \ - \ - makeWallModelType \ - ( \ - WallSpringSliderDashpot, \ - KinematicCloud, \ - ParcelType \ - ); \ - \ - makeWallModelType \ - ( \ - WallLocalSpringSliderDashpot, \ - KinematicCloud, \ - ParcelType \ - ); + makeWallModel(KC##ParcelType); \ + makeWallModelType(WallSpringSliderDashpot, KC##ParcelType); \ + makeWallModelType(WallLocalSpringSliderDashpot, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelDispersionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelDispersionModels.H index 20ed09c36baa6ad9c1903d41901083fb45d49d61..61ec782a54ca761cc83fc255c1ce125a2b932e35 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelDispersionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelDispersionModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "NoDispersion.H" @@ -38,32 +39,19 @@ License #define makeParcelDispersionModels(ParcelType) \ \ - makeDispersionModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ + \ + makeDispersionModel(KC##ParcelType); \ \ defineNamedTemplateTypeNameAndDebug \ ( \ - DispersionRASModel<KinematicCloud<ParcelType> >, \ + DispersionRASModel<KC##ParcelType>, \ 0 \ ); \ \ - makeDispersionModelType \ - ( \ - NoDispersion, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeDispersionModelType \ - ( \ - GradientDispersionRAS, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeDispersionModelType \ - ( \ - StochasticDispersionRAS, \ - KinematicCloud, \ - ParcelType \ - ); + makeDispersionModelType(NoDispersion, KC##ParcelType); \ + makeDispersionModelType(GradientDispersionRAS, KC##ParcelType); \ + makeDispersionModelType(StochasticDispersionRAS, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelForces.H b/src/lagrangian/intermediate/parcels/include/makeParcelForces.H index bc04078abdd886b46a1223d783108eae590b1e0f..1bcd963a67fa96f22fa275324aee78e5c40a4573 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelForces.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelForces.H @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "SphereDragForce.H" @@ -42,44 +43,15 @@ License #define makeParcelForces(ParcelType) \ \ - makeParticleForceModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeParticleForceModelType \ - ( \ - SphereDragForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - NonSphereDragForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - GravityForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - ParamagneticForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - PressureGradientForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - SRFForce, \ - KinematicCloud, \ - ParcelType \ - ); + makeParticleForceModel(KC##ParcelType); \ + makeParticleForceModelType(SphereDragForce, KC##ParcelType); \ + makeParticleForceModelType(NonSphereDragForce, KC##ParcelType); \ + makeParticleForceModelType(GravityForce, KC##ParcelType); \ + makeParticleForceModelType(ParamagneticForce, KC##ParcelType); \ + makeParticleForceModelType(PressureGradientForce, KC##ParcelType); \ + makeParticleForceModelType(SRFForce, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H index 8218b00a1531a173b9647db905f17b350df87bfc..3839e7c145d3e7a716b30af18682fbfc082189b6 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" +#include "KinematicCloud.H" #include "ThermoCloud.H" #include "NoHeatTransfer.H" @@ -37,20 +39,12 @@ License #define makeParcelHeatTransferModels(ParcelType) \ \ - makeHeatTransferModel(ThermoCloud<ParcelType>); \ + typedef ThermoCloud<KinematicCloud<Cloud<ParcelType> > > TKC##ParcelType; \ \ - makeHeatTransferModelType \ - ( \ - NoHeatTransfer, \ - ThermoCloud, \ - ParcelType \ - ); \ - makeHeatTransferModelType \ - ( \ - RanzMarshall, \ - ThermoCloud, \ - ParcelType \ - ); + makeHeatTransferModel(TKC##ParcelType); \ + \ + makeHeatTransferModelType(NoHeatTransfer, TKC##ParcelType); \ + makeHeatTransferModelType(RanzMarshall, TKC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H index e235a96aaae36e086a5e49d858f00171ef29e911..b0dbf0db9b120085e4c42e795d2d63ea9859c2d0 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "ConeInjection.H" @@ -43,50 +44,17 @@ License #define makeParcelInjectionModels(ParcelType) \ \ - makeInjectionModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeInjectionModelType \ - ( \ - ConeInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - FieldActivatedInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - InflationInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - KinematicLookupTableInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - ManualInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - NoInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - PatchInjection, \ - KinematicCloud, \ - ParcelType \ - ); + makeInjectionModel(KC##ParcelType); \ + \ + makeInjectionModelType(ConeInjection, KC##ParcelType); \ + makeInjectionModelType(FieldActivatedInjection, KC##ParcelType); \ + makeInjectionModelType(InflationInjection, KC##ParcelType); \ + makeInjectionModelType(KinematicLookupTableInjection, KC##ParcelType); \ + makeInjectionModelType(ManualInjection, KC##ParcelType); \ + makeInjectionModelType(NoInjection, KC##ParcelType); \ + makeInjectionModelType(PatchInjection, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H index a7bc0c26178f423053641f9dbd00bc5b71878178..b54b09a2f0d11a0baa86648edbd9927d4c9b7cbf 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "LocalInteraction.H" @@ -39,32 +40,14 @@ License #define makeParcelPatchInteractionModels(ParcelType) \ \ - makePatchInteractionModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makePatchInteractionModelType \ - ( \ - LocalInteraction, \ - KinematicCloud, \ - ParcelType \ - ); \ - makePatchInteractionModelType \ - ( \ - NoInteraction, \ - KinematicCloud, \ - ParcelType \ - ); \ - makePatchInteractionModelType \ - ( \ - Rebound, \ - KinematicCloud, \ - ParcelType \ - ); \ - makePatchInteractionModelType \ - ( \ - StandardWallInteraction, \ - KinematicCloud, \ - ParcelType \ - ); + makePatchInteractionModel(KC##ParcelType); \ + \ + makePatchInteractionModelType(LocalInteraction, KC##ParcelType); \ + makePatchInteractionModelType(NoInteraction, KC##ParcelType); \ + makePatchInteractionModelType(Rebound, KC##ParcelType); \ + makePatchInteractionModelType(StandardWallInteraction, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelPostProcessingModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelPostProcessingModels.H index 76b81aea20b5b0a7cf37ca610519cb24cc4c9246..302eec03c0b94a50872c33322b0006f69e793f98 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelPostProcessingModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelPostProcessingModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "NoPostProcessing.H" @@ -38,26 +39,13 @@ License #define makeParcelPostProcessingModels(ParcelType) \ \ - makePostProcessingModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makePostProcessingModelType \ - ( \ - NoPostProcessing, \ - KinematicCloud, \ - ParcelType \ - ); \ - makePostProcessingModelType \ - ( \ - ParticleTracks, \ - KinematicCloud, \ - ParcelType \ - ); \ - makePostProcessingModelType \ - ( \ - PatchPostProcessing, \ - KinematicCloud, \ - ParcelType \ - ); + makePostProcessingModel(KC##ParcelType); \ + \ + makePostProcessingModelType(NoPostProcessing, KC##ParcelType); \ + makePostProcessingModelType(ParticleTracks, KC##ParcelType); \ + makePostProcessingModelType(PatchPostProcessing, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelSurfaceFilmModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelSurfaceFilmModels.H index 045d26612ee69ee0d340d7c90fbb5ad9ea46e78b..1488749fc50b205825e23c5d9ea9b02824da38c3 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelSurfaceFilmModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelSurfaceFilmModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "NoSurfaceFilm.H" @@ -36,14 +37,10 @@ License #define makeParcelSurfaceFilmModels(ParcelType) \ \ - makeSurfaceFilmModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeSurfaceFilmModelType \ - ( \ - NoSurfaceFilm, \ - KinematicCloud, \ - ParcelType \ - ); + makeSurfaceFilmModel(KC##ParcelType); \ + makeSurfaceFilmModelType(NoSurfaceFilm, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H index 5a4977831339a91b9c1e1397c89534912221acdb..8e2421bcb3c1a2508c07511053b8b3d7e2b0a2fb 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,11 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "ReactingMultiphaseCloud.H" +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" +#include "ReactingCloud.H" + #include "NoComposition.H" #include "SingleMixtureFraction.H" @@ -36,21 +40,12 @@ License #define makeReactingMultiphaseParcelCompositionModels(ParcelType) \ \ - makeCompositionModel(ReactingCloud<ParcelType>); \ - \ - makeCompositionModelType \ - ( \ - NoComposition, \ - ReactingCloud, \ - ParcelType \ - ); \ + typedef ReactingCloud<ThermoCloud<KinematicCloud<Cloud<ParcelType> > > > \ + RTKC##ParcelType; \ \ - makeCompositionModelType \ - ( \ - SingleMixtureFraction, \ - ReactingCloud, \ - ParcelType \ - ); + makeCompositionModel(RTKC##ParcelType); \ + makeCompositionModelType(NoComposition, RTKC##ParcelType); \ + makeCompositionModelType(SingleMixtureFraction, RTKC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H index f44f9228a2faa934be92f72542dc8fb9848985ef..c703672afa3e4884088645d71febf0855dea9fd2 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,10 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" +#include "ReactingCloud.H" #include "ReactingMultiphaseCloud.H" #include "ConstantRateDevolatilisation.H" @@ -38,25 +42,38 @@ License #define makeReactingMultiphaseParcelDevolatilisationModels(ParcelType) \ \ - makeDevolatilisationModel(ReactingMultiphaseCloud<ParcelType>); \ + typedef ReactingMultiphaseCloud \ + < \ + ReactingCloud \ + < \ + ThermoCloud \ + < \ + KinematicCloud \ + < \ + Cloud \ + < \ + ParcelType \ + > \ + > \ + > \ + > \ + > RMPRTKC##ParcelType; \ \ + makeDevolatilisationModel(RMPRTKC##ParcelType); \ makeDevolatilisationModelType \ ( \ ConstantRateDevolatilisation, \ - ReactingMultiphaseCloud, \ - ParcelType \ + RMPRTKC##ParcelType \ ); \ makeDevolatilisationModelType \ ( \ NoDevolatilisation, \ - ReactingMultiphaseCloud, \ - ParcelType \ + RMPRTKC##ParcelType \ ); \ makeDevolatilisationModelType \ ( \ SingleKineticRateDevolatilisation, \ - ReactingMultiphaseCloud, \ - ParcelType \ + RMPRTKC##ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H index b0042f5e44f52235234d3700166ebb7eab418de8..cfa3ae9838cb1809b73a1f002e3c77038a3c8ba8 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H @@ -28,7 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" +#include "Cloud.H" #include "KinematicCloud.H" #include "ConeInjection.H" @@ -42,43 +42,18 @@ License #define makeReactingMultiphaseParcelInjectionModels(ParcelType) \ \ - makeInjectionModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeInjectionModelType \ - ( \ - ConeInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - FieldActivatedInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - ManualInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - NoInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - PatchInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ + makeInjectionModel(KC##ParcelType); \ + makeInjectionModelType(ConeInjection, KC##ParcelType); \ + makeInjectionModelType(FieldActivatedInjection, KC##ParcelType); \ + makeInjectionModelType(ManualInjection, KC##ParcelType); \ + makeInjectionModelType(NoInjection, KC##ParcelType); \ + makeInjectionModelType(PatchInjection, KC##ParcelType); \ makeInjectionModelType \ ( \ ReactingMultiphaseLookupTableInjection, \ - KinematicCloud, \ - ParcelType \ + KC##ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H index b548fd23086e3b28a47868e9bb6e6667e1a7a7d1..5abbcfc97d04cc253ccc52dbe657d2ba791af91a 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,21 +28,37 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" +#include "ReactingCloud.H" #include "ReactingMultiphaseCloud.H" + #include "NoSurfaceReaction.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define makeReactingMultiphaseParcelSurfaceReactionModels(ParcelType) \ \ - makeSurfaceReactionModel(ReactingMultiphaseCloud<ParcelType>); \ + typedef ReactingMultiphaseCloud \ + < \ + ReactingCloud \ + < \ + ThermoCloud \ + < \ + KinematicCloud \ + < \ + Cloud \ + < \ + ParcelType \ + > \ + > \ + > \ + > \ + > RMPRTKC##ParcelType; \ \ - makeSurfaceReactionModelType \ - ( \ - NoSurfaceReaction, \ - ReactingMultiphaseCloud, \ - ParcelType \ - ); + makeSurfaceReactionModel(RMPRTKC##ParcelType); \ + makeSurfaceReactionModelType(NoSurfaceReaction, RMPRTKC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H index c68d74ff7fd5ad91ec29f0d286929547d97f2d19..2831f1aebf308d59798f78c7b752571c247bc58b 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,11 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" #include "ReactingCloud.H" + #include "NoComposition.H" #include "SinglePhaseMixture.H" @@ -36,21 +40,12 @@ License #define makeReactingParcelCompositionModels(ParcelType) \ \ - makeCompositionModel(ReactingCloud<ParcelType>); \ - \ - makeCompositionModelType \ - ( \ - NoComposition, \ - ReactingCloud, \ - ParcelType \ - ); \ + typedef ReactingCloud<ThermoCloud<KinematicCloud<Cloud<ParcelType> > > > \ + RTKC##ParcelType; \ \ - makeCompositionModelType \ - ( \ - SinglePhaseMixture, \ - ReactingCloud, \ - ParcelType \ - ); + makeCompositionModel(RTKC##ParcelType); \ + makeCompositionModelType(NoComposition, RTKC##ParcelType); \ + makeCompositionModelType(SinglePhaseMixture, RTKC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H index 88ff47a40ce17f9aab33c825990ea3e123cbf4f4..fd36acecaf566a64579777f44464b51a56d55edf 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "ConeInjection.H" @@ -41,44 +42,15 @@ License #define makeReactingParcelInjectionModels(ParcelType) \ \ - makeInjectionModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeInjectionModelType \ - ( \ - ConeInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - FieldActivatedInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - ManualInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - NoInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - PatchInjection, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeInjectionModelType \ - ( \ - ReactingLookupTableInjection, \ - KinematicCloud, \ - ParcelType \ - ); + makeInjectionModel(KC##ParcelType); \ + makeInjectionModelType(ConeInjection, KC##ParcelType); \ + makeInjectionModelType(FieldActivatedInjection, KC##ParcelType); \ + makeInjectionModelType(ManualInjection, KC##ParcelType); \ + makeInjectionModelType(NoInjection, KC##ParcelType); \ + makeInjectionModelType(PatchInjection, KC##ParcelType); \ + makeInjectionModelType(ReactingLookupTableInjection, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H index e08e703fdba6de1ec9b202a6d63ae083530279c0..a37919bc53866528bd061f305e0618ab6e90f297 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,9 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" #include "ReactingCloud.H" #include "NoPhaseChange.H" @@ -37,20 +40,12 @@ License #define makeReactingParcelPhaseChangeModels(ParcelType) \ \ - makePhaseChangeModel(ReactingCloud<ParcelType>); \ + typedef ReactingCloud<ThermoCloud<KinematicCloud<Cloud<ParcelType> > > > \ + RTKC##ParcelType; \ \ - makePhaseChangeModelType \ - ( \ - NoPhaseChange, \ - ReactingCloud, \ - ParcelType \ - ); \ - makePhaseChangeModelType \ - ( \ - LiquidEvaporation, \ - ReactingCloud, \ - ParcelType \ - ); + makePhaseChangeModel(RTKC##ParcelType); \ + makePhaseChangeModelType(NoPhaseChange, RTKC##ParcelType); \ + makePhaseChangeModelType(LiquidEvaporation, RTKC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H index a7ae4e064e93dd7e75d56d6c713ece8fc5967103..3291265a95941abbd8cde0e4a9d8792eb85c98ad 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "NoSurfaceFilm.H" @@ -37,20 +38,11 @@ License #define makeReactingParcelSurfaceFilmModels(ParcelType) \ \ - makeSurfaceFilmModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeSurfaceFilmModelType \ - ( \ - NoSurfaceFilm, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeSurfaceFilmModelType \ - ( \ - ThermoSurfaceFilm, \ - KinematicCloud, \ - ParcelType \ - ); + makeSurfaceFilmModel(KC##ParcelType); \ + makeSurfaceFilmModelType(NoSurfaceFilm, KC##ParcelType); \ + makeSurfaceFilmModelType(ThermoSurfaceFilm, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeThermoParcelForces.H b/src/lagrangian/intermediate/parcels/include/makeThermoParcelForces.H index a39f748559cd1389758d1a189dae662d7c70ef9b..c916c0811a71c62d5031df277f5497d2c2762c63 100644 --- a/src/lagrangian/intermediate/parcels/include/makeThermoParcelForces.H +++ b/src/lagrangian/intermediate/parcels/include/makeThermoParcelForces.H @@ -28,6 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" #include "SphereDragForce.H" @@ -41,52 +42,18 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeThermoParcelForces(ParcelType) \ +#define makeThermoParcelForces(ParcelType) \ \ - makeParticleForceModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeParticleForceModelType \ - ( \ - SphereDragForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - NonSphereDragForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - BrownianMotionForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - GravityForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - ParamagneticForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - PressureGradientForce, \ - KinematicCloud, \ - ParcelType \ - ); \ - makeParticleForceModelType \ - ( \ - SRFForce, \ - KinematicCloud, \ - ParcelType \ - ); + makeParticleForceModel(KC##ParcelType); \ + makeParticleForceModelType(SphereDragForce, KC##ParcelType); \ + makeParticleForceModelType(NonSphereDragForce, KC##ParcelType); \ + makeParticleForceModelType(BrownianMotionForce, KC##ParcelType); \ + makeParticleForceModelType(GravityForce, KC##ParcelType); \ + makeParticleForceModelType(ParamagneticForce, KC##ParcelType); \ + makeParticleForceModelType(PressureGradientForce, KC##ParcelType); \ + makeParticleForceModelType(SRFForce, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeThermoParcelSurfaceFilmModels.H b/src/lagrangian/intermediate/parcels/include/makeThermoParcelSurfaceFilmModels.H index bf1ff47a2067dae0ff4f9397b1f919a0eee2d22b..68f674b3b74aeba94a18faca623588c8c9759564 100644 --- a/src/lagrangian/intermediate/parcels/include/makeThermoParcelSurfaceFilmModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeThermoParcelSurfaceFilmModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,9 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "Cloud.H" #include "KinematicCloud.H" + #include "NoSurfaceFilm.H" #include "ThermoSurfaceFilm.H" @@ -36,21 +38,12 @@ License #define makeParcelSurfaceFilmModels(ParcelType) \ \ - makeSurfaceFilmModel(KinematicCloud<ParcelType>); \ + typedef KinematicCloud<Cloud<ParcelType> > KC##ParcelType; \ \ - makeSurfaceFilmModelType \ - ( \ - NoSurfaceFilm, \ - KinematicCloud, \ - ParcelType \ - ); \ + makeSurfaceFilmModel(KC##ParcelType); \ \ - makeSurfaceFilmModelType \ - ( \ - ThermoSurfaceFilm, \ - KinematicCloud, \ - ParcelType \ - ); + makeSurfaceFilmModelType(NoSurfaceFilm, KC##ParcelType); \ + makeSurfaceFilmModelType(ThermoSurfaceFilm, KC##ParcelType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H index e51e14afcf6a3340a5d6a457c12e9c93a5002962..df79528a6b0795a3c9f468feffd434b25884f8d5 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,13 +146,13 @@ public: defineTemplateRunTimeSelectionTable(CollisionModel<CloudType>, dictionary); -#define makeCollisionModelType(SS, CloudType, ParcelType) \ +#define makeCollisionModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - CollisionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + CollisionModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H index bbfb8f4aecbe179259b6a27cc37d07fec2988f43..9ba5743b5db6a67d7fa8bc14a9e3dd44f360f0bd 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -155,27 +155,12 @@ public: ); -#define makePairModelType(SS, CloudType, ParcelType) \ +#define makePairModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - PairModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; - - -#define makePairModelThermoType(SS, CloudType, ParcelType, ThermoType) \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS<CloudType<ParcelType<ThermoType> > >, \ - 0 \ - ); \ - \ - PairModel<CloudType<ParcelType<ThermoType> > >:: \ - adddictionaryConstructorToTable \ - <SS<CloudType<ParcelType<ThermoType> > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + PairModel<CloudType>::adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H index 729a0c8bdf8746da09ce674e238e9e88d7e8275c..9d79d5e56d00d91e767846d917334171ed201a5d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,27 +165,12 @@ public: ); -#define makeWallModelType(SS, CloudType, ParcelType) \ +#define makeWallModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - WallModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; - - -#define makeWallModelThermoType(SS, CloudType, ParcelType, ThermoType) \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS<CloudType<ParcelType<ThermoType> > >, \ - 0 \ - ); \ - \ - WallModel<CloudType<ParcelType<ThermoType> > >:: \ - adddictionaryConstructorToTable \ - <SS<CloudType<ParcelType<ThermoType> > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + WallModel<CloudType>::adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H index d5b80000c34456461b139288b1bb2a9758829705..90dbb5e8bf1fdda9a6b77689e1e10f6c4a995c3a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H @@ -141,13 +141,13 @@ public: ); -#define makeDispersionModelType(SS, CloudType, ParcelType) \ +#define makeDispersionModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - DispersionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + DispersionModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index adfdd991a248fe0cb59a5950f1a172bcccd5419d..22e11fa894a2b3bd518f07ee80d73d4cf620bb2a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -204,7 +204,7 @@ bool Foam::InjectionModel<CloudType>::findCellAtPosition const vector p0 = position; - this->owner().findCellFacePt + this->owner().mesh().findCellFacePt ( position, cellI, @@ -571,7 +571,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) // Create a new parcel parcelType* pPtr = new parcelType ( - td.cloud(), + td.cloud().pMesh(), pos, cellI, tetFaceI, @@ -671,7 +671,7 @@ void Foam::InjectionModel<CloudType>::injectSteadyState // Create a new parcel parcelType* pPtr = new parcelType ( - td.cloud(), + td.cloud().pMesh(), pos, cellI, tetFaceI, diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H index 3bbf913d5c977cd2abb0b5971c0cf6e0bb46ae81..4759c35615036f9a8f530d58b4c2fcad42a112e6 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H @@ -69,6 +69,10 @@ class InjectionModel { public: + //- Convenience typedef for parcelType + typedef typename CloudType::parcelType parcelType; + + // Enumerations //- Parcel basis representation options @@ -96,9 +100,6 @@ protected: // Protected data - //- Convenience typedef for parcel type - typedef typename CloudType::parcelType parcelType; - // Global injection properties //- Start of injection [s] @@ -305,7 +306,7 @@ public: const label parcelI, const label nParcels, const scalar time, - typename CloudType::parcelType& parcel + parcelType& parcel ); //- Flag to identify whether model fully describes the parcel @@ -332,13 +333,12 @@ public: defineTemplateRunTimeSelectionTable(InjectionModel<CloudType>, dictionary); -#define makeInjectionModelType(SS, CloudType, ParcelType) \ +#define makeInjectionModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - InjectionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + InjectionModel<CloudType>::adddictionaryConstructorToTable<SS<CloudType> >\ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H index e06646ca03b412ded87d9e8702a8f51969832855..2cbca12d10d25bb9d33bc8addc55b1c374f61226 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H @@ -206,13 +206,12 @@ public: defineTemplateRunTimeSelectionTable(ParticleForce<CloudType>, dictionary); -#define makeParticleForceModelType(SS, CloudType, ParcelType) \ +#define makeParticleForceModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - ParticleForce<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + ParticleForce<CloudType>::adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C index 5d0c848594bda963ffd24e802118636b8255dc31..e2e1c67d249aa9946e67d095564ba1c0949fef07 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C @@ -47,32 +47,31 @@ Foam::word Foam::PatchInteractionModel<CloudType>::interactionTypeToWord const interactionType& itEnum ) { + word it = "other"; + switch (itEnum) { case itRebound: { - return "rebound"; + it = "rebound"; break; } case itStick: { - return "stick"; + it = "stick"; break; } case itEscape: { - return "escape"; + it = "escape"; break; } default: { - return "other"; } } -#ifdef __ICC - // Prevent Icc complaining about missing return statement. - return word::null; -#endif + + return it; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H index 45e36a68d364243c07517b4280dfa5a5ecdfa164..a56b794481c94321504e32c1baf65f64b89e8a50 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H @@ -201,13 +201,13 @@ public: ); -#define makePatchInteractionModelType(SS, CloudType, ParcelType) \ +#define makePatchInteractionModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - PatchInteractionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + PatchInteractionModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/ParticleTracks/ParticleTracks.C b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/ParticleTracks/ParticleTracks.C index 799afdfa4c94e4ba01a51b97cc05debb026e1091..65c2d494878fa40a0def8866ec3aa9f521db7852 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/ParticleTracks/ParticleTracks.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/ParticleTracks/ParticleTracks.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -137,7 +137,7 @@ void Foam::ParticleTracks<CloudType>::postFace(const parcelType& p) { cloudPtr_->append ( - static_cast<parcelType*>(p.clone(cloudPtr_()).ptr()) + static_cast<parcelType*>(p.clone(this->owner().mesh()).ptr()) ); } } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.H index fbfd6b6231f5354cacbc39b6f249a309ef0586de..1d1a95d7eefb6c02f4731034e9fff4a3f10096c0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,7 +53,7 @@ class PatchPostProcessing { // Private data - typedef typename CloudType::parcelType parcelType; + typedef typename CloudType::particleType parcelType; //- Maximum number of parcels to store label maxStoredParcels_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H index ba8f3bb9ef156a45cb1d8a076e4cb05f4f97137a..44830bd479aea8f11901947ae6494ae57dbf4ce8 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -154,13 +154,13 @@ public: ); -#define makePostProcessingModelType(SS, CloudType, ParcelType) \ +#define makePostProcessingModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - PostProcessingModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + PostProcessingModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index a454c5daad1d53fc50ecc937c6ca93193cba48f9..38fa34ccf7943b1b48d48e533b70078f4fdd28bc 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,7 +149,7 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td) const directMappedWallPolyPatch& wpp = refCast<const directMappedWallPolyPatch> ( - this->owner().mesh().boundaryMesh()[primaryPatchI] + this->owner().mesh().boundaryMesh()[primaryPatchI] ); const labelList& injectorCellsPatch = wpp.faceCells(); @@ -177,10 +177,10 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td) const point& pos = this->owner().mesh().C()[cellI]; // Create a new parcel - typename CloudType::parcelType* pPtr = - new typename CloudType::parcelType + parcelType* pPtr = + new parcelType ( - td.cloud(), + this->owner().pMesh(), pos, cellI, tetFaceI, diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H index 35c415751258957b906b66878d0e6c9e4272a0e9..5d60c7b3b5d9fe23f342f5f1634e9b56f895c511 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,13 +249,13 @@ public: ); -#define makeSurfaceFilmModelType(SS, CloudType, ParcelType) \ +#define makeSurfaceFilmModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - SurfaceFilmModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + SurfaceFilmModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index 04ec177d1cb5a8320d839704e6ba1965c3103f1d..fe42c546724aca2220a369840bd2f026e4287620 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -280,13 +280,13 @@ public: ); -#define makeCompositionModelType(SS, CloudType, ParcelType) \ +#define makeCompositionModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - CompositionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + CompositionModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index 6b72e9db0cc3823a7d7c7d54d52b28101e39d05c..60c394e6a6f21930f0dc69021e7b1ce2fcc3b5cf 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -194,5 +194,50 @@ void Foam::LiquidEvaporation<CloudType>::calculate } } +template<class CloudType> +Foam::scalar Foam::LiquidEvaporation<CloudType>::dh +( + const label idc, + const label idl, + const label p, + const label T +) const +{ + scalar dh = 0; + + typedef PhaseChangeModel<CloudType> parent; + switch (parent::enthalpyTransfer_) + { + case (parent::etLatentHeat): + { + dh = liquids_.properties()[idl].hl(p, T); + break; + } + case (parent::etEnthalpyDifference): + { + scalar hc = this->owner().composition().carrier().H(idc, T); + scalar hp = liquids_.properties()[idl].h(p, T); + + dh = hc - hp; + break; + } + default: + { + FatalErrorIn + ( + "Foam::scalar Foam::LiquidEvaporation<CloudType>::dh" + "(" + "const label, " + "const label, " + "const label, " + "const label" + ")" + ) << "Unknown enthalpyTransfer type" << abort(FatalError); + } + } + + return dh; +} + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H index 8c66c4fbbd20723d111c0f0a348a9ee8ddb3414e..a3e43aa9319a9967a0f3d411607bac7a00723366 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H @@ -118,6 +118,15 @@ public: const scalar pc, scalarField& dMassPC ) const; + + //- Return the enthalpy per unit mass + virtual scalar dh + ( + const label idc, + const label idl, + const label p, + const label T + ) const; }; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C index 9d5db2b56092d503407b319bbf48e003c90f3e72..fb5ca61ec18a5bae30f2645dca71b7f655e16af7 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -156,6 +156,19 @@ void Foam::PhaseChangeModel<CloudType>::calculate } +template<class CloudType> +Foam::scalar Foam::PhaseChangeModel<CloudType>::dh +( + const label idc, + const label idl, + const label p, + const label T +) const +{ + return 0.0; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "PhaseChangeModelNew.C" diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H index 5ca5cd651d2c7ae983465315a5614d36ba1505ad..416e5f5b91f1dccabfba4956ab1698a21af4db64 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,6 +165,15 @@ public: const scalar pc, scalarField& dMassPC ) const; + + //- Return the enthalpy per unit mass + virtual scalar dh + ( + const label idc, + const label idl, + const label p, + const label T + ) const; }; @@ -185,13 +194,13 @@ public: ); -#define makePhaseChangeModelType(SS, CloudType, ParcelType) \ +#define makePhaseChangeModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - PhaseChangeModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + PhaseChangeModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H index c376b3a0a93fa692d1c75d83aeeb3e11b5f2bcd4..f82897ec08490d482a2cc6fe4a35daf18532a7f0 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H @@ -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) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,13 +145,13 @@ public: ); -#define makeDevolatilisationModelType(SS, CloudType, ParcelType) \ +#define makeDevolatilisationModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - DevolatilisationModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + DevolatilisationModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H index ff60f44a5aefb001efcc9e3db2558d0a603730f8..47c439439d3764159f3407350ae94038a12699c7 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H @@ -158,13 +158,13 @@ public: ); -#define makeSurfaceReactionModelType(SS, CloudType, ParcelType) \ +#define makeSurfaceReactionModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - SurfaceReactionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + SurfaceReactionModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H index 2e670c662375f124afa236ea6aa95199beed3b6c..3535dda395cc63a2bfddf01ef4bfadbf015092d3 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H @@ -164,13 +164,13 @@ public: ); -#define makeHeatTransferModelType(SS, CloudType, ParcelType) \ +#define makeHeatTransferModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \ \ - HeatTransferModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + HeatTransferModel<CloudType>:: \ + adddictionaryConstructorToTable<SS<CloudType> > \ + add##SS##CloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index 84dc17c90ddcd8739cd8c099c27d8321fbc519ee..69585476475de2203ac0758702e11c9b86baba92 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -446,7 +446,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::splashInteraction // Create a new parcel by copying source parcel parcelType* pPtr = new parcelType(p); - pPtr->origId() = this->owner().getNewParticleID(); + pPtr->origId() = pPtr->getNewParticleID(); pPtr->origProc() = Pstream::myProcNo();