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/applications/utilities/cfdemPostproc/cfdemPostproc.C b/applications/utilities/cfdemPostproc/cfdemPostproc.C index 04400a96..52dc61c5 100644 --- a/applications/utilities/cfdemPostproc/cfdemPostproc.C +++ b/applications/utilities/cfdemPostproc/cfdemPostproc.C @@ -38,9 +38,10 @@ Description #include "cfdemCloud.H" #include "dataExchangeModel.H" #include "voidFractionModel.H" -#include "regionModel.H" #include "locateModel.H" #include "averagingModel.H" +#include "momCoupleModel.H" +#include "forceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -83,9 +84,12 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; count+=DEM_dump_Interval;// proceed loading new data - - - particleCloud.regionM().resetVolFields(Us); + particleCloud.averagingM().resetVectorAverage(particleCloud.averagingM().UsPrev(),particleCloud.averagingM().UsNext()); + particleCloud.voidFractionM().resetVoidFractions(); + particleCloud.averagingM().resetVectorAverage(particleCloud.forceM(0).impParticleForces(),particleCloud.forceM(0).impParticleForces(),true); + particleCloud.averagingM().resetVectorAverage(particleCloud.forceM(0).expParticleForces(),particleCloud.forceM(0).expParticleForces(),true); + particleCloud.averagingM().resetWeightFields(); + particleCloud.momCoupleM(0).resetMomSourceField(); particleCloud.dataExchangeM().couple(); @@ -95,13 +99,13 @@ int main(int argc, char *argv[]) particleCloud.set_radii(radii_); - particleCloud.locateM().findCell(particleCloud.regionM().inRegion(),positions_,cellIDs_,particleCloud.numberOfParticles()); + particleCloud.locateM().findCell(NULL,positions_,cellIDs_,particleCloud.numberOfParticles()); particleCloud.set_cellIDs(cellIDs_); particleCloud.voidFractionM().setvoidFraction ( - particleCloud.regionM().inRegion(),voidfractions_,particleWeights_,particleVolumes_ + NULL,voidfractions_,particleWeights_,particleVolumes_ ); voidfraction.internalField() = particleCloud.voidFractionM().voidFractionInterp(); @@ -113,7 +117,7 @@ int main(int argc, char *argv[]) velocities_, particleWeights_, particleCloud.averagingM().UsWeightField(), - particleCloud.regionM().inRegion() + NULL ); runTime.write(); diff --git a/doc/CFDEMcoupling_Manual.pdf b/doc/CFDEMcoupling_Manual.pdf index 06dd414a..4a9b335b 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 9f28fbe5..b0d05d10 100644 Binary files a/doc/githubAccess_public.pdf and b/doc/githubAccess_public.pdf differ diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index d1578924..c939c8b0 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -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 diff --git a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H index 57ad0d8a..433cf2ad 100755 --- a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H +++ b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H @@ -1,4 +1,4 @@ -word CFDEMversion="cfdem-2.4.5"; +word CFDEMversion="cfdem-2.4.6"; word compatibleLIGGGHTSversion="2.0.4"; Info << "\nCFDEMcoupling version: " << CFDEMversion << "\n" << endl; diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C index 68ff1c8d..5e8319f0 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C @@ -309,45 +309,6 @@ std::vector Foam::clockModel::calcShift() const return shifts; } -/*void Foam::clockModel::normHist() const -{ - int myrank=-10; - int numprocs=-10; - MPI_Comm_rank(MPI_COMM_WORLD,&myrank); - MPI_Comm_size(MPI_COMM_WORLD, &numprocs); - - - double buffOut=0.; - double buffIn=0.; - - // code to examine - List< int > codeParts(4); - codeParts[0]=1; // Global - codeParts[1]=2; // Coupling - codeParts[2]=3; // LIGGGHTS - codeParts[3]=26;// Flow - - forAll(codeParts,i) - { - Info << "i=" << i << " ,codeParts[i]=" << codeParts[i] << endl; - buffIn = double(deltaT_[codeParts[i]]); - MPI_Allreduce(&buffIn, &buffOut, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - buffIn = buffIn/buffOut; - Pout << "[" << myrank << "]: " << identifier_[codeParts[i]] << " " << buffIn << '\n'; - - Info << "CPU time % of " < globalTime(numprocs); - forAll(globalTime,procI) - globalTime[procI]=buffIn; - - forAll(globalTime,procI) - Info<< globalTime[procI] << ", "; - Info << endl; - } - return; -}*/ - - void Foam::clockModel::normHist() const { int myrank=-10; @@ -398,8 +359,9 @@ void Foam::clockModel::plotHist(double buffIn,std::string identifier,int numproc globalTime[myrank]=buffIn; MPI_Allreduce(globalTime, globalTime_all, numprocs, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - for(int j=0;jsetup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammps_vec_); // map data according to last TS + allocateArray(id_lammps_,-1.,nlocal_foam_); allocateArray(tmpI_,-1.,nlocal_foam_); lmp2foam_->exchange(id_lammps_sync, tmpI_); for(int i=0;isetup(nlocal_lammps_,id_lammpsComm_,nlocal_foam_,id_foam_); lmp2foam_->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_); }else { - //lmp2foam_->setup(nlocal_lammps_,id_lammpsComm_,nlocal_foam_,id_foam_); 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_); @@ -723,11 +722,11 @@ void Foam::twoWayM2M::locateParticle() const if (nlocal_foam_lost_all > 0) { Info << "all-to-all necessary: nlocal_foam_lost_all=" << nlocal_foam_lost_all << endl; - /*if(lost_pos_all) + 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!!! 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; @@ -754,7 +753,7 @@ void Foam::twoWayM2M::locateParticle() const cellID_foam_[nlocal_foam_] = cellID; // mark that ID was finally found - id_foam_lost_all[i]=-1; + //id_foam_lost_all[i]=-1; nlocal_foam_ += 1; //Pout << "stage3 found particle at pos=" << pos << " ,id="<< id_foam_lost_all[i] << endl; @@ -804,9 +803,9 @@ int gugu; MPI_Allreduce(&nlocal_lammps_, &gugu, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); Info << "nlocal_lammps_ALL=" << gugu << endl;*/ - //delete[] id_foam_nowhere_all; + //delete[] lost_pos_all; + //lmp->memory->destroy(lost_pos_); //delete[] id_foam_lost_all; - //delete[] lost_pos_all; // gives invalid free() ... } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H index 7407dc7e..a27f8f91 100644 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/twoWayM2M.H @@ -106,7 +106,6 @@ private: mutable int nlocal_foam_lost_; mutable int *id_foam_lost_; mutable int *id_foam_lost_all; - mutable int *id_foam_nowhere_all; mutable double *lost_pos_; mutable double *lost_pos_all; mutable int *cellID_foam_; diff --git a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh index 14a1faad..015cbf1a 100755 --- a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh +++ b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh @@ -25,7 +25,7 @@ fi if [ $liggghtsSim == "true" ] then cd $casePath/DEM - liggghts < in.liggghts_init + $CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME < in.liggghts_init #- get VTK data from liggghts dump file #cd $casePath/DEM diff --git a/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init b/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init index 60eea0ed..48efe65d 100755 --- a/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init +++ b/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init @@ -1,5 +1,5 @@ # Pour granular particles into chute container, then induce flow - +echo both atom_style granular atom_modify map array communicate single vel yes @@ -24,7 +24,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 #pair style -pair_style gran/hertz/history 1 0 #Hertzian without cohesion +pair_style gran/hertz/history pair_coeff * * #timestep, gravity @@ -32,19 +32,22 @@ timestep 0.00001 fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 #walls -fix zwalls all wall/gran/hertz/history 1 0 zplane 0.0 0.0553 1 -fix cylwalls all wall/gran/hertz/history 1 0 zcylinder 0.01385 1 +fix zwalls1 all wall/gran/hertz/history primitive type 1 zplane 0.0 +fix zwalls2 all wall/gran/hertz/history primitive type 1 zplane 0.0553 +fix cylwalls all wall/gran/hertz/history primitive type 1 zcylinder 0.0138 0. 0. tangential_damping off #cfd coupling #fix cfd all couple/cfd #particle insertion -group nve_group region reg region bc cylinder z 0.0 0.0 0.012 0.02 0.03 units box -fix ins nve_group pour 10000 1 1 vol 0.7 100 diam uniform 0.001 0.001 dens uniform 200 200 vel uniform 0. 0. 0. 0. -1.0 region bc +fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 200 radius constant 0.001 +fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0 + +fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -1. insert_every once overlapcheck yes all_in yes particles_in_region 1000 region bc #apply nve integration to all particles that are inserted as single particles -fix integr nve_group nve/sphere +fix integr all nve/sphere #screen output @@ -57,9 +60,6 @@ compute_modify thermo_temp dynamic yes #insert the first particles so that dump is not empty run 1 dump dmp all custom 1000 post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius -#force : f_couple_cfd[0] f_couple_cfd[1] f_couple_cfd[2] -#node : f_couple_cfd[6] -#cell id : f_couple_cfd[7] run 3000 upto #write_restart liggghts.restart