release on 2013-02-06_21-55-59

This commit is contained in:
goniva
2013-02-06 21:55:59 +01:00
parent 9845faf2a8
commit 1f885cf941
36 changed files with 375 additions and 140 deletions

82
README Normal file
View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
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. Note: this code is not part of OpenFOAM (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
CFDEM coupling provides an open source parallel coupled CFD-DEM framework
combining the strengths of LIGGGHTS DEM code and the Open Source
CFD package OpenFOAM(R)(*). The CFDEMcoupling toolbox allows to expand
standard CFD solvers of OpenFOAM(R)(*) to include a coupling to the DEM
code LIGGGHTS. In this toolbox the particle representation within the
CFD solver is organized by "cloud" classes. Key functionalities are organised
in sub-models (e.g. force models, data exchange models, etc.) which can easily
be selected and combined by dictionary settings.
The coupled solvers run fully parallel on distributed-memory clusters.
Features are:
- its modular approach allows users to easily implement new models
- its MPI parallelization enables to use it for large scale problems
- the "forum"_lws on CFD-DEM gives the possibility to exchange with other
users / developers
- the use of GIT allows to easily update to the latest version
- basic documentation is provided
The file structure:
- "src" directory including the source files of the coupling toolbox and models
- "applications" directory including the solver files for coupled CFD-DEM simulations
- "doc" directory including the documentation of CFDEMcoupling
- "tutorials" directory including basic tutorial cases showing the functionality
Details on installation are given on the "www.cfdem.com"
The functionality of this CFD-DEM framwork is described via "tutorial cases" showing
how to use different solvers and models.
CFDEMcoupling stands for Computational Fluid Dynamics (CFD) -
Discrete Element Method (DEM) coupling.
CFDEMcoupling is an open-source code, distributed freely under the terms of the
GNU Public License (GPL).
Core development of CFDEMcoupling is done by
Christoph Goniva and Christoph Kloss, both at DCS Computing GmbH, 2012
\*---------------------------------------------------------------------------*/
(*) "OpenFOAM(R)"_of is a registered trade mark of Silicon Graphics
International Corp. This offering is not affiliated, approved or endorsed by
Silicon Graphics International Corp., the producer of the OpenFOAM(R) software
and owner of the OpenFOAM(R) trademark.
\*---------------------------------------------------------------------------*/

View File

@ -62,6 +62,7 @@ int main(int argc, char *argv[])
int count=0;
int DEM_dump_Interval=1000;
particleCloud.reAllocArrays();
double **positions_;
double **velocities_;
@ -73,11 +74,14 @@ int main(int argc, char *argv[])
particleCloud.dataExchangeM().allocateArray(positions_,0.,3);
particleCloud.dataExchangeM().allocateArray(velocities_,0.,3);
particleCloud.dataExchangeM().allocateArray(radii_,0.,1);
particleCloud.get_radii(radii_); // get ref to radii
//particleCloud.dataExchangeM().allocateArray(radii_,0.,1);
particleCloud.dataExchangeM().allocateArray(voidfractions_,0.,1);
particleCloud.dataExchangeM().allocateArray(particleWeights_,0.,1);
particleCloud.dataExchangeM().allocateArray(particleVolumes_,0.,1);
particleCloud.dataExchangeM().allocateArray(cellIDs_,0.,1);
particleCloud.get_cellIDs(cellIDs_); // get ref to cellIDs
//particleCloud.dataExchangeM().allocateArray(cellIDs_,0.,1);
while (runTime.loop())
{
@ -97,12 +101,8 @@ int main(int argc, char *argv[])
particleCloud.dataExchangeM().getData("v","vector-atom",velocities_,count);
particleCloud.dataExchangeM().getData("radius","scalar-atom",radii_,count);
particleCloud.set_radii(radii_);
particleCloud.locateM().findCell(NULL,positions_,cellIDs_,particleCloud.numberOfParticles());
particleCloud.set_cellIDs(cellIDs_);
particleCloud.voidFractionM().setvoidFraction
(
NULL,voidfractions_,particleWeights_,particleVolumes_
@ -128,13 +128,13 @@ int main(int argc, char *argv[])
}
delete positions_;
delete velocities_;
delete radii_;
delete voidfractions_;
delete particleWeights_;
delete particleVolumes_;
delete cellIDs_;
particleCloud.dataExchangeM().destroy(positions_,3);
particleCloud.dataExchangeM().destroy(velocities_,3);
//particleCloud.dataExchangeM().destroy(radii_); // destroyed in cloud
particleCloud.dataExchangeM().destroy(voidfractions_,1);
particleCloud.dataExchangeM().destroy(particleWeights_,1);
particleCloud.dataExchangeM().destroy(particleVolumes_,1);
//particleCloud.dataExchangeM().destroy(cellIDs_); // destroyed in cloud
Info<< "End\n" << endl;

Binary file not shown.

BIN
doc/githubAccess_public.pdf Normal file

Binary file not shown.

View File

@ -25,7 +25,7 @@ writeLiggghtsProps
overwrite switch2;
}
</PRE>
<UL><LI><I>switch1</I> = switch (choose on/off) to select if only last step is stored or every write step. "off" is not recommended (DEM data might get lost)
<UL><LI><I>switch1</I> = switch (choose on/off) to select if only last step is stored or every write step.
<LI><I>name</I> = name of the restart file to be written in /$caseDir/DEM/ default default "liggghts.restartCFDEM"

View File

@ -23,7 +23,7 @@ writeLiggghtsProps
overwrite switch2;
\} :pre
{switch1} = switch (choose on/off) to select if only last step is stored or every write step. "off" is not recommended (DEM data might get lost) :ulb,l
{switch1} = switch (choose on/off) to select if only last step is stored or every write step. :ulb,l
{name} = name of the restart file to be written in /$caseDir/DEM/ default default "liggghts.restartCFDEM" :l
{switch2} = switch (choose on/off) to select if only one restart file $name or many files $name_$timeStamp are written :l
:ule

