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 count=0;
int DEM_dump_Interval=1000; int DEM_dump_Interval=1000;
particleCloud.reAllocArrays();
double **positions_; double **positions_;
double **velocities_; double **velocities_;
@ -73,11 +74,14 @@ int main(int argc, char *argv[])
particleCloud.dataExchangeM().allocateArray(positions_,0.,3); particleCloud.dataExchangeM().allocateArray(positions_,0.,3);
particleCloud.dataExchangeM().allocateArray(velocities_,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(voidfractions_,0.,1);
particleCloud.dataExchangeM().allocateArray(particleWeights_,0.,1); particleCloud.dataExchangeM().allocateArray(particleWeights_,0.,1);
particleCloud.dataExchangeM().allocateArray(particleVolumes_,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()) while (runTime.loop())
{ {
@ -97,12 +101,8 @@ int main(int argc, char *argv[])
particleCloud.dataExchangeM().getData("v","vector-atom",velocities_,count); particleCloud.dataExchangeM().getData("v","vector-atom",velocities_,count);
particleCloud.dataExchangeM().getData("radius","scalar-atom",radii_,count); particleCloud.dataExchangeM().getData("radius","scalar-atom",radii_,count);
particleCloud.set_radii(radii_);
particleCloud.locateM().findCell(NULL,positions_,cellIDs_,particleCloud.numberOfParticles()); particleCloud.locateM().findCell(NULL,positions_,cellIDs_,particleCloud.numberOfParticles());
particleCloud.set_cellIDs(cellIDs_);
particleCloud.voidFractionM().setvoidFraction particleCloud.voidFractionM().setvoidFraction
( (
NULL,voidfractions_,particleWeights_,particleVolumes_ NULL,voidfractions_,particleWeights_,particleVolumes_
@ -128,13 +128,13 @@ int main(int argc, char *argv[])
} }
delete positions_; particleCloud.dataExchangeM().destroy(positions_,3);
delete velocities_; particleCloud.dataExchangeM().destroy(velocities_,3);
delete radii_; //particleCloud.dataExchangeM().destroy(radii_); // destroyed in cloud
delete voidfractions_; particleCloud.dataExchangeM().destroy(voidfractions_,1);
delete particleWeights_; particleCloud.dataExchangeM().destroy(particleWeights_,1);
delete particleVolumes_; particleCloud.dataExchangeM().destroy(particleVolumes_,1);
delete cellIDs_; //particleCloud.dataExchangeM().destroy(cellIDs_); // destroyed in cloud
Info<< "End\n" << endl; 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; overwrite switch2;
} }
</PRE> </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" <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; overwrite switch2;
\} :pre \} :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 {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 {switch2} = switch (choose on/off) to select if only one restart file $name or many files $name_$timeStamp are written :l
:ule :ule

View File

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

View File

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

View File

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

View File

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

View File

@ -89,9 +89,13 @@ inline double ** cfdemCloud::voidfractions() const
return voidfractions_; 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 inline double ** cfdemCloud::cellIDs() const
@ -99,9 +103,12 @@ inline double ** cfdemCloud::cellIDs() const
return cellIDs_; 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 inline double ** cfdemCloud::particleWeights() const

View File

@ -32,6 +32,8 @@ Description
#include "error.H" #include "error.H"
#include "mpi.h" #include "mpi.h"
#include "clockModel.H" #include "clockModel.H"
#include <unistd.h>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -355,11 +357,13 @@ void Foam::clockModel::normHist() const
plotHist(buffIn,identifier_[26],numprocs,myrank); plotHist(buffIn,identifier_[26],numprocs,myrank);
Info << "===========================" << endl; Info << "===========================" << endl;
getRAMUsage();
return; return;
} }
void Foam::clockModel::plotHist(double buffIn,std::string identifier,int numprocs,int myrank) const 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=NULL;
double* globalTime_all=NULL; double* globalTime_all=NULL;
particleCloud_.dataExchangeM().allocateArray(globalTime,0.,numprocs); 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; Info << "\t" <<identifier << endl;
particleCloud_.dataExchangeM().destroy(globalTime); 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 void Foam::clockModel::Hist() const
@ -396,8 +417,73 @@ void Foam::clockModel::Hist() const
return; 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 * * * * * * * * * * * * // // * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

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

View File

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

View File

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

View File

