From ced34627eb67de55d64dd03c7d214fc55fba5ecc Mon Sep 17 00:00:00 2001 From: cfdem Date: Thu, 10 Jan 2013 09:16:04 +0100 Subject: [PATCH] release on 2013-01-10_09-16-04 --- README | 82 ----------- doc/CFDEMcoupling_Manual.pdf | Bin 515794 -> 515794 bytes doc/githubAccess_public.pdf | Bin 362471 -> 362471 bytes src/lagrangian/cfdemParticle/Make/files | 24 +++- .../cfdemParticle/cfdTools/versionInfo.H | 4 +- .../dataExchangeModel/twoWayM2M/twoWayM2M.C | 136 ++++++++++-------- .../dataExchangeModel/twoWayM2M/twoWayM2M.H | 2 +- .../CFD/constant/liggghtsCommands | 4 +- .../CFD/constant/couplingProperties | 16 ++- 9 files changed, 113 insertions(+), 155 deletions(-) delete mode 100644 README diff --git a/README b/README deleted file mode 100644 index a677e0a8..00000000 --- a/README +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - 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 b54d84891add82a0e5d794e92f4324010183825d..8974fc41f2a20b7835db7e3c5f55a39502896192 100644 GIT binary patch delta 137 zcmcb#SN_so`3W5yh6V+ad>jb9O3Cyh%SXw8rwoYK%I)VMk-8hS66LTX& zV~ZrS#AFlG#I&U36!TQ$G*dGp^E5M4!(=-ff+}L|?6`_c5{pVIic-_KOe`%8%?!9y JRbBnvxB#W>D;NL( diff --git a/doc/githubAccess_public.pdf b/doc/githubAccess_public.pdf index 04ef4b3fbad9d9bf24a381c5ff1529295d51c6b4..00d397ac149b0a1bd036f3284e4e191630a577bb 100644 GIT binary patch delta 108 zcmaFfFZR4&Y(fWzp@D&=p_zeE2KPGH$Of%RvbQ(9u0Wr~rxg^6L3 gfuW(XQCcbx8>AST7?>v-0tM}C2&tHUx}8-90JFX!x&QzG delta 108 zcmaFfFZR4&Y(fWzfu*4d5STYkXq~{=I)SNm0(0vGmaP+5f3`U#nHVRVCnp;l8Cxcq hSr{joBpR8eB_*brBpF*+n3memory->destroy(tmpI_); lmp->memory->destroy(tmp_); delete lmp2foam_; @@ -194,17 +187,30 @@ void twoWayM2M::getData char* charName = wordToChar(name); if ( type == "vector-atom" && name != "x") { - double **tata_ = (double **) lammps_extract_atom(lmp,charName); - lmp2foam_vec_->exchange(&(tata_[0][0]), &(field[0][0])); - }else if (name != "x"){ - //tmp_ = (double *) lammps_extract_atom(lmp,charName); // funct nicht? + double **tmp_ = (double **) lammps_extract_atom(lmp,charName); + //for (int i = 0; i < nlocal_lammps_; i++) + // for(int j=0;j<3; j++) + // Pout << couplingStep_ << "st tmp_[" << i << "][j]=" << tmp_[i][j] << " - name="<< name <exchange(tmp_ ? tmp_[0] : NULL, field[0]); + + //for (int i = 0; i < nlocal_foam_; i++) + // for(int j=0;j<3; j++) + // Pout << couplingStep_ << "st field[" << i << "][j]=" << field[i][j] << " - name="<< name <0) - // for (int i = 0; i < nlocal_lammps_; i++) - // Pout << couplingStep_ << "st tmp_[" << i << "]=" << tmp_[i] << " - "<exchange(tmp_, &(field[0][0])); + //for (int i = 0; i < nlocal_lammps_; i++) + // Pout << couplingStep_ << "st tmp_[" << i << "]=" << tmp_[i] << " - name=" << name <exchange(tmp_, field[0]); + + //for (int i = 0; i < nlocal_foam_; i++) + // Pout << couplingStep_ << "st field[0][" << i << "]=" << field[0][i] << " - name=" << name <modify->find_fix_property(charName,"property/atom","vector",0,0,"cfd coupling",false); if(fix) - tata_ = (double **) static_cast(fix)->array_atom; + tmp_ = (double **) static_cast(fix)->array_atom; else Warning << "coupling fix not found!"<exchange(&(field[0][0]),&(tata_[0][0])); + foam2lmp_vec_->exchange(field[0],tmp_ ? tmp_[0] : NULL); //================== //for(int index = 0;index < nlocal_lammps_; ++index){ @@ -416,53 +422,61 @@ void Foam::twoWayM2M::syncIDs() const // get data from lammps nlocal_lammps_ = *((int *) lammps_extract_global(lmp,"nlocal")); - int* id_lammps_sync=NULL; - double** pos_lammps_sync=NULL; + int* id_lammpsSync=NULL; + double** pos_lammpsSync=NULL; if(firstRun_) { - // make a copy of id array - allocateArray(id_lammps_,0,nlocal_lammps_); - memcpy(id_lammps_, (int *) lammps_extract_atom(lmp,"id"), nlocal_lammps_*sizeof(int)); + // get access to id array + id_lammps_ = (int *) lammps_extract_atom(lmp,"id"); - allocateArray(id_lammps_vec_,0,nlocal_lammps_*3); + // genereate vector IDs + allocateArray(id_lammpsVec_,0,nlocal_lammps_*3); for (int i = 0; i < nlocal_lammps_; i++) for (int j=0;j<3;j++) - id_lammps_vec_[i*3+j] = id_lammps_[i]*3+j; + id_lammpsVec_[i*3+j] = id_lammps_[i]*3+j; - pos_lammps_ = (double **) lammps_extract_atom(lmp,"x"); + // get access to "x" + pos_lammps_ = (double **) lammps_extract_atom(lmp,"x"); } else { // re-arrange data using map // get access to id array - id_lammps_sync = (int *) lammps_extract_atom(lmp,"id"); + id_lammpsSync = (int *) lammps_extract_atom(lmp,"id"); // genereate vector IDs - allocateArray(id_lammps_vec_,0,nlocal_lammps_*3); + allocateArray(id_lammpsVec_,0,nlocal_lammps_*3); for (int i = 0; i < nlocal_lammps_; i++) for (int j=0;j<3;j++) - id_lammps_vec_[i*3+j] = id_lammps_sync[i]*3+j; + id_lammpsVec_[i*3+j] = id_lammpsSync[i]*3+j; // make setup of m2m - lmp2foam_->setup(nlocal_lammps_,id_lammps_sync,nlocal_foam_,id_foam_); - 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_); + lmp2foam_->setup(nlocal_lammps_,id_lammpsSync,nlocal_foam_,id_foam_); + lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foam_vec_); + foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammpsVec_); // map data according to last TS + id_lammps_=NULL; allocateArray(id_lammps_,-1.,nlocal_foam_); allocateArray(tmpI_,-1.,nlocal_foam_); - lmp2foam_->exchange(id_lammps_sync, tmpI_); + lmp2foam_->exchange(id_lammpsSync, tmpI_); for(int i=0;iexchange(pos_lammps_sync[0], tmp_); + lmp2foam_vec_->exchange(pos_lammpsSync ? pos_lammpsSync[0] : NULL, tmp_); + + pos_lammps_ = NULL; // points to lig data before + allocateArray(pos_lammps_,0,3,nlocal_foam_); for(int i=0;i0) - for (int i = 0; i < nlocal_foam_; i++) - Pout << couplingStep_ << "st pos:" <<"=" << pos_lammps_[i][0]<<","<setup(nlocal_lammps_,id_lammps_,nlocal_foam_,id_foam_); - 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_); + lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foam_vec_); + foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammpsVec_); }else { - lmp2foam_->setup(nlocal_lammps_,id_lammps_sync,nlocal_foam_,id_foam_); - 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_); + lmp2foam_->setup(nlocal_lammps_,id_lammpsSync,nlocal_foam_,id_foam_); + lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foam_vec_); + foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammpsVec_); } particleCloud_.clockM().stop("setup_Comm"); } @@ -719,23 +730,28 @@ void Foam::twoWayM2M::locateParticle() const particleCloud_.clockM().start(9,"locate_Stage3"); // check if all-to-all is necessary - int nlocal_foam_lost_all; - MPI_Allreduce(&nlocal_foam_lost_, &nlocal_foam_lost_all, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + int nlocal_foam_lostAll; + MPI_Allreduce(&nlocal_foam_lost_, &nlocal_foam_lostAll, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - if (nlocal_foam_lost_all > 0) + if (nlocal_foam_lostAll > 0) { - Info << "all-to-all necessary: nlocal_foam_lost_all=" << nlocal_foam_lost_all << endl; + Info << "all-to-all necessary: nlocal_foam_lostAll=" << nlocal_foam_lostAll << endl; if(lost_pos_all) { delete[] lost_pos_all; lost_pos_all = NULL; } - int nlocal_foam_lost_all = LAMMPS_NS::MPI_Allgather_Vector(lost_pos_, nlocal_foam_lost_*3, lost_pos_all, MPI_COMM_WORLD)/3; // new[] für lost_pos_all!!! + if(id_foam_lost_all) + { + delete[] id_foam_lost_all; + id_foam_lost_all = NULL; + } + int nlocal_foam_lostAll = LAMMPS_NS::MPI_Allgather_Vector(lost_pos_, nlocal_foam_lost_*3, lost_pos_all, MPI_COMM_WORLD)/3; // new[] für lost_pos_all!!! LAMMPS_NS::MPI_Allgather_Vector(id_foam_lost_, nlocal_foam_lost_, id_foam_lost_all, MPI_COMM_WORLD); - //Info << couplingStep_ << "st nlocal_foam_lost_all=" << nlocal_foam_lost_all << endl; + //Info << couplingStep_ << "st nlocal_foam_lostAll=" << nlocal_foam_lostAll << endl; // locate lost particles - for (int i = 0; i < nlocal_foam_lost_all; i++) + for (int i = 0; i < nlocal_foam_lostAll; i++) { pos = vector(lost_pos_all[i*3+0],lost_pos_all[i*3+1],lost_pos_all[i*3+2]); //Pout << "stage3 look for particle at pos=" << pos << endl; @@ -767,11 +783,11 @@ void Foam::twoWayM2M::locateParticle() const /* // check if really all particles were found particleCloud_.clockM().start(10,"locate_Stage3"); - Foam::dataExchangeModel::allocateArray(id_foam_nowhere_all,1,nlocal_foam_lost_all); - MPI_Allreduce(id_foam_lost_all, id_foam_nowhere_all, nlocal_foam_lost_all, MPI_INT, MPI_MIN, MPI_COMM_WORLD); + Foam::dataExchangeModel::allocateArray(id_foam_nowhere_all,1,nlocal_foam_lostAll); + MPI_Allreduce(id_foam_lost_all, id_foam_nowhere_all, nlocal_foam_lostAll, MPI_INT, MPI_MIN, MPI_COMM_WORLD); int i=0; - while (i < nlocal_foam_lost_all) + while (i < nlocal_foam_lostAll) { // these particles where found nowhere if (id_foam_nowhere_all[i] > 0) @@ -786,7 +802,7 @@ void Foam::twoWayM2M::locateParticle() const // re-arrange IDs for vectors for (int k=0;k<3;k++) { - id_lammps_vec_[j*3+k] = id_lammps_vec_[nlocal_lammps_*3+k]; + id_lammpsVec_[j*3+k] = id_lammpsVec_[nlocal_lammps_*3+k]; } nlocal_lammps_ -= 1; diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H index a27f8f91..aab1d961 100644 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H @@ -96,7 +96,7 @@ private: mutable int nlocal_lammps_; mutable int *id_lammps_; //mutable int *id_lammpsComm_; - mutable int *id_lammps_vec_; + mutable int *id_lammpsVec_; mutable int nlocal_foam_; mutable int *id_foam_; mutable int *id_foam_vec_; diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands index 6c14add5..4ecd5aa5 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands @@ -29,7 +29,7 @@ liggghtsCommandModels ); // ************************************************************************* // -runLiggghtsProps +/*runLiggghtsProps { preNo false; -} +}*/ diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties index 0003f94e..8b929d6a 100755 --- a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties +++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties @@ -32,7 +32,7 @@ couplingInterval 100; voidFractionModel divided;//centre;//bigParticle;// -locateModel standard; +locateModel turboEngineM2M;//standard; meshMotionModel noMeshMotion; @@ -40,7 +40,7 @@ regionModel allRegion; IOModel basicIO; //trackIO; // -dataExchangeModel twoWayMPI;//twoWayFiles;//oneWayVTK;// +dataExchangeModel twoWayM2M;//twoWayMPI;//twoWayFiles;//oneWayVTK;// averagingModel dense;//dilute;// @@ -123,6 +123,11 @@ twoWayMPIProps liggghtsPath "../DEM/in.liggghts_init"; } +twoWayM2MProps +{ + liggghtsPath "../DEM/in.liggghts_init"; +} + twoWayFilesProps { maxNumberOfParticles 10000; @@ -147,4 +152,11 @@ bigParticleProps scaleUpVol 1.0; } +turboEngineM2MProps +{ + turboEngineProps + { + treeSearch true; + } +} // ************************************************************************* //