View File

@ -6,7 +6,6 @@ voidFractionModels = subModels/voidFractionModel
locateModels = subModels/locateModel
meshMotionModels = subModels/meshMotionModel
momCoupleModels = subModels/momCoupleModel
regionModels = subModels/regionModel
dataExchangeModels = subModels/dataExchangeModel
averagingModels = subModels/averagingModel
clockModels = subModels/clockModel
@ -20,18 +19,33 @@ $(forceModels)/forceModel/forceModel.C
$(forceModels)/forceModel/newForceModel.C
$(forceModels)/noDrag/noDrag.C
$(forceModels)/DiFeliceDrag/DiFeliceDrag.C
$(forceModels)/DiFeliceDragNLift/DiFeliceDragNLift.C
$(forceModels)/GidaspowDrag/GidaspowDrag.C
$(forceModels)/SchillerNaumannDrag/SchillerNaumannDrag.C
$(forceModels)/Archimedes/Archimedes.C
$(forceModels)/ArchimedesIB/ArchimedesIB.C
$(forceModels)/interface/interface.C
$(forceModels)/ShirgaonkarIB/ShirgaonkarIB.C
$(forceModels)/fieldTimeAverage/fieldTimeAverage.C
$(forceModels)/fieldBound/fieldBound.C
$(forceModels)/volWeightedAverage/volWeightedAverage.C
$(forceModels)/totalMomentumExchange/totalMomentumExchange.C
$(forceModels)/KochHillDrag/KochHillDrag.C
$(forceModels)/BeetstraDrag/multiphaseFlowBasic/multiphaseFlowBasic.C
$(forceModels)/BeetstraDrag/BeetstraDrag.C
$(forceModels)/LaEuScalarLiquid/LaEuScalarLiquid.C
$(forceModels)/LaEuScalarTemp/LaEuScalarTemp.C
$(forceModels)/LaEuScalarDust/LaEuScalarDust.C
$(forceModels)/virtualMassForce/virtualMassForce.C
$(forceModels)/gradPForce/gradPForce.C
$(forceModels)/gradULiftForce/gradULiftForce.C
$(forceModels)/viscForce/viscForce.C
$(forceModels)/MeiLift/MeiLift.C
$(forceModels)/KochHillDragNLift/KochHillDragNLift.C
$(forceModels)/solidsPressureForce/solidsPressureForce.C
$(forceModels)/periodicPressure/periodicPressure.C
$(forceModels)/periodicPressureControl/periodicPressureControl.C
$(forceModels)/averageSlipVel/averageSlipVel.C
$(forceModelsMS)/forceModelMS/forceModelMS.C
$(forceModelsMS)/forceModelMS/newForceModelMS.C
@ -42,6 +56,7 @@ $(IOModels)/IOModel/newIOModel.C
$(IOModels)/noIO/noIO.C
$(IOModels)/basicIO/basicIO.C
$(IOModels)/trackIO/trackIO.C
$(IOModels)/sophIO/sophIO.C
$(voidFractionModels)/voidFractionModel/voidFractionModel.C
$(voidFractionModels)/voidFractionModel/newVoidFractionModel.C
@ -60,21 +75,18 @@ $(locateModels)/turboEngineSearch/turboEngineSearch.C
$(locateModels)/turboEngineSearchM2M/turboEngineSearchM2M.C
$(locateModels)/engineSearchIB/engineSearchIB.C
$(meshMotionModels)/meshMotionModel/meshMotionModel.C
$(meshMotionModels)/meshMotionModel/newMeshMotionModel.C
$(meshMotionModels)/noMeshMotion/noMeshMotion.C
$(meshMotionModels)/DEMdrivenMeshMotion/DEMdrivenMeshMotion.C
$(momCoupleModels)/momCoupleModel/momCoupleModel.C
$(momCoupleModels)/momCoupleModel/newMomCoupleModel.C
$(momCoupleModels)/explicitCouple/explicitCouple.C
$(momCoupleModels)/explicitCoupleSource/explicitCoupleSource.C
$(momCoupleModels)/implicitCouple/implicitCouple.C
$(momCoupleModels)/noCouple/noCouple.C
$(regionModels)/regionModel/regionModel.C
$(regionModels)/regionModel/newRegionModel.C
$(regionModels)/allRegion/allRegion.C
$(dataExchangeModels)/dataExchangeModel/dataExchangeModel.C
$(dataExchangeModels)/dataExchangeModel/newDataExchangeModel.C
$(dataExchangeModels)/oneWayVTK/oneWayVTK.C

