ENH: First pass of introducing steady tracking

This commit is contained in:
andy
2010-10-22 18:04:37 +01:00
parent b3c82b633c
commit 544068cfff
32 changed files with 774 additions and 109 deletions

View File

@ -396,7 +396,7 @@ void Foam::Cloud<ParticleType>::cloudReset(const Cloud<ParticleType>& c)
template<class ParticleType>
template<class TrackingData>
void Foam::Cloud<ParticleType>::move(TrackingData& td)
void Foam::Cloud<ParticleType>::move(TrackingData& td, const scalar trackTime)
{
const polyBoundaryMesh& pbm = pMesh().boundaryMesh();
const globalMeshData& pData = polyMesh_.globalData();
@ -454,7 +454,7 @@ void Foam::Cloud<ParticleType>::move(TrackingData& td)
ParticleType& p = pIter();
// Move the particle
bool keepParticle = p.move(td);
bool keepParticle = p.move(td, trackTime);
// If the particle is to be kept
// (i.e. it hasn't passed through an inlet or outlet)

View File

@ -324,7 +324,7 @@ public:
//- Move the particles
// passing the TrackingData to the track function
template<class TrackingData>
void move(TrackingData& td);
void move(TrackingData& td, const scalar trackTime);
//- Remap the cells of particles corresponding to the
// mesh topology change

View File

@ -979,7 +979,10 @@ void Foam::InteractionLists<ParticleType>::fillReferredParticleCloud()
forAllConstIter(typename IDLList<ParticleType>, refCell, iter)
{
cloud_.addParticle(iter().clone().ptr());
cloud_.addParticle
(
static_cast<ParticleType*>(iter().clone().ptr())
);
}
}
}

View File

@ -198,6 +198,25 @@ Foam::Particle<ParticleType>::Particle(const Particle<ParticleType>& p)
{}
template<class ParticleType>
Foam::Particle<ParticleType>::Particle
(
const Particle<ParticleType>& p,
const Cloud<ParticleType>& c
)
:
cloud_(c),
position_(p.position_),
cellI_(p.cellI_),
faceI_(p.faceI_),
stepFraction_(p.stepFraction_),
tetFaceI_(p.tetFaceI_),
tetPtI_(p.tetPtI_),
origProc_(p.origProc_),
origId_(p.origId_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParticleType>

View File

@ -361,10 +361,28 @@ public:
//- Construct as a copy
Particle(const Particle& p);
//- Construct as a copy
Particle(const Particle& p, const Cloud<ParticleType>& c);
//- Construct a clone
autoPtr<ParticleType> clone() const
virtual autoPtr<Particle<ParticleType> > clone() const
{
return autoPtr<Particle>(new Particle(*this));
return autoPtr<Particle<ParticleType> >
(
new Particle<ParticleType>(*this)
);
}
//- Construct a clone
virtual autoPtr<Particle<ParticleType> > clone
(
const Cloud<ParticleType>& c
) const
{
return autoPtr<Particle<ParticleType> >
(
new Particle<ParticleType>(*this, c)
);
}

View File

@ -111,6 +111,16 @@ Foam::coalParcel::coalParcel(const coalParcel& p)
}
Foam::coalParcel::coalParcel
(
const coalParcel& p,
const ReactingMultiphaseCloud<coalParcel>& c
)
:
ReactingMultiphaseParcel<coalParcel>(p, c)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::coalParcel::~coalParcel()

View File

@ -103,10 +103,33 @@ public:
//- Construct as a copy
coalParcel(const coalParcel& p);
//- Construct and return a clone
autoPtr<coalParcel> clone() const
//- Construct as a copy
coalParcel
(
const coalParcel& p,
const ReactingMultiphaseCloud<coalParcel>& c
);
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<coalParcel> > clone() const
{
return autoPtr<coalParcel>(new coalParcel(*this));
return autoPtr<Particle<coalParcel> >(new coalParcel(*this));
}
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<coalParcel> > clone
(
const Cloud<coalParcel>& c
) const
{
return autoPtr<Particle<coalParcel> >
(
new coalParcel
(
*this,
static_cast<const ReactingMultiphaseCloud<coalParcel>&>(c)
)
);
}

View File

