Dear all,
In coupled cases, the data of particle radius, position and velocity are given from DEM. (src/lagrangian/cfdemParticle/cfdemCloud).
As I need the information of particle id as well, I modified the cfdemCloud.C , cfdemCloud.H, cfdemCloudI.H and basicIO.C by adding several lines to bring in the information of particle id.
After the compilation(wclean, wmake libso), everything seems fine and no error occurs.
But when I run a case, the error appears:
[0]
[0]
[0] --> FOAM FATAL ERROR:
[0] gradPForce model not found!
[0]
[0]
FOAM parallel run aborting
[0]
[0] #0 Foam::error::printStack(Foam::Ostream&)[1]
[1]
[1] --> FOAM FATAL ERROR:
[1] gradPForce model not found!
[1]
[1]
FOAM parallel run aborting
[1]
[1] #0 Foam::error::printStack(Foam::Ostream&) at ??:?
[1] #1 Foam::error::abort() at ??:?
[0] #1 Foam::error::abort() at ??:?
[1] #2 at ??:?
[0] #2
[1] at ??:?
[1] #3 __libc_start_main[0] at ??:?
[0] #3 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[1] #4 in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #4
[1] at ??:?
I only added the information of particle id and did not modify anything about the force model, so I really do not know why this error occurred.
Any comments or suggestions?
Many thanks.
Riccardo Maione | Wed, 11/25/2015 - 12:03
Hello xlibp
Hello xlibp
can you share your modified files so i can have a look? please underline your modifications
Regards,
Riccardo
xlibp | Thu, 11/26/2015 - 03:25
modified files cfdemCloud.C
Sorry for the uploaded incomplete file, I'm not quite familiar about this forum.
I wish to upload the rest of the first file again. Many thanks for your patience.
...
bool Foam::cfdemCloud::reAllocArrays() const
{
if(numberOfParticlesChanged_ && !arraysReallocated_)
{
// get arrays of new length
dataExchangeM().allocateArray(positions_,0.,3);
dataExchangeM().allocateArray(velocities_,0.,3);
dataExchangeM().allocateArray(fluidVel_,0.,3);
dataExchangeM().allocateArray(fAcc_,0.,3);
dataExchangeM().allocateArray(impForces_,0.,3);
dataExchangeM().allocateArray(expForces_,0.,3);
dataExchangeM().allocateArray(DEMForces_,0.,3);
dataExchangeM().allocateArray(Cds_,0.,1);
dataExchangeM().allocateArray(radii_,0.,1);
dataExchangeM().allocateArray(ids_,0.,1);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// added 4/5
dataExchangeM().allocateArray(voidfractions_,1.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(cellIDs_,-1.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(particleWeights_,0.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(particleV_,0.,1);
arraysReallocated_ = true;
return true;
}
return false;
}
...
bool Foam::cfdemCloud::reAllocArrays(int nP, bool forceRealloc) const
{
if( (numberOfParticlesChanged_ && !arraysReallocated_) || forceRealloc)
{
// get arrays of new length
dataExchangeM().allocateArray(positions_,0.,3,nP);
dataExchangeM().allocateArray(velocities_,0.,3,nP);
dataExchangeM().allocateArray(fluidVel_,0.,3,nP);
dataExchangeM().allocateArray(impForces_,0.,3,nP);
dataExchangeM().allocateArray(expForces_,0.,3,nP);
dataExchangeM().allocateArray(DEMForces_,0.,3,nP);
dataExchangeM().allocateArray(Cds_,0.,1,nP);
dataExchangeM().allocateArray(radii_,0.,1,nP);
dataExchangeM().allocateArray(ids_,0.,1,nP);
//////////////////////////////////////////////////////////////////////////////////////////////////////////// added 5/5
dataExchangeM().allocateArray(voidfractions_,1.,voidFractionM().maxCellsPerParticle(),nP);
dataExchangeM().allocateArray(cellIDs_,0.,voidFractionM().maxCellsPerParticle(),nP);
dataExchangeM().allocateArray(particleWeights_,0.,voidFractionM().maxCellsPerParticle(),nP);
dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle(),nP);
arraysReallocated_ = true;
return true;
}
return false;
}
...
Best regards,
xlibp
xlibp | Thu, 11/26/2015 - 03:09
modified files
Hi, Riccardo, many thanks for your reply.
Here comes my modified files.
1. cfdemCloud.C
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#include "fileName.H"
#include "cfdemCloud.H"
#include "global.H"
#include "forceModel.H"
#include "locateModel.H"
#include "momCoupleModel.H"
#include "meshMotionModel.H"
#include "voidFractionModel.H"
#include "dataExchangeModel.H"
#include "IOModel.H"
#include "probeModel.H"
#include "averagingModel.H"
#include "clockModel.H"
#include "smoothingModel.H"
#include "liggghtsCommandModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cfdemCloud::cfdemCloud
(
const fvMesh& mesh
)
:
mesh_(mesh),
couplingProperties_
(
IOobject
(
"couplingProperties",
mesh_.time().constant(),
mesh_,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
liggghtsCommandDict_
(
IOobject
(
"liggghtsCommands",
mesh_.time().constant(),
mesh_,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
solveFlow_(true),
verbose_(false),
ignore_(false),
modelType_(couplingProperties_.lookup("modelType")),
positions_(NULL),
velocities_(NULL),
fluidVel_(NULL),
fAcc_(NULL),
impForces_(NULL),
expForces_(NULL),
DEMForces_(NULL),
Cds_(NULL),
radii_(NULL),
ids_(NULL),
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// added 1/5
voidfractions_(NULL),
cellIDs_(NULL),
particleWeights_(NULL),
particleVolumes_(NULL),
particleV_(NULL),
numberOfParticles_(0),
d32_(-1),
numberOfParticlesChanged_(false),
arraysReallocated_(false),
forceModels_(couplingProperties_.lookup("forceModels")),
momCoupleModels_(couplingProperties_.lookup("momCoupleModels")),
liggghtsCommandModelList_(liggghtsCommandDict_.lookup("liggghtsCommandModels")),
turbulenceModelType_(couplingProperties_.lookup("turbulenceModelType")),
cg_(1.),
cgOK_(true),
impDEMdrag_(false),
impDEMdragAcc_(false),
imExSplitFactor_(1.0),
treatVoidCellsAsExplicitForce_(false),
useDDTvoidfraction_(false),
ddtVoidfraction_
(
IOobject
(
"ddtVoidfraction",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0,0,-1,0,0), 0) // 1/s
),
turbulence_
(
#if defined(version21) || defined(version16ext)
#ifdef compre
mesh.lookupObject
#else
mesh.lookupObject
#endif
#elif defined(version15)
mesh.lookupObject
#endif
(
turbulenceModelType_
)
),
locateModel_
(
locateModel::New
(
couplingProperties_,
*this
)
),
/*momCoupleModel_
(
momCoupleModel::New
(
couplingProperties_,
*this
)
),*/
dataExchangeModel_
(
dataExchangeModel::New
(
couplingProperties_,
*this
)
),
IOModel_
(
IOModel::New
(
couplingProperties_,
*this
)
),
probeModel_
(
probeModel::New
(
couplingProperties_,
*this,
"none",
"none"
)
),
voidFractionModel_
(
voidFractionModel::New
(
couplingProperties_,
*this
)
),
averagingModel_
(
averagingModel::New
(
couplingProperties_,
*this
)
),
clockModel_
(
clockModel::New
(
couplingProperties_,
*this
)
),
smoothingModel_
(
smoothingModel::New
(
couplingProperties_,
*this
)
),
meshMotionModel_
(
meshMotionModel::New
(
couplingProperties_,
*this
)
)
{
#include "versionInfo.H"
global buildInfo(couplingProperties_,*this);
buildInfo.info();
Info << "If BC are important, please provide volScalarFields -imp/expParticleForces-" << endl;
if (couplingProperties_.found("solveFlow"))
solveFlow_=Switch(couplingProperties_.lookup("solveFlow"));
if (couplingProperties_.found("imExSplitFactor"))
imExSplitFactor_ = readScalar(couplingProperties_.lookup("imExSplitFactor"));
if (couplingProperties_.found("treatVoidCellsAsExplicitForce"))
treatVoidCellsAsExplicitForce_ = readBool(couplingProperties_.lookup("treatVoidCellsAsExplicitForce"));
if (couplingProperties_.found("verbose")) verbose_=true;
if (couplingProperties_.found("ignore")) ignore_=true;
if (turbulenceModelType_=="LESProperties")
Info << "WARNING - LES functionality not yet tested!" << endl;
if (couplingProperties_.found("useDDTvoidfraction"))
useDDTvoidfraction_=true;
else
Info << "ignoring ddt(voidfraction)" << endl;
forceModel_ = new autoPtr[nrForceModels()];
for (int i=0;i[momCoupleModels_.size()];
for (int i=0;i[liggghtsCommandModelList_.size()];
for (int i=0;i 1) FatalError<< "at least one of your models is not fit for cg !!!"<< abort(FatalError);
}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
Foam::cfdemCloud::~cfdemCloud()
{
clockM().evalPar();
clockM().normHist();
dataExchangeM().destroy(positions_,3);
dataExchangeM().destroy(velocities_,3);
dataExchangeM().destroy(fluidVel_,3);
dataExchangeM().destroy(fAcc_,3);
dataExchangeM().destroy(impForces_,3);
dataExchangeM().destroy(expForces_,3);
dataExchangeM().destroy(DEMForces_,3);
dataExchangeM().destroy(Cds_,1);
dataExchangeM().destroy(radii_,1);
dataExchangeM().destroy(ids_,1);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// added2/5
dataExchangeM().destroy(voidfractions_,1);
dataExchangeM().destroy(cellIDs_,1);
dataExchangeM().destroy(particleWeights_,1);
dataExchangeM().destroy(particleVolumes_,1);
dataExchangeM().destroy(particleV_,1);
}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
void Foam::cfdemCloud::getDEMdata()
{
dataExchangeM().getData("radius","scalar-atom",radii_);
dataExchangeM().getData("id","scalar-atom",ids_);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// added 3/5
dataExchangeM().getData("x","vector-atom",positions_);
dataExchangeM().getData("v","vector-atom",velocities_);
if(impDEMdragAcc_)
dataExchangeM().getData("dragAcc","vector-atom",fAcc_); // array is used twice - might be necessary to clean it first
}
void Foam::cfdemCloud::giveDEMdata()
{
if(forceM(0).coupleForce())
{
dataExchangeM().giveData("dragforce","vector-atom",DEMForces_);
if(impDEMdrag_)
{
if(verbose_) Info << "sending Ksl and uf" << endl;
dataExchangeM().giveData("Ksl","scalar-atom",Cds_);
dataExchangeM().giveData("uf","vector-atom",fluidVel_);
}
}
if(verbose_) Info << "giveDEMdata done." << endl;
}
// * * * write top level fields * * * //
// * * * * * * * * * * * * * * * protected Member Functions * * * * * * * * * * * * * //
void Foam::cfdemCloud::setNumberOfParticles(int nP)
{
if(nP != numberOfParticles())
{
numberOfParticlesChanged_ = true;
numberOfParticles_ = nP;
}
}
void Foam::cfdemCloud::findCells()
{
locateM().findCell(NULL,positions_,cellIDs_,numberOfParticles());
}
void Foam::cfdemCloud::setForces()
{
resetArray(fluidVel_,numberOfParticles(),3);
resetArray(impForces_,numberOfParticles(),3);
resetArray(expForces_,numberOfParticles(),3);
resetArray(DEMForces_,numberOfParticles(),3);
resetArray(Cds_,numberOfParticles(),1);
for (int i=0;i >* Foam::cfdemCloud::getVprobe()
{
return probeModel_->getVprobe();
}
std::vector< std::vector >* Foam::cfdemCloud::getSprobe()
{
return probeModel_->getSprobe();
}
// * * * * * * * * * * * * * * * WRITE * * * * * * * * * * * * * //
// * * * write cfdemCloud internal data * * * //
bool Foam::cfdemCloud::evolve
(
volScalarField& alpha,
volVectorField& Us,
volVectorField& U
)
{
numberOfParticlesChanged_ = false;
arraysReallocated_=false;
bool doCouple=false;
if(!ignore())
{
if (dataExchangeM().doCoupleNow())
{
Info << "\n Coupling..." << endl;
dataExchangeM().couple(0);
doCouple=true;
// reset vol Fields
clockM().start(16,"resetVolFields");
if(verbose_)
{
Info << "couplingStep:" << dataExchangeM().couplingStep()
<< "\n- resetVolFields()" << endl;
}
averagingM().resetVectorAverage(averagingM().UsPrev(),averagingM().UsNext(),false);
voidFractionM().resetVoidFractions();
averagingM().resetVectorAverage(forceM(0).impParticleForces(),forceM(0).impParticleForces(),true);
averagingM().resetVectorAverage(forceM(0).expParticleForces(),forceM(0).expParticleForces(),true);
averagingM().resetWeightFields();
for (int i=0;i cfdemCloud::divVoidfractionTau(volVectorField& U,volScalarField& voidfraction) const
{
return
(
- fvm::laplacian(voidfractionNuEff(voidfraction), U)
- fvc::div(voidfractionNuEff(voidfraction)*dev2(fvc::grad(U)().T()))
);
}
tmp cfdemCloud::ddtVoidfraction() const
{
if (!useDDTvoidfraction_)
{
Info << "suppressing ddt(voidfraction)" << endl;
return tmp (ddtVoidfraction_ * 0.);
}
return tmp (ddtVoidfraction_ * 1.) ;
}
void cfdemCloud::calcDdtVoidfraction(volScalarField& voidfraction) const
{
// version if ddt is calculated only at coupling time
//Info << "calculating ddt(voidfraction) based on couplingTime" << endl;
//scalar scale=mesh().time().deltaT().value()/dataExchangeM().couplingTime();
//ddtVoidfraction_ = fvc::ddt(voidfraction) * scale;
ddtVoidfraction_ = fvc::ddt(voidfraction);
}
/*tmp cfdemCloud::ddtVoidfractionU(volVectorField& U,volScalarField& voidfraction) const
{
if (dataExchangeM().couplingStep() <= 2) return fvm::ddt(U);
return fvm::ddt(voidfraction,U);
}*/
tmp cfdemCloud::voidfractionNuEff(volScalarField& voidfraction) const
{
if (modelType_=="B" || modelType_=="Bfull")
{
return tmp
(
#ifdef compre
new volScalarField("viscousTerm", (turbulence_.mut() + turbulence_.mu()))
#else
new volScalarField("viscousTerm", (turbulence_.nut() + turbulence_.nu()))
#endif
);
}
else
{
return tmp
(
#ifdef compre
new volScalarField("viscousTerm", voidfraction*(turbulence_.mut() + turbulence_.mu()))
#else
new volScalarField("viscousTerm", voidfraction*(turbulence_.nut() + turbulence_.nu()))
#endif
);
}
}
void cfdemCloud::resetArray(double**& array,int length,int width,double resetVal)
{
for(int index = 0;index < length; ++index){
for(int i=0;i
#include "fvCFD.H"
#include "IFstream.H"
#if defined(version21) || defined(version16ext)
#include "turbulenceModel.H"
#elif defined(version15)
#include "RASModel.H"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// forward declarations
class forceModel;
class locateModel;
class voidFractionModel;
class dataExchangeModel;
class IOModel;
class probeModel;
class averagingModel;
class clockModel;
class smoothingModel;
class momCoupleModel;
class meshMotionModel;
class liggghtsCommandModel;
/*---------------------------------------------------------------------------*\
Class cfdemCloud Declaration
\*---------------------------------------------------------------------------*/
class cfdemCloud
{
// protected data
protected:
const fvMesh& mesh_;
IOdictionary couplingProperties_;
IOdictionary liggghtsCommandDict_;
Switch solveFlow_;
bool verbose_;
bool ignore_;
const word modelType_;
mutable double **positions_;
mutable double **velocities_;
mutable double **fluidVel_;
mutable double **fAcc_;
mutable double **impForces_;
mutable double **expForces_;
mutable double **DEMForces_;
mutable double **Cds_;
mutable double **radii_;
mutable double **ids_;
//////////////////////////////////////////////////////////////////////////// added 1/4
mutable double **voidfractions_;
mutable double **cellIDs_;
mutable double **particleWeights_;
mutable double **particleVolumes_;
mutable double **particleV_;
int numberOfParticles_;
scalar d32_;
bool numberOfParticlesChanged_;
mutable bool arraysReallocated_;
const wordList forceModels_;
const wordList momCoupleModels_;
const wordList liggghtsCommandModelList_;
const word turbulenceModelType_;
mutable scalar cg_;
bool cgOK_;
bool impDEMdrag_;
bool impDEMdragAcc_;
mutable scalar imExSplitFactor_;
mutable bool treatVoidCellsAsExplicitForce_; //will treat the coupling force in cells with no Us data explicitly
bool useDDTvoidfraction_;
mutable volScalarField ddtVoidfraction_;
#if defined(version21) || defined(version16ext)
#ifdef compre
const compressible::turbulenceModel& turbulence_;
#else
const incompressible::turbulenceModel& turbulence_;
#endif
#elif defined(version15)
const incompressible::RASModel& turbulence_;
#endif
autoPtr* forceModel_;
autoPtr locateModel_;
autoPtr* momCoupleModel_;
autoPtr dataExchangeModel_;
autoPtr IOModel_;
autoPtr probeModel_;
autoPtr voidFractionModel_;
autoPtr averagingModel_;
autoPtr clockModel_;
autoPtr smoothingModel_;
autoPtr meshMotionModel_;
autoPtr* liggghtsCommand_;
// Protected member functions
virtual void getDEMdata();
virtual void giveDEMdata();
virtual void setNumberOfParticles(int);
virtual void findCells();
virtual void setForces();
virtual void setParticleForceField();
virtual void setVectorAverages();
public:
friend class dataExchangeModel;
friend class voidFractionModel;
friend class forceModel;
friend class forceSubModel;
// Constructors
//- Construct from mesh and a list of particles
cfdemCloud
(
const fvMesh& mesh
);
//- Destructor
virtual ~cfdemCloud();
// public Member Functions
// Access
void checkCG(bool);
void setPos(double **&);
word modelType(){ return modelType_; };
label particleCell(int);
vector position(int);
vector velocity(int);
vector fluidVel(int);
virtual const forceModel& forceM(int);
virtual int nrForceModels();
scalar voidfraction(int);
label liggghtsCommandModelIndex(word);
inline void setCG(double) const;
inline const scalar& cg() const;
inline const bool& impDEMdrag() const;
inline const bool& impDEMdragAcc() const;
inline const scalar& imExSplitFactor() const;
inline const bool& treatVoidCellsAsExplicitForce() const;
inline const bool& ignore() const;
inline const fvMesh& mesh() const;
inline bool solveFlow() const;
inline bool verbose() const;
inline const IOdictionary& couplingProperties() const;
inline double ** positions() const;
inline double ** velocities() const;
inline double ** fluidVels() const;
inline double ** fAccs() const;
inline double ** impForces() const;
inline double ** expForces() const;
inline double ** DEMForces() const;
inline double ** Cds() const;
inline double ** radii() const;
inline double ** ids() const;
//////////////////////////////////////////////////////////////////////////// added 2/4
inline double ** voidfractions() const;
inline void get_radii(double**&) const;
inline void get_ids(double**&) const;
/////////////////////////////////////////////////////////////////////////// added 3/4
inline double ** cellIDs() const;
inline void get_cellIDs(double**&) const;
inline double ** particleWeights() const;
virtual inline label body(int);
virtual inline double particleVolume(int);
inline scalar radius(int);
inline scalar id(int);
/////////////////////////////////////////////////////////////////////////// added 4/4
virtual inline double d(int);
inline scalar d32(bool recalc=true);
virtual inline double dMin() {return -1;}
virtual inline double dMax() {return -1;}
virtual inline int minType() {return -1;}
virtual inline int maxType() {return -1;}
virtual inline bool multipleTypesDMax() {return false;}
virtual inline bool multipleTypesDMin() {return false;}
virtual inline double ** particleDensity() const {return NULL;};
virtual inline int ** particleTypes() const {return NULL;};
virtual label particleType(label index) const {return -1;};
//access to the particle's rotation and torque data
virtual inline double ** DEMTorques() const {return NULL;};
virtual inline double ** omegaArray() const {return NULL;};
virtual vector omega(int) const {return Foam::vector(0,0,0);};
//access to the particles' orientation information
virtual inline double ** exArray() const {return NULL;};
virtual vector ex(int) const {return Foam::vector(0,0,0);};
//Detector if SRF module is enable or not
virtual inline bool SRFOn(){return false;}
inline int numberOfParticles() const;
inline bool numberOfParticlesChanged() const;
inline int numberOfClumps() const;
inline bool arraysReallocated() const;
inline const wordList& forceModels();
inline const voidFractionModel& voidFractionM() const;
inline const locateModel& locateM() const;
inline const momCoupleModel& momCoupleM(int) const;
inline const dataExchangeModel& dataExchangeM() const;
inline const IOModel& IOM() const;
inline const probeModel& probeM() const;
inline const averagingModel& averagingM() const;
inline const clockModel& clockM() const;
inline const smoothingModel& smoothingM() const;
inline const meshMotionModel& meshMotionM() const;
inline const wordList& liggghtsCommandModelList() const;
inline autoPtr* liggghtsCommand() const;
#if defined(version21) || defined(version16ext)
#ifdef compre
inline const compressible::turbulenceModel& turbulence() const;
#else
inline const incompressible::turbulenceModel& turbulence() const;
#endif
#elif defined(version15)
inline const incompressible::RASModel& turbulence() const;
#endif
// Write
// write cfdemCloud internal data
virtual bool evolve(volScalarField&,volVectorField&,volVectorField&);
virtual bool reAllocArrays() const;
virtual bool reAllocArrays(int nP, bool forceRealloc) const; //force number of particles during reallocation
// IO
void writeScalarFieldToTerminal(double**&);
void writeVectorFieldToTerminal(double**&);
// functions
tmp divVoidfractionTau(volVectorField& ,volScalarField&) const;
tmp ddtVoidfraction() const;
void calcDdtVoidfraction(volScalarField& voidfraction) const;
//tmp ddtVoidfractionU(volVectorField& ,volScalarField&) const;
tmp voidfractionNuEff(volScalarField&) const;
void resetArray(double**&,int,int,double resetVal=0.);
std::vector< std::vector >* getVprobe();
std::vector< std::vector >* getSprobe();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "cfdemCloudI.H"
#endif
// ************************************************************************* //
3.cfdemCloudI.H
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#include "momCoupleModel.H"
#include "smoothingModel.H"
#include "meshMotionModel.H"
#include "averagingModel.H"
#include "clockModel.H"
#include "IOModel.H"
#include "voidFractionModel.H"
#include "locateModel.H"
#include "probeModel.H"
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline void cfdemCloud::setCG(double cg) const
{
cg_ = cg;
Info << "cg is set to: " << cg_ << endl;
};
inline const bool& cfdemCloud::impDEMdrag() const
{
return impDEMdrag_;
};
inline const bool& cfdemCloud::impDEMdragAcc() const
{
return impDEMdragAcc_;
};
inline const scalar& cfdemCloud::imExSplitFactor() const
{
return imExSplitFactor_;
};
inline const bool& cfdemCloud::treatVoidCellsAsExplicitForce() const
{
return treatVoidCellsAsExplicitForce_;
}
inline const scalar& cfdemCloud::cg() const
{
return cg_;
};
inline const bool& cfdemCloud::ignore() const
{
return ignore_;
}
inline const fvMesh& cfdemCloud::mesh() const
{
return mesh_;
}
inline bool cfdemCloud::solveFlow() const
{
return bool(solveFlow_);
}
inline bool cfdemCloud::verbose() const
{
return verbose_;
}
inline const IOdictionary& cfdemCloud::couplingProperties() const
{
return couplingProperties_;
}
inline double ** cfdemCloud::positions() const
{
return positions_;
}
inline double ** cfdemCloud::velocities() const
{
return velocities_;
}
inline double ** cfdemCloud::fluidVels() const
{
return fluidVel_;
}
inline double ** cfdemCloud::fAccs() const
{
return fAcc_;
}
inline double ** cfdemCloud::impForces() const
{
return impForces_;
}
inline double ** cfdemCloud::expForces() const
{
return expForces_;
}
inline double ** cfdemCloud::DEMForces() const
{
return DEMForces_;
}
inline double ** cfdemCloud::Cds() const
{
return Cds_;
}
inline double ** cfdemCloud::radii() const
{
return radii_;
}
/////////////////////////////////////////////////////////////////////////////////////// added 1/3
inline double ** cfdemCloud::ids() const
{
return ids_;
}
inline double ** cfdemCloud::voidfractions() const
{
return voidfractions_;
}
inline void cfdemCloud::get_radii(double **& values) const
{
// Info << "set_radii level=" << numberOfParticles_ << endl;
// make a copy of the array entries
// for (int i=0;i* cfdemCloud::liggghtsCommand() const
{
return liggghtsCommand_;
}
#if defined(version21) || defined(version16ext)
#ifdef compre
inline const compressible::turbulenceModel& cfdemCloud::turbulence() const
#else
inline const incompressible::turbulenceModel& cfdemCloud::turbulence() const
#endif
#elif defined(version15)
inline const incompressible::RASModel& cfdemCloud::turbulence() const
#endif
{
return turbulence_;
}
}
// ************************************************************************* //
4. basicIO.C
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "basicIO.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(basicIO, 0);
addToRunTimeSelectionTable
(
IOModel,
basicIO,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
basicIO::basicIO
(
const dictionary& dict,
cfdemCloud& sm
)
:
IOModel(dict,sm),
//propsDict_(dict.subDict(typeName + "Props")),
dirName_("lagrangian"),
path_("dev/null"),
nPProc_(-1),
lagPath_("dev/null")
{
//if (propsDict_.found("dirName")) dirName_=word(propsDict_.lookup("dirName"));
path_ = buildFilePath(dirName_);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
basicIO::~basicIO()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Public Member Functions
int basicIO::dumpDEMdata() const
{
if (dumpNow())
{
// make time directory
if (parOutput_) lagPath_=buildFilePath(dirName_);
else
{
Info << "createTimeDir(path_), path="< -1) count++;
nPProc_=count;
// stream data to file
streamDataToPath(lagPath_, particleCloud_.positions(),nPProc_,"positions","vector","Cloud","0");
streamDataToPath(lagPath_, particleCloud_.velocities(),nPProc_,"v","vector","vectorField","");
streamDataToPath(lagPath_, particleCloud_.radii(),nPProc_,"r","scalar","scalarField","");
streamDataToPath(lagPath_, particleCloud_.ids(),nPProc_,"id","scalar","scalarField",""); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// added 1/1
}
return nPProc_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Private Member Functions
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
Best regards,
xlibp
Leopold Sun | Wed, 07/07/2021 - 10:34
To whom the same thing occurs
To whom the same thing occurs: try recompiling the solver