View File

@ -1,5 +1,5 @@
word CFDEMversion="cfdem-2.4.7";
word compatibleLIGGGHTSversion="2.2.3";
word CFDEMversion="cfdem-2.5.0";
word compatibleLIGGGHTSversion="2.2.4";
Info << "\nCFDEMcoupling version: " << CFDEMversion << "\n" << endl;
Info << "\n, compatible to LIGGGHTS version: " << compatibleLIGGGHTSversion << "\n" << endl;

View File

@ -42,7 +42,6 @@ Description
#include "clockModel.H"
#include "liggghtsCommandModel.H"
#include "mpi.h"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cfdemCloud::cfdemCloud
(
@ -222,24 +221,18 @@ Foam::cfdemCloud::~cfdemCloud()
{
clockM().evalPar();
clockM().normHist();
free2D(positions_);
free2D(velocities_);
free2D(impForces_);
free2D(expForces_);
free2D(DEMForces_);
free2D(radii_);
free2D(voidfractions_);
free2D(cellIDs_);
free2D(particleWeights_);
free2D(particleVolumes_);
dataExchangeM().destroy(positions_,3);
dataExchangeM().destroy(velocities_,3);
dataExchangeM().destroy(impForces_,3);
dataExchangeM().destroy(expForces_,3);
dataExchangeM().destroy(DEMForces_,3);
dataExchangeM().destroy(radii_,1);
dataExchangeM().destroy(voidfractions_,1);
dataExchangeM().destroy(cellIDs_,1);
dataExchangeM().destroy(particleWeights_,1);
dataExchangeM().destroy(particleVolumes_,1);
}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
inline void Foam::cfdemCloud::free2D(double** array)
{
if(array) free(array[0]);
free(array);
}
void Foam::cfdemCloud::getDEMdata()
{
dataExchangeM().getData("radius","scalar-atom",radii_);

View File

@ -162,8 +162,6 @@ protected:
autoPtr<liggghtsCommandModel>* liggghtsCommand_;
// Private member functions
inline void free2D(double**);
virtual void getDEMdata();
virtual void giveDEMdata();
@ -238,11 +236,11 @@ public:
inline double ** voidfractions() const;
inline void set_radii(double**&) const;
inline void get_radii(double**&) const;
inline double ** cellIDs() const;
inline void set_cellIDs(double**&) const;
inline void get_cellIDs(double**&) const;
inline double ** particleWeights() const;

View File

@ -89,9 +89,13 @@ inline double ** cfdemCloud::voidfractions() const
return voidfractions_;
}
inline void cfdemCloud::set_radii(double **& values) const
inline void cfdemCloud::get_radii(double **& values) const
{
radii_=values;
// Info << "set_radii level=" << numberOfParticles_ << endl;
// make a copy of the array entries
// for (int i=0;i<numberOfParticles_;i++)
// radii_[0][i]=values[0][i];
values=radii_;
}
inline double ** cfdemCloud::cellIDs() const
@ -99,9 +103,12 @@ inline double ** cfdemCloud::cellIDs() const
return cellIDs_;
}
inline void cfdemCloud::set_cellIDs(double **& values) const
inline void cfdemCloud::get_cellIDs(double **& values) const
{
cellIDs_=values;
// // make a copy of the array entries
// for (int i=0;i<numberOfParticles_;i++)
// cellIDs_[0][i]=values[0][i];
values=cellIDs_;
}
inline double ** cfdemCloud::particleWeights() const

