diff --git a/README b/README
new file mode 100755
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/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C b/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C
index c07ca22d..87d83393 100644
--- a/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C
+++ b/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C
@@ -76,9 +76,15 @@ int main(int argc, char *argv[])
Info << "update Ksl.internalField()" << endl;
Ksl = particleCloud.momCoupleM(0).impMomSource();
- particleCloud.smoothingM().smoothen(Ksl);
Ksl.correctBoundaryConditions();
+ //Force Checks
+ vector fTotal(0,0,0);
+ vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField()));
+ reduce(fImpTotal, sumOp
Note that the variable "imExSplitFactor" can be set in the couplingProperties in order to treat implicitly defined forces (in the implementation of the force model) as explicit ones. "imExSplitFactor 1.0;" is set by default, meaning that all implicit forces will be considered implicitly, whereas "imExSplitFactor 0.0;" would mean that implicitly defined forces will be treated in an explicit fashion.
-Description: +
Note that the switch "treatVoidCellsAsExplicitForce true;" can be set in the couplingProperties in order to change the treatment of cells which are void of particles. This is only relevant if (i) smoothing is used, and (ii) implicit force coupling is performed. By default, the particle veloctiy field (Us) will be smoothed to obtain a meaningful reference quantity for the implicit force coupling. In case "treatVoidCellsAsExplicitForce true;" is set, however, Us will not be smoothed and implicit forces (after the smoothing has been performed) in cells void of particles be treated as explicit ones. This avoids the problem of defining Us in cells that are void of particles, but for which an implicit coupling force is obtained in the smoothing process. +Description:
The momCoupleModel is the base class for momentum exchange between DEM and CFD simulation.
diff --git a/doc/momCoupleModel.txt b/doc/momCoupleModel.txt index 05db72eb..0a7dbf2f 100644 --- a/doc/momCoupleModel.txt +++ b/doc/momCoupleModel.txt @@ -31,6 +31,7 @@ Forces can be coupled in an implicit way to the fluid solver (i.e., when solving Note that the variable "imExSplitFactor" can be set in the couplingProperties in order to treat implicitly defined forces (in the implementation of the force model) as explicit ones. "imExSplitFactor 1.0;" is set by default, meaning that all implicit forces will be considered implicitly, whereas "imExSplitFactor 0.0;" would mean that implicitly defined forces will be treated in an explicit fashion. +Note that the switch "treatVoidCellsAsExplicitForce true;" can be set in the couplingProperties in order to change the treatment of cells which are void of particles. This is only relevant if (i) smoothing is used, and (ii) implicit force coupling is performed. By default, the particle veloctiy field (Us) will be smoothed to obtain a meaningful reference quantity for the implicit force coupling. In case "treatVoidCellsAsExplicitForce true;" is set, however, Us will not be smoothed and implicit forces (after the smoothing has been performed) in cells void of particles be treated as explicit ones. This avoids the problem of defining Us in cells that are void of particles, but for which an implicit coupling force is obtained in the smoothing process. [Description:] The momCoupleModel is the base class for momentum exchange between DEM and CFD simulation. diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index e8798d13..3ce050bb 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -3,10 +3,10 @@ forceModels = subModels/forceModel forceModelsMS = subModels/forceModelMS IOModels = subModels/IOModel voidFractionModels = subModels/voidFractionModel +voidFractionModelsMS = subModels/voidFractionModelMS locateModels = subModels/locateModel meshMotionModels = subModels/meshMotionModel momCoupleModels = subModels/momCoupleModel -regionModels = subModels/regionModel dataExchangeModels = subModels/dataExchangeModel averagingModels = subModels/averagingModel clockModels = subModels/clockModel @@ -15,6 +15,7 @@ smoothingModels = subModels/smoothingModel probeModels = subModels/probeModel $(cfdemCloud)/cfdemCloud.C +derived/cfdemCloudBiDisperse/cfdemCloudBiDisperse.C derived/cfdemCloudIB/cfdemCloudIB.C derived/cfdemCloudMS/cfdemCloudMS.C @@ -23,36 +24,59 @@ $(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)/interfaceParticleProbe/interfaceParticleProbe.C +$(forceModels)/fieldStore/fieldStore.C +$(forceModels)/fieldTimeAverage/fieldTimeAverage.C +$(forceModels)/fieldBound/fieldBound.C +$(forceModels)/volWeightedAverage/volWeightedAverage.C +$(forceModels)/totalMomentumExchange/totalMomentumExchange.C $(forceModels)/KochHillDrag/KochHillDrag.C $(forceModels)/KochHillRWDrag/KochHillRWDrag.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)/HollowayDrag/HollowayDrag.C $(forceModels)/viscForce/viscForce.C $(forceModels)/MeiLift/MeiLift.C +$(forceModels)/melting/melting.C +$(forceModels)/KochHillDragNLift/KochHillDragNLift.C +/*$(forceModels)/stokesSpheroidDrag/stokesSpheroidDrag.C*/ +$(forceModels)/solidsPressureForce/solidsPressureForce.C +$(forceModels)/periodicPressure/periodicPressure.C +$(forceModels)/periodicPressureControl/periodicPressureControl.C +$(forceModels)/averageSlipVel/averageSlipVel.C $(forceModels)/particleCellVolume/particleCellVolume.C -$(forceModels)/fieldTimeAverage/fieldTimeAverage.C -$(forceModels)/volWeightedAverage/volWeightedAverage.C $(forceModelsMS)/forceModelMS/forceModelMS.C $(forceModelsMS)/forceModelMS/newForceModelMS.C $(forceModelsMS)/DiFeliceDragMS/DiFeliceDragMS.C +$(forceModelsMS)/GidaspowDragMS/GidaspowDragMS.C +$(forceModelsMS)/noDragMS/noDragMS.C $(probeModels)/probeModel/probeModel.C $(probeModels)/probeModel/newProbeModel.C $(probeModels)/noProbe/noProbe.C $(probeModels)/particleProbe/particleProbe.C +/*$(probeModels)/interfaceParticleProbe/interfaceParticleProbe.C*/ $(IOModels)/IOModel/IOModel.C $(IOModels)/IOModel/newIOModel.C $(IOModels)/noIO/noIO.C $(IOModels)/basicIO/basicIO.C +$(IOModels)/tempIO/tempIO.C +$(IOModels)/colorIO/colorIO.C $(IOModels)/trackIO/trackIO.C $(IOModels)/sophIO/sophIO.C @@ -60,34 +84,39 @@ $(voidFractionModels)/voidFractionModel/voidFractionModel.C $(voidFractionModels)/voidFractionModel/newVoidFractionModel.C $(voidFractionModels)/centreVoidFraction/centreVoidFraction.C $(voidFractionModels)/dividedVoidFraction/dividedVoidFraction.C +$(voidFractionModels)/dividedVoidFractionBiDi/dividedVoidFractionBiDi.C $(voidFractionModels)/dividedVoidFractionMS/dividedVoidFractionMS.C $(voidFractionModels)/bigParticleVoidFraction/bigParticleVoidFraction.C $(voidFractionModels)/GaussVoidFraction/GaussVoidFraction.C $(voidFractionModels)/IBVoidFraction/IBVoidFraction.C +$(voidFractionModels)/weightedNeigbhorsVoidFraction/weightedNeigbhorsVoidFraction.C + +$(voidFractionModelsMS)/voidFractionModelMS/voidFractionModelMS.C +$(voidFractionModelsMS)/voidFractionModelMS/newVoidFractionModelMS.C $(locateModels)/locateModel/locateModel.C $(locateModels)/locateModel/newLocateModel.C $(locateModels)/standardSearch/standardSearch.C $(locateModels)/engineSearch/engineSearch.C +$(locateModels)/engineSearchMany2Many/engineSearchMany2Many.C $(locateModels)/turboEngineSearch/turboEngineSearch.C $(locateModels)/turboEngineSearchM2M/turboEngineSearchM2M.C $(locateModels)/engineSearchIB/engineSearchIB.C - +$(locateModels)/hyperEngineSearch/hyperEngineSearch.C +$(locateModels)/ijkSearch/ijkSearch.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 @@ -95,11 +124,13 @@ $(dataExchangeModels)/twoWayFiles/twoWayFiles.C $(dataExchangeModels)/noDataExchange/noDataExchange.C $(dataExchangeModels)/twoWayMPI/twoWayMPI.C $(dataExchangeModels)/twoWayM2M/twoWayM2M.C +$(dataExchangeModels)/twoWayMany2Many/twoWayMany2Many.C $(averagingModels)/averagingModel/averagingModel.C $(averagingModels)/averagingModel/newAveragingModel.C $(averagingModels)/dilute/dilute.C $(averagingModels)/dense/dense.C +$(averagingModels)/denseBiDi/denseBiDi.C $(clockModels)/clockModel/clockModel.C $(clockModels)/clockModel/newClockModel.C @@ -108,6 +139,7 @@ $(clockModels)/noClock/noClock.C $(liggghtsCommandModels)/liggghtsCommandModel/liggghtsCommandModel.C $(liggghtsCommandModels)/liggghtsCommandModel/newLiggghtsCommandModel.C +$(liggghtsCommandModels)/colorParticles/colorParticles.C $(liggghtsCommandModels)/execute/execute.C $(liggghtsCommandModels)/runLiggghts/runLiggghts.C $(liggghtsCommandModels)/writeLiggghts/writeLiggghts.C @@ -117,5 +149,6 @@ $(smoothingModels)/smoothingModel/smoothingModel.C $(smoothingModels)/smoothingModel/newSmoothingModel.C $(smoothingModels)/noSmoothing/noSmoothing.C $(smoothingModels)/constDiffSmoothing/constDiffSmoothing.C +$(smoothingModels)/localPSizeDiffSmoothing/localPSizeDiffSmoothing.C LIB = $(CFDEM_LIB_DIR)/lib$(CFDEM_LIB_NAME) diff --git a/src/lagrangian/cfdemParticle/Make/options b/src/lagrangian/cfdemParticle/Make/options index e3ef2b01..4d01d3d8 100644 --- a/src/lagrangian/cfdemParticle/Make/options +++ b/src/lagrangian/cfdemParticle/Make/options @@ -14,11 +14,12 @@ EXE_INC = \ -I$(LIB_SRC)/OpenFOAM/containers/HashTables/labelHashSet \ -I$(CFDEM_LIGGGHTS_SRC_DIR) \ -I$(CFDEM_M2MLIB_PATH) \ + -I$(CFDEM_Many2ManyLIB_PATH) \ -I$(CFDEM_SRC_DIR)/cfdTools \ LIB_LIBS = \ $(PLIBS) \ - -L$(CFDEM_LIB_DIR) \ + -L$(FOAM_USER_LIBBIN) \ -lfiniteVolume \ -lincompressibleRASModels \ -lincompressibleLESModels \ @@ -28,4 +29,10 @@ LIB_LIBS = \ -L$(CFDEM_LIGGGHTS_SRC_DIR) \ -Wl,--whole-archive -l$(CFDEM_LIGGGHTS_LIB_NAME) -Wl,--no-whole-archive \ -L$(CFDEM_M2MLIB_PATH) \ - -lcouple + -lcouple \ + -L$(CFDEM_Many2ManyLIB_PATH) \ + -lcoupleMany2Many \ + +/* add -I$(CFDEM_POEMSLIB_PATH) \ to EXE_INC */ +/* -L$(CFDEM_POEMSLIB_PATH) \ */ +/* -lpoems */ diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index a56df915..58e57813 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -100,6 +100,7 @@ Foam::cfdemCloud::cfdemCloud cgOK_(true), impDEMdrag_(false), imExSplitFactor_(1.0), + treatVoidCellsAsExplicitForce_(false), useDDTvoidfraction_(false), ddtVoidfraction_ ( @@ -219,6 +220,8 @@ Foam::cfdemCloud::cfdemCloud solveFlow_=Switch(couplingProperties_.lookup("solveFlow")); if (couplingProperties_.found("imExSplitFactor")) imExSplitFactor_ = readScalar(couplingProperties_.lookup("imExSplitFactor")); + if (couplingProperties_.found("treatVoidCellsAsExplicitForce")) + treatVoidCellsAsExplicitForce_ = readBool(couplingProperties_.lookup("treatVoidCellsAsExplicitForce")); if (couplingProperties_.found("verbose")) verbose_=true; if (couplingProperties_.found("ignore")) ignore_=true; if (turbulenceModelType_=="LESProperties") @@ -508,7 +511,12 @@ bool Foam::cfdemCloud::evolve //Smoothen "next" fields smoothingM().dSmoothing(); smoothingM().smoothen(voidFractionM().voidFractionNext()); - smoothingM().smoothenReferenceField(averagingM().UsNext()); + + //only smoothen if we use implicit force coupling in cells void of particles + //because we need unsmoothened Us field to detect cells for explicit + //force coupling + if(!treatVoidCellsAsExplicitForce()) + smoothingM().smoothenReferenceField(averagingM().UsNext()); clockM().stop("setVectorAverage"); } diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index 31b98f1f..e658f99e 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -142,6 +142,8 @@ protected: mutable scalar imExSplitFactor_; + mutable bool treatVoidCellsAsExplicitForce_; //will treat the coupling force in cells with no Us data explicitly + bool useDDTvoidfraction_; mutable volScalarField ddtVoidfraction_; @@ -245,6 +247,8 @@ public: inline const scalar& imExSplitFactor() const; + inline const bool& treatVoidCellsAsExplicitForce() const; + inline const bool& ignore() const; inline const fvMesh& mesh() const; @@ -298,6 +302,13 @@ public: virtual inline double ** particleDensity() const {return NULL;}; virtual inline int ** particleTypes() const {return NULL;}; virtual label particleType(label index) const {return -1;}; + + //access to the particle's rotation and torque data + virtual inline double ** DEMTorques() const {return NULL;}; + virtual inline double ** omegaArray() const {return NULL;}; + virtual vector omega(int) const {return Foam::vector(0,0,0);}; + + //access to the particles' orientation information virtual inline double ** exArray() const {return NULL;}; virtual vector ex(int) const {return Foam::vector(0,0,0);}; diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H index 91b7b10a..3993ec17 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H @@ -60,6 +60,11 @@ inline const scalar& cfdemCloud::imExSplitFactor() const return imExSplitFactor_; }; +inline const bool& cfdemCloud::treatVoidCellsAsExplicitForce() const +{ + return treatVoidCellsAsExplicitForce_; +} + inline const scalar& cfdemCloud::cg() const { return cg_; diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C index 5c209a09..2fe8810c 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C @@ -56,14 +56,14 @@ cfdemCloudMS::cfdemCloudMS cellIDsCM_(NULL), bodies_(NULL), nrigids_(NULL), - exCM_(NULL), - eyCM_(NULL), - ezCM_(NULL), - typeCM_(NULL), - typeVolCM_(NULL), - VclumpCM_(NULL), - particleWeightsCM_(NULL), - dHCM_(NULL), + nClumpTypes_(1), + clumpType_(NULL), + clumpVol_(NULL), + clumpDH_(NULL), + clumpWeights_(NULL), + //exCM_(NULL), + //eyCM_(NULL), + //ezCM_(NULL), //SclumpCM_(NULL), //scalingCM_(NULL), //Cclump_ex_(NULL), @@ -72,8 +72,6 @@ cfdemCloudMS::cfdemCloudMS expForcesCM_(NULL), DEMForcesCM_(NULL), numberOfClumps_(-1), - overlapCorr_(readScalar(couplingProperties_.lookup("overlapCorr"))), - monoMS_(Switch(couplingProperties_.lookup("monoMS"))), numberOfClumpsChanged_(false), useforcePerClump_(false), forceModels_(couplingProperties_.lookup("forceModelsMS")) @@ -88,9 +86,6 @@ cfdemCloudMS::cfdemCloudMS forceModels_[i] ); } - - if(overlapCorr_>1.0) FatalError << "overlapCorr_ must be <= 1."<< abort(FatalError); - Info << "overlapCorr_=" << overlapCorr_ << endl; } @@ -103,14 +98,13 @@ cfdemCloudMS::~cfdemCloudMS() delete cellIDsCM_; delete bodies_; delete nrigids_; - delete exCM_; - delete eyCM_; - delete ezCM_; - delete typeCM_; - delete typeVolCM_; - delete VclumpCM_; - delete particleWeightsCM_; - delete dHCM_; + delete clumpType_; + delete clumpVol_; + delete clumpDH_; + delete clumpWeights_; + //delete exCM_; + //delete eyCM_; + //delete ezCM_; //delete SclumpCM_; //delete scalingCM_; //delete Cclump_ex_; @@ -126,34 +120,43 @@ cfdemCloudMS::~cfdemCloudMS() void cfdemCloudMS::getDEMdata() { cfdemCloud::getDEMdata(); - // update NClumpTypes in data exch. model - //dataExchangeM().checkNClumpTypes(); dataExchangeM().getData("xcm","vector-multisphere",positionsCM_); // position of the centre of mass dataExchangeM().getData("vcm","vector-multisphere",velocitiesCM_); // velocity of the centre of mass dataExchangeM().getData("body","scalar-atom",bodies_); // clump-particle connex - dataExchangeM().getData("nrigid","scalar-multisphere",nrigids_); // # particles in clump - dataExchangeM().getData("ex_space","vector-multisphere",exCM_); // axis of inertia - dataExchangeM().getData("ey_space","vector-multisphere",eyCM_); // axis of inertia - dataExchangeM().getData("ez_space","vector-multisphere",ezCM_); // axis of inertia + dataExchangeM().getData("clumptype","scalar-multisphere",clumpType_); // type of the clump -// dataExchangeM().getData("typeCM","scalar-multisphere",typeCM_); // type of the clump -// dataExchangeM().getData("nTypes","scalar-global",nTypes_); // nr of clump types -// dataExchangeM().getData("Vclump","vector-global",typeVolCM_); // Volume of the clump type - setClumpVolume(); // can be replaced once volume is communicated!!! - setdHCM(); // calc and store dHCM + nClumpTypes_=dataExchangeM().getNumberOfTypes(); // nr of clump types + double* typeVol_=dataExchangeM().getTypeVol(); // volume of the clump -// dataExchangeM().getScalarData("Sclump",SclumpCM_); // surface area of the clump -// dataExchangeM().getScalarData("scaling",scalingCM_); // scaling of the clump -// dataExchangeM().getScalarData("Cclump_ex",Cclump_ex_); // cross section of the clump in ex normal direction -// dataExchangeM().getScalarData("Cclump_ey",Cclump_ey_); // cross section of the clump in ey normal direction + //- save clump volume and mass + double **typeDH(NULL); + dataExchangeM().allocateArray(typeDH,-1,1,nClumpTypes()+1); + for(int k = 1;k <= nClumpTypes(); k++) + typeDH[k][0]=pow(typeVol_[k]*1.9099,1./3.); // 6/pi=1.9099 // calc a hydraulic diameter as d of vol equal sphere - // calc Saequi, surface area of the vol aequivalent sphere - // Saequi=pi*pow(6*VclumpCM_/pi,2./3.); + int ct(0); + double dh(0); + for(int ind = 0;ind < numberOfClumps(); ind++) + { + ct=clumpType()[0][ind]; + clumpVol_[ind][0] = typeVol_[ct]; + clumpDH_[ind][0]=typeDH[ct][0]; + //Info << "ct=" << ct << endl; + //Info << "clumpVol()[ind][0]=" << clumpVol()[ind][0] << endl; + //Info << "clumpDH()[ind][0]=" << clumpDH()[ind][0] << endl; + } + delete typeDH; + // -- - // calc Caequi, cross section of the vol aequivalent sphere - // Caequi=Saequi/4; + //dataExchangeM().getData("ex_space","vector-multisphere",exCM_); // axis of inertia + //dataExchangeM().getData("ey_space","vector-multisphere",eyCM_); // axis of inertia + //dataExchangeM().getData("ez_space","vector-multisphere",ezCM_); // axis of inertia + //dataExchangeM().getScalarData("Sclump",SclumpCM_); // surface area of the clump + //dataExchangeM().getScalarData("scaling",scalingCM_); // scaling of the clump + //dataExchangeM().getScalarData("Cclump_ex",Cclump_ex_); // cross section of the clump in ex normal direction + //dataExchangeM().getScalarData("Cclump_ey",Cclump_ey_); // cross section of the clump in ey normal direction } void Foam::cfdemCloudMS::giveDEMdata() @@ -185,22 +188,19 @@ bool cfdemCloudMS::reAllocArrays() const { if(cfdemCloud::reAllocArrays()) { - int nClumpTypes = dataExchangeM().nClumpTypes(); - // get arrays of new length dataExchangeM().allocateArray(positionsCM_,0,3,"nbodies"); dataExchangeM().allocateArray(velocitiesCM_,0,3,"nbodies"); dataExchangeM().allocateArray(cellIDsCM_,-1,1,"nbodies"); dataExchangeM().allocateArray(bodies_,0,1); - dataExchangeM().allocateArray(nrigids_,0,1,"nbodies"); - dataExchangeM().allocateArray(exCM_,0,3,"nbodies"); - dataExchangeM().allocateArray(eyCM_,0,3,"nbodies"); - dataExchangeM().allocateArray(ezCM_,0,3,"nbodies"); - dataExchangeM().allocateArray(typeCM_,0,1,"nbodies"); - dataExchangeM().allocateArray(typeVolCM_,0,1,nClumpTypes); - dataExchangeM().allocateArray(VclumpCM_,0,1,"nbodies"); - dataExchangeM().allocateArray(particleWeightsCM_,1,1,"nbodies"); - dataExchangeM().allocateArray(dHCM_,1.,1,"nbodies"); + dataExchangeM().allocateArray(nrigids_,0,1,"nbodies"); + dataExchangeM().allocateArray(clumpType_,0,3,"nbodies"); + dataExchangeM().allocateArray(clumpVol_,0,1,"nbodies"); + dataExchangeM().allocateArray(clumpDH_,1.,1,"nbodies"); + dataExchangeM().allocateArray(clumpWeights_,1,1,"nbodies"); + //dataExchangeM().allocateArray(exCM_,0,3,"nbodies"); + //dataExchangeM().allocateArray(eyCM_,0,3,"nbodies"); + //dataExchangeM().allocateArray(ezCM_,0,3,"nbodies"); //dataExchangeM().allocateArray(SclumpCM_,0,3,nClumpTypes); //dataExchangeM().allocateArray(scalingCM_,0,3,"nbodies"); //dataExchangeM().allocateArray(Cclump_ex_,0,3,nClumpTypes); @@ -259,98 +259,19 @@ void Foam::cfdemCloudMS::setParticleForceField() ( forceM(0).impParticleForces(), impForcesCM_, - particleWeightsCM_, + clumpWeights_, numberOfClumps() ); averagingM().setVectorSumSimple ( forceM(0).expParticleForces(), expForcesCM_, - particleWeightsCM_, + clumpWeights_, numberOfClumps() ); } } -void Foam::cfdemCloudMS::setClumpVolume() -{ - //============================================ - // final version if vol is transferred - //label type; - //for(int ind = 0;ind < numberOfClumps(); ind++) - //{ - // type = typeCM()[ind][0]; - // VclumpCM()[ind][0] = typeVolCM()[type][0]; - //} - //============================================ - - - //============================================ - // prelim version - scalar r(0); - int nrigidC(-1); - label ind(-1); - label prevInd(-2); - - // loop all particles - // NOTE: this approach is inefficient and - // assumes same overlap for all clumps - for(int index = 0;index < numberOfParticles(); index++) - { - ind=body(index); - // clump not found - if (ind < 0) Warning <<"clump was deleted??? ind = "<< ind << endl; - //else - { - //if(verbose_) Pout <<"clump :"<< ind << " found on this proc, cellIDCM(ind)=" << cellIDCM(ind) << endl; - - // particles of clump have same size - // Note: does this work in parallel??? - if(monoMS_) - { - if(prevInd!=ind) - { - prevInd=ind; - nrigidC=nrigid(ind); - - if (nrigidC <= 0) - { - Warning <<"A BUG occurred in Foam::cfdemCloudMS::setClumpVolume() nrigidC = " - << nrigidC <<", ind = " << ind <<", index=" << index <<"\n" << endl; - nrigidC = 1; - } - r=radius(index); - VclumpCM_[ind][0]=nrigidC*r*r*r*0.52360*overlapCorr_; // pi/6=0.52360 - //if(verbose_) Pout << "ind=" << ind << " ,VclumpCM_[ind][0]" << VclumpCM_[ind][0] << endl; - } - } - // particles of clump can have different size - else - { - r=radius(index); - VclumpCM_[ind][0]+=r*r*r*0.52360*overlapCorr_; // pi/6=0.52360 - //if(verbose_) Pout << "summing up volume: " << "ind=" << ind << " ,VclumpCM_[ind][0]" << VclumpCM_[ind][0] << endl; - } - } - //else - //if(verbose_) Pout <<"clump :"<< ind << " not found on this proc." << endl; - } - if(verbose_) - { - for(int ind = 0;ind < numberOfClumps(); ind++) - Pout << "clumpVolume: " << "ind=" << ind << " ,VclumpCM_[ind][0]" << VclumpCM_[ind][0] << endl; - } - //============================================ -} - -void Foam::cfdemCloudMS::setdHCM() -{ - // calc a hydraulic diameter as d of vol equal sphere - for(int ind = 0;ind < numberOfClumps(); ind++) - dHCM_[ind][0]=pow(VclumpCM_[ind][0]*1.9099,1./3.); // 6/pi=1.9099 - -} - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // PUBLIC MEMBER FUNCTIONS diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H index 0948818a..0d1fa40f 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H @@ -66,17 +66,15 @@ private: mutable int **bodies_; mutable int **nrigids_; - mutable double **exCM_; - mutable double **eyCM_; - mutable double **ezCM_; - - mutable double **typeCM_; - mutable double **typeVolCM_; - mutable double **VclumpCM_; - mutable double **particleWeightsCM_; - - mutable double **dHCM_; + mutable int **clumpType_; + mutable int nClumpTypes_; + mutable double **clumpVol_; + mutable double **clumpDH_; + mutable double **clumpWeights_; + //mutable double **exCM_; + //mutable double **eyCM_; + //mutable double **ezCM_; //mutable double **SclumpCM_; //mutable double **scalingCM_; //mutable double **Cclump_ex_; @@ -87,8 +85,6 @@ private: mutable double **DEMForcesCM_; int numberOfClumps_; - scalar overlapCorr_; // ratio between clump vol and sum(particle vol) - Switch monoMS_; bool numberOfClumpsChanged_; bool useforcePerClump_; @@ -104,8 +100,6 @@ private: void findCells(); void setForces(); void setParticleForceField(); - void setClumpVolume(); // can be replaced once volume is communicated!!! - void setdHCM(); public: @@ -128,8 +122,6 @@ public: inline double particleVolume(int); - //inline double d(int); - inline vector positionCM(int); inline vector velocityCM(int); @@ -144,13 +136,13 @@ public: inline double **& velocitiesCM() const; - inline double **& typeCM() const; + inline int **& clumpType() const; - inline double **& typeVolCM() const; + inline int nClumpTypes() const; - inline double **& VclumpCM() const; + inline double **& clumpVol() const; - inline double **& dHCM() const; + inline double **& clumpDH() const; inline double **& impForcesCM() const; diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H index ce5b0794..53f5a88d 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H @@ -42,18 +42,12 @@ inline label Foam::cfdemCloudMS::body(int index) inline double cfdemCloudMS::particleVolume(int index) { int ind = body(index); // particle to clump ID - double Vp(VclumpCM_[ind][0]); + double Vp(clumpVol_[ind][0]); int nR(nrigid(ind)); if(nR>0) Vp/=nR; return Vp; } -/*inline double cfdemCloudMS::d(int index) -{ - int ind = body(index); // particle to clump ID - return dHCM_[ind][0]; -}*/ - inline vector Foam::cfdemCloudMS::positionCM(int index) { vector pos; @@ -93,24 +87,24 @@ inline double **& cfdemCloudMS::velocitiesCM() const return velocitiesCM_; } -inline double **& cfdemCloudMS::typeCM() const +inline int cfdemCloudMS::nClumpTypes() const { - return typeCM_; + return nClumpTypes_; } -inline double **& cfdemCloudMS::typeVolCM() const +inline int **& cfdemCloudMS::clumpType() const { - return typeVolCM_; + return clumpType_; } -inline double **& cfdemCloudMS::VclumpCM() const +inline double **& cfdemCloudMS::clumpVol() const { - return VclumpCM_; + return clumpVol_; } -inline double **& cfdemCloudMS::dHCM() const +inline double **& cfdemCloudMS::clumpDH() const { - return dHCM_; + return clumpDH_; } inline double **& cfdemCloudMS::impForcesCM() const diff --git a/src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H b/src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H index 233ee974..aa7bbb96 100644 --- a/src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H +++ b/src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H @@ -8,7 +8,7 @@ //#define comp // if comp is on - you must use Make/options_comp! //define multi sphere -//#define multisphere +#define multisphere // features of 2.1 work also in 2.3 #if defined(version23) diff --git a/src/lagrangian/cfdemParticle/etc/functions.sh b/src/lagrangian/cfdemParticle/etc/functions.sh index c0286cce..45e91aae 100755 --- a/src/lagrangian/cfdemParticle/etc/functions.sh +++ b/src/lagrangian/cfdemParticle/etc/functions.sh @@ -139,6 +139,7 @@ compileLIGGGHTS() logpath="$1" logfileName="$2" headerText="$3" + clean="$4" #--------------------------------------------------------------------------------# #- clean up old log file @@ -157,9 +158,14 @@ compileLIGGGHTS() echo 2>&1 | tee -a $logpath/$logfileName #- wclean and wmake - rm $CFDEM_LIGGGHTS_SRC_DIR/"lmp_"$CFDEM_LIGGGHTS_MAKEFILE_NAME - rm $CFDEM_LIGGGHTS_SRC_DIR/"lib"$CFDEM_LIGGGHTS_LIB_NAME".a" - make clean-all 2>&1 | tee -a $logpath/$logfileName + if [[ $clean == "false" ]]; then + echo "not cleaning LIGGGHTS" + else + rm $CFDEM_LIGGGHTS_SRC_DIR/"lmp_"$CFDEM_LIGGGHTS_MAKEFILE_NAME + rm $CFDEM_LIGGGHTS_SRC_DIR/"lib"$CFDEM_LIGGGHTS_LIB_NAME".a" + make clean-all 2>&1 | tee -a $logpath/$logfileName + echo "cleaning LIGGGHTS" + fi if [[ $WM_NCOMPPROCS == "" ]]; then echo "compiling LIGGGHTS on one CPU" make $CFDEM_LIGGGHTS_MAKEFILE_NAME 2>&1 | tee -a $logpath/$logfileName diff --git a/src/lagrangian/cfdemParticle/etc/library-list.txt b/src/lagrangian/cfdemParticle/etc/library-list.txt index 27e798d4..e34c2541 100644 --- a/src/lagrangian/cfdemParticle/etc/library-list.txt +++ b/src/lagrangian/cfdemParticle/etc/library-list.txt @@ -1 +1,11 @@ lagrangian/cfdemParticle/dir + +#=====================================================' +#- RADL +fvOptions/dir +cylPorousMedia/dir + +#=====================================================' +#- other +finiteVolume/dir + diff --git a/src/lagrangian/cfdemParticle/etc/solver-list.txt b/src/lagrangian/cfdemParticle/etc/solver-list.txt index 925e9976..960eff2f 100644 --- a/src/lagrangian/cfdemParticle/etc/solver-list.txt +++ b/src/lagrangian/cfdemParticle/etc/solver-list.txt @@ -1,4 +1,14 @@ -cfdemSolverPisoMS/dir cfdemSolverPiso/dir cfdemSolverIB/dir cfdemSolverPisoScalar/dir +cfdemSolverPimpleImEx/dir +cfdemSolverIBInterLubrication/dir +cfdemSolverIBScalar/dir +cfdemSolverInterDyM/dir +cfdemSolverInterDyMPC/dir +cfdemSolverBubble/dir +cfdemSolverPisoMS/dir +cfdemSolverPimpleDyM_22x/dir +cfdemSolverPimpleDyMMS_22x/dir +cfdemSolverPimpleDyMScalar_22x/dir +myPimpleDyMFoam/dir diff --git a/src/lagrangian/cfdemParticle/etc/tutorial-list.txt b/src/lagrangian/cfdemParticle/etc/tutorial-list.txt index d893faf1..92456e25 100644 --- a/src/lagrangian/cfdemParticle/etc/tutorial-list.txt +++ b/src/lagrangian/cfdemParticle/etc/tutorial-list.txt @@ -7,15 +7,51 @@ #===================================================================# cfdemSolverPiso/settlingTestMPI/dir - cfdemSolverPiso/ErgunTestMPI/dir - cfdemSolverPiso/ErgunTestMPI_cgs/dir - cfdemSolverPiso/ErgunTestMPI_restart/dir - cfdemSolverIB/twoSpheresGlowinskiMPI/dir - cfdemSolverPisoScalar/packedBedTemp/dir +#===================================================================# +# RADL +cfdemSolverPimpleImEx/settlingTestMPI/dir +cfdemSolverPimpleImEx/ErgunTestMPI/dir +#cfdemSolverPimpleImEx/crossFlow/dir +#cfdemSolverIB/periodicCase/dir +#cfdemSolverIB/cfdemIBPeriodicCubicalBox_fullyPeriodic/dir +#cfdemSolverIBInterLubrication/twoCoatedParticlesRelMotion_smallTest/dir +#cfdemSolverIBScalar/cfdemIBPeriodicCubicalBoxScalar/dir + +#===================================================================# +# NesteJacobs +#Projects/Neste/cfdemSolverBubble/3pFBreactor/dir +#Projects/Neste/cfdemSolverInterDyM/3pFBreactor/dir + +#===================================================================# +# not in release: + +#cfdemSolverPiso/settlingTestBigParticleMPI/dir cfdemSolverPiso/ErgunTestCG/dir +cfdemSolverPiso/ErgunTestM2M/dir +#cfdemSolverPiso/HopperEmptying/dir + +cfdemSolverPimpleDyM/ErgunTestMPI/dir + +#cfdemSolverPisoMS/settlingTestMPI/dir +#cfdemSolverPisoMS/ErgunTestMPI/dir + +#cfdemSolverInterDyM/twoPhaseSettlingTest/dir +#cfdemSolverInterDyM/ErgunTestMPI/dir +#cfdemSolverInterDyM/granularPiston/dir +#cfdemSolverInterDyM/sugarNcoffee/dir + +#cfdemSolverBubble/ErgunTestMPI_pureLiquid/dir + +#- these examples are already designed for 2.3.x +#cfdemSolverInterDyMPC/sugarNcoffee/dir +#cfdemSolverInterDyMPC/granularPiston/dir +#cfdemSolverInterDyMPC/meltingPot/dir + + + diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C index c932fdaa..100d2bcd 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C @@ -137,7 +137,7 @@ void Foam::dataExchangeModel::allocateArray { int len=0; if(strcmp(length,"nparticles")==0) len = particleCloud_.numberOfParticles(); - else if (strcmp(length,"nbodies")==0) len = nClumpTypes_; + else if (strcmp(length,"nbodies")==0) len = particleCloud_.numberOfClumps(); else FatalError<<"call allocateArray with length, nparticles or nbodies!\n" << abort(FatalError); allocateArray(array,initVal,width,len); } @@ -226,7 +226,7 @@ scalar Foam::dataExchangeModel::timeStepFraction() const } int Foam::dataExchangeModel::getNumberOfParticles() const { - Warning << "ask for nr of clumps - which is not supported for this dataExchange model" << endl; + Warning << "ask for nr of particles - which is not supported for this dataExchange model" << endl; return -1; } @@ -235,7 +235,17 @@ int Foam::dataExchangeModel::getNumberOfClumps() const Warning << "ask for nr of clumps - which is not supported for this dataExchange model" << endl; return -1; } +int Foam::dataExchangeModel::getNumberOfTypes() const +{ + Warning << "ask for nr of types - which is not supported for this dataExchange model" << endl; + return -1; +} +double* Foam::dataExchangeModel::getTypeVol() const +{ + Warning << "ask for type volume - which is not supported for this dataExchange model" << endl; + return NULL; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components @@ -248,7 +258,6 @@ dataExchangeModel::dataExchangeModel dict_(dict), particleCloud_(sm), maxNumberOfParticles_(0), - nClumpTypes_(1), couplingStep_(0), DEMts_(-1.), couplingInterval_(readScalar(dict_.lookup("couplingInterval"))) diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H index db14e440..879d7fa3 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H @@ -62,8 +62,6 @@ protected: int maxNumberOfParticles_; - int nClumpTypes_; - mutable int couplingStep_; scalar DEMts_; @@ -120,8 +118,6 @@ public: // Member Function inline const int& maxNumberOfParticles() const {return maxNumberOfParticles_;}; - inline int nClumpTypes() const {return nClumpTypes_;}; - template