mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added kinetic energy and momentum monitoring functions.
This commit is contained in:
@ -477,11 +477,21 @@ void Foam::DsmcCloud<ParcelType>::evolve()
|
||||
template<class ParcelType>
|
||||
void Foam::DsmcCloud<ParcelType>::info() const
|
||||
{
|
||||
vector linearMomentum = linearMomentumOfSystem();
|
||||
|
||||
reduce(linearMomentum, sumOp<vector>());
|
||||
|
||||
Info<< "Cloud name: " << this->name() << nl
|
||||
<< " Current number of parcels = "
|
||||
<< returnReduce(this->size(), sumOp<label>()) << nl
|
||||
<< " Current mass in system = "
|
||||
<< returnReduce(massInSystem(), sumOp<scalar>()) << nl
|
||||
<< " Linear momentum = "
|
||||
<< linearMomentum << nl
|
||||
<< " Linear momentum magnitude = "
|
||||
<< mag(linearMomentum) << nl
|
||||
<< " Linear kinetic energy = "
|
||||
<< returnReduce(linearKineticEnergyOfSystem(), sumOp<scalar>()) << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -282,6 +282,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;
|
||||
|
||||
|
||||
@ -164,6 +164,49 @@ inline Foam::scalar Foam::DsmcCloud<ParcelType>::massInSystem() const
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::vector Foam::DsmcCloud<ParcelType>::linearMomentumOfSystem() const
|
||||
{
|
||||
vector linearMomentum(vector::zero);
|
||||
|
||||
forAllConstIter(typename DsmcCloud<ParcelType>, *this, iter)
|
||||
{
|
||||
const ParcelType& p = iter();
|
||||
|
||||
const typename ParcelType::constantProperties& cP = constProps
|
||||
(
|
||||
p.typeId()
|
||||
);
|
||||
|
||||
linearMomentum += cP.mass()*p.U();
|
||||
}
|
||||
|
||||
return nParticle_*linearMomentum;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::scalar
|
||||
Foam::DsmcCloud<ParcelType>::linearKineticEnergyOfSystem() const
|
||||
{
|
||||
scalar linearKineticEnergy = 0.0;
|
||||
|
||||
forAllConstIter(typename DsmcCloud<ParcelType>, *this, iter)
|
||||
{
|
||||
const ParcelType& p = iter();
|
||||
|
||||
const typename ParcelType::constantProperties& cP = constProps
|
||||
(
|
||||
p.typeId()
|
||||
);
|
||||
|
||||
linearKineticEnergy += 0.5*cP.mass()*(p.U() & p.U());
|
||||
}
|
||||
|
||||
return nParticle_*linearKineticEnergy;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::Random& Foam::DsmcCloud<ParcelType>::rndGen()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user