View File

@ -32,6 +32,8 @@ Description
#include "error.H"
#include "mpi.h"
#include "clockModel.H"
#include <unistd.h>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,22 +58,22 @@ void Foam::clockModel::start(int pos,std::string ident) const
{
if(particleCloud_.mesh().time().value() > startTime_)
{
if (pos >= n_) // alternatively one fixed size?
{
n_ = 2*n_;
deltaT_.resize(n_,0);
identifier_.resize(n_,"");
nOfRuns_.resize(n_,0);
level_.resize(n_,-1);
parent_.resize(n_,-2);
}
identifier_[pos]=ident;
level_[pos] = curLev_;
curLev_ += 1;
parent_[pos]=curParent_;
curParent_ = pos;
nOfRuns_[pos] += 1;
deltaT_[pos]-=std::clock();
if (pos >= n_) // alternatively one fixed size?
{
n_ = 2*n_;
deltaT_.resize(n_,0);
identifier_.resize(n_,"");
nOfRuns_.resize(n_,0);
level_.resize(n_,-1);
parent_.resize(n_,-2);
}
identifier_[pos]=ident;
level_[pos] = curLev_;
curLev_ += 1;
parent_[pos]=curParent_;
curParent_ = pos;
nOfRuns_[pos] += 1;
deltaT_[pos]-=std::clock();
}
return;
}
@ -80,16 +82,16 @@ void Foam::clockModel::stop() const
{
if(particleCloud_.mesh().time().value() > startTime_)
{
deltaT_[curParent_]+=std::clock();
curLev_ -= 1;
if (curParent_ >= 0)
{
curParent_ = parent_[curParent_];
}
else
{
curParent_ = -1;
}
deltaT_[curParent_]+=std::clock();
curLev_ -= 1;
if (curParent_ >= 0)
{
curParent_ = parent_[curParent_];
}
else
{
curParent_ = -1;
}
}
return;
}
@ -98,20 +100,20 @@ void Foam::clockModel::stop(std::string ident) const
{
if(particleCloud_.mesh().time().value() > startTime_)
{
deltaT_[curParent_] += std::clock();
if (curParent_ > 0 && identifier_[curParent_].compare(ident)!=0)
{
Pout<<"Warning: stop identifier did not equal start identifier! "<<ident<<" & "<<identifier_[curParent_]<<nl;
}
curLev_ -= 1;
if (curParent_ >= 0)
{
curParent_ = parent_[curParent_];
}
else
{
curParent_ = -1;
}
deltaT_[curParent_] += std::clock();
if (curParent_ > 0 && identifier_[curParent_].compare(ident)!=0)
{
Pout<<"Warning: stop identifier did not equal start identifier! "<<ident<<" & "<<identifier_[curParent_]<<nl;
}
curLev_ -= 1;
if (curParent_ >= 0)
{
curParent_ = parent_[curParent_];
}
else
{
curParent_ = -1;
}
}
return;
}
@ -355,11 +357,13 @@ void Foam::clockModel::normHist() const
plotHist(buffIn,identifier_[26],numprocs,myrank);
Info << "===========================" << endl;
getRAMUsage();
return;
}
void Foam::clockModel::plotHist(double buffIn,std::string identifier,int numprocs,int myrank) const
{
/* // version using double*, problem: no alloc for double * and MPI
double* globalTime=NULL;
double* globalTime_all=NULL;
particleCloud_.dataExchangeM().allocateArray(globalTime,0.,numprocs);
@ -374,7 +378,24 @@ void Foam::clockModel::plotHist(double buffIn,std::string identifier,int numproc
Info << "\t" <<identifier << endl;
particleCloud_.dataExchangeM().destroy(globalTime);
particleCloud_.dataExchangeM().destroy(globalTime_all);
particleCloud_.dataExchangeM().destroy(globalTime_all);*/
double** globalTime=NULL;
double** globalTime_all=NULL;
particleCloud_.dataExchangeM().allocateArray(globalTime,0.,1,numprocs);
particleCloud_.dataExchangeM().allocateArray(globalTime_all,0.,1,numprocs);
globalTime[0][myrank]=buffIn;
MPI_Allreduce(globalTime[0], globalTime_all[0], numprocs, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
if(myrank==0)
for(int j=0;j<numprocs;j++)
printf("%4f ",globalTime_all[0][j]);
Info << "\t" <<identifier << endl;
particleCloud_.dataExchangeM().destroy(globalTime,1);
particleCloud_.dataExchangeM().destroy(globalTime_all,1);
}
void Foam::clockModel::Hist() const
@ -396,8 +417,73 @@ void Foam::clockModel::Hist() const
return;
}
void Foam::clockModel::getRAMUsage() const
{
int myrank=-10;
MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
int numprocs=-10;
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
pid_t myPID = getpid(); //get PID of running process
//Pout << myPID << "\n";
std::string fileName = "/proc/"; //build path to /proc/PID/smaps and open file
std::stringstream strs;
strs << myPID;
fileName.append(strs.str());
fileName.append("/smaps");
std::ifstream inFile;
inFile.open(fileName.data(),ios_base::in);
std::string line;
int RssMem = 0;
int SwapMem = 0;
int temp = 0;
strs.str("");
if (inFile.is_open()) //search in File smaps for Rss and Swap entries
{
while(inFile.good())
{
getline(inFile,line);
strs.str("");
if (line.substr(0,4).compare("Rss:") == 0)
{
strs << line;
strs >> line >> temp;
RssMem = RssMem + temp;
//Pout << temp << " ";
}
else if (line.substr(0,5).compare("Swap:") == 0)
{
strs << line;
strs >> line >> temp;
SwapMem = SwapMem + temp;
//Pout << strs.str() << " ";
}
}
}
double SwapMB = (double)SwapMem/1024.0; //kB -> MB
double RssMB = (double)RssMem/1024.0;
inFile.close();
// set up communication between Procs and plot Stuff
Info << " RAM USAGE HISTOGRAM in MB" << endl;
plotHist(RssMB,"RSS memory used",numprocs,myrank);
if (SwapMem > 0)
{
plotHist(SwapMB,"WARNING: Swap",numprocs,myrank);
}
Info << "===========================" << endl;
//Pout << "SWAP Memory used: " << SwapMem <<"MB\n";
//Pout << "Rss Memory used: " << RssMem <<"MB\n";
return;
}
// * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -130,8 +130,10 @@ public:
void initElems();
std::vector<int> calcShift() const; //detects empty indices in vector, when times are evaluated
void Hist() const; //calc Histogram
void normHist() const; //calc normalized Histogram
virtual void normHist() const; //calc normalized Histogram
void plotHist(double,std::string,int,int) const; //plot histogramm to terminal
void getRAMUsage() const;
};

