mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
updated particle forces
This commit is contained in:
@ -177,6 +177,7 @@ template<class ParcelType>
|
|||||||
void Foam::KinematicCloud<ParcelType>::preEvolve()
|
void Foam::KinematicCloud<ParcelType>::preEvolve()
|
||||||
{
|
{
|
||||||
this->dispersion().cacheFields(true);
|
this->dispersion().cacheFields(true);
|
||||||
|
forces_.cacheFields(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -189,6 +190,7 @@ void Foam::KinematicCloud<ParcelType>::postEvolve()
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->dispersion().cacheFields(false);
|
this->dispersion().cacheFields(false);
|
||||||
|
forces_.cacheFields(false);
|
||||||
|
|
||||||
this->postProcessing().post();
|
this->postProcessing().post();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -274,18 +274,6 @@ public:
|
|||||||
inline const dictionary& interpolationSchemes() const;
|
inline const dictionary& interpolationSchemes() const;
|
||||||
|
|
||||||
|
|
||||||
// Forces to include in particle motion evaluation
|
|
||||||
|
|
||||||
//- Return reference to the gravity force flag
|
|
||||||
inline Switch forceGravity() const;
|
|
||||||
|
|
||||||
//- Return reference to the virtual mass force flag
|
|
||||||
inline Switch forceVirtualMass() const;
|
|
||||||
|
|
||||||
//- Return reference to the pressure gradient force flag
|
|
||||||
inline Switch forcePressureGradient() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Sub-models
|
// Sub-models
|
||||||
|
|
||||||
//- Return const-access to the dispersion model
|
//- Return const-access to the dispersion model
|
||||||
|
|||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "particleForces.H"
|
#include "particleForces.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "fvcGrad.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -40,21 +41,17 @@ Foam::particleForces::particleForces
|
|||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
dict_(dict.subDict("particleForces")),
|
dict_(dict.subDict("particleForces")),
|
||||||
g_(g),
|
g_(g),
|
||||||
|
gradUPtr_(NULL),
|
||||||
gravity_(dict_.lookup("gravity")),
|
gravity_(dict_.lookup("gravity")),
|
||||||
virtualMass_(dict_.lookup("virtualMass")),
|
virtualMass_(dict_.lookup("virtualMass")),
|
||||||
Cvm_(0.0),
|
Cvm_(0.0),
|
||||||
pressureGradient_(dict_.lookup("pressureGradient")),
|
pressureGradient_(dict_.lookup("pressureGradient")),
|
||||||
gradUName_("unknown_gradUName")
|
UName_(dict_.lookupOrDefault<word>("U", "U"))
|
||||||
{
|
{
|
||||||
if (gravity_)
|
if (virtualMass_)
|
||||||
{
|
{
|
||||||
dict_.lookup("Cvm") >> Cvm_;
|
dict_.lookup("Cvm") >> Cvm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pressureGradient_)
|
|
||||||
{
|
|
||||||
dict_.lookup("gradU") >> gradUName_;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -63,18 +60,21 @@ Foam::particleForces::particleForces(const particleForces& f)
|
|||||||
mesh_(f.mesh_),
|
mesh_(f.mesh_),
|
||||||
dict_(f.dict_),
|
dict_(f.dict_),
|
||||||
g_(f.g_),
|
g_(f.g_),
|
||||||
|
gradUPtr_(f.gradUPtr_),
|
||||||
gravity_(f.gravity_),
|
gravity_(f.gravity_),
|
||||||
virtualMass_(f.virtualMass_),
|
virtualMass_(f.virtualMass_),
|
||||||
Cvm_(f.Cvm_),
|
Cvm_(f.Cvm_),
|
||||||
pressureGradient_(f.pressureGradient_),
|
pressureGradient_(f.pressureGradient_),
|
||||||
gradUName_(f.gradUName_)
|
UName_(f.UName_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::particleForces::~particleForces()
|
Foam::particleForces::~particleForces()
|
||||||
{}
|
{
|
||||||
|
cacheFields(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -109,9 +109,26 @@ Foam::Switch Foam::particleForces::pressureGradient() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::word& Foam::particleForces::gradUName() const
|
const Foam::word& Foam::particleForces::UName() const
|
||||||
{
|
{
|
||||||
return gradUName_;
|
return UName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::particleForces::cacheFields(const bool store)
|
||||||
|
{
|
||||||
|
if (store && pressureGradient_)
|
||||||
|
{
|
||||||
|
const volVectorField U = mesh_.lookupObject<volVectorField>(UName_);
|
||||||
|
gradUPtr_ = fvc::grad(U).ptr();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (gradUPtr_)
|
||||||
|
{
|
||||||
|
delete gradUPtr_;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -130,15 +147,17 @@ Foam::vector Foam::particleForces::calcCoupled
|
|||||||
// Virtual mass force
|
// Virtual mass force
|
||||||
if (virtualMass_)
|
if (virtualMass_)
|
||||||
{
|
{
|
||||||
notImplemented("Foam::particleForces::calc(...) - virtualMass force");
|
notImplemented
|
||||||
|
(
|
||||||
|
"Foam::particleForces::calcCoupled(...) - virtual mass force"
|
||||||
|
);
|
||||||
// Ftot += Cvm_*rhoc/rho*d(Uc - U)/dt;
|
// Ftot += Cvm_*rhoc/rho*d(Uc - U)/dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pressure gradient force
|
// Pressure gradient force
|
||||||
if (pressureGradient_)
|
if (pressureGradient_)
|
||||||
{
|
{
|
||||||
const volSymmTensorField& gradU =
|
const volTensorField& gradU = *gradUPtr_;
|
||||||
mesh_.lookupObject<volSymmTensorField>(gradUName_);
|
|
||||||
Ftot += rhoc/rho*(U & gradU[cellI]);
|
Ftot += rhoc/rho*(U & gradU[cellI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ SourceFiles
|
|||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
#include "vector.H"
|
#include "vector.H"
|
||||||
|
#include "volFieldsFwd.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -65,6 +66,9 @@ class particleForces
|
|||||||
//- Gravity
|
//- Gravity
|
||||||
const vector g_;
|
const vector g_;
|
||||||
|
|
||||||
|
//- Velocity gradient field
|
||||||
|
const volTensorField* gradUPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Forces to include in particle motion evaluation
|
// Forces to include in particle motion evaluation
|
||||||
|
|
||||||
@ -80,8 +84,11 @@ class particleForces
|
|||||||
//- Pressure gradient
|
//- Pressure gradient
|
||||||
Switch pressureGradient_;
|
Switch pressureGradient_;
|
||||||
|
|
||||||
//- Name of velocity gradient field for pressure gradient force
|
|
||||||
word gradUName_;
|
// Additional info
|
||||||
|
|
||||||
|
//- Name of velucity field - default = "U"
|
||||||
|
const word UName_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -126,12 +133,15 @@ public:
|
|||||||
//- Return pressure gradient force activate switch
|
//- Return pressure gradient force activate switch
|
||||||
Switch pressureGradient() const;
|
Switch pressureGradient() const;
|
||||||
|
|
||||||
//- Return the name of the velocity gradient field
|
//- Return name of velocity field
|
||||||
const word& gradUName() const;
|
const word& UName() const;
|
||||||
|
|
||||||
|
|
||||||
// Evaluation
|
// Evaluation
|
||||||
|
|
||||||
|
//- Cache carrier fields
|
||||||
|
void cacheFields(const bool store);
|
||||||
|
|
||||||
//- Calculate action/reaction forces between carrier and particles
|
//- Calculate action/reaction forces between carrier and particles
|
||||||
vector calcCoupled
|
vector calcCoupled
|
||||||
(
|
(
|
||||||
|
|||||||
@ -80,9 +80,7 @@ particleForces
|
|||||||
{
|
{
|
||||||
gravity on;
|
gravity on;
|
||||||
virtualMass off;
|
virtualMass off;
|
||||||
Cvm 0.5;
|
|
||||||
pressureGradient off;
|
pressureGradient off;
|
||||||
gradU gradU;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManualInjectionCoeffs
|
ManualInjectionCoeffs
|
||||||
|
|||||||
@ -66,9 +66,7 @@ particleForces
|
|||||||
{
|
{
|
||||||
gravity on;
|
gravity on;
|
||||||
virtualMass off;
|
virtualMass off;
|
||||||
Cvm 0.5;
|
|
||||||
pressureGradient off;
|
pressureGradient off;
|
||||||
gradU gradU;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManualInjectionCoeffs
|
ManualInjectionCoeffs
|
||||||
|
|||||||
@ -74,9 +74,7 @@ particleForces
|
|||||||
{
|
{
|
||||||
gravity on;
|
gravity on;
|
||||||
virtualMass off;
|
virtualMass off;
|
||||||
Cvm 0.5;
|
|
||||||
pressureGradient off;
|
pressureGradient off;
|
||||||
gradU gradU;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManualInjectionCoeffs
|
ManualInjectionCoeffs
|
||||||
|
|||||||
@ -74,9 +74,7 @@ particleForces
|
|||||||
{
|
{
|
||||||
gravity on;
|
gravity on;
|
||||||
virtualMass off;
|
virtualMass off;
|
||||||
Cvm 0.5;
|
|
||||||
pressureGradient off;
|
pressureGradient off;
|
||||||
gradU gradU;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManualInjectionCoeffs
|
ManualInjectionCoeffs
|
||||||
|
|||||||
@ -54,9 +54,7 @@ particleForces
|
|||||||
{
|
{
|
||||||
gravity on;
|
gravity on;
|
||||||
virtualMass off;
|
virtualMass off;
|
||||||
Cvm 0.5;
|
|
||||||
pressureGradient off;
|
pressureGradient off;
|
||||||
gradU gradU;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManualInjectionCoeffs
|
ManualInjectionCoeffs
|
||||||
|
|||||||
@ -66,9 +66,7 @@ particleForces
|
|||||||
{
|
{
|
||||||
gravity on;
|
gravity on;
|
||||||
virtualMass off;
|
virtualMass off;
|
||||||
Cvm 0.5;
|
|
||||||
pressureGradient off;
|
pressureGradient off;
|
||||||
gradU gradU;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManualInjectionCoeffs
|
ManualInjectionCoeffs
|
||||||
|
|||||||
Reference in New Issue
Block a user