@ -41,8 +41,16 @@ License
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::cloudSolution::read()
{
dict_.lookup("transient") >> transient_;
dict_.lookup("coupled") >> coupled_;
dict_.lookup("cellValueSourceCorrection") >> cellValueSourceCorrection_;
if (steadyState())
{
dict_.lookup("maxTrackTime") >> maxTrackTime_;
dict_.subDict("sourceTerms").lookup("resetOnStartup")
>> resetSourcesOnStartup_;
}
}
@ -56,8 +64,11 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution
mesh_(mesh),
dict_(dict),
active_(dict.lookup("active")),
transient_(false),
coupled_(false),
cellValueSourceCorrection_(false)
cellValueSourceCorrection_(false),
maxTrackTime_(0.0),
resetSourcesOnStartup_(false)
{
if (active_)
{
@ -75,8 +86,11 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution
mesh_(cs.mesh_),
dict_(cs.dict_),
active_(cs.active_),
transient_(cs.transient_),
coupled_(cs.coupled_),
cellValueSourceCorrection_(cs.cellValueSourceCorrection_)
cellValueSourceCorrection_(cs.cellValueSourceCorrection_),
maxTrackTime_(cs.maxTrackTime_),
resetSourcesOnStartup_(cs.resetSourcesOnStartup_)
{}
@ -89,8 +103,11 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution
mesh_(mesh),
dict_(dictionary::null),
active_(false),
transient_(false),
coupled_(false),
cellValueSourceCorrection_(false)
cellValueSourceCorrection_(false),
maxTrackTime_(0.0),
resetSourcesOnStartup_(false)
{}
@ -99,6 +116,30 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::~cloudSolution()
{}
template<class ParcelType>
Foam::scalar Foam::KinematicCloud<ParcelType>::cloudSolution::relaxCoeff
(
const word& fieldName
) const
{
return readScalar(sourceTermDict().subDict(fieldName).lookup("alpha"));
}
template<class ParcelType>
bool Foam::KinematicCloud<ParcelType>::cloudSolution::sourceActive() const
{
return coupled_ && (active_ || steadyState());
}
template<class ParcelType>
bool Foam::KinematicCloud<ParcelType>::cloudSolution::writeThisStep() const
{
return active_ && mesh_.time().outputTime();
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ParcelType>
@ -127,6 +168,8 @@ void Foam::KinematicCloud<ParcelType>::restoreState()
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::preEvolve()
{
Info<< "\nSolving cloud " << this->name() << endl;
this->dispersion().cacheFields(true);
forces_.cacheFields(true, solution_.interpolationSchemes());
updateCellOccupancy();
@ -184,28 +227,41 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud
typename ParcelType::trackData& td
)
{
label preInjectionSize = this->size();
this->surfaceFilm().inject(td);
// Update the cellOccupancy if the size of the cloud has changed
// during the injection.
if (preInjectionSize != this->size())
{
updateCellOccupancy();
preInjectionSize = this->size();
}
this->injection().inject(td);
if (solution_.coupled())
{
resetSourceTerms();
}
// Assume that motion will update the cellOccupancy as necessary
// before it is required.
motion(td);
if (solution_.transient())
{
label preInjectionSize = this->size();
this->surfaceFilm().inject(td);
// Update the cellOccupancy if the size of the cloud has changed
// during the injection.
if (preInjectionSize != this->size())
{
updateCellOccupancy();
preInjectionSize = this->size();
}
this->injection().inject(td);
// Assume that motion will update the cellOccupancy as necessary
// before it is required.
motion(td);
}
else
{
// this->surfaceFilm().injectStreadyState(td);
this->injection().injectSteadyState(td, solution_.maxTrackTime());
td.part() = ParcelType::trackData::tpVelocityHalfStep;
Cloud<ParcelType>::move(td, solution_.maxTrackTime());
}
}
@ -254,10 +310,10 @@ void Foam::KinematicCloud<ParcelType>::moveCollide
)
{
td.part() = ParcelType::trackData::tpVelocityHalfStep;
Cloud<ParcelType>::move(td);
Cloud<ParcelType>::move(td, this->db().time().deltaTValue());
td.part() = ParcelType::trackData::tpLinearTrack;
Cloud<ParcelType>::move(td);
Cloud<ParcelType>::move(td, this->db().time().deltaTValue());
// td.part() = ParcelType::trackData::tpRotationalTrack;
// Cloud<ParcelType>::move(td);
@ -267,13 +323,15 @@ void Foam::KinematicCloud<ParcelType>::moveCollide
this->collision().collide();
td.part() = ParcelType::trackData::tpVelocityHalfStep;
Cloud<ParcelType>::move(td);
Cloud<ParcelType>::move(td, this->db().time().deltaTValue());
}
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::postEvolve()
{
Info<< endl;
if (debug)
{
this->writePositions();
@ -304,6 +362,13 @@ void Foam::KinematicCloud<ParcelType>::cloudReset(KinematicCloud<ParcelType>& c)
}
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::relaxSources()
{
this->relax(UTrans_(), cloudCopyPtr_->UTrans(), "U");
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
@ -433,6 +498,11 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
{
ParcelType::readFields(*this);
}
if (solution_.resetSourcesOnStartup())
{
resetSourceTerms();
}
}
@ -555,7 +625,7 @@ void Foam::KinematicCloud<ParcelType>::checkParcelProperties
parcel.rho() = constProps_.rho0();
}
scalar carrierDt = this->db().time().deltaTValue();
const scalar carrierDt = this->db().time().deltaTValue();
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
}
@ -563,7 +633,22 @@ void Foam::KinematicCloud<ParcelType>::checkParcelProperties
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::resetSourceTerms()
{
UTrans_->field() = vector::zero;
UTrans().field() = vector::zero;
}
template<class ParcelType>
template<class Type>
void Foam::KinematicCloud<ParcelType>::relax
(
DimensionedField<Type, volMesh>& field,
const DimensionedField<Type, volMesh>& field0,
const word& name
) const
{
const scalar coeff = solution_.relaxCoeff(name);
field = field0 + coeff*(field - field0);
}
@ -574,14 +659,31 @@ void Foam::KinematicCloud<ParcelType>::evolve()
{
typename ParcelType::trackData td(*this);
preEvolve();
if (solution_.transient())
{
preEvolve();
evolveCloud(td);
evolveCloud(td);
}
else
{
storeState();
preEvolve();
evolveCloud(td);
relaxSources();
}
info();
postEvolve();
info();
Info<< endl;
if (solution_.steadyState())
{
restoreState();
}
}
}