View File

@ -72,7 +72,6 @@ noClock::~noClock()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -77,13 +77,14 @@ public:
// Member Functions
virtual void start(int pos) const {};
virtual void start(int pos,std::string identifier) const {};
virtual void stop() const {};
virtual void stop(std::string identifier) const {};
virtual std::string eval() const {return "";};
virtual void evalFile() const {};
virtual void evalPar() const {};
void start(int pos) const {};
void start(int pos,std::string identifier) const {};
void stop() const {};
void stop(std::string identifier) const {};
std::string eval() const {return "";};
void evalFile() const {};
void evalPar() const {};
void normHist() const {};
};

View File

@ -63,6 +63,10 @@ void Foam::dataExchangeModel::allocateArray
int length
) const
{
// this model should only be used for VTK (and File exchange model)
//if(particleCloud_.dataExchangeM().type() != "oneWayVTK")
// FatalError<< "dataExchangeModel::allocateArray should not be used with your dataExchangeModel" << abort(FatalError);
// allocate and init double array
array = new double*[length];
for (int i=0; i<length; i++)
@ -88,10 +92,13 @@ void Foam::dataExchangeModel::allocateArray
else FatalError<<"call allocateArray with length, nparticles or nbodies!\n" << abort(FatalError);
allocateArray(array,initVal,width,len);
}
void Foam::dataExchangeModel::destroy(double** array) const
void Foam::dataExchangeModel::destroy(double** array,int len) const
{
if (array == NULL) return;
delete [] array[0];
for ( int i = 0; i < len; i++ )
delete [] array[i];
delete [] array;
}
@ -105,6 +112,10 @@ void Foam::dataExchangeModel::allocateArray
int length
) const
{
// this model should only be used for VTK (and File exchange model)
//if(particleCloud_.dataExchangeM().type() != "oneWayVTK")
// FatalError<< "dataExchangeModel::allocateArray should not be used with your dataExchangeModel" << abort(FatalError);
// allocate and init double array
array = new int*[length];
for (int i=0; i<length; i++)
@ -130,10 +141,13 @@ void Foam::dataExchangeModel::allocateArray
else FatalError<<"call allocateArray with length, nparticles or nbodies!\n" << abort(FatalError);
allocateArray(array,initVal,width,len);
}
void Foam::dataExchangeModel::destroy(int** array) const
void Foam::dataExchangeModel::destroy(int** array,int len) const
{
if (array == NULL) return;
delete [] array[0];
for ( int i = 0; i < len; i++ )
delete [] array[i];
delete [] array;
}
//====
@ -147,6 +161,10 @@ void Foam::dataExchangeModel::allocateArray
int length
) const
{
// this model should only be used for VTK (and File exchange model)
//if(particleCloud_.dataExchangeM().type() != "oneWayVTK")
// FatalError<< "dataExchangeModel::allocateArray should not be used with your dataExchangeModel" << abort(FatalError);
// allocate and init int array
array = new int[length];
for (int i=0; i<length; i++)
@ -154,6 +172,7 @@ void Foam::dataExchangeModel::allocateArray
}
void Foam::dataExchangeModel::destroy(int* array) const
{
if (array == NULL) return;
delete [] array;
}
//====
@ -167,6 +186,10 @@ void Foam::dataExchangeModel::allocateArray
int length
) const
{
// this model should only be used for VTK (and File exchange model)
//if(particleCloud_.dataExchangeM().type() != "oneWayVTK")
// FatalError<< "dataExchangeModel::allocateArray should not be used with your dataExchangeModel" << abort(FatalError);
// allocate and init double array
array = new double[length];
for (int i=0; i<length; i++)
@ -174,6 +197,7 @@ void Foam::dataExchangeModel::allocateArray
}
void Foam::dataExchangeModel::destroy(double* array) const
{
if (array == NULL) return;
delete [] array;
}
//====

