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/cfdemSolverIB/Make/options b/applications/solvers/cfdemSolverIB/Make/options index c32ff599..8a1101ab 100755 --- a/applications/solvers/cfdemSolverIB/Make/options +++ b/applications/solvers/cfdemSolverIB/Make/options @@ -11,7 +11,6 @@ EXE_INC = \ -I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude - EXE_LIBS = \ -L$(CFDEM_LIB_DIR)\ -lincompressibleRASModels \ @@ -22,3 +21,4 @@ EXE_LIBS = \ -ldynamicMesh \ -lfvOptions \ -l$(CFDEM_LIB_NAME) + diff --git a/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C b/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C index 87d83393..025b264a 100644 --- a/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C +++ b/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C @@ -42,6 +42,7 @@ Description #include "implicitCouple.H" #include "clockModel.H" #include "smoothingModel.H" +#include "forceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,10 +60,9 @@ int main(int argc, char *argv[]) #include "checkModelType.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - + Info<< "\nStarting time loop\n" << endl; while (runTime.loop()) { - Info<< "\nStarting time loop\n" << endl; particleCloud.clockM().start(1,"Global"); Info<< "Time = " << runTime.timeName() << nl << endl; @@ -72,7 +72,17 @@ int main(int argc, char *argv[]) // do particle stuff particleCloud.clockM().start(2,"Coupling"); - particleCloud.evolve(voidfraction,Us,U); + bool hasEvolved = particleCloud.evolve(voidfraction,Us,U); + + if(hasEvolved) + { + //Smoothen implicit momCoupling force + //fSmooth.internalField() = particleCloud.forceM(0).impParticleForces() ; + //particleCloud.smoothingM().smoothen(fSmooth); + //fSmooth.correctBoundaryConditions(); + //particleCloud.forceM(0).impParticleForces() = fSmooth; + particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces()); + } Info << "update Ksl.internalField()" << endl; Ksl = particleCloud.momCoupleM(0).impMomSource(); @@ -97,16 +107,16 @@ int main(int argc, char *argv[]) // Momentum predictor fvVectorMatrix UEqn ( - fvm::ddt(voidfraction,U) + fvm::Sp(fvc::ddt(voidfraction),U) - + fvm::div(phi,U) + fvm::Sp(fvc::div(phi),U) + fvm::ddt(voidfraction,U) - fvm::Sp(fvc::ddt(voidfraction),U) + + fvm::div(phi,U) - fvm::Sp(fvc::div(phi),U) // + turbulence->divDevReff(U) + particleCloud.divVoidfractionTau(U, voidfraction) == - fvm::Sp(Ksl/rho,U) ); - if (modelType=="B") - UEqn == - fvc::grad(p) + Ksl/rho*Us; + if (modelType=="B" || modelType=="Bfull") + UEqn == - fvc::grad(p) + Ksl/rho*Us; else UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us; @@ -169,7 +179,7 @@ int main(int argc, char *argv[]) #include "continuityErrorPhiPU.H" - if (modelType=="B") + if (modelType=="B" || modelType=="Bfull") U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA; else U -= voidfraction*rUA*fvc::grad(p) - Ksl/rho*Us*rUA; diff --git a/applications/solvers/cfdemSolverPiso/createFields.H b/applications/solvers/cfdemSolverPiso/createFields.H index 849ef338..fba80df6 100644 --- a/applications/solvers/cfdemSolverPiso/createFields.H +++ b/applications/solvers/cfdemSolverPiso/createFields.H @@ -89,6 +89,22 @@ mesh ); +/* + volVectorField fSmooth + ( + IOobject + ( + "fSmooth", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::NO_WRITE + ), + mesh, + dimensionedVector("0", dimensionSet(1, 1, -2, 0, 0), vector::zero) + ); +*/ + //=============================== //# include "createPhi.H" diff --git a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C index ac015944..6a3bf53c 100644 --- a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C +++ b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C @@ -40,30 +40,26 @@ Description #include "cfdemCloud.H" #include "implicitCouple.H" -#include "forceModel.H" #include "smoothingModel.H" +#include "forceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" - #include "createTime.H" #include "createMesh.H" #include "createFields.H" - #include "initContinuityErrs.H" // create cfdemCloud #include "readGravitationalAcceleration.H" cfdemCloud particleCloud(mesh); - #include "checkModelType.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; @@ -73,7 +69,7 @@ int main(int argc, char *argv[]) // do particle stuff Info << "- evolve()" << endl; - particleCloud.evolve(voidfraction,Us,U); + bool hasEvolved = particleCloud.evolve(voidfraction,Us,U); Ksl.internalField() = particleCloud.momCoupleM(0).impMomSource(); particleCloud.smoothingM().smoothen(Ksl); @@ -115,7 +111,7 @@ int main(int argc, char *argv[]) if (momentumPredictor) { //solve UEqn - if (modelType=="B") + if (modelType=="B" || modelType=="Bfull") solve(UEqn == - fvc::grad(p) + Ksl/rho*Us); else solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us); @@ -176,7 +172,7 @@ int main(int argc, char *argv[]) #include "continuityErrorPhiPU.H" - if (modelType=="B") + if (modelType=="B" || modelType=="Bfull") U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA; else U -= voidfraction*rUA*fvc::grad(p) - Ksl/rho*Us*rUA; diff --git a/applications/utilities/cfdemPostproc/cfdemPostproc.C b/applications/utilities/cfdemPostproc/cfdemPostproc.C index 8db48d87..478136e3 100644 --- a/applications/utilities/cfdemPostproc/cfdemPostproc.C +++ b/applications/utilities/cfdemPostproc/cfdemPostproc.C @@ -71,6 +71,7 @@ int main(int argc, char *argv[]) double **voidfractions_; double **particleWeights_; double **particleVolumes_; + double **particleV_; double **cellIDs_; particleCloud.dataExchangeM().allocateArray(positions_,0.,3); @@ -80,6 +81,7 @@ int main(int argc, char *argv[]) particleCloud.dataExchangeM().allocateArray(voidfractions_,0.,1); particleCloud.dataExchangeM().allocateArray(particleWeights_,0.,1); particleCloud.dataExchangeM().allocateArray(particleVolumes_,0.,1); + particleCloud.dataExchangeM().allocateArray(particleV_,0.,1); particleCloud.get_cellIDs(cellIDs_); // get ref to cellIDs //particleCloud.dataExchangeM().allocateArray(cellIDs_,0.,1); @@ -105,7 +107,7 @@ int main(int argc, char *argv[]) particleCloud.locateM().findCell(NULL,positions_,cellIDs_,particleCloud.numberOfParticles()); particleCloud.setPos(positions_); - particleCloud.voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_); + particleCloud.voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_,particleV_); voidfraction.internalField() = particleCloud.voidFractionM().voidFractionInterp(); voidfraction.correctBoundaryConditions(); @@ -135,6 +137,7 @@ int main(int argc, char *argv[]) particleCloud.dataExchangeM().destroy(voidfractions_,1); particleCloud.dataExchangeM().destroy(particleWeights_,1); particleCloud.dataExchangeM().destroy(particleVolumes_,1); + particleCloud.dataExchangeM().destroy(particleV_,1); //particleCloud.dataExchangeM().destroy(cellIDs_); // destroyed in cloud Info<< "End\n" << endl; diff --git a/doc/CFDEMcoupling_Manual.html b/doc/CFDEMcoupling_Manual.html index 793e3968..5f120f05 100644 --- a/doc/CFDEMcoupling_Manual.html +++ b/doc/CFDEMcoupling_Manual.html @@ -164,7 +164,7 @@ In order to get the latest code version, please use the git repository at http:/