View File

@ -27,14 +27,16 @@ Class
Description
Templated base class for kinematic cloud
- Kinematic only
- holds a 'cloudSolution' class that stores all relevant solution info
- sub-models:
- Collision model
- Dispersion model
- Drag model
- Injection model
- Patch interaction model
- Post-processing model
- Surface film model
- Collision model
SourceFiles
KinematicCloudI.H
@ -133,6 +135,9 @@ public:
//- Cloud active flag
const Switch active_;
//- Transient flag
Switch transient_;
// Run-time options
@ -145,6 +150,19 @@ public:
// during the lagrangian timestep
Switch cellValueSourceCorrection_;
//- Maximum particle track time [s]
scalar maxTrackTime_;
//- Flag to indicate whether coupling source terms should be
// reset on start-up/first read
Switch resetSourcesOnStartup_;
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const cloudSolution&);
public:
@ -169,8 +187,12 @@ public:
//- Read properties from dictionary
void read();
// Access
//- Return relaxation coefficient for field
scalar relaxCoeff(const word& fieldName) const;
//- Return reference to the mesh
inline const fvMesh& mesh() const;
@ -180,17 +202,41 @@ public:
//- Return the active flag
inline const Switch active() const;
//- Return const access to the transient flag
inline const Switch transient() const;
//- Return const access to the steady flag
inline const Switch steadyState() const;
//- Return const access to the coupled flag
inline const Switch coupled() const;
//- Return const access to the cell value correction flag
inline const Switch cellValueSourceCorrection() const;
//- Return const access to the particle track time
inline scalar maxTrackTime() const;
//- Return const access to the reset sources flag
inline const Switch resetSourcesOnStartup() const;
//- Source terms dictionary
inline const dictionary& sourceTermDict() const;
//- Interpolation schemes dictionary
inline const dictionary& interpolationSchemes() const;
//- Integration schemes dictionary
inline const dictionary& integrationSchemes() const;
// Helper functions
//- Returns true if sources are active (at this time)
bool sourceActive() const;
//- Returns true if writing this step
bool writeThisStep() const;
};
@ -311,6 +357,9 @@ protected:
//- Reset state of cloud
void cloudReset(KinematicCloud<ParcelType>& c);
//- Apply relaxation to (steady state) cloud sources
void relaxSources();
public:
@ -543,10 +592,19 @@ public:
const bool fullyDescribed
);
//- Reset the spray source terms
//- Reset the cloud source terms
void resetSourceTerms();
//- Evolve the spray (inject, inject)
//- Relax field
template<class Type>
void relax
(
DimensionedField<Type, volMesh>& field,
const DimensionedField<Type, volMesh>& field0,
const word& name
) const;
//- Evolve the cloud
void evolve();
};

