Skip to content
Snippets Groups Projects
Commit 3e1f2f74 authored by andy's avatar andy
Browse files

ENH: Added pAmbient property to cloud

parent dbd17b70
Branches
Tags
No related merge requests found
......@@ -126,17 +126,6 @@ void Foam::KinematicCloud<CloudType>::solve(TrackData& td)
}
template<class CloudType>
void Foam::KinematicCloud<CloudType>::preEvolve()
{
Info<< "\nSolving cloud " << this->name() << endl;
this->dispersion().cacheFields(true);
forces_.cacheFields(true);
updateCellOccupancy();
}
template<class CloudType>
void Foam::KinematicCloud<CloudType>::buildCellOccupancy()
{
......@@ -310,6 +299,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
U_(U),
mu_(mu),
g_(g),
pAmbient_(0.0),
forces_
(
*this,
......@@ -403,6 +393,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
U_(c.U_),
mu_(c.mu_),
g_(c.g_),
pAmbient_(c.pAmbient_),
forces_(c.forces_),
functions_(c.functions_),
dispersionModel_(c.dispersionModel_->clone()),
......@@ -478,6 +469,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
U_(c.U_),
mu_(c.mu_),
g_(c.g_),
pAmbient_(c.pAmbient_),
forces_(*this, mesh),
functions_(*this),
dispersionModel_(NULL),
......@@ -600,6 +592,20 @@ void Foam::KinematicCloud<CloudType>::scaleSources()
}
template<class CloudType>
void Foam::KinematicCloud<CloudType>::preEvolve()
{
Info<< "\nSolving cloud " << this->name() << endl;
this->dispersion().cacheFields(true);
forces_.cacheFields(true);
updateCellOccupancy();
pAmbient_ = constProps_.dict().template
lookupOrDefault<scalar>("pAmbient", pAmbient_);
}
template<class CloudType>
void Foam::KinematicCloud<CloudType>::evolve()
{
......
......@@ -176,6 +176,9 @@ protected:
//- Gravity
const dimensionedVector& g_;
//- Averaged ambient domain pressure
scalar pAmbient_;
//- Optional particle forces
forceType forces_;
......@@ -230,9 +233,6 @@ protected:
template<class TrackData>
void solve(TrackData& td);
//- Pre-evolve
void preEvolve();
//- Build the cellOccupancy
void buildCellOccupancy();
......@@ -367,6 +367,12 @@ public:
//- Gravity
inline const dimensionedVector& g() const;
//- Return const-access to the ambient pressure
inline scalar pAmbient() const;
//- Return reference to the ambient pressure
inline scalar& pAmbient();
//- Optional particle forces
// inline const typename parcelType::forceType& forces() const;
......@@ -514,6 +520,9 @@ public:
//- Apply scaling to (transient) cloud sources
void scaleSources();
//- Pre-evolve
void preEvolve();
//- Evolve the cloud
void evolve();
......
......@@ -109,6 +109,20 @@ inline const Foam::dimensionedVector& Foam::KinematicCloud<CloudType>::g() const
}
template<class CloudType>
inline Foam::scalar Foam::KinematicCloud<CloudType>::pAmbient() const
{
return pAmbient_;
}
template<class CloudType>
inline Foam::scalar& Foam::KinematicCloud<CloudType>::pAmbient()
{
return pAmbient_;
}
template<class CloudType>
//inline const typename CloudType::parcelType::forceType&
inline const typename Foam::KinematicCloud<CloudType>::forceType&
......
......@@ -304,6 +304,15 @@ void Foam::ThermoCloud<CloudType>::scaleSources()
}
template<class CloudType>
void Foam::ThermoCloud<CloudType>::preEvolve()
{
CloudType::preEvolve();
this->pAmbient() = thermo_.thermo().p().average().value();
}
template<class CloudType>
void Foam::ThermoCloud<CloudType>::evolve()
{
......
......@@ -304,6 +304,9 @@ public:
//- Apply scaling to (transient) cloud sources
void scaleSources();
//- Pre-evolve
void preEvolve();
//- Evolve the cloud
void evolve();
......
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