modelType 
 
-

"modelType" refers to the formulation of the equations to be solved. Choose "A" or "B", according to Zhou et al. (2010): "Discrete particle simulation of particle-fluid flow: model formulations and their applicability", JFM. "A" requires the use of the force models gradPForce and viscForce, whereas "B" requires the force model "Archimedes". +

"modelType" refers to the formulation of the equations to be solved. Choose "A", "B" or "Bfull", according to Zhou et al. (2010): "Discrete particle simulation of particle-fluid flow: model formulations and their applicability", JFM. "A" requires the use of the force models gradPForce and viscForce, whereas "B" requires the force model "Archimedes". "Bfull" refers to model type I.

couplingInterval 
 
diff --git a/doc/CFDEMcoupling_Manual.pdf b/doc/CFDEMcoupling_Manual.pdf index 334e5e73..2f6afc0c 100644 Binary files a/doc/CFDEMcoupling_Manual.pdf and b/doc/CFDEMcoupling_Manual.pdf differ diff --git a/doc/CFDEMcoupling_Manual.txt b/doc/CFDEMcoupling_Manual.txt index 9d5ebd48..6e0f2156 100644 --- a/doc/CFDEMcoupling_Manual.txt +++ b/doc/CFDEMcoupling_Manual.txt @@ -133,7 +133,7 @@ Reasonable example settings for the "couplingProperties" dictionary are given in modelType :pre -"modelType" refers to the formulation of the equations to be solved. Choose "A" or "B", according to Zhou et al. (2010): "Discrete particle simulation of particle-fluid flow: model formulations and their applicability", JFM. "A" requires the use of the force models gradPForce and viscForce, whereas "B" requires the force model "Archimedes". +"modelType" refers to the formulation of the equations to be solved. Choose "A", "B" or "Bfull", according to Zhou et al. (2010): "Discrete particle simulation of particle-fluid flow: model formulations and their applicability", JFM. "A" requires the use of the force models gradPForce and viscForce, whereas "B" requires the force model "Archimedes". "Bfull" refers to model type I. couplingInterval :pre diff --git a/doc/forceModel.html b/doc/forceModel.html index 411ada29..0e71fa58 100644 --- a/doc/forceModel.html +++ b/doc/forceModel.html @@ -33,7 +33,7 @@