View File

@ -51,6 +51,46 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::active() const
}
template<class ParcelType>
inline const Foam::dictionary&
Foam::KinematicCloud<ParcelType>::cloudSolution::sourceTermDict() const
{
return dict_.subDict("sourceTerms");
}
template<class ParcelType>
inline const Foam::dictionary&
Foam::KinematicCloud<ParcelType>::cloudSolution::interpolationSchemes() const
{
return dict_.subDict("interpolationSchemes");
}
template<class ParcelType>
inline const Foam::dictionary&
Foam::KinematicCloud<ParcelType>::cloudSolution::integrationSchemes() const
{
return dict_.subDict("integrationSchemes");
}
template<class ParcelType>
inline const Foam::Switch
Foam::KinematicCloud<ParcelType>::cloudSolution::transient() const
{
return transient_;
}
template<class ParcelType>
inline const Foam::Switch
Foam::KinematicCloud<ParcelType>::cloudSolution::steadyState() const
{
return !transient_;
}
template<class ParcelType>
inline const Foam::Switch
Foam::KinematicCloud<ParcelType>::cloudSolution::coupled() const
@ -69,18 +109,18 @@ const
template<class ParcelType>
inline const Foam::dictionary&
Foam::KinematicCloud<ParcelType>::cloudSolution::interpolationSchemes() const
inline Foam::scalar
Foam::KinematicCloud<ParcelType>::cloudSolution::maxTrackTime() const
{
return dict_.subDict("interpolationSchemes");
return maxTrackTime_;
}
template<class ParcelType>
inline const Foam::dictionary&
Foam::KinematicCloud<ParcelType>::cloudSolution::integrationSchemes() const
inline const Foam::Switch
Foam::KinematicCloud<ParcelType>::cloudSolution::resetSourcesOnStartup() const
{
return dict_.subDict("integrationSchemes");
return resetSourcesOnStartup_;
}

View File

@ -92,6 +92,22 @@ void Foam::ReactingCloud<ParcelType>::cloudReset(ReactingCloud<ParcelType>& c)
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::relaxSources()
{
ThermoCloud<ParcelType>::relaxSources();
forAll(rhoTrans_, fieldI)
{
DimensionedField<scalar, volMesh>& rhoT =
rhoTrans_[fieldI];
const DimensionedField<scalar, volMesh>& rhoT0 =
cloudCopyPtr_->rhoTrans()[fieldI];
this->relax(rhoT, rhoT0, "rho");
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
@ -156,6 +172,11 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
{
ParcelType::readFields(*this);
}
if (this->solution().resetSourcesOnStartup())
{
resetSourceTerms();
}
}
@ -266,14 +287,31 @@ void Foam::ReactingCloud<ParcelType>::evolve()
{
typename ParcelType::trackData td(*this);
this->preEvolve();
if (this->solution().transient())
{
this->preEvolve();
this->evolveCloud(td);
this->evolveCloud(td);
}
else
{
storeState();
this->preEvolve();
this->evolveCloud(td);
relaxSources();
}
info();
this->postEvolve();
info();
Info<< endl;
if (this->solution().steadyState())
{
restoreState();
}
}
}

View File

