Commit 7d505177 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Restructured and cleaned cloud evolution functions

parent 77752b9e
......@@ -179,10 +179,11 @@ void Foam::KinematicCloud<ParcelType>::updateCellOccupancy()
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::evolveCloud()
void Foam::KinematicCloud<ParcelType>::evolveCloud
(
typename ParcelType::trackData& td
)
{
typename ParcelType::trackData td(*this);
label preInjectionSize = this->size();
this->surfaceFilm().inject(td);
......@@ -195,7 +196,6 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud()
preInjectionSize = this->size();
}
this->injection().inject(td);
if (solution_.coupled())
......@@ -572,9 +572,11 @@ void Foam::KinematicCloud<ParcelType>::evolve()
{
if (solution_.active())
{
typename ParcelType::trackData td(*this);
preEvolve();
evolveCloud();
evolveCloud(td);
postEvolve();
......
......@@ -297,7 +297,7 @@ protected:
void updateCellOccupancy();
//- Evolve the cloud
void evolveCloud();
void evolveCloud(typename ParcelType::trackData& td);
//- Particle motion
void motion(typename ParcelType::trackData& td);
......
......@@ -80,61 +80,6 @@ void Foam::ReactingCloud<ParcelType>::checkSuppliedComposition
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::preEvolve()
{
ThermoCloud<ParcelType>::preEvolve();
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::evolveCloud()
{
typename ParcelType::trackData td(*this);
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())
{
this->updateCellOccupancy();
preInjectionSize = this->size();
}
this->injection().inject(td);
if (this->solution().coupled())
{
resetSourceTerms();
}
// Assume that motion will update the cellOccupancy as necessary
// before it is required.
motion(td);
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::motion
(
typename ParcelType::trackData& td
)
{
ThermoCloud<ParcelType>::motion(td);
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::postEvolve()
{
ThermoCloud<ParcelType>::postEvolve();
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::cloudReset(ReactingCloud<ParcelType>& c)
{
......@@ -319,11 +264,13 @@ void Foam::ReactingCloud<ParcelType>::evolve()
{
if (this->solution().active())
{
preEvolve();
typename ParcelType::trackData td(*this);
this->preEvolve();
evolveCloud();
this->evolveCloud(td);
postEvolve();
this->postEvolve();
info();
Info<< endl;
......
......@@ -136,18 +136,6 @@ protected:
// Cloud evolution functions
//- Pre-evolve
void preEvolve();
//- Evolve the cloud
void evolveCloud();
//- Particle motion
void motion(typename ParcelType::trackData& td);
//- Post-evolve
void postEvolve();
//- Reset state of cloud
void cloudReset(ReactingCloud<ParcelType>& c);
......
......@@ -53,61 +53,6 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::restoreState()
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::preEvolve()
{
ReactingCloud<ParcelType>::preEvolve();
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud()
{
typename ParcelType::trackData td(*this);
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())
{
this->updateCellOccupancy();
preInjectionSize = this->size();
}
this->injection().inject(td);
if (this->solution().coupled())
{
resetSourceTerms();
}
// Assume that motion will update the cellOccupancy as necessary
// before it is required.
motion(td);
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::motion
(
typename ParcelType::trackData& td
)
{
ReactingCloud<ParcelType>::motion(td);
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::postEvolve()
{
ReactingCloud<ParcelType>::postEvolve();
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::cloudReset
(
......@@ -274,11 +219,13 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
{
if (this->solution().active())
{
preEvolve();
typename ParcelType::trackData td(*this);
this->preEvolve();
evolveCloud();
this->evolveCloud(td);
postEvolve();
this->postEvolve();
info();
Info<< endl;
......
......@@ -127,18 +127,6 @@ protected:
// Cloud evolution functions
//- Pre-evolve
void preEvolve();
//- Evolve the cloud
void evolveCloud();
//- Particle motion
void motion(typename ParcelType::trackData& td);
//- Post-evolve
void postEvolve();
//- Reset state of cloud
void cloudReset(ReactingMultiphaseCloud<ParcelType>& c);
......
......@@ -54,61 +54,6 @@ void Foam::ThermoCloud<ParcelType>::restoreState()
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::preEvolve()
{
KinematicCloud<ParcelType>::preEvolve();
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::evolveCloud()
{
typename ParcelType::trackData td(*this);
label preInjectionSize = this->size();
// Update the cellOccupancy if the size of the cloud has changed
// during the injection.
this->surfaceFilm().inject(td);
if (preInjectionSize != this->size())
{
this->updateCellOccupancy();
preInjectionSize = this->size();
}
this->injection().inject(td);
if (this->solution().coupled())
{
resetSourceTerms();
}
// Assume that motion will update the cellOccupancy as necessary
// before it is required.
motion(td);
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::motion
(
typename ParcelType::trackData& td
)
{
KinematicCloud<ParcelType>::motion(td);
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::postEvolve()
{
KinematicCloud<ParcelType>::postEvolve();
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::cloudReset(ThermoCloud<ParcelType>& c)
{
......@@ -294,11 +239,13 @@ void Foam::ThermoCloud<ParcelType>::evolve()
{
if (this->solution().active())
{
preEvolve();
typename ParcelType::trackData td(*this);
this->preEvolve();
evolveCloud();
this->evolveCloud(td);
postEvolve();
this->postEvolve();
info();
Info<< endl;
......
......@@ -133,18 +133,6 @@ protected:
// Cloud evolution functions
//- Pre-evolve
void preEvolve();
//- Evolve the cloud
void evolveCloud();
//- Particle motion
void motion(typename ParcelType::trackData& td);
//- Post-evolve
void postEvolve();
//- Reset state of cloud
void cloudReset(ThermoCloud<ParcelType>& c);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment