diff --git a/README b/README new file mode 100644 index 00000000..fd2ca756 --- /dev/null +++ b/README @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + 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 the ESI Group. +This offering is not affiliated, approved or endorsed by ESI Group, +the producer of the OpenFOAMĀ® software and owner of the OpenFOAMĀ® trade mark. +\*---------------------------------------------------------------------------*/ diff --git a/doc/CFDEMcoupling_Manual.pdf b/doc/CFDEMcoupling_Manual.pdf index edf01a70..1987a301 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 fa34461b..0e0be5f6 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 d2f26c35..5434353f 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 @@ -21,18 +20,33 @@ $(forceModels)/forceModel/newForceModel.C $(forceModels)/noDrag/noDrag.C $(forceModels)/checkCouplingInterval/checkCouplingInterval.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 @@ -62,21 +76,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 @@ -102,4 +113,4 @@ $(liggghtsCommandModels)/runLiggghts/runLiggghts.C $(liggghtsCommandModels)/writeLiggghts/writeLiggghts.C $(liggghtsCommandModels)/readLiggghtsData/readLiggghtsData.C -LIB = $(FOAM_USER_LIBBIN)/lib$(CFDEM_LIB_NAME) +LIB = $(CFDEM_LIB_DIR)/lib$(CFDEM_LIB_NAME) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 64360185..8bcb9a80 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -419,7 +419,10 @@ bool Foam::cfdemCloud::evolve // reset vol Fields clockM().start(16,"resetVolFields"); - if(verbose_) Info << "- resetVolFields()" << endl; + if(verbose_){ + Info << "couplingStep:" << dataExchangeM().couplingStep() + << "\n- resetVolFields()" << endl; + } averagingM().resetVectorAverage(averagingM().UsPrev(),averagingM().UsNext()); voidFractionM().resetVoidFractions(); averagingM().resetVectorAverage(forceM(0).impParticleForces(),forceM(0).impParticleForces(),true); @@ -495,7 +498,6 @@ bool Foam::cfdemCloud::evolve clockM().start(23,"giveDEMdata"); giveDEMdata(); clockM().stop("giveDEMdata"); - }//end dataExchangeM().couple() Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl; @@ -506,7 +508,7 @@ bool Foam::cfdemCloud::evolve // calc ddt(voidfraction) if (doCouple) calcDdtVoidfraction(voidFractionM().voidFractionNext()); - //calcDdtVoidfraction(alpha); // alternative with scale=1! + //calcDdtVoidfraction(alpha); // alternative with scale=1! (does not see change in alpha?) // update particle velocity Field Us.internalField() = averagingM().UsInterp(); @@ -572,7 +574,6 @@ void cfdemCloud::calcDdtVoidfraction(volScalarField& voidfraction) const { Info << "calculating ddt(voidfraction) based on couplingTime" << endl; scalar scale=mesh().time().deltaT().value()/dataExchangeM().couplingTime(); - Info << "scale="<< scale << endl; ddtVoidfraction_ = fvc::ddt(voidfraction) * scale; } diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C index 069565b3..fc4572ed 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C @@ -130,29 +130,26 @@ tmp explicitCouple::expMomSource() const ) ); - // calc fNext - forAll(fNext_,cellI) - { - fNext_[cellI] = arrayToField(cellI); + scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); - // limiter - for (int i=0;i<3;i++) + if(1-tsf < 1e-4) //tsf==1 + { + // calc fNext + forAll(fNext_,cellI) { - if (fNext_[cellI][i] > fLimit_[i]) fNext_[cellI][i] = fLimit_[i]; + fNext_[cellI] = arrayToField(cellI); + + // limiter + for (int i=0;i<3;i++) + { + if (fNext_[cellI][i] > fLimit_[i]) fNext_[cellI][i] = fLimit_[i]; + } } - } - - // underrelaxation of f - if (particleCloud_.dataExchangeM().couplingStep() > 1) + tsource() = fPrev_; + }else { - tsource() = (1 - particleCloud_.dataExchangeM().timeStepFraction()) * fPrev_ - + particleCloud_.dataExchangeM().timeStepFraction() * fNext_; + tsource() = (1 - tsf) * fPrev_ + tsf * fNext_; } - else - { - tsource() = fNext_; - } - return tsource; } diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C index 6d0c89e2..ae4083b9 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C @@ -139,34 +139,32 @@ tmp implicitCouple::impMomSource() const ) ); + scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); + // calc Ksl scalar Ur; - forAll(KslNext_,cellI) + if(1-tsf < 1e-4) //tsf==1 { - Ur = mag(U_[cellI] - Us_[cellI]); - - if(Ur > 0. && (1.-alpha_[cellI]) > SMALL) //momentum exchange switched off if alphaMin=1 + forAll(KslNext_,cellI) { - KslNext_[cellI] = mag(particleCloud_.forceM(0).impParticleForces()[cellI]) + Ur = mag(U_[cellI] - Us_[cellI]); + + if(Ur > 0. && (1.-alpha_[cellI]) > SMALL) //momentum exchange switched off if alphaMin=1 + { + KslNext_[cellI] = mag(particleCloud_.forceM(0).impParticleForces()[cellI]) / Ur / particleCloud_.mesh().V()[cellI]; + } + else KslNext_[cellI] = 0; + + // limiter + if (KslNext_[cellI] > KslLimit_) KslNext_[cellI] = KslLimit_; } - else KslNext_[cellI] = 0; - - // limiter - if (KslNext_[cellI] > KslLimit_) KslNext_[cellI] = KslLimit_; - } - - // underrelaxation of Ksl - if (particleCloud_.dataExchangeM().couplingStep() > 1) + tsource() = KslPrev_; + }else { - tsource() = (1 - particleCloud_.dataExchangeM().timeStepFraction()) * KslPrev_ - + particleCloud_.dataExchangeM().timeStepFraction() * KslNext_; - } - else - { - tsource() = KslNext_; + tsource() = (1 - tsf) * KslPrev_ + tsf * KslNext_; } return tsource; diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C index e5ec3e31..6d3a9840 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C @@ -122,19 +122,15 @@ tmp Foam::voidFractionModel::voidFractionInterp() const ) ); - // use this instead of above code??? - //tmp tsource = voidfractionPrev_; - - if(particleCloud_.dataExchangeM().couplingStep() > 1) + scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); + if(1-tsf < 1e-4) //tsf==1 { - tsource() = (1 - particleCloud_.dataExchangeM().timeStepFraction()) * voidfractionPrev_ - + particleCloud_.dataExchangeM().timeStepFraction() * voidfractionNext_; + tsource() = voidfractionPrev_; } else { - tsource() = voidfractionNext_; + tsource() = (1 - tsf) * voidfractionPrev_ + tsf * voidfractionNext_; } - return tsource; } diff --git a/tutorials/cfdemSolverPimple/ErgunTestMPI/DEM/post/dummy b/tutorials/cfdemSolverPimple/ErgunTestMPI/DEM/post/dummy index 5985960b..9ca241b3 100644 --- a/tutorials/cfdemSolverPimple/ErgunTestMPI/DEM/post/dummy +++ b/tutorials/cfdemSolverPimple/ErgunTestMPI/DEM/post/dummy @@ -1,2 +1,3 @@ dummyfile dummyfile +dummyfile diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties index efe10759..6e27db55 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties @@ -26,8 +26,6 @@ FoamFile //===========================================================================// // sub-models & settings -//ignoreDDTvoidfraction; - modelType "A"; // A or B couplingInterval 100; diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict index af81da5d..d17976fe 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict @@ -23,13 +23,13 @@ startTime 0; stopAt endTime; -endTime 0.1;//0.1; +endTime 0.1; deltaT 0.0005; writeControl adjustableRunTime; -writeInterval 0.001; +writeInterval 0.01; purgeWrite 0; diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/post/dummy b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/post/dummy index bb1b6545..ba551b98 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/post/dummy +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/post/dummy @@ -40,3 +40,6 @@ dummyfile dummyfile dummyfile dummyfile +dummyfile +dummyfile +dummyfile diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/octave/settlingVelocity.m b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/octave/settlingVelocity.m index 2c422d48..a745a648 100644 --- a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/octave/settlingVelocity.m +++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/octave/settlingVelocity.m @@ -9,7 +9,7 @@ path = '../../DEM/post/velocity.txt'; data = load(path); U_sim = data(:,2:4); t_sim = data(:,1); -fprintf('final velociy of sim = %f/%f/%f m/s\n',U_sim(length(U_sim(:,1)),1),U_sim(length(U_sim(:,1)),2),U_sim(length(U_sim(:,1)),3) ) +fprintf('final velocity of sim = %f/%f/%f m/s\n',U_sim(length(U_sim(:,1)),1),U_sim(length(U_sim(:,1)),2),U_sim(length(U_sim(:,1)),3) ) %====================================% diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/0/Tsource b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/0/Tsource index 79de16a9..038d15c8 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/0/Tsource +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/0/Tsource @@ -25,7 +25,7 @@ dimensions [0 0 -1 1 0 0 0]; // rho=1 // --> Tsource = 1 -internalField uniform 1; +internalField uniform 0; boundaryField { diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties index 4db3ad9d..f7055010 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties @@ -28,7 +28,7 @@ FoamFile modelType B; // A or B -couplingInterval 100; +couplingInterval 500; voidFractionModel divided; diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict index 5ae07b58..c21bc0ac 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict @@ -23,13 +23,13 @@ startTime 0; stopAt endTime; -endTime 1; +endTime 1.0; -deltaT 0.001; +deltaT 0.005; writeControl adjustableRunTime; -writeInterval 0.01; +writeInterval 0.1; purgeWrite 0; diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/fvSchemes b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/fvSchemes index 3e024c03..29629bfa 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/fvSchemes +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/fvSchemes @@ -39,7 +39,7 @@ divSchemes div((nuEff*dev(grad(U).T()))) Gauss linear; div((viscousTerm*dev(grad(U).T()))) Gauss linear; div((nu*dev(grad(U).T()))) Gauss linear; - div(phi,T) Gauss upwind; //limitedLinear 1; + div(phi,T) Gauss limitedLinear 1; //Gauss upwind; // } laplacianSchemes