@ -139,6 +139,9 @@ protected:
//- Reset state of cloud
void cloudReset(ReactingCloud<ParcelType>& c);
//- Apply relaxation to (steady state) cloud sources
void relaxSources();
public:
@ -253,10 +256,10 @@ public:
const bool fullyDescribed
);
//- Reset the spray source terms
//- Reset the cloud source terms
void resetSourceTerms();
//- Evolve the spray (inject, move)
//- Evolve the cloud
void evolve();
};

View File

@ -109,6 +109,11 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
{
ParcelType::readFields(*this);
}
if (this->solution().resetSourcesOnStartup())
{
resetSourceTerms();
}
}
@ -221,14 +226,31 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
{
typename ParcelType::trackData td(*this);
this->preEvolve();
if (this->solution().transient())
{
this->preEvolve();
this->evolveCloud(td);
this->evolveCloud(td);
}
else
{
storeState();
this->preEvolve();
this->evolveCloud(td);
this->relaxSources();
}
info();
this->postEvolve();
info();
Info<< endl;
if (this->solution().steadyState())
{
restoreState();
}
}
}

View File

@ -237,10 +237,10 @@ public:
const bool fullyDescribed
);
//- Reset the spray source terms
//- Reset the cloud source terms
void resetSourceTerms();
//- Evolve the spray (inject, move)
//- Evolve the cloud
void evolve();
};

View File

@ -66,6 +66,15 @@ void Foam::ThermoCloud<ParcelType>::cloudReset(ThermoCloud<ParcelType>& c)
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::relaxSources()
{
KinematicCloud<ParcelType>::relaxSources();
this->relax(hsTrans_(), cloudCopyPtr_->hsTrans(), "hs");
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ParcelType>
@ -133,6 +142,11 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
{
ParcelType::readFields(*this);
}
if (this->solution().resetSourcesOnStartup())
{
resetSourceTerms();
}
}
@ -241,14 +255,31 @@ void Foam::ThermoCloud<ParcelType>::evolve()
{
typename ParcelType::trackData td(*this);
this->preEvolve();
if (this->solution().transient())
{
this->preEvolve();
this->evolveCloud(td);
this->evolveCloud(td);
}
else
{
storeState();
this->preEvolve();
this->evolveCloud(td);
relaxSources();
}
info();
this->postEvolve();
info();
Info<< endl;
if (this->solution().steadyState())
{
restoreState();
}
}
}

View File

@ -136,6 +136,9 @@ protected:
//- Reset state of cloud
void cloudReset(ThermoCloud<ParcelType>& c);
//- Apply relaxation to (steady state) cloud sources
void relaxSources();
public:
@ -270,10 +273,10 @@ public:
const bool fullyDescribed
);
//- Reset the spray source terms
//- Reset the cloud source terms
void resetSourceTerms();
//- Evolve the spray (inject, move)
//- Evolve the cloud
void evolve();
};

View File