View File

@ -158,13 +158,13 @@ public:
// double **
virtual void allocateArray(double**&, double, int, int) const;
virtual void allocateArray(double**&, double, int, const char* ="nparticles") const;
virtual void destroy(double**) const;
virtual void destroy(double**,int) const;
//====
// int **
virtual void allocateArray(int**&, int, int, int) const;
virtual void allocateArray(int**&, int, int, const char* ="nparticles") const;
virtual void destroy(int**) const;
virtual void destroy(int**,int) const;
//====
//====

View File

@ -33,7 +33,6 @@ Description
#include "twoWayFiles.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam

View File

@ -162,7 +162,7 @@ twoWayM2M::~twoWayM2M()
delete[] id_foamLostAll;
destroy(tmpI_);
destroy(tmp_);
destroy(pos_lammps_);
destroy(pos_lammps_,3);
delete lmp2foam_;
delete lmp2foam_vec_;
delete foam2lmp_vec_;
@ -293,8 +293,9 @@ void Foam::twoWayM2M::allocateArray
for (int j = 0; j < width; j++)
array[i][j] = initVal;
}
void Foam::twoWayM2M::destroy(double** array) const
void Foam::twoWayM2M::destroy(double** array,int len) const
{
// destroy array[i] first?
lmp->memory->destroy(array);
}
//============
@ -328,8 +329,9 @@ void Foam::twoWayM2M::allocateArray
for (int j = 0; j < width; j++)
array[i][j] = initVal;
}
void Foam::twoWayM2M::destroy(int** array) const
void Foam::twoWayM2M::destroy(int** array,int len) const
{
// destroy array[i] first?
lmp->memory->destroy(array);
}
//============

