diff --git a/README b/README new file mode 100644 index 00000000..a677e0a8 --- /dev/null +++ b/README @@ -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. +\*---------------------------------------------------------------------------*/ diff --git a/doc/CFDEMcoupling_Manual.pdf b/doc/CFDEMcoupling_Manual.pdf index ffc8bcef..81a55d31 100644 Binary files a/doc/CFDEMcoupling_Manual.pdf and b/doc/CFDEMcoupling_Manual.pdf differ diff --git a/doc/githubAccess_public.pdf b/doc/githubAccess_public.pdf index a7ede5a3..74778a77 100644 Binary files a/doc/githubAccess_public.pdf and b/doc/githubAccess_public.pdf differ diff --git a/doc/locateModel_engineSearch.html b/doc/locateModel_engineSearch.html index fd286783..c68e36f2 100644 --- a/doc/locateModel_engineSearch.html +++ b/doc/locateModel_engineSearch.html @@ -28,7 +28,7 @@ engineProps
locateModel engine;
engineProps
{
- treeSearch false;
+ treeSearch true;
}
Description: @@ -36,9 +36,9 @@ engineProps
The locateModel "engine" locates the CFD cell and cellID corresponding to a given position. The engineSearch locate Model can be used with different settings to use different algorithms:
-locateModel turboEngine;
turboEngineProps
{
- treeSearch false;
+ treeSearch true;
}
Description: @@ -37,10 +37,9 @@ turboEngineProps
The turboEngineSearch locate Model can be used with different settings to use different algorithms:
-Restrictions: none.
diff --git a/doc/locateModel_turboEngineSearch.txt b/doc/locateModel_turboEngineSearch.txt
index 0689ca6c..6e79ead4 100644
--- a/doc/locateModel_turboEngineSearch.txt
+++ b/doc/locateModel_turboEngineSearch.txt
@@ -25,7 +25,7 @@ turboEngineProps
locateModel turboEngine;
turboEngineProps
\{
- treeSearch false;
+ treeSearch true;
\} :pre
[Description:]
@@ -34,8 +34,8 @@ The locateModel "turboEngine" locates the CFD cell and cellID corresponding to a
The turboEngineSearch locate Model can be used with different settings to use different algorithms:
-faceDecomp false; treeSearch false; will execute some geometric (linear) search using the last known cellID (recommended) :ulb,l
-faceDecomp false; treeSearch true; will use a recursive tree structure to find the cell. :l
+faceDecomp false; treeSearch false; will execute some geometric (linear) search using the last known cellID :ulb,l
+faceDecomp false; treeSearch true; will use a recursive tree structure to find the cell. (recommended):l
:ule
[Restrictions:] none.
diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files
index d1578924..e2411291 100644
--- a/src/lagrangian/cfdemParticle/Make/files
+++ b/src/lagrangian/cfdemParticle/Make/files
@@ -20,18 +20,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 +57,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,20 +76,22 @@ $(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
+$(regionModels)/differentialRegion/differentialRegion.C
$(dataExchangeModels)/dataExchangeModel/dataExchangeModel.C
$(dataExchangeModels)/dataExchangeModel/newDataExchangeModel.C
diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/irregular.o b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/irregular.o
index 590607a5..7f77b22c 100644
Binary files a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/irregular.o and b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/irregular.o differ
diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/libcouple.a b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/libcouple.a
index b9aa4517..d87f0f65 100644
Binary files a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/libcouple.a and b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library/libcouple.a differ
diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.C
index 1102ad66..a1602e1c 100644
--- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.C
+++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.C
@@ -148,7 +148,9 @@ twoWayM2M::~twoWayM2M()
delete[] lost_pos_;
delete[] cellID_foam_;
delete[] pos_foam_;
- //delete[] lmp2foam_;
+ delete lmp2foam_;
+ delete lmp2foam_vec_;
+ delete foam2lmp_vec_;
//delete lmp;
}
@@ -247,7 +249,7 @@ void Foam::twoWayM2M::allocateArray
) const
{
//if(length==-1) then LIGGGHTS uses own length data
- allocate_external_double(array, width,length,initVal,lmp);
+ allocate_external_double(array, width,max(length,1),initVal,lmp);
}
void Foam::twoWayM2M::allocateArray
@@ -272,7 +274,7 @@ void Foam::twoWayM2M::allocateArray
) const
{
//if(length==-1) then LIGGGHTS uses own length data
- allocate_external_int(array, width,length,initVal,lmp);
+ allocate_external_int(array, width,max(length,1),initVal,lmp);
}
void Foam::twoWayM2M::allocateArray
@@ -352,19 +354,22 @@ int Foam::twoWayM2M::getNumberOfClumps() const
void Foam::twoWayM2M::syncIDs() const
{
+ // if I do not creat new communicators it fails at liggghts porcessor transfer!
+ // this should probably not be done that often!!!
+ delete lmp2foam_;
+ delete lmp2foam_vec_;
+ delete foam2lmp_vec_;
+ lmp2foam_ = new Many2Many(MPI_COMM_WORLD);
+ lmp2foam_vec_ = new Many2Many(MPI_COMM_WORLD);
+ foam2lmp_vec_ = new Many2Many(MPI_COMM_WORLD);
+ //?=======
+
//MPI_Barrier(MPI_COMM_WORLD);
- //Pout << "== syncIDs " << endl;
+ //Pout << couplingStep_ << "st == syncIDs " << endl;
particleCloud_.clockM().start(5,"recv_DEM_ids");
// get data from lammps
- int nlocal_lammps_old=nlocal_lammps_;
nlocal_lammps_ = *((int *) lammps_extract_global(lmp,"nlocal"));
-
- // weak form to detect lmp proc change - this will cause problems!!!
- //bool comRun=false;
- //if(nlocal_lammps_old != nlocal_lammps_) comRun=true;
- //MPI_Allreduce(&comRun, &firstRun_, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
-
int* id_lammps_sync;
double** pos_lammps_sync;
if(firstRun_) // do not forget iterator !
@@ -379,18 +384,12 @@ void Foam::twoWayM2M::syncIDs() const
id_lammps_vec_[i*3+j] = id_lammps_[i]*3+j;
Foam::dataExchangeModel::allocateArray(pos_lammps_,-1.,3,nlocal_lammps_); // do I need this???
- pos_lammps_ = (double **) lammps_extract_atom(lmp,"x");
-
- //for (int i = 0; i < nlocal_lammps_; i++){
- // vector pp;
- // for (int j = 0; j < 3; j++) pp[j]=pos_lammps_[i][j];
- // Pout << "pp=" << pp << endl;
- //}
-
- }else
+ pos_lammps_ = (double **) lammps_extract_atom(lmp,"x");
+ }
+ else
{
// re-arrange data using map
- Foam::dataExchangeModel::allocateArray(id_lammps_sync,-1.,nlocal_lammps_);
+ Foam::dataExchangeModel::allocateArray(id_lammps_sync,-1.,nlocal_lammps_); // probably not necessary
id_lammps_sync = (int *) lammps_extract_atom(lmp,"id");
delete [] id_lammps_vec_;
@@ -404,10 +403,10 @@ void Foam::twoWayM2M::syncIDs() const
lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammps_vec_,nlocal_foam_*3,id_foam_vec_);
foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammps_vec_);
+ // map data according to last TS
Foam::dataExchangeModel::allocateArray(id_lammps_,-1,nlocal_foam_); // probably not necessary
lmp2foam_->exchange(id_lammps_sync, id_lammps_);
-
Foam::dataExchangeModel::allocateArray(pos_lammps_sync,-1.,3,nlocal_lammps_); // probably not necessary
pos_lammps_sync = (double **) lammps_extract_atom(lmp,"x");
@@ -417,66 +416,14 @@ void Foam::twoWayM2M::syncIDs() const
Foam::dataExchangeModel::allocateArray(pos_lammps_,-1.,3,nlocal_foam_);
lmp2foam_vec_->exchange(&(pos_lammps_sync[0][0]), &(gugu[0][0]));
- // try the same with getData
- //double** gugu;
- //Foam::dataExchangeModel::allocateArray(gugu,-1.,3,nlocal_foam_);
- //Foam::dataExchangeModel::allocateArray(pos_lammps_,-1.,3,nlocal_foam_);
- //getData("x","vector-atom",gugu,1);
-
// conversion of array (should not be necessary if above problem is solved)
for (int i = 0; i < nlocal_foam_; i++)
for (int j = 0; j < 3; j++)
pos_lammps_[i][j]=gugu[0][i*3+j];
- /*// test communication - works!!!
- int* llv;
- int* ovv;
- Many2Many* l2f = new Many2Many(MPI_COMM_WORLD);
- double** gaga;
- if(Pstream::myProcNo()==0)
- {
- Foam::dataExchangeModel::allocateArray(llv,0,6);
- Foam::dataExchangeModel::allocateArray(ovv,0,1);
- for(int i=0;i<6;i++)
- llv[i]=i+1;
- ovv[0]=-1;
- l2f->setup(6,llv,0,ovv);
- l2f->exchange(&(pos_lammps_sync[0][0]), &(gaga[0][0]));
- }else{
- Foam::dataExchangeModel::allocateArray(llv,0,1);
- Foam::dataExchangeModel::allocateArray(ovv,0,6);
- for(int i=0;i<6;i++)
- ovv[i]=i+1;
- llv[0]=-1;
- l2f->setup(0,llv,6,ovv);
-
- double** gugu;
- Foam::dataExchangeModel::allocateArray(gaga,-1.,3,2);
- Foam::dataExchangeModel::allocateArray(gugu,-1.,3,2);
- l2f->exchange(&(pos_lammps_sync[0][0]), &(gugu[0][0]));
-
- // this does not work! -conversion needed!
- //for (int i = 0; i < 2; i++)
- // Pout << "getDataXX: " << "v" <<"=" << gugu[i][0]<<","<< gugu[i][1]<<","<< gugu[i][2]<