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()
|
||||
{
|
||||
this->dispersion().cacheFields(true);
|
||||
forces_.cacheFields(true);
|
||||
}
|
||||
|
||||
|
||||
@ -189,6 +190,7 @@ void Foam::KinematicCloud<ParcelType>::postEvolve()
|
||||
}
|
||||
|
||||
this->dispersion().cacheFields(false);
|
||||
forces_.cacheFields(false);
|
||||
|
||||
this->postProcessing().post();
|
||||
}
|
||||
|
||||
@ -274,18 +274,6 @@ public:
|
||||
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
|
||||
|
||||
//- Return const-access to the dispersion model
|
||||
|
||||
@ -27,6 +27,7 @@ License
|
||||
#include "particleForces.H"
|
||||
#include "fvMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "fvcGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -40,21 +41,17 @@ Foam::particleForces::particleForces
|
||||
mesh_(mesh),
|
||||
dict_(dict.subDict("particleForces")),
|
||||
g_(g),
|
||||
gradUPtr_(NULL),
|
||||
gravity_(dict_.lookup("gravity")),
|
||||
virtualMass_(dict_.lookup("virtualMass")),
|
||||
Cvm_(0.0),
|
||||
pressureGradient_(dict_.lookup("pressureGradient")),
|
||||
gradUName_("unknown_gradUName")
|
||||
UName_(dict_.lookupOrDefault<word>("U", "U"))
|
||||
{
|
||||
if (gravity_)
|
||||
if (virtualMass_)
|
||||
{
|
||||
dict_.lookup("Cvm") >> Cvm_;
|
||||
}
|
||||
|
||||
if (pressureGradient_)
|
||||
{
|
||||
dict_.lookup("gradU") >> gradUName_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,18 +60,21 @@ Foam::particleForces::particleForces(const particleForces& f)
|
||||
mesh_(f.mesh_),
|
||||
dict_(f.dict_),
|
||||
g_(f.g_),
|
||||
gradUPtr_(f.gradUPtr_),
|
||||
gravity_(f.gravity_),
|
||||
virtualMass_(f.virtualMass_),
|
||||
Cvm_(f.Cvm_),
|
||||
pressureGradient_(f.pressureGradient_),
|
||||
gradUName_(f.gradUName_)
|
||||
UName_(f.UName_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::particleForces::~particleForces()
|
||||
{}
|
||||
{
|
||||
cacheFields(false);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * 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
|
||||
if (virtualMass_)
|
||||
{
|
||||
notImplemented("Foam::particleForces::calc(...) - virtualMass force");
|
||||
notImplemented
|
||||
(
|
||||
"Foam::particleForces::calcCoupled(...) - virtual mass force"
|
||||
);
|
||||
// Ftot += Cvm_*rhoc/rho*d(Uc - U)/dt;
|
||||
}
|
||||
|
||||
// Pressure gradient force
|
||||
if (pressureGradient_)
|
||||
{
|
||||
const volSymmTensorField& gradU =
|
||||
mesh_.lookupObject<volSymmTensorField>(gradUName_);
|
||||
const volTensorField& gradU = *gradUPtr_;
|
||||
Ftot += rhoc/rho*(U & gradU[cellI]);
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ SourceFiles
|
||||
#include "dictionary.H"
|
||||
#include "Switch.H"
|
||||
#include "vector.H"
|
||||
#include "volFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -65,6 +66,9 @@ class particleForces
|
||||
//- Gravity
|
||||
const vector g_;
|
||||
|
||||
//- Velocity gradient field
|
||||
const volTensorField* gradUPtr_;
|
||||
|
||||
|
||||
// Forces to include in particle motion evaluation
|
||||
|
||||
@ -80,8 +84,11 @@ class particleForces
|
||||
//- Pressure gradient
|
||||
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:
|
||||
@ -126,12 +133,15 @@ public:
|
||||
//- Return pressure gradient force activate switch
|
||||
Switch pressureGradient() const;
|
||||
|
||||
//- Return the name of the velocity gradient field
|
||||
const word& gradUName() const;
|
||||
//- Return name of velocity field
|
||||
const word& UName() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Cache carrier fields
|
||||
void cacheFields(const bool store);
|
||||
|
||||
//- Calculate action/reaction forces between carrier and particles
|
||||
vector calcCoupled
|
||||
(
|
||||
|
||||
@ -80,9 +80,7 @@ particleForces
|
||||
{
|
||||
gravity on;
|
||||
virtualMass off;
|
||||
Cvm 0.5;
|
||||
pressureGradient off;
|
||||
gradU gradU;
|
||||
}
|
||||
|
||||
ManualInjectionCoeffs
|
||||
|
||||
@ -66,9 +66,7 @@ particleForces
|
||||
{
|
||||
gravity on;
|
||||
virtualMass off;
|
||||
Cvm 0.5;
|
||||
pressureGradient off;
|
||||
gradU gradU;
|
||||
}
|
||||
|
||||
ManualInjectionCoeffs
|
||||
|
||||
@ -74,9 +74,7 @@ particleForces
|
||||
{
|
||||
gravity on;
|
||||
virtualMass off;
|
||||
Cvm 0.5;
|
||||
pressureGradient off;
|
||||
gradU gradU;
|
||||
}
|
||||
|
||||
ManualInjectionCoeffs
|
||||
|
||||
@ -74,9 +74,7 @@ particleForces
|
||||
{
|
||||
gravity on;
|
||||
virtualMass off;
|
||||
Cvm 0.5;
|
||||
pressureGradient off;
|
||||
gradU gradU;
|
||||
}
|
||||
|
||||
ManualInjectionCoeffs
|
||||
|
||||
@ -54,9 +54,7 @@ particleForces
|
||||
{
|
||||
gravity on;
|
||||
virtualMass off;
|
||||
Cvm 0.5;
|
||||
pressureGradient off;
|
||||
gradU gradU;
|
||||
}
|
||||
|
||||
ManualInjectionCoeffs
|
||||
|
||||
@ -66,9 +66,7 @@ particleForces
|
||||
{
|
||||
gravity on;
|
||||
virtualMass off;
|
||||
Cvm 0.5;
|
||||
pressureGradient off;
|
||||
gradU gradU;
|
||||
}
|
||||
|
||||
ManualInjectionCoeffs
|
||||
|
||||
Reference in New Issue
Block a user