Description:

-

The force model performs the calculation of forces (e.g. fluid-particle interaction forces) acting on each DEM particle. All force models selected are executed sequentially and the forces on the particles are superposed. +

The force model performs the calculation of forces (e.g. fluid-particle interaction forces) acting on each DEM particle. All force models selected are executed sequentially and the forces on the particles are superposed. If the fluid density field is needed, by default a field named "rho" will be used. Via the forceSubModel an alternative field can be chosen.

Restrictions:

diff --git a/doc/forceModel.txt b/doc/forceModel.txt index 790b1106..4ae3a1a1 100644 --- a/doc/forceModel.txt +++ b/doc/forceModel.txt @@ -31,7 +31,7 @@ Note: This examples list might not be complete - please look for other models (f [Description:] -The force model performs the calculation of forces (e.g. fluid-particle interaction forces) acting on each DEM particle. All force models selected are executed sequentially and the forces on the particles are superposed. +The force model performs the calculation of forces (e.g. fluid-particle interaction forces) acting on each DEM particle. All force models selected are executed sequentially and the forces on the particles are superposed. If the fluid density field is needed, by default a field named "rho" will be used. Via the forceSubModel an alternative field can be chosen. [Restrictions:] diff --git a/doc/forceModel_Archimedes.html b/doc/forceModel_Archimedes.html index 95e5156b..8301478d 100644 --- a/doc/forceModel_Archimedes.html +++ b/doc/forceModel_Archimedes.html @@ -19,13 +19,10 @@ ); ArchimedesProps { - densityFieldName "density"; gravityFieldName "gravity"; }; -