Commit 029345a6 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Updated mechanism that cloud copy is passed around for source relaxation

parent 75b2f2c2
......@@ -172,7 +172,7 @@ void Foam::KinematicCloud<ParcelType>::solve
evolveCloud(td);
td.cloud().relaxSources();
td.cloud().relaxSources(td.cloud().cloudCopy());
}
td.cloud().info();
......@@ -545,13 +545,13 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
Cloud<ParcelType>(c.mesh(), name, c),
kinematicCloud(),
cloudCopyPtr_(NULL),
mesh_(c.mesh()),
mesh_(c.mesh_),
particleProperties_(c.particleProperties_),
solution_(c.solution_),
constProps_(c.constProps_),
subModelProperties_(c.subModelProperties_),
rndGen_(c.rndGen_, true),
cellOccupancyPtr_(c.cellOccupancyPtr_->clone()),
cellOccupancyPtr_(NULL),
rho_(c.rho_),
U_(c.U_),
mu_(c.mu_),
......@@ -578,9 +578,7 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
IOobject::NO_WRITE,
false
),
mesh_,
c.UTrans_().dimensions(),
c.UTrans_().field()
c.UTrans_()
)
),
UCoeff_
......@@ -722,9 +720,12 @@ void Foam::KinematicCloud<ParcelType>::relax
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::relaxSources()
void Foam::KinematicCloud<ParcelType>::relaxSources
(
const KinematicCloud<ParcelType>& cloudOldTime
)
{
this->relax(UTrans_(), cloudCopyPtr_->UTrans(), "U");
this->relax(UTrans_(), cloudOldTime.UTrans(), "U");
}
......
......@@ -418,6 +418,9 @@ public:
// Access
//- Return a reference to the cloud copy
inline const KinematicCloud& cloudCopy() const;
//- If the collision model controls the wall interaction,
// then the wall impact distance should be zero.
// Otherwise, it should be allowed to be the value from
......@@ -615,7 +618,7 @@ public:
) const;
//- Apply relaxation to (steady state) cloud sources
void relaxSources();
void relaxSources(const KinematicCloud<ParcelType>& cloudOldTime);
//- Evolve the cloud
void evolve();
......
......@@ -126,6 +126,14 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::resetSourcesOnStartup() const
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
inline const KinematicCloud<ParcelType>&
Foam::KinematicCloud<ParcelType>::cloudCopy() const
{
return cloudCopyPtr_();
}
template<class ParcelType>
inline bool Foam::KinematicCloud<ParcelType>::hasWallImpactDistance() const
{
......
......@@ -275,16 +275,19 @@ void Foam::ReactingCloud<ParcelType>::resetSourceTerms()
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::relaxSources()
void Foam::ReactingCloud<ParcelType>::relaxSources
(
const ReactingCloud<ParcelType>& cloudOldTime
)
{
ThermoCloud<ParcelType>::relaxSources();
typedef DimensionedField<scalar, volMesh> dsfType;
ThermoCloud<ParcelType>::relaxSources(cloudOldTime);
forAll(rhoTrans_, fieldI)
{
DimensionedField<scalar, volMesh>& rhoT =
rhoTrans_[fieldI];
const DimensionedField<scalar, volMesh>& rhoT0 =
cloudCopyPtr_->rhoTrans()[fieldI];
dsfType& rhoT = rhoTrans_[fieldI];
const dsfType& rhoT0 = cloudOldTime.rhoTrans()[fieldI];
this->relax(rhoT, rhoT0, "rho");
}
}
......
......@@ -191,6 +191,9 @@ public:
// Access
//- Return a reference to the cloud copy
inline const ReactingCloud& cloudCopy() const;
//- Return the constant properties
inline const typename ParcelType::constantProperties&
constProps() const;
......@@ -215,6 +218,10 @@ public:
inline DimensionedField<scalar, volMesh>&
rhoTrans(const label i);
//- Return const access to mass source fields
inline const PtrList<DimensionedField<scalar, volMesh> >&
rhoTrans() const;
//- Return reference to mass source fields
inline PtrList<DimensionedField<scalar, volMesh> >&
rhoTrans();
......@@ -264,7 +271,7 @@ public:
void resetSourceTerms();
//- Apply relaxation to (steady state) cloud sources
void relaxSources();
void relaxSources(const ReactingCloud<ParcelType>& cloudOldTime);
//- Evolve the cloud
void evolve();
......
......@@ -25,6 +25,14 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
inline const ReactingCloud<ParcelType>&
Foam::ReactingCloud<ParcelType>::cloudCopy() const
{
return cloudCopyPtr_();
}
template<class ParcelType>
inline const typename ParcelType::constantProperties&
Foam::ReactingCloud<ParcelType>::constProps() const
......@@ -57,6 +65,15 @@ Foam::ReactingCloud<ParcelType>::rhoTrans(const label i)
}
template<class ParcelType>
inline
const Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >&
Foam::ReactingCloud<ParcelType>::rhoTrans() const
{
return rhoTrans_;
}
template<class ParcelType>
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >&
Foam::ReactingCloud<ParcelType>::rhoTrans()
......
......@@ -187,6 +187,9 @@ public:
// Access
//- Return a reference to the cloud copy
inline const ReactingMultiphaseCloud& cloudCopy() const;
//- Return the constant properties
inline const typename ParcelType::constantProperties&
constProps() const;
......
......@@ -25,6 +25,14 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
inline const ReactingMultiphaseCloud<ParcelType>&
Foam::ReactingMultiphaseCloud<ParcelType>::cloudCopy() const
{
return cloudCopyPtr_();
}
template<class ParcelType>
inline const typename ParcelType::constantProperties&
Foam::ReactingMultiphaseCloud<ParcelType>::constProps() const
......
......@@ -272,11 +272,14 @@ void Foam::ThermoCloud<ParcelType>::resetSourceTerms()
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::relaxSources()
void Foam::ThermoCloud<ParcelType>::relaxSources
(
const ThermoCloud<ParcelType>& cloudOldTime
)
{
KinematicCloud<ParcelType>::relaxSources();
KinematicCloud<ParcelType>::relaxSources(cloudOldTime);
this->relax(hsTrans_(), cloudCopyPtr_->hsTrans(), "hs");
this->relax(hsTrans_(), cloudOldTime.hsTrans(), "hs");
}
......
......@@ -191,6 +191,9 @@ public:
// Access
//- Return a reference to the cloud copy
inline const ThermoCloud& cloudCopy() const;
//- Return the constant properties
inline const typename ParcelType::constantProperties&
constProps() const;
......@@ -278,7 +281,7 @@ public:
void resetSourceTerms();
//- Apply relaxation to (steady state) cloud sources
void relaxSources();
void relaxSources(const ThermoCloud<ParcelType>& cloudOldTime);
//- Evolve the cloud
void evolve();
......
......@@ -29,6 +29,14 @@ using namespace Foam::constant;
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ParcelType>
inline const ThermoCloud<ParcelType>&
Foam::ThermoCloud<ParcelType>::cloudCopy() const
{
return cloudCopyPtr_();
}
template<class ParcelType>
inline const typename ParcelType::constantProperties&
Foam::ThermoCloud<ParcelType>::constProps() const
......
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