Skip to content
Snippets Groups Projects
Commit d75f9636 authored by laurence's avatar laurence
Browse files

Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

parents 4486773f 9269db2f
Branches
Tags
No related merge requests found
......@@ -397,6 +397,9 @@ public:
// inline const typename parcelType::forceType& forces() const;
inline const forceType& forces() const;
//- Return the optional particle forces
inline forceType& forces();
//- Optional cloud function objects
inline functionType& functions();
......@@ -487,6 +490,9 @@ public:
//- Total linear kinetic energy in the system
inline scalar linearKineticEnergyOfSystem() const;
//- Total rotational kinetic energy in the system
inline scalar rotationalKineticEnergyOfSystem() const;
//- Penetration for fraction [0-1] of the current total mass
inline scalar penetration(const scalar fraction) const;
......
......@@ -156,6 +156,14 @@ Foam::KinematicCloud<CloudType>::forces() const
}
template<class CloudType>
inline typename Foam::KinematicCloud<CloudType>::forceType&
Foam::KinematicCloud<CloudType>::forces()
{
return forces_;
}
template<class CloudType>
inline typename Foam::KinematicCloud<CloudType>::functionType&
Foam::KinematicCloud<CloudType>::functions()
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -38,7 +38,9 @@ Foam::ParticleForceList<CloudType>::ParticleForceList
PtrList<ParticleForce<CloudType> >(),
owner_(owner),
mesh_(mesh),
dict_(dictionary::null)
dict_(dictionary::null),
calcCoupled_(true),
calcNonCoupled_(true)
{}
......@@ -54,7 +56,9 @@ Foam::ParticleForceList<CloudType>::ParticleForceList
PtrList<ParticleForce<CloudType> >(),
owner_(owner),
mesh_(mesh),
dict_(dict)
dict_(dict),
calcCoupled_(true),
calcNonCoupled_(true)
{
if (readFields)
{
......@@ -151,9 +155,13 @@ Foam::forceSuSp Foam::ParticleForceList<CloudType>::calcCoupled
) const
{
forceSuSp value(vector::zero, 0.0);
forAll(*this, i)
if (calcCoupled_)
{
value += this->operator[](i).calcCoupled(p, dt, mass, Re, muc);
forAll(*this, i)
{
value += this->operator[](i).calcCoupled(p, dt, mass, Re, muc);
}
}
return value;
......@@ -171,9 +179,13 @@ Foam::forceSuSp Foam::ParticleForceList<CloudType>::calcNonCoupled
) const
{
forceSuSp value(vector::zero, 0.0);
forAll(*this, i)
if (calcNonCoupled_)
{
value += this->operator[](i).calcNonCoupled(p, dt, mass, Re, muc);
forAll(*this, i)
{
value += this->operator[](i).calcNonCoupled(p, dt, mass, Re, muc);
}
}
return value;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -64,6 +64,12 @@ class ParticleForceList
//- Forces dictionary
const dictionary dict_;
//- Calculate coupled forces flag
bool calcCoupled_;
//- Calculate non-coupled forces flag
bool calcNonCoupled_;
public:
......@@ -105,6 +111,12 @@ public:
//- Return the forces dictionary
inline const dictionary& dict() const;
//- Set the calcCoupled flag
inline void setCalcCoupled(bool flag);
//- Set the calcNonCoupled flag
inline void setCalcNonCoupled(bool flag);
// Evaluation
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -53,4 +53,18 @@ inline const Foam::dictionary& Foam::ParticleForceList<CloudType>::dict() const
}
template<class CloudType>
inline void Foam::ParticleForceList<CloudType>::setCalcCoupled(bool flag)
{
calcCoupled_ = flag;
}
template<class CloudType>
inline void Foam::ParticleForceList<CloudType>::setCalcNonCoupled(bool flag)
{
calcNonCoupled_ = flag;
}
// ************************************************************************* //
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