@ -63,6 +63,10 @@ void Foam::dataExchangeModel::allocateArray
int length int length
) const ) 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 // allocate and init double array
array = new double*[length]; array = new double*[length];
for (int i=0; i<length; i++) 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); else FatalError<<"call allocateArray with length, nparticles or nbodies!\n" << abort(FatalError);
allocateArray(array,initVal,width,len); 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; if (array == NULL) return;
delete [] array[0];
for ( int i = 0; i < len; i++ )
delete [] array[i];
delete [] array; delete [] array;
} }
@ -105,6 +112,10 @@ void Foam::dataExchangeModel::allocateArray
int length int length
) const ) 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 // allocate and init double array
array = new int*[length]; array = new int*[length];
for (int i=0; i<length; i++) 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); else FatalError<<"call allocateArray with length, nparticles or nbodies!\n" << abort(FatalError);
allocateArray(array,initVal,width,len); 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; if (array == NULL) return;
delete [] array[0];
for ( int i = 0; i < len; i++ )
delete [] array[i];
delete [] array; delete [] array;
} }
//==== //====
@ -147,6 +161,10 @@ void Foam::dataExchangeModel::allocateArray
int length int length
) const ) 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 // allocate and init int array
array = new int[length]; array = new int[length];
for (int i=0; i<length; i++) for (int i=0; i<length; i++)
@ -154,6 +172,7 @@ void Foam::dataExchangeModel::allocateArray
} }
void Foam::dataExchangeModel::destroy(int* array) const void Foam::dataExchangeModel::destroy(int* array) const
{ {
if (array == NULL) return;
delete [] array; delete [] array;
} }
//==== //====
@ -167,6 +186,10 @@ void Foam::dataExchangeModel::allocateArray
int length int length
) const ) 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 // allocate and init double array
array = new double[length]; array = new double[length];
for (int i=0; i<length; i++) for (int i=0; i<length; i++)
@ -174,6 +197,7 @@ void Foam::dataExchangeModel::allocateArray
} }
void Foam::dataExchangeModel::destroy(double* array) const void Foam::dataExchangeModel::destroy(double* array) const
{ {
if (array == NULL) return;
delete [] array; delete [] array;
} }
//==== //====

View File

@ -158,13 +158,13 @@ public:
// double ** // double **
virtual void allocateArray(double**&, double, int, int) const; virtual void allocateArray(double**&, double, int, int) const;
virtual void allocateArray(double**&, double, int, const char* ="nparticles") const; virtual void allocateArray(double**&, double, int, const char* ="nparticles") const;
virtual void destroy(double**) const; virtual void destroy(double**,int) const;
//==== //====
// int ** // int **
virtual void allocateArray(int**&, int, int, int) const; virtual void allocateArray(int**&, int, int, int) const;
virtual void allocateArray(int**&, int, int, const char* ="nparticles") 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 "twoWayFiles.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam

View File

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

View File

@ -182,12 +182,12 @@ public:
// double ** // double **
void allocateArray(double**&, double, int, int) const; void allocateArray(double**&, double, int, int) const;
void allocateArray(double**&, double, int,const char* ="nparticles") const; void allocateArray(double**&, double, int,const char* ="nparticles") const;
void destroy(double**) const; void destroy(double**,int) const;
//============ //============
// int ** // int **
void allocateArray(int**&, int, int, int) const; void allocateArray(int**&, int, int, int) const;
void allocateArray(int**&, int, int,const char* ="nparticles") 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); char* charLength= const_cast<char*> (length);
allocate_external_double(array, width,charLength,initVal,lmp); 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; 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); free(array);
} }
//============ //============
@ -230,10 +234,28 @@ void Foam::twoWayMPI::allocateArray
char* charLength= const_cast<char*> (length); char* charLength= const_cast<char*> (length);
allocate_external_int(array, width,charLength,initVal,lmp); 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; if (array == NULL) return;
free(array[0]);
free(array); free(array);
} }
//============ //============

View File

@ -143,12 +143,18 @@ public:
// double ** // double **
void allocateArray(double**&, double, int, int) const; void allocateArray(double**&, double, int, int) const;
void allocateArray(double**&, double, int,const char* ="nparticles") const; void allocateArray(double**&, double, int,const char* ="nparticles") const;
void destroy(double**) const; void destroy(double**,int) const;
//============ //============
// int ** // int **
void allocateArray(int**&, int, int, int) const; void allocateArray(int**&, int, int, int) const;
void allocateArray(int**&, int, int,const char* ="nparticles") 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; bool couple() const;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,7 +11,8 @@ units si
processors 2 1 1 processors 2 1 1
#read the restart file #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! #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 #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
dummyfile
dummyfile
dummyfile

View File

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