@ -240,11 +240,41 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
{}
template<class ParcelType>
Foam::KinematicParcel<ParcelType>::KinematicParcel
(
const KinematicParcel<ParcelType>& p,
const KinematicCloud<ParcelType>& c
)
:
Particle<ParcelType>(p, c),
typeId_(p.typeId_),
nParticle_(p.nParticle_),
d_(p.d_),
dTarget_(p.dTarget_),
U_(p.U_),
f_(p.f_),
angularMomentum_(p.angularMomentum_),
torque_(p.torque_),
rho_(p.rho_),
tTurb_(p.tTurb_),
UTurb_(p.UTurb_),
collisionRecords_(p.collisionRecords_),
rhoc_(p.rhoc_),
Uc_(p.Uc_),
muc_(p.muc_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
template<class TrackData>
bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
bool Foam::KinematicParcel<ParcelType>::move
(
TrackData& td,
const scalar trackTime
)
{
ParcelType& p = static_cast<ParcelType&>(*this);
@ -254,8 +284,6 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
const polyMesh& mesh = td.cloud().pMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const scalar deltaT = mesh.time().deltaTValue();
switch (td.part())
{
case TrackData::tpVelocityHalfStep:
@ -263,16 +291,16 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
// First and last leapfrog velocity adjust part, required
// before and after tracking and force calculation
p.U() += 0.5*deltaT*p.f()/p.mass();
p.U() += 0.5*trackTime*p.f()/p.mass();
angularMomentum_ += 0.5*deltaT*torque_;
angularMomentum_ += 0.5*trackTime*torque_;
break;
}
case TrackData::tpLinearTrack:
{
scalar tEnd = (1.0 - p.stepFraction())*deltaT;
scalar tEnd = (1.0 - p.stepFraction())*trackTime;
const scalar dtMax = tEnd;
while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL)
@ -293,7 +321,7 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
}
tEnd -= dt;
p.stepFraction() = 1.0 - tEnd/deltaT;
p.stepFraction() = 1.0 - tEnd/trackTime;
// Avoid problems with extremely small timesteps
if (dt > ROOTVSMALL)

View File

@ -366,10 +366,33 @@ public:
//- Construct as a copy
KinematicParcel(const KinematicParcel& p);
//- Construct and return a clone
autoPtr<KinematicParcel> clone() const
//- Construct as a copy
KinematicParcel
(
const KinematicParcel& p,
const KinematicCloud<ParcelType>& c
);
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone() const
{
return autoPtr<KinematicParcel>(new KinematicParcel(*this));
return autoPtr<Particle<ParcelType> >(new KinematicParcel(*this));
}
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone
(
const Cloud<ParcelType>& c
) const
{
return autoPtr<Particle<ParcelType> >
(
new KinematicParcel
(
*this,
static_cast<const KinematicCloud<ParcelType>&>(c)
)
);
}
@ -543,7 +566,7 @@ public:
//- Move the parcel
template<class TrackData>
bool move(TrackData& td);
bool move(TrackData& td, const scalar trackTime);
// Patch interactions

View File

@ -639,6 +639,20 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
{}
template<class ParcelType>
Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
(
const ReactingMultiphaseParcel<ParcelType>& p,
const ReactingMultiphaseCloud<ParcelType>& c
)
:
ReactingParcel<ParcelType>(p, c),
YGas_(p.YGas_),
YLiquid_(p.YLiquid_),
YSolid_(p.YSolid_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingMultiphaseParcelIO.C"

View File

@ -315,14 +315,36 @@ public:
//- Construct as a copy
ReactingMultiphaseParcel(const ReactingMultiphaseParcel& p);
//- Construct and return a clone
autoPtr<ReactingMultiphaseParcel> clone() const
//- Construct as a copy
ReactingMultiphaseParcel
(
const ReactingMultiphaseParcel& p,
const ReactingMultiphaseCloud<ParcelType>& c
);
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone() const
{
return
autoPtr<ReactingMultiphaseParcel>
return autoPtr<Particle<ParcelType> >
(
new ReactingMultiphaseParcel(*this)
);
}
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone
(
const Cloud<ParcelType>& c
) const
{
return autoPtr<Particle<ParcelType> >
(
new ReactingMultiphaseParcel
(
new ReactingMultiphaseParcel(*this)
);
*this,
static_cast<const ReactingMultiphaseCloud<ParcelType>&>(c)
)
);
}

View File

@ -517,6 +517,20 @@ Foam::ReactingParcel<ParcelType>::ReactingParcel
{}
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p,
const ReactingCloud<ParcelType>& c
)
:
ThermoParcel<ParcelType>(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingParcelIO.C"

View File

@ -260,13 +260,39 @@ public:
bool readFields = true
);
//- Construct as a copy
ReactingParcel
(
const ReactingParcel& p,
const ReactingCloud<ParcelType>& c
);
//- Construct as a copy
ReactingParcel(const ReactingParcel& p);
//- Construct and return a clone
autoPtr<ReactingParcel> clone() const
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone() const
{
return autoPtr<ReactingParcel>(new ReactingParcel(*this));
return autoPtr<Particle<ParcelType> >
(
new ReactingParcel<ParcelType>(*this)
);
}
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone
(
const Cloud<ParcelType>& c
) const
{
return autoPtr<Particle<ParcelType> >
(
new ReactingParcel<ParcelType>
(
*this,
static_cast<const ReactingCloud<ParcelType>&>(c)
)
);
}

View File