View File

@ -182,12 +182,12 @@ public:
// double **
void allocateArray(double**&, double, int, int) const;
void allocateArray(double**&, double, int,const char* ="nparticles") const;
void destroy(double**) const;
void destroy(double**,int) const;
//============
// int **
void allocateArray(int**&, int, int, int) const;
void allocateArray(int**&, int, int,const char* ="nparticles") const;
void destroy(int**) const;
void destroy(int**,int) const;
//==============
//==============

View File

@ -198,10 +198,14 @@ void Foam::twoWayMPI::allocateArray
char* charLength= const_cast<char*> (length);
allocate_external_double(array, width,charLength,initVal,lmp);
}
void Foam::twoWayMPI::destroy(double** array) const
void Foam::twoWayMPI::destroy(double** array,int len) const
{
if (array == NULL) return;
free(array[0]);
//for ( int i = 0; i < len; i++ ) // does not work
for ( int i = 0; i < 1; i++ )
free(array[i]);
free(array);
}
//============
@ -230,10 +234,28 @@ void Foam::twoWayMPI::allocateArray
char* charLength= const_cast<char*> (length);
allocate_external_int(array, width,charLength,initVal,lmp);
}
void Foam::twoWayMPI::destroy(int** array) const
void Foam::twoWayMPI::destroy(int** array,int len) const
{
if (array == NULL) return;
//for ( int i = 0; i < len; i++ ) // does not work
for ( int i = 0; i < 1; i++ )
free(array[i]);
free(array);
}
//============
// int *
void Foam::twoWayMPI::destroy(int* array) const
{
if (array == NULL) return;
free(array);
}
//============
// double *
void Foam::twoWayMPI::destroy(double* array) const
{
if (array == NULL) return;
free(array[0]);
free(array);
}
//============

View File

@ -143,12 +143,18 @@ public:
// double **
void allocateArray(double**&, double, int, int) const;
void allocateArray(double**&, double, int,const char* ="nparticles") const;
void destroy(double**) const;
void destroy(double**,int) const;
//============
// int **
void allocateArray(int**&, int, int, int) const;
void allocateArray(int**&, int, int,const char* ="nparticles") const;
void destroy(int**) const;
void destroy(int**,int) const;
//==============
// double *
void destroy(double*) const;
//============
// int **
void destroy(int*) const;
//==============
bool couple() const;

View File

