mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Adding momentum and linear kinetic energy monitoring functions.
This commit is contained in:
@ -259,6 +259,12 @@ void Foam::InteractingKinematicCloud<ParcelType>::evolve()
|
||||
template<class ParcelType>
|
||||
void Foam::InteractingKinematicCloud<ParcelType>::info() const
|
||||
{
|
||||
vector linearMomentum = linearMomentumOfSystem();
|
||||
reduce(linearMomentum, sumOp<vector>());
|
||||
|
||||
scalar linearKineticEnergy = linearKineticEnergyOfSystem();
|
||||
reduce(linearKineticEnergy, sumOp<scalar>());
|
||||
|
||||
Info<< "Cloud: " << this->name() << nl
|
||||
<< " Total number of parcels added = "
|
||||
<< returnReduce(this->injection().parcelsAddedTotal(), sumOp<label>())
|
||||
@ -269,7 +275,13 @@ void Foam::InteractingKinematicCloud<ParcelType>::info() const
|
||||
<< " Current number of parcels = "
|
||||
<< returnReduce(this->size(), sumOp<label>()) << nl
|
||||
<< " Current mass in system = "
|
||||
<< returnReduce(massInSystem(), sumOp<scalar>()) << nl;
|
||||
<< returnReduce(massInSystem(), sumOp<scalar>()) << nl
|
||||
<< " Linear momentum = "
|
||||
<< linearMomentum << nl
|
||||
<< " |Linear momentum| = "
|
||||
<< mag(linearMomentum) << nl
|
||||
<< " Linear kinetic energy = "
|
||||
<< linearKineticEnergy << nl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -361,6 +361,12 @@ public:
|
||||
//- Total mass in system
|
||||
inline scalar massInSystem() const;
|
||||
|
||||
//- Total linear momentum of the system
|
||||
inline vector linearMomentumOfSystem() const;
|
||||
|
||||
//- Total linear kinetic energy in the system
|
||||
inline scalar linearKineticEnergyOfSystem() const;
|
||||
|
||||
//- Print cloud information
|
||||
void info() const;
|
||||
|
||||
|
||||
@ -221,6 +221,40 @@ Foam::InteractingKinematicCloud<ParcelType>::massInSystem() const
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::vector
|
||||
Foam::InteractingKinematicCloud<ParcelType>::linearMomentumOfSystem() const
|
||||
{
|
||||
vector linearMomentum(vector::zero);
|
||||
|
||||
forAllConstIter(typename InteractingKinematicCloud<ParcelType>, *this, iter)
|
||||
{
|
||||
const ParcelType& p = iter();
|
||||
|
||||
linearMomentum += p.mass()*p.U();
|
||||
}
|
||||
|
||||
return linearMomentum;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::scalar
|
||||
Foam::InteractingKinematicCloud<ParcelType>::linearKineticEnergyOfSystem() const
|
||||
{
|
||||
scalar linearKineticEnergy = 0.0;
|
||||
|
||||
forAllConstIter(typename InteractingKinematicCloud<ParcelType>, *this, iter)
|
||||
{
|
||||
const ParcelType& p = iter();
|
||||
|
||||
linearKineticEnergy += 0.5*p.mass()*(p.U() & p.U());
|
||||
}
|
||||
|
||||
return linearKineticEnergy;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::Random& Foam::InteractingKinematicCloud<ParcelType>::rndGen()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user