@ -290,6 +290,21 @@ Foam::ThermoParcel<ParcelType>::ThermoParcel
{}
template<class ParcelType>
Foam::ThermoParcel<ParcelType>::ThermoParcel
(
const ThermoParcel<ParcelType>& p,
const ThermoCloud<ParcelType>& c
)
:
KinematicParcel<ParcelType>(p, c),
T_(p.T_),
Cp_(p.Cp_),
Tc_(p.Tc_),
Cpc_(p.Cpc_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ThermoParcelIO.C"

View File

@ -284,10 +284,29 @@ public:
//- Construct as a copy
ThermoParcel(const ThermoParcel& p);
//- Construct and return a clone
autoPtr<ThermoParcel> clone() const
//- Construct as a copy
ThermoParcel(const ThermoParcel& p, const ThermoCloud<ParcelType>& c);
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone() const
{
return autoPtr<ThermoParcel>(new ThermoParcel(*this));
return autoPtr<Particle<ParcelType> >(new ThermoParcel(*this));
}
//- Construct and return a (basic particle) clone
virtual autoPtr<Particle<ParcelType> > clone
(
const Cloud<ParcelType>& c
) const
{
return autoPtr<Particle<ParcelType> >
(
new ThermoParcel
(
*this,
static_cast<const ThermoCloud<ParcelType>&>(c)
)
);
}

View File

@ -115,6 +115,16 @@ Foam::basicKinematicParcel::basicKinematicParcel
{}
Foam::basicKinematicParcel::basicKinematicParcel
(
const basicKinematicParcel& p,
const KinematicCloud<basicKinematicParcel>& c
)
:
KinematicParcel<basicKinematicParcel>(p, c)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::basicKinematicParcel::~basicKinematicParcel()

View File

@ -100,14 +100,36 @@ public:
//- 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
autoPtr<basicKinematicParcel> clone() const
virtual autoPtr<Particle<basicKinematicParcel> > clone() const
{
return
autoPtr<basicKinematicParcel>
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
(
new basicKinematicParcel(*this)
);
*this,
static_cast<const KinematicCloud<basicKinematicParcel>&>(c)
)
);
}

View File

@ -119,6 +119,16 @@ Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel
{}
Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel
(
const basicReactingMultiphaseParcel& p,
const ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& c
)
:
ReactingMultiphaseParcel<basicReactingMultiphaseParcel>(p, c)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::basicReactingMultiphaseParcel::~basicReactingMultiphaseParcel()

View File

@ -106,14 +106,42 @@ public:
//- 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
autoPtr<basicReactingMultiphaseParcel> clone() const
virtual autoPtr<Particle<basicReactingMultiphaseParcel> > clone() const
{
return
autoPtr<basicReactingMultiphaseParcel>
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
(
new basicReactingMultiphaseParcel(*this)
);
*this,
static_cast
<
const ReactingMultiphaseCloud
<
basicReactingMultiphaseParcel
>&
>(c)
)
);
}

View File

@ -107,6 +107,16 @@ Foam::basicReactingParcel::basicReactingParcel
{}
Foam::basicReactingParcel::basicReactingParcel
(
const basicReactingParcel& p,
const ReactingCloud<basicReactingParcel>& c
)
:
ReactingParcel<basicReactingParcel>(p, c)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::basicReactingParcel::~basicReactingParcel()

View File

@ -101,14 +101,36 @@ public:
//- 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
autoPtr<basicReactingParcel> clone() const
virtual autoPtr<Particle<basicReactingParcel> > clone() const
{
return
autoPtr<basicReactingParcel>
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
(
new basicReactingParcel(*this)
);
*this,
static_cast<const ReactingCloud<basicReactingParcel>&>(c)
)
);
}

View File

@ -108,6 +108,16 @@ Foam::basicThermoParcel::basicThermoParcel
{}
Foam::basicThermoParcel::basicThermoParcel
(
const basicThermoParcel& p,
const ThermoCloud<basicThermoParcel>& c
)
:
ThermoParcel<basicThermoParcel>(p, c)
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::basicThermoParcel::~basicThermoParcel()

View File

@ -99,14 +99,36 @@ public:
//- 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
autoPtr<basicThermoParcel> clone() const
virtual autoPtr<Particle<basicThermoParcel> > clone() const
{
return
autoPtr<basicThermoParcel>
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
(
new basicThermoParcel(*this)
);
*this,
static_cast<const ThermoCloud<basicThermoParcel>&>(c)
)
);
}