@ -94,7 +94,7 @@ voidFractionModel::voidFractionModel
voidFractionModel::~voidFractionModel()
{
particleCloud_.dataExchangeM().destroy(cellsPerParticle_);
particleCloud_.dataExchangeM().destroy(cellsPerParticle_,1);
}
// * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //

View File

@ -46,7 +46,7 @@ if [ $liggghtsSim == "true" ]
#- generate VTK data
cd $casePath/DEM/post
python -i $CFDEM_LPP_DIR/lpp.py dump.liggghts_init
python $CFDEM_LPP_DIR/lpp.py dump.liggghts_init
fi
@ -58,7 +58,7 @@ if [ $cfdemPostProc == "true" ]
headerText="run_cfdemPostproc_fillCylinder_CFD"
logfileName="log_$headerText"
solverName="cfdemPostproc"
debugMode="off" # on | off
debugMode="off" # on | off | strict
#--------------------------------------------------------------------------------#
#- clean up case
@ -90,7 +90,6 @@ rm -r $casePath/CFD/particles
rm -r $casePath/CFD/VTK
rm -r $casePath/DEM/post/*
rm -r $casePath/DEM/log.*
rm -r $casePath/log*
echo "done"
#- preserve post directory

View File

@ -23,7 +23,7 @@ startTime 0;
stopAt endTime;
endTime 0.1;//0.01;
endTime 0.1;//0.1;
deltaT 0.001;

View File

@ -107,6 +107,7 @@ rm -rf $casePath/CFD/patchAverage_pressureDrop
rm -rf $casePath/CFD/probes
rm -rf $casePath/CFD/particles
rm -r $casePath/CFD/log.*
rm -r $casePath/CFD/lagrangian
rm $casePath/log.liggghts
rm $casePath/DEM/liggghts.restartCFDEM*
rm $casePath/DEM/post/dump.*

View File

@ -29,12 +29,12 @@ liggghtsCommandModels
writeLiggghts
);
/*
//- optional
writeLiggghtsProps
{
writeLast on; // off is not recommended
overwrite on;
}*/
writeLast off;
overwrite off;
}
// ************************************************************************* //

View File

@ -29,7 +29,7 @@ deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.001;//0.01;
writeInterval 0.01;//0.01;
purgeWrite 0;

View File

@ -29,7 +29,7 @@ deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.001;//0.01;
writeInterval 0.01;//0.01;
purgeWrite 0;

View File

@ -29,7 +29,7 @@ deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.001;//0.01;
writeInterval 0.01;//0.01;
purgeWrite 0;

View File

@ -11,7 +11,8 @@ units si
processors 2 1 1
#read the restart file
read_restart ../DEM/liggghts.restartCFDEM
#read_restart ../DEM/liggghts.restartCFDEM
read_restart ../DEM/liggghts.restartCFDEM_0.050000
#do not do this here, the simulation box is in the restart file!
#region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box

View File

@ -27,3 +27,11 @@ dummyfile
dummyfile
dummyfile
dummyfile
dummyfile
dummyfile
dummyfile
dummyfile
dummyfile
dummyfile
dummyfile
dummyfile

View File

@ -32,7 +32,7 @@ couplingInterval 100;
voidFractionModel divided;//centre;//bigParticle;//
locateModel turboEngineM2M;//standard;
locateModel engine;//standard;
meshMotionModel noMeshMotion;
@ -40,7 +40,7 @@ regionModel allRegion;
IOModel basicIO; //trackIO; //
dataExchangeModel twoWayM2M;//twoWayMPI;//twoWayFiles;//oneWayVTK;//
dataExchangeModel twoWayMPI;//twoWayFiles;//oneWayVTK;//
averagingModel dense;//dilute;//
@ -123,11 +123,6 @@ twoWayMPIProps
liggghtsPath "../DEM/in.liggghts_init";
}
twoWayM2MProps
{
liggghtsPath "../DEM/in.liggghts_init";
}
twoWayFilesProps
{
maxNumberOfParticles 10000;
@ -152,11 +147,9 @@ bigParticleProps
scaleUpVol 1.0;
}
turboEngineM2MProps
engineProps
{
turboEngineProps
{
treeSearch true;
}
}
// ************************************************************************* //