diff --git a/README b/README
index fd2ca75..2a7f869 100755
--- a/README
+++ b/README
@@ -25,16 +25,17 @@ License
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).
+ This code provides models and solvers 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
+CFDEM(R) coupling provides an open source parallel coupled CFD-DEM framework
+combining the strengths of LIGGGHTS(R) DEM code and the Open Source
+CFD package OpenFOAM(R)(*). The CFDEM(R)coupling 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
+code LIGGGHTS(R). 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.
@@ -54,7 +55,7 @@ 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
+- "doc" directory including the documentation of CFDEM(R)coupling
- "tutorials" directory including basic tutorial cases showing the functionality
@@ -64,18 +65,17 @@ 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) -
+CFDEM(R)coupling stands for Computational Fluid Dynamics (CFD) -
Discrete Element Method (DEM) coupling.
-CFDEMcoupling is an open-source code, distributed freely under the terms of the
+CFDEM(R)coupling is an open-source code, distributed freely under the terms of the
GNU Public License (GPL).
-Core development of CFDEMcoupling is done by
+Core development of CFDEM(R)coupling 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.
+(*) "OpenFOAM(R)"_of is a registered trade mark of OpenCFD Limited, a wholly owned subsidiary of the ESI Group.
+This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks.
\*---------------------------------------------------------------------------*/
diff --git a/applications/.gitignore b/applications/.gitignore
new file mode 100644
index 0000000..4459954
--- /dev/null
+++ b/applications/.gitignore
@@ -0,0 +1,7 @@
+*.o
+*.d
+*.a
+*.dep
+log_*
+log.*
+*~
diff --git a/applications/solvers/cfdemSolverIB/Make/options b/applications/solvers/cfdemSolverIB/Make/options
index c32ff59..a51d1da 100755
--- a/applications/solvers/cfdemSolverIB/Make/options
+++ b/applications/solvers/cfdemSolverIB/Make/options
@@ -1,3 +1,5 @@
+include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
+
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
@@ -11,7 +13,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 \
@@ -21,4 +22,7 @@ EXE_LIBS = \
-ldynamicFvMesh \
-ldynamicMesh \
-lfvOptions \
- -l$(CFDEM_LIB_NAME)
+ -l$(CFDEM_LIB_NAME) \
+ $(CFDEM_ADD_LIB_PATHS) \
+ $(CFDEM_ADD_LIBS)
+
diff --git a/applications/solvers/cfdemSolverIB/cfdemSolverIB.C b/applications/solvers/cfdemSolverIB/cfdemSolverIB.C
index 93f0d41..9c930e6 100755
--- a/applications/solvers/cfdemSolverIB/cfdemSolverIB.C
+++ b/applications/solvers/cfdemSolverIB/cfdemSolverIB.C
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
#include "initContinuityErrs.H"
#if defined(version22)
- #include "createFvOptions.H"
+ #include "createFvOptions.H"
#endif
// create cfdemCloud
@@ -128,10 +128,12 @@ int main(int argc, char *argv[])
for (int corr=0; corr());
+ Info << "TotalForceExp: " << fTotal << endl;
+ Info << "TotalForceImp: " << fImpTotal << endl;
+
#include "solverDebugInfo.H"
particleCloud.clockM().stop("Coupling");
@@ -91,23 +102,19 @@ 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;
- else
- UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us;
-
UEqn.relax();
-
- if (momentumPredictor)
- solve(UEqn);
+ if (momentumPredictor && (modelType=="B" || modelType=="Bfull"))
+ solve(UEqn == - fvc::grad(p) + Ksl/rho*Us);
+ else if (momentumPredictor)
+ solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us);
// --- PISO loop
@@ -120,11 +127,17 @@ int main(int argc, char *argv[])
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
+ surfaceScalarField rUAfvoidfraction("(voidfraction2|A(U)F)", fvc::interpolate(rUAvoidfraction));
U = rUA*UEqn.H();
- phi = (fvc::interpolate(U*voidfraction) & mesh.Sf() );
- //+ fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
+ #ifdef version23
+ phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ + rUAfvoidfraction*fvc::ddtCorr(U, phi);
+ #else
+ phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ + fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
+ #endif
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);
@@ -157,13 +170,14 @@ int main(int argc, char *argv[])
if (nonOrth == nNonOrthCorr)
{
phiGes -= pEqn.flux();
+ phi = phiGes;
}
} // end non-orthogonal corrector loop
#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;
@@ -191,7 +205,7 @@ int main(int argc, char *argv[])
}
Info<< "End\n" << endl;
-
+
return 0;
}
diff --git a/applications/solvers/cfdemSolverPisoScalar/Make/options b/applications/solvers/cfdemSolverPisoScalar/Make/options
index e79c26f..68aecd1 100644
--- a/applications/solvers/cfdemSolverPisoScalar/Make/options
+++ b/applications/solvers/cfdemSolverPisoScalar/Make/options
@@ -1,3 +1,5 @@
+include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
+
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
@@ -12,4 +14,6 @@ EXE_LIBS = \
-lincompressibleLESModels \
-lincompressibleTransportModels \
-lfiniteVolume \
- -l$(CFDEM_LIB_NAME)
+ -l$(CFDEM_LIB_NAME) \
+ $(CFDEM_ADD_LIB_PATHS) \
+ $(CFDEM_ADD_LIBS)
diff --git a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C
index ac01594..2a3e49a 100644
--- a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C
+++ b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C
@@ -30,7 +30,7 @@ Application
Description
Transient solver for incompressible flow.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
- The code is an evolution of the solver pisoFoam in OpenFOAM(R) 1.6,
+ The code is an evolution of the solver pisoFoam in OpenFOAM(R) 1.6,
where additional functionality for CFD-DEM coupling is added.
\*---------------------------------------------------------------------------*/
@@ -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;
@@ -72,11 +68,15 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
// 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);
+ if(hasEvolved)
+ {
+ particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
+ }
+
+ Info << "update Ksl.internalField()" << endl;
+ Ksl = particleCloud.momCoupleM(0).impMomSource();
Ksl.correctBoundaryConditions();
@@ -87,107 +87,116 @@ int main(int argc, char *argv[])
Tsource.correctBoundaryConditions();
// solve scalar transport equation
- phi = fvc::interpolate(U*voidfraction) & mesh.Sf();
-
- solve
+ fvScalarMatrix TEqn
(
- fvm::ddt(voidfraction,T)
- + fvm::div(phi, T)
- - fvm::laplacian(DT*voidfraction, T)
- ==
- Tsource
+ fvm::ddt(voidfraction,T) - fvm::Sp(fvc::ddt(voidfraction),T)
+ + fvm::div(phi, T) - fvm::Sp(fvc::div(phi),T)
+ - fvm::laplacian(DT*voidfraction, T)
+ ==
+ Tsource
);
+ TEqn.relax();
+ TEqn.solve();
- // Pressure-velocity PISO corrector
+ if(particleCloud.solveFlow())
{
- // Momentum predictor
- fvVectorMatrix UEqn
- (
- fvm::ddt(voidfraction,U)
- + fvm::div(phi, U)
- + turbulence->divDevReff(U)
- ==
- - fvm::Sp(Ksl/rho,U)
- );
-
- UEqn.relax();
-
- if (momentumPredictor)
+ // Pressure-velocity PISO corrector
{
- //solve UEqn
- if (modelType=="B")
+ // Momentum predictor
+ fvVectorMatrix UEqn
+ (
+ 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)
+ );
+
+ UEqn.relax();
+ if (momentumPredictor && (modelType=="B" || modelType=="Bfull"))
solve(UEqn == - fvc::grad(p) + Ksl/rho*Us);
- else
+ else if (momentumPredictor)
solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us);
+
+ // --- PISO loop
+
+ //for (int corr=0; corrcorrect();
+ }// end solveFlow
+ else
+ {
+ Info << "skipping flow solution." << endl;
}
- turbulence->correct();
-
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
diff --git a/applications/utilities/cfdemPostproc/Make/options b/applications/utilities/cfdemPostproc/Make/options
index c961d2d..c6a8758 100644
--- a/applications/utilities/cfdemPostproc/Make/options
+++ b/applications/utilities/cfdemPostproc/Make/options
@@ -1,3 +1,5 @@
+include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
+
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
@@ -14,4 +16,6 @@ EXE_LIBS = \
-lincompressibleTransportModels \
-lfiniteVolume \
-l$(CFDEM_LIB_NAME) \
+ $(CFDEM_ADD_LIB_PATHS) \
+ $(CFDEM_ADD_LIBS)
diff --git a/applications/utilities/cfdemPostproc/cfdemPostproc.C b/applications/utilities/cfdemPostproc/cfdemPostproc.C
index 8db48d8..478136e 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/applications/utilities/cfdemPostproc/createFields.H b/applications/utilities/cfdemPostproc/createFields.H
index ab0ae8a..6856c6f 100644
--- a/applications/utilities/cfdemPostproc/createFields.H
+++ b/applications/utilities/cfdemPostproc/createFields.H
@@ -26,7 +26,7 @@
IOobject::NO_WRITE
),
mesh,
- dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), vector::zero)
+ dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), Foam::vector::zero)
);
//========================
@@ -62,7 +62,7 @@
IOobject::AUTO_WRITE
),
mesh,
- dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), vector::zero)
+ dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), Foam::vector::zero)
);
//========================
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 0000000..4459954
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,7 @@
+*.o
+*.d
+*.a
+*.dep
+log_*
+log.*
+*~
diff --git a/doc/CFDEMcoupling_Manual.html b/doc/CFDEMcoupling_Manual.html
index 4bce9e4..2af4e1b 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
@@ -217,9 +217,11 @@ listing below of styles within certain commands.
| forceModel_DiFeliceDrag | forceModel_GidaspowDrag |
| forceModel_KochHillDrag | forceModel_LaEuScalarTemp |
| forceModel_MeiLift | forceModel_SchillerNaumannDrag |
-| forceModel_ShirgaonkarIB | forceModel_gradPForce |
-| forceModel_noDrag | forceModel_particleCellVolume |
-| forceModel_virtualMassForce | forceModel_viscForce |
+| forceModel_ShirgaonkarIB | forceModel_fieldStore |
+| forceModel_gradPForce | forceModel_noDrag |
+| forceModel_particleCellVolume | forceModel_virtualMassForce |
+| forceModel_viscForce | forceSubModel |
+| forceSubModel_ImEx | forceSubModel_ImExCorr |
| liggghtsCommandModel | liggghtsCommandModel_execute |
| liggghtsCommandModel_readLiggghtsData | liggghtsCommandModel_runLiggghts |
| liggghtsCommandModel_writeLiggghts | locateModel |
diff --git a/doc/CFDEMcoupling_Manual.pdf b/doc/CFDEMcoupling_Manual.pdf
index 11f58f2..95cb01e 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 65da209..2f80b73 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
@@ -221,6 +221,10 @@ Reasonable example settings for the "liggghtsCommands" dictionary are given in t
+
+
+
+
@@ -261,11 +265,15 @@ listing below of styles within certain commands.
"forceModel_MeiLift"_forceModel_MeiLift.html,
"forceModel_SchillerNaumannDrag"_forceModel_SchillerNaumannDrag.html,
"forceModel_ShirgaonkarIB"_forceModel_ShirgaonkarIB.html,
+"forceModel_fieldStore"_forceModel_fieldStore.html,
"forceModel_gradPForce"_forceModel_gradPForce.html,
"forceModel_noDrag"_forceModel_noDrag.html,
"forceModel_particleCellVolume"_forceModel_particleCellVolume.html,
"forceModel_virtualMassForce"_forceModel_virtualMassForce.html,
"forceModel_viscForce"_forceModel_viscForce.html,
+"forceSubModel"_forceSubModel.html,
+"forceSubModel_ImEx"_forceSubModel_ImEx.html,
+"forceSubModel_ImExCorr"_forceSubModel_ImExCorr.html,
"liggghtsCommandModel"_liggghtsCommandModel.html,
"liggghtsCommandModel_execute"_liggghtsCommandModel_execute.html,
"liggghtsCommandModel_readLiggghtsData"_liggghtsCommandModel_readLiggghtsData.html,
diff --git a/doc/cfdemSolverPisoScalar.html b/doc/cfdemSolverPisoScalar.html
index 599a219..191cd84 100644
--- a/doc/cfdemSolverPisoScalar.html
+++ b/doc/cfdemSolverPisoScalar.html
@@ -11,12 +11,14 @@
Description:
-"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
+
"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles, whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
see:
GONIVA, C., KLOSS, C., HAGER,A. and PIRKER, S. (2010): "An Open Source CFD-DEM Perspective", Proc. of OpenFOAM Workshop, Göteborg, June 22.-24.
+The heat transfer equation is implemented according to Nield & Bejan (2013), Convection in Porous Media, DOI 10.1007/978-1-4614-5541-7_2, Springer
+
(*) This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks. OPENFOAM® is a registered trade mark of OpenCFD Limited, a wholly owned subsidiary of the ESI Group.
diff --git a/doc/cfdemSolverPisoScalar.txt b/doc/cfdemSolverPisoScalar.txt
index 41126c4..f05ca93 100644
--- a/doc/cfdemSolverPisoScalar.txt
+++ b/doc/cfdemSolverPisoScalar.txt
@@ -9,12 +9,15 @@ cfdemSolverPisoScalar command :h3
[Description:]
-"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
+"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles, whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
see:
GONIVA, C., KLOSS, C., HAGER,A. and PIRKER, S. (2010): "An Open Source CFD-DEM Perspective", Proc. of OpenFOAM Workshop, Göteborg, June 22.-24.
+The heat transfer equation is implemented according to Nield & Bejan (2013), Convection in Porous Media, DOI 10.1007/978-1-4614-5541-7_2, Springer
+
+
:line
(*) This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks. OPENFOAM® is a registered trade mark of OpenCFD Limited, a wholly owned subsidiary of the ESI Group.
diff --git a/doc/clockModel_standardClock.html b/doc/clockModel_standardClock.html
index 57ec9ee..b757df1 100644
--- a/doc/clockModel_standardClock.html
+++ b/doc/clockModel_standardClock.html
@@ -23,7 +23,7 @@
The "standardClock" model is a basic clockModel model which measures the run time between every ".start(int arrayPos,string name)" and ".stop(string name)" statement placed in the code. If a ".start(name)" is called more than once (e.g. in a loop) the accumulated times are calculated. After the simulation has finished, the data is stored in $caseDir/CFD/clockData/$startTime/*.txt .
Since the measurements are stored in an array, it is necessary to put a variable arrayPos (type integer) at the start command. Those do not need to be in ascending order and positions may be omitted. The standard size of this array is 30 and can be changed at the initialization of the standardClock class. If arrayPos is out of bounds, the array size will be doubled. The stop command does not need arrayPos, since the class remembers the positions. The string name is intended for easier evaluation afterwards an may be omitted like ".start(int arrayPos)" and ".stop()". The command ".stop(string name)" is a safety feature, because if the name is not equal to the started name, output will be produced for information.
-After the case ran you may use the matPlot.py script located in $CFDEM_UT_DIR/vizClock/ to produce a graphical output of your measurements. The usage is like 'python < matPlot.py' and you have to be in the directory of the desired time step, where there is a file called "timeEvalFull.txt", which contains averaged and maximum data with respect to the number of processes.
+After the case ran you may use the matPlot.py script located in $CFDEM_UT_DIR/vizClock/ to produce a graphical output of your measurements. The usage is like 'python < matPlot.py' and you have to be in the directory of the desired time step, where there is a file called "timeEvalFull.txt", which contains averaged and maximum data with respect to the number of processes. There is an alias called "vizClock" to run this python routine for visualizing the data.
Restrictions: none.
diff --git a/doc/clockModel_standardClock.txt b/doc/clockModel_standardClock.txt
index 30d675c..bae9832 100644
--- a/doc/clockModel_standardClock.txt
+++ b/doc/clockModel_standardClock.txt
@@ -21,7 +21,7 @@ clockModel standardClock; :pre
The "standardClock" model is a basic clockModel model which measures the run time between every ".start(int arrayPos,string name)" and ".stop(string name)" statement placed in the code. If a ".start(name)" is called more than once (e.g. in a loop) the accumulated times are calculated. After the simulation has finished, the data is stored in $caseDir/CFD/clockData/$startTime/*.txt .
Since the measurements are stored in an array, it is necessary to put a variable {arrayPos} (type integer) at the start command. Those do not need to be in ascending order and positions may be omitted. The standard size of this array is 30 and can be changed at the initialization of the standardClock class. If {arrayPos} is out of bounds, the array size will be doubled. The stop command does not need {arrayPos}, since the class remembers the positions. The string name is intended for easier evaluation afterwards an may be omitted like ".start(int arrayPos)" and ".stop()". The command ".stop(string name)" is a safety feature, because if the name is not equal to the started name, output will be produced for information.
-After the case ran you may use the matPlot.py script located in $CFDEM_UT_DIR/vizClock/ to produce a graphical output of your measurements. The usage is like 'python < matPlot.py' and you have to be in the directory of the desired time step, where there is a file called "timeEvalFull.txt", which contains averaged and maximum data with respect to the number of processes.
+After the case ran you may use the matPlot.py script located in $CFDEM_UT_DIR/vizClock/ to produce a graphical output of your measurements. The usage is like 'python < matPlot.py' and you have to be in the directory of the desired time step, where there is a file called "timeEvalFull.txt", which contains averaged and maximum data with respect to the number of processes. There is an alias called "vizClock" to run this python routine for visualizing the data.
[Restrictions:] none.
diff --git a/doc/forceModel.html b/doc/forceModel.html
index 411ada2..0e71fa5 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 790b110..4ae3a1a 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 95e5156..8301478 100644
--- a/doc/forceModel_Archimedes.html
+++ b/doc/forceModel_Archimedes.html
@@ -19,13 +19,10 @@
);
ArchimedesProps
{
- densityFieldName "density";
gravityFieldName "gravity";
};
-- density = name of the finite volume density field
-
-
- gravity = name of the finite volume gravity field
+
- gravity = name of the finite volume gravity field
@@ -37,7 +34,6 @@ ArchimedesProps
);
ArchimedesProps
{
- densityFieldName "rho";
gravityFieldName "g";
}
diff --git a/doc/forceModel_Archimedes.txt b/doc/forceModel_Archimedes.txt
index cd3f765..41c18ae 100644
--- a/doc/forceModel_Archimedes.txt
+++ b/doc/forceModel_Archimedes.txt
@@ -17,12 +17,10 @@ forceModels
);
ArchimedesProps
\{
- densityFieldName "density";
gravityFieldName "gravity";
\}; :pre
-{density} = name of the finite volume density field :ulb,l
-{gravity} = name of the finite volume gravity field :l
+{gravity} = name of the finite volume gravity field :ulb,l
:ule
[Examples:]
@@ -33,7 +31,6 @@ forceModels
);
ArchimedesProps
\{
- densityFieldName "rho";
gravityFieldName "g";
\} :pre
diff --git a/doc/forceModel_ArchimedesIB.html b/doc/forceModel_ArchimedesIB.html
index 0146856..9f43172 100644
--- a/doc/forceModel_ArchimedesIB.html
+++ b/doc/forceModel_ArchimedesIB.html
@@ -19,14 +19,11 @@
);
ArchimedesIBProps
{
- densityFieldName "density";
gravityFieldName "gravity";
voidfractionFieldName "voidfraction";
};
-- density = name of the finite volume density field
-
-
- gravity = name of the finite volume gravity field
+
- gravity = name of the finite volume gravity field
- voidfraction = name of the finite volume voidfraction field
@@ -40,7 +37,6 @@ ArchimedesIBProps
);
ArchimedesIBProps
{
- densityFieldName "rho";
gravityFieldName "g";
voidfractionFieldName "voidfractionNext";
}
diff --git a/doc/forceModel_ArchimedesIB.txt b/doc/forceModel_ArchimedesIB.txt
index b9aca33..041d737 100644
--- a/doc/forceModel_ArchimedesIB.txt
+++ b/doc/forceModel_ArchimedesIB.txt
@@ -17,13 +17,11 @@ forceModels
);
ArchimedesIBProps
\{
- densityFieldName "density";
gravityFieldName "gravity";
voidfractionFieldName "voidfraction";
\}; :pre
-{density} = name of the finite volume density field :ulb,l
-{gravity} = name of the finite volume gravity field :l
+{gravity} = name of the finite volume gravity field :ulb,l
{voidfraction} = name of the finite volume voidfraction field :l
:ule
@@ -35,7 +33,6 @@ forceModels
);
ArchimedesIBProps
\{
- densityFieldName "rho";
gravityFieldName "g";
voidfractionFieldName "voidfractionNext";
\} :pre
diff --git a/doc/forceModel_DiFeliceDrag.html b/doc/forceModel_DiFeliceDrag.html
index 9b02164..53a2aeb 100644
--- a/doc/forceModel_DiFeliceDrag.html
+++ b/doc/forceModel_DiFeliceDrag.html
@@ -20,15 +20,12 @@
DiFeliceDragProps
{
velFieldName "U";
- densityFieldName "density";
- interpolation;
+ interpolation switch1;
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume gravity field
-
-
- interpolation = flag to use interpolated voidfraction and velocity values (normally off)
+
- switch1 = flag to use interpolated voidfraction and velocity values (normally off)
@@ -41,8 +38,7 @@ DiFeliceDragProps
DiFeliceDragProps
{
velFieldName "U";
- densityFieldName "rho";
- interpolation;
+ interpolation true;
}
Description:
diff --git a/doc/forceModel_DiFeliceDrag.txt b/doc/forceModel_DiFeliceDrag.txt
index 7180d17..77e6e4b 100644
--- a/doc/forceModel_DiFeliceDrag.txt
+++ b/doc/forceModel_DiFeliceDrag.txt
@@ -18,13 +18,11 @@ forceModels
DiFeliceDragProps
\{
velFieldName "U";
- densityFieldName "density";
- interpolation;
+ interpolation switch1;
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume gravity field :l
-{interpolation} = flag to use interpolated voidfraction and velocity values (normally off) :l
+{switch1} = flag to use interpolated voidfraction and velocity values (normally off) :l
:ule
[Examples:]
@@ -36,8 +34,7 @@ forceModels
DiFeliceDragProps
\{
velFieldName "U";
- densityFieldName "rho";
- interpolation;
+ interpolation true;
\} :pre
[Description:]
diff --git a/doc/forceModel_GidaspowDrag.html b/doc/forceModel_GidaspowDrag.html
index 0523427..9aa7318 100644
--- a/doc/forceModel_GidaspowDrag.html
+++ b/doc/forceModel_GidaspowDrag.html
@@ -20,24 +20,24 @@
GidaspowDragProps
{
velFieldName "U";
- densityFieldName "density";
voidfractionFieldName "voidfraction";
+ granVelFieldName "Us";
phi "scalar";
- interpolation;
- implDEM;
+ interpolation switch1;
+ implForceDEM switch2;
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume gravity field
-
- voidfraction = name of the finite volume voidfraction field
+
- Us = name of the finite volume cell averaged particle velocity field
+
- phi = drag correction factor (in doubt 1)
-
- interpolation = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values
+
- switch1 = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values
-implDEM = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
+switch2 = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
Examples:
@@ -49,8 +49,8 @@ GidaspowDragProps
GidaspowDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
+ granVelFieldName "Us";
}
Description:
diff --git a/doc/forceModel_GidaspowDrag.txt b/doc/forceModel_GidaspowDrag.txt
index 8357170..452c67f 100644
--- a/doc/forceModel_GidaspowDrag.txt
+++ b/doc/forceModel_GidaspowDrag.txt
@@ -18,19 +18,19 @@ forceModels
GidaspowDragProps
\{
velFieldName "U";
- densityFieldName "density";
voidfractionFieldName "voidfraction";
+ granVelFieldName "Us";
phi "scalar";
- interpolation;
- implDEM;
+ interpolation switch1;
+ implForceDEM switch2;
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume gravity field :l
{voidfraction} = name of the finite volume voidfraction field :l
+{Us} = name of the finite volume cell averaged particle velocity field :l
{phi} = drag correction factor (in doubt 1) :l
-{interpolation} = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values :l
-{implDEM} = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
+{switch1} = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values :l
+{switch2} = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
:ule
[Examples:]
@@ -42,8 +42,8 @@ forceModels
GidaspowDragProps
\{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
+ granVelFieldName "Us";
\} :pre
[Description:]
diff --git a/doc/forceModel_KochHillDrag.html b/doc/forceModel_KochHillDrag.html
index db34b8a..1cf16d9 100644
--- a/doc/forceModel_KochHillDrag.html
+++ b/doc/forceModel_KochHillDrag.html
@@ -20,21 +20,18 @@
KochHillDragProps
{
velFieldName "U";
- densityFieldName "density";
voidfractionFieldName "voidfraction";
- interpolation;
- implDEM;
+ interpolation "bool1";
+ implForceDEM "bool2";
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume gravity field
-
- voidfraction = name of the finite volume voidfraction field
-
- interpolation = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values
+
- bool1 = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values
-implDEM = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
+bool2 = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
Examples:
@@ -46,7 +43,6 @@ KochHillDragProps
KochHillDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
}
diff --git a/doc/forceModel_KochHillDrag.txt b/doc/forceModel_KochHillDrag.txt
index 5a783fe..0737bb2 100644
--- a/doc/forceModel_KochHillDrag.txt
+++ b/doc/forceModel_KochHillDrag.txt
@@ -18,17 +18,15 @@ forceModels
KochHillDragProps
\{
velFieldName "U";
- densityFieldName "density";
voidfractionFieldName "voidfraction";
- interpolation;
- implDEM;
+ interpolation "bool1";
+ implForceDEM "bool2";
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume gravity field :l
{voidfraction} = name of the finite volume voidfraction field :l
-{interpolation} = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values :l
-{implDEM} = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
+{bool1} = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values :l
+{bool2} = (optional, normally off) flag to use implicit formulation of drag on DEM side:l
:ule
[Examples:]
@@ -40,7 +38,6 @@ forceModels
KochHillDragProps
\{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
\} :pre
diff --git a/doc/forceModel_LaEuScalarTemp.html b/doc/forceModel_LaEuScalarTemp.html
index c0075c9..778d3e3 100644
--- a/doc/forceModel_LaEuScalarTemp.html
+++ b/doc/forceModel_LaEuScalarTemp.html
@@ -21,23 +21,19 @@ LaEuScalarTempProps
{
velFieldName "U";
tempFieldName "T";
- tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
lambda value;
Cp value1;
- densityFieldName "density";
- interpolation;
- verbose;
+ interpolation "switch1";
+ verbose "switch2";
};
- U = name of the finite volume fluid velocity field
- T = name of the finite volume scalar temperature field
-
- Tsource = name of the finite volume scalar temperature source field
-
- voidfraction = name of the finite volume voidfraction field
- Temp = name of the DEM data representing the particles temperature
@@ -48,11 +44,9 @@ LaEuScalarTempProps
- value1 = fluid specific heat capacity [W*s/(kg*K)]
-
- density = name of the finite volume fluid density field
+
- switch1 = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values
-
- interpolation = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values
-
-
- verbose = (normally off) for verbose run
+
- switch2 = (normally off) for verbose run
@@ -66,13 +60,11 @@ LaEuScalarTempProps
{
velFieldName "U";
tempFieldName "T";
- tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
lambda 0.0256;
Cp 1007;
- densityFieldName "rho";
}
Description:
@@ -81,7 +73,7 @@ LaEuScalarTempProps
Restrictions:
-Goes only with cfdemSolverScalar.
+
Goes only with cfdemSolverScalar. The force model has to be the second (!!!) model in the forces list.
Related commands:
diff --git a/doc/forceModel_LaEuScalarTemp.txt b/doc/forceModel_LaEuScalarTemp.txt
index a2b8690..307693c 100644
--- a/doc/forceModel_LaEuScalarTemp.txt
+++ b/doc/forceModel_LaEuScalarTemp.txt
@@ -19,28 +19,24 @@ LaEuScalarTempProps
\{
velFieldName "U";
tempFieldName "T";
- tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
lambda value;
Cp value1;
- densityFieldName "density";
- interpolation;
- verbose;
+ interpolation "switch1";
+ verbose "switch2";
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
{T} = name of the finite volume scalar temperature field :l
-{Tsource} = name of the finite volume scalar temperature source field :l
{voidfraction} = name of the finite volume voidfraction field :l
{Temp} = name of the DEM data representing the particles temperature :l
{convectiveHeatFlux} = name of the DEM data representing the particle-fluid convective heat flux :l
{value} = fluid thermal conductivity \[W/(m*K)\] :l
{value1} = fluid specific heat capacity \[W*s/(kg*K)\] :l
-{density} = name of the finite volume fluid density field :l
-{interpolation} = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values :l
-{verbose} = (normally off) for verbose run :l
+{switch1} = (optional, normally off) flag to use interpolated voidfraction and fluid velocity values :l
+{switch2} = (normally off) for verbose run :l
:ule
[Examples:]
@@ -53,13 +49,11 @@ LaEuScalarTempProps
\{
velFieldName "U";
tempFieldName "T";
- tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
lambda 0.0256;
Cp 1007;
- densityFieldName "rho";
\} :pre
[Description:]
@@ -68,7 +62,7 @@ This "forceModel" does not influence the particles or the fluid flow! Using the
[Restrictions:]
-Goes only with cfdemSolverScalar.
+Goes only with cfdemSolverScalar. The force model has to be the second (!!!) model in the forces list.
[Related commands:]
diff --git a/doc/forceModel_MeiLift.html b/doc/forceModel_MeiLift.html
index b1045e5..e21aa8b 100644
--- a/doc/forceModel_MeiLift.html
+++ b/doc/forceModel_MeiLift.html
@@ -20,21 +20,18 @@
MeiLiftProps
{
velFieldName "U";
- densityFieldName "density";
useSecondOrderTerms;
- interpolation;
- verbose;
+ interpolation "switch1";
+ verbose "switch2";
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume fluid density field
-
- useSecondOrderTerms = switch to activate second order terms in the lift force model
-
- interpolation = switch to activate tri-linear interpolation of the flow quantities at the particle position
+
- switch1 = switch to activate tri-linear interpolation of the flow quantities at the particle position
-
- verbose = switch to activate the report of per-particle quantities to the screen
+
- switch2 = switch to activate the report of per-particle quantities to the screen
@@ -47,10 +44,9 @@ MeiLiftProps
MeiLiftProps
{
velFieldName "U";
- densityFieldName "rho";
useSecondOrderTerms;
- interpolation;
- verbose;
+ interpolation true;
+ verbose true;
}
Description:
diff --git a/doc/forceModel_MeiLift.txt b/doc/forceModel_MeiLift.txt
index 4513065..205a597 100644
--- a/doc/forceModel_MeiLift.txt
+++ b/doc/forceModel_MeiLift.txt
@@ -18,17 +18,15 @@ forceModels
MeiLiftProps
\{
velFieldName "U";
- densityFieldName "density";
useSecondOrderTerms;
- interpolation;
- verbose;
+ interpolation "switch1";
+ verbose "switch2";
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume fluid density field :l
{useSecondOrderTerms} = switch to activate second order terms in the lift force model :l
-{interpolation} = switch to activate tri-linear interpolation of the flow quantities at the particle position :l
-{verbose} = switch to activate the report of per-particle quantities to the screen :l
+{switch1} = switch to activate tri-linear interpolation of the flow quantities at the particle position :l
+{switch2} = switch to activate the report of per-particle quantities to the screen :l
:ule
[Examples:]
@@ -40,10 +38,9 @@ forceModels
MeiLiftProps
\{
velFieldName "U";
- densityFieldName "rho";
useSecondOrderTerms;
- interpolation;
- verbose;
+ interpolation true;
+ verbose true;
\} :pre
[Description:]
diff --git a/doc/forceModel_SchillerNaumannDrag.html b/doc/forceModel_SchillerNaumannDrag.html
index acd2fa3..7ff1eca 100644
--- a/doc/forceModel_SchillerNaumannDrag.html
+++ b/doc/forceModel_SchillerNaumannDrag.html
@@ -20,13 +20,10 @@
SchillerNaumannDragProps
{
velFieldName "U";
- densityFieldName "density";
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume gravity field
-
Examples:
@@ -38,7 +35,6 @@ SchillerNaumannDragProps
SchillerNaumannDragProps
{
velFieldName "U";
- densityFieldName "rho";
}
Description:
diff --git a/doc/forceModel_SchillerNaumannDrag.txt b/doc/forceModel_SchillerNaumannDrag.txt
index 4357264..aaa1c8a 100644
--- a/doc/forceModel_SchillerNaumannDrag.txt
+++ b/doc/forceModel_SchillerNaumannDrag.txt
@@ -18,11 +18,9 @@ forceModels
SchillerNaumannDragProps
\{
velFieldName "U";
- densityFieldName "density";
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume gravity field :l
:ule
[Examples:]
@@ -34,7 +32,6 @@ forceModels
SchillerNaumannDragProps
\{
velFieldName "U";
- densityFieldName "rho";
\} :pre
[Description:]
diff --git a/doc/forceModel_ShirgaonkarIB.html b/doc/forceModel_ShirgaonkarIB.html
index 5e198cf..27e0ddc 100644
--- a/doc/forceModel_ShirgaonkarIB.html
+++ b/doc/forceModel_ShirgaonkarIB.html
@@ -20,14 +20,11 @@
ShirgaonkarIBProps
{
velFieldName "U";
- densityFieldName "density";
pressureFieldName "pressure";
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume density field
-
- pressure = name of the finite volume pressure field
@@ -41,7 +38,6 @@ ShirgaonkarIBProps
ShirgaonkarIBProps
{
velFieldName "U";
- densityFieldName "rho";
pressureFieldName "p";
}
diff --git a/doc/forceModel_ShirgaonkarIB.txt b/doc/forceModel_ShirgaonkarIB.txt
index 9f488cf..87cae6c 100644
--- a/doc/forceModel_ShirgaonkarIB.txt
+++ b/doc/forceModel_ShirgaonkarIB.txt
@@ -18,12 +18,10 @@ forceModels
ShirgaonkarIBProps
\{
velFieldName "U";
- densityFieldName "density";
pressureFieldName "pressure";
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume density field :l
{pressure} = name of the finite volume pressure field :l
:ule
@@ -36,7 +34,6 @@ forceModels
ShirgaonkarIBProps
\{
velFieldName "U";
- densityFieldName "rho";
pressureFieldName "p";
\} :pre
diff --git a/doc/forceModel_fieldStore.html b/doc/forceModel_fieldStore.html
new file mode 100644
index 0000000..d21cbcb
--- /dev/null
+++ b/doc/forceModel_fieldStore.html
@@ -0,0 +1,68 @@
+
+CFDEMproject WWW Site - CFDEM Commands
+
+
+
+
+
+
+
+forceModel_fieldStore command
+
+Syntax:
+
+Defined in couplingProperties dictionary.
+
+forceModels
+(
+ fieldStore
+);
+fieldStoreProps
+{
+ scalarFieldNames
+ (
+ "scalarField"
+ );
+ vectorFieldNames
+ (
+ "vectorField"
+ );
+};
+
+- scalarField = names of the finite volume scalar fields to be stored
+
+
- vectorField = names of the finite volume vector fields to be stored
+
+
+
+Examples:
+
+forceModels
+(
+ fieldStore
+);
+fieldStoreProps
+{
+ scalarFieldNames
+ (
+ "voidfraction"
+ );
+ vectorFieldNames
+ (
+ "U"
+ );
+}
+
+Description:
+
+This "forceModel" does not influence the particles or the flow - it is a tool to store a scalar/vector field! This is especially useful if you use a boundary condition which cannot interpreted correctly in your postporcessor (e.g. paraview).
+
+Restrictions:
+
+none.
+
+Related commands:
+
+forceModel
+
+
diff --git a/doc/forceModel_fieldStore.txt b/doc/forceModel_fieldStore.txt
new file mode 100644
index 0000000..2e8af44
--- /dev/null
+++ b/doc/forceModel_fieldStore.txt
@@ -0,0 +1,63 @@
+"CFDEMproject WWW Site"_lws - "CFDEM Commands"_lc :c
+
+:link(lws,http://www.cfdem.com)
+:link(lc,CFDEMcoupling_Manual.html#comm)
+
+:line
+
+forceModel_fieldStore command :h3
+
+[Syntax:]
+
+Defined in couplingProperties dictionary.
+
+forceModels
+(
+ fieldStore
+);
+fieldStoreProps
+\{
+ scalarFieldNames
+ (
+ "scalarField"
+ );
+ vectorFieldNames
+ (
+ "vectorField"
+ );
+\}; :pre
+
+{scalarField} = names of the finite volume scalar fields to be stored :ulb,l
+{vectorField} = names of the finite volume vector fields to be stored :l
+:ule
+
+[Examples:]
+
+forceModels
+(
+ fieldStore
+);
+fieldStoreProps
+\{
+ scalarFieldNames
+ (
+ "voidfraction"
+ );
+ vectorFieldNames
+ (
+ "U"
+ );
+\} :pre
+
+[Description:]
+
+This "forceModel" does not influence the particles or the flow - it is a tool to store a scalar/vector field! This is especially useful if you use a boundary condition which cannot interpreted correctly in your postporcessor (e.g. paraview).
+
+[Restrictions:]
+
+none.
+
+[Related commands:]
+
+"forceModel"_forceModel.html
+
diff --git a/doc/forceModel_gradPForce.html b/doc/forceModel_gradPForce.html
index f555313..661b4a0 100644
--- a/doc/forceModel_gradPForce.html
+++ b/doc/forceModel_gradPForce.html
@@ -20,18 +20,15 @@
gradPForceProps
{
pFieldName "pressure";
- densityFieldName "density";
velocityFieldName "U";
- interpolation;
+ interpolation switch1;
};
- pressure = name of the finite volume fluid pressure field
-
- density = name of the finite volume gravity field
-
- U = name of the finite volume fluid velocity field
-
- interpolation = flag to use interpolated pressure values (normally off)
+
- switch1 = flag to use interpolated pressure values (normally off)
@@ -44,9 +41,8 @@ gradPForceProps
gradPForceProps
{
pFieldName "p";
- densityFieldName "rho";
velocityFieldName "U";
- interpolation;
+ interpolation true;
}
Description:
diff --git a/doc/forceModel_gradPForce.txt b/doc/forceModel_gradPForce.txt
index 7a0801d..68a8b30 100644
--- a/doc/forceModel_gradPForce.txt
+++ b/doc/forceModel_gradPForce.txt
@@ -18,15 +18,13 @@ forceModels
gradPForceProps
\{
pFieldName "pressure";
- densityFieldName "density";
velocityFieldName "U";
- interpolation;
+ interpolation switch1;
\}; :pre
{pressure} = name of the finite volume fluid pressure field :ulb,l
-{density} = name of the finite volume gravity field :l
{U} = name of the finite volume fluid velocity field :l
-{interpolation} = flag to use interpolated pressure values (normally off) :l
+{switch1} = flag to use interpolated pressure values (normally off) :l
:ule
[Examples:]
@@ -38,9 +36,8 @@ forceModels
gradPForceProps
\{
pFieldName "p";
- densityFieldName "rho";
velocityFieldName "U";
- interpolation;
+ interpolation true;
\} :pre
[Description:]
diff --git a/doc/forceModel_virtualMassForce.html b/doc/forceModel_virtualMassForce.html
index 98202c4..8c7499f 100644
--- a/doc/forceModel_virtualMassForce.html
+++ b/doc/forceModel_virtualMassForce.html
@@ -20,13 +20,10 @@
virtualMassForceProps
{
velFieldName "U";
- densityFieldName "density";
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume fluid density field
-
Examples:
@@ -38,7 +35,6 @@ virtualMassForceProps
virtualMassForceProps
{
velFieldName "U";
- densityFieldName "rho";
}
Description:
diff --git a/doc/forceModel_virtualMassForce.txt b/doc/forceModel_virtualMassForce.txt
index af55780..084371f 100644
--- a/doc/forceModel_virtualMassForce.txt
+++ b/doc/forceModel_virtualMassForce.txt
@@ -18,11 +18,9 @@ forceModels
virtualMassForceProps
\{
velFieldName "U";
- densityFieldName "density";
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume fluid density field :l
:ule
[Examples:]
@@ -34,7 +32,6 @@ forceModels
virtualMassForceProps
\{
velFieldName "U";
- densityFieldName "rho";
\} :pre
[Description:]
diff --git a/doc/forceModel_viscForce.html b/doc/forceModel_viscForce.html
index ebd76ec..cb233bf 100644
--- a/doc/forceModel_viscForce.html
+++ b/doc/forceModel_viscForce.html
@@ -20,15 +20,12 @@
viscForceProps
{
velocityFieldName "U";
- densityFieldName "density";
- interpolation;
+ interpolation "switch";
};
- U = name of the finite volume fluid velocity field
-
- density = name of the finite volume gravity field
-
-
- interpolation = flag to use interpolated stress values (normally off)
+
- switch = flag to use interpolated stress values (normally off)
@@ -41,7 +38,6 @@ viscForceProps
viscForceProps
{
velocityFieldName "U";
- densityFieldName "density";
}
Description:
diff --git a/doc/forceModel_viscForce.txt b/doc/forceModel_viscForce.txt
index 8577846..6bcd3cb 100644
--- a/doc/forceModel_viscForce.txt
+++ b/doc/forceModel_viscForce.txt
@@ -18,13 +18,11 @@ forceModels
viscForceProps
\{
velocityFieldName "U";
- densityFieldName "density";
- interpolation;
+ interpolation "switch";
\}; :pre
{U} = name of the finite volume fluid velocity field :ulb,l
-{density} = name of the finite volume gravity field :l
-{interpolation} = flag to use interpolated stress values (normally off) :l
+{switch} = flag to use interpolated stress values (normally off) :l
:ule
[Examples:]
@@ -36,7 +34,6 @@ forceModels
viscForceProps
\{
velocityFieldName "U";
- densityFieldName "density";
\} :pre
[Description:]
diff --git a/doc/forceSubModel.html b/doc/forceSubModel.html
new file mode 100644
index 0000000..090c1c9
--- /dev/null
+++ b/doc/forceSubModel.html
@@ -0,0 +1,49 @@
+
+
CFDEMproject WWW Site - CFDEM Commands
+
+
+
+
+
+
+
+forceSubModel command
+
+Syntax:
+
+Defined in couplingProperties sub-dictionary of the force model in use. If no force sub-model is applied ImEx is used as default. If the keyword "forceSubModels" is provided, a choice of sub model is demanded.
+
+forceSubModels
+(
+ model_x
+ model_y
+);
+
+- model = name of force sub-model to be applied
+
+Examples:
+
+forceSubModels
+(
+ ImEx
+);
+
+Note: This examples list might not be complete - please look for other models (forceSubModel_XY) in this documentation.
+
+Description:
+
+The force sub model is designed to hold the settings a force model can have. For now it handles the treatExplicit, treatDEM and implDEM option.
+
+Restrictions:
+
+None.
+
+Related commands:
+
+ImEx
+
+Note: This examples list may be incomplete - please look for other models (forceSubModel_XY) in this documentation.
+
+Default: none.
+
+
diff --git a/doc/forceSubModel.txt b/doc/forceSubModel.txt
new file mode 100644
index 0000000..8d150a9
--- /dev/null
+++ b/doc/forceSubModel.txt
@@ -0,0 +1,45 @@
+"CFDEMproject WWW Site"_lws - "CFDEM Commands"_lc :c
+
+:link(lws,http://www.cfdem.com)
+:link(lc,CFDEMcoupling_Manual.html#comm)
+
+:line
+
+forceSubModel command :h3
+
+[Syntax:]
+
+Defined in couplingProperties sub-dictionary of the force model in use. If no force sub-model is applied ImEx is used as default. If the keyword "forceSubModels" is provided, a choice of sub model is demanded.
+
+forceSubModels
+(
+ model_x
+ model_y
+); :pre
+
+model = name of force sub-model to be applied :ul
+
+[Examples:]
+
+forceSubModels
+(
+ ImEx
+); :pre
+
+Note: This examples list might not be complete - please look for other models (forceSubModel_XY) in this documentation.
+
+[Description:]
+
+The force sub model is designed to hold the settings a force model can have. For now it handles the treatExplicit, treatDEM and implDEM option.
+
+[Restrictions:]
+
+None.
+
+[Related commands:]
+
+"ImEx"_forceSubModel_ImEx.html
+
+Note: This examples list may be incomplete - please look for other models (forceSubModel_XY) in this documentation.
+
+[Default:] none.
diff --git a/doc/forceSubModel_ImEx.html b/doc/forceSubModel_ImEx.html
new file mode 100644
index 0000000..43b92d4
--- /dev/null
+++ b/doc/forceSubModel_ImEx.html
@@ -0,0 +1,45 @@
+
+CFDEMproject WWW Site - CFDEM Commands
+
+
+
+
+
+
+
+forceSubModel_ImEx command
+
+Syntax:
+
+Defined in couplingProperties sub-dictionary of the force model in use.
+
+forceSubModels
+(
+ ImEx;
+);
+
+treatExplicit true; // optional for some force models.
+treatDEM true; // optional for some force models.
+implDEM true; // optional for some force models.
+
+Examples:
+
+forceSubModels
+(
+ ImEx;
+);
+treatExplicit true; // optional for some force models.
+
+Description:
+
+ If no force sub-model is applied ImEx is used as default. If the keyword "forceSubModels" is provided, a choice of sub model is demanded. Depending on the force model different keywords are read and can therefrore be set (see the log file). If the keyword is provided, its value is used.
+
+Restrictions:
+
+none.
+
+Related commands:
+
+forceSubModel
+
+
diff --git a/doc/forceSubModel_ImEx.txt b/doc/forceSubModel_ImEx.txt
new file mode 100644
index 0000000..e81f55e
--- /dev/null
+++ b/doc/forceSubModel_ImEx.txt
@@ -0,0 +1,42 @@
+"CFDEMproject WWW Site"_lws - "CFDEM Commands"_lc :c
+
+:link(lws,http://www.cfdem.com)
+:link(lc,CFDEMcoupling_Manual.html#comm)
+
+:line
+
+forceSubModel_ImEx command :h3
+
+[Syntax:]
+
+Defined in couplingProperties sub-dictionary of the force model in use.
+
+forceSubModels
+(
+ ImEx;
+);
+
+treatExplicit true; // optional for some force models.
+treatDEM true; // optional for some force models.
+implDEM true; // optional for some force models.
+
+[Examples:]
+
+forceSubModels
+(
+ ImEx;
+);
+treatExplicit true; // optional for some force models.
+
+[Description:]
+
+ If no force sub-model is applied ImEx is used as default. If the keyword "forceSubModels" is provided, a choice of sub model is demanded. Depending on the force model different keywords are read and can therefrore be set (see the log file). If the keyword is provided, its value is used.
+
+[Restrictions:]
+
+none.
+
+[Related commands:]
+
+"forceSubModel"_forceSubModel.html
+
diff --git a/doc/forceSubModel_ImExCorr.html b/doc/forceSubModel_ImExCorr.html
new file mode 100644
index 0000000..a593c81
--- /dev/null
+++ b/doc/forceSubModel_ImExCorr.html
@@ -0,0 +1,46 @@
+
+CFDEMproject WWW Site - CFDEM Commands
+
+
+
+
+
+
+
+forceSubModel_ImExCorr command
+
+Syntax:
+
+Defined in couplingProperties sub-dictionary of the force model in use.
+
+forceSubModels
+(
+ ImExCorr;
+);
+
+treatExplicit true; // optional for some force models.
+treatDEM true; // optional for some force models.
+implDEM true; // optional for some force models.
+explicitCorr true; // optional for some force models.
+
+Examples:
+
+forceSubModels
+(
+ ImExCorr;
+);
+treatExplicit true; // optional for some force models.
+
+Description:
+
+ Same as ImEx, but it additionally reads "explicitCorr" to correct the error steming from interpolation of Ufluid and averaging of Uparticles.
+
+Restrictions:
+
+none.
+
+Related commands:
+
+forceSubModel
+
+
diff --git a/doc/forceSubModel_ImExCorr.txt b/doc/forceSubModel_ImExCorr.txt
new file mode 100644
index 0000000..4913551
--- /dev/null
+++ b/doc/forceSubModel_ImExCorr.txt
@@ -0,0 +1,43 @@
+"CFDEMproject WWW Site"_lws - "CFDEM Commands"_lc :c
+
+:link(lws,http://www.cfdem.com)
+:link(lc,CFDEMcoupling_Manual.html#comm)
+
+:line
+
+forceSubModel_ImExCorr command :h3
+
+[Syntax:]
+
+Defined in couplingProperties sub-dictionary of the force model in use.
+
+forceSubModels
+(
+ ImExCorr;
+);
+
+treatExplicit true; // optional for some force models.
+treatDEM true; // optional for some force models.
+implDEM true; // optional for some force models.
+explicitCorr true; // optional for some force models.
+
+[Examples:]
+
+forceSubModels
+(
+ ImExCorr;
+);
+treatExplicit true; // optional for some force models.
+
+[Description:]
+
+ Same as ImEx, but it additionally reads "explicitCorr" to correct the error steming from interpolation of Ufluid and averaging of Uparticles.
+
+[Restrictions:]
+
+none.
+
+[Related commands:]
+
+"forceSubModel"_forceSubModel.html
+
diff --git a/doc/githubAccess_public.pdf b/doc/githubAccess_public.pdf
index f184f26..8cd384f 100644
Binary files a/doc/githubAccess_public.pdf and b/doc/githubAccess_public.pdf differ
diff --git a/doc/liggghtsCommandModel_writeLiggghts.html b/doc/liggghtsCommandModel_writeLiggghts.html
index 3a96aaf..00e06cc 100644
--- a/doc/liggghtsCommandModel_writeLiggghts.html
+++ b/doc/liggghtsCommandModel_writeLiggghts.html
@@ -21,18 +21,20 @@
writeLiggghtsProps
{
writeLast switch1;
+ path "path";
writeName "name";
overwrite switch2;
verbose;
}
-- switch1 = switch (choose on/off) to select if only last step is stored or every write step.
+
- switch1 = switch (choose on/off) to select if only last step is stored or every write step (default on).
-
- name = name of the restart file to be written in /$caseDir/DEM/ default default "liggghts.restartCFDEM"
+
- path = optionally an alternative path for saving the restart file can be defined (default "../DEM").
-
- switch2 = switch (choose on/off) to select if only one restart file $name or many files $name_$timeStamp are written
+
- name = name of the restart file to be written in /$caseDir/DEM/ default (default "liggghts.restartCFDEM")
-
- verbose = (normally off) for verbose run
+
- switch2 = switch (choose on/off) to select if only one restart file $name or many files $name_$timeStamp are written (default off):l
+verbose = (default off) for verbose run
diff --git a/doc/liggghtsCommandModel_writeLiggghts.txt b/doc/liggghtsCommandModel_writeLiggghts.txt
index 77f4f46..ede5e12 100644
--- a/doc/liggghtsCommandModel_writeLiggghts.txt
+++ b/doc/liggghtsCommandModel_writeLiggghts.txt
@@ -19,15 +19,17 @@ liggghtsCommandModels
writeLiggghtsProps
\{
writeLast switch1;
+ path "path";
writeName "name";
overwrite switch2;
verbose;
\} :pre
-{switch1} = switch (choose on/off) to select if only last step is stored or every write step. :ulb,l
-{name} = name of the restart file to be written in /$caseDir/DEM/ default default "liggghts.restartCFDEM" :l
-{switch2} = switch (choose on/off) to select if only one restart file $name or many files $name_$timeStamp are written :l
-{verbose} = (normally off) for verbose run :l
+{switch1} = switch (choose on/off) to select if only last step is stored or every write step (default on). :ulb,l
+{path} = optionally an alternative path for saving the restart file can be defined (default "../DEM"). :l
+{name} = name of the restart file to be written in /$caseDir/DEM/ default (default "liggghts.restartCFDEM") :l
+{switch2} = switch (choose on/off) to select if only one restart file $name or many files $name_$timeStamp are written (default off):l
+{verbose} = (default off) for verbose run :l
:ule
[Examples:]
diff --git a/doc/momCoupleModel.html b/doc/momCoupleModel.html
index 2acae6a..3a37c23 100644
--- a/doc/momCoupleModel.html
+++ b/doc/momCoupleModel.html
@@ -33,7 +33,8 @@
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 05db72e..0a7dbf2 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/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..4459954
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,7 @@
+*.o
+*.d
+*.a
+*.dep
+log_*
+log.*
+*~
diff --git a/src/lagrangian/cfdemParticle/cfdTools/checkModelType.H b/src/lagrangian/cfdemParticle/cfdTools/checkModelType.H
index 9a6ddf5..a91bb78 100644
--- a/src/lagrangian/cfdemParticle/cfdTools/checkModelType.H
+++ b/src/lagrangian/cfdemParticle/cfdTools/checkModelType.H
@@ -4,8 +4,7 @@
word modelType = particleCloud.modelType();
//Warning << "model type not being checked" << endl;
-
- if (modelType=="B"){
+ if (modelType=="Bfull"){
Info << "solving volume averaged Navier Stokes equations of type B\n"<< endl;
// check if Archimedes is used
@@ -18,6 +17,41 @@
if(!found)
FatalError <<"Archimedes model not found!\n" << abort(FatalError);
+ // check if gradPForce is used
+ found=false;
+ forAll(particleCloud.forceModels(),i)
+ {
+ if(particleCloud.forceModels()[i]=="gradPForce")
+ found=true;
+ }
+ if(!found)
+ FatalError <<"gradPForce model not found!\n" << abort(FatalError);
+
+ // check if viscForce is used
+ found=false;
+ forAll(particleCloud.forceModels(),i)
+ {
+ if(particleCloud.forceModels()[i]=="viscForce")
+ found=true;
+ }
+ if(!found)
+ FatalError <<"viscForce model not found!\n" << abort(FatalError);
+
+ }else if(modelType=="B"){
+ Info << "solving volume averaged Navier Stokes equations of type B\n"<< endl;
+
+ // check if Archimedes is used
+ bool found=false;
+ forAll(particleCloud.forceModels(),i)
+ {
+ if(particleCloud.forceModels()[i]=="Archimedes")
+ found=true;
+ }
+ if(!found)
+ FatalError <<"Archimedes model not found!\n" << abort(FatalError);
+
+
+
// check if gradP and viscForce are used
found=false;
forAll(particleCloud.forceModels(),i)
diff --git a/src/lagrangian/cfdemParticle/cfdTools/compressibleContinuityErrsPU.H b/src/lagrangian/cfdemParticle/cfdTools/compressibleContinuityErrsPU.H
new file mode 100644
index 0000000..67d0f08
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/cfdTools/compressibleContinuityErrsPU.H
@@ -0,0 +1,53 @@
+/*---------------------------------------------------------------------------*\
+ CFDEMcoupling - Open Source CFD-DEM coupling
+
+ CFDEMcoupling is part of the CFDEMproject
+ www.cfdem.com
+ Christoph Goniva, christoph.goniva@cfdem.com
+ Copyright (C) 1991-2009 OpenCFD Ltd.
+ Copyright (C) 2009-2012 JKU, Linz
+ Copyright (C) 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, see .
+
+Global
+ continuityErrs
+
+Description
+ Calculates and prints the continuity errors.
+ The code is an evolution of compressibleContinuityErrs.H in OpenFOAM(R) 2.3.x,
+ where additional functionality for CFD-DEM coupling is added.
+\*---------------------------------------------------------------------------*/
+
+{
+ dimensionedScalar totalMass = fvc::domainIntegrate(rho*voidfraction);
+
+ scalar sumLocalContErr =
+ (fvc::domainIntegrate(mag(rho - thermo.rho())*voidfraction)/totalMass).value();
+
+ scalar globalContErr =
+ (fvc::domainIntegrate((rho - thermo.rho())*voidfraction)/totalMass).value();
+
+ cumulativeContErr += globalContErr;
+
+ Info<< "time step continuity errors : sum local = " << sumLocalContErr
+ << ", global = " << globalContErr
+ << ", cumulative = " << cumulativeContErr
+ << endl;
+}
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/cfdTools/global.C b/src/lagrangian/cfdemParticle/cfdTools/global.C
new file mode 100644
index 0000000..1e97aec
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/cfdTools/global.C
@@ -0,0 +1,80 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+\*---------------------------------------------------------------------------*/
+
+#include "error.H"
+#include "global.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(global, 0);
+
+defineRunTimeSelectionTable(global, dictionary);
+
+// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+void global::info()
+{
+ Info << "\nYou are currently using:" << endl;
+ Info << "OF version: " << FOAMversion << endl;
+ Info << "OF build: " << FOAMbuild << endl;
+ Info << "CFDEM build: " << CFDEMversion << "\n" << endl;
+}
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+// Construct from components
+global::global
+(
+ const dictionary& dict,
+ cfdemCloud& sm
+)
+:
+ dict_(dict),
+ particleCloud_(sm),
+ CFDEMversion(GITVERSION)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+global::~global()
+{}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/cfdTools/global.H b/src/lagrangian/cfdemParticle/cfdTools/global.H
new file mode 100644
index 0000000..afaaf44
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/cfdTools/global.H
@@ -0,0 +1,128 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+
+Class
+ global
+
+SourceFiles
+ global.Cver
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef global_H
+#define global_H
+
+#include "fvCFD.H"
+#include "cfdemCloud.H"
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class global Declaration
+\*---------------------------------------------------------------------------*/
+
+class global
+{
+
+protected:
+
+ // Protected data
+ const dictionary& dict_;
+
+ cfdemCloud& particleCloud_;
+
+ const char* const CFDEMversion;
+
+
+ // Protected member functions
+
+public:
+
+ //- Runtime type information
+ TypeName("global");
+
+ // Declare runtime constructor selection table
+
+ declareRunTimeSelectionTable
+ (
+ autoPtr,
+ global,
+ dictionary,
+ (
+ const dictionary& dict,
+ cfdemCloud& sm
+ ),
+ (dict,sm)
+ );
+
+
+ // Constructors
+
+ //- Construct from components
+ global
+ (
+ const dictionary& dict,
+ cfdemCloud& sm
+ );
+
+
+ // Destructor
+
+ virtual ~global();
+
+
+ // Selector
+
+ static autoPtr New
+ (
+ const dictionary& dict,
+ cfdemCloud& sm
+ );
+
+ // Member Function
+
+ void info();
+
+ // Access
+
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H
new file mode 100644
index 0000000..a7c6067
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H
@@ -0,0 +1,265 @@
+/* ----------------------------------------------------------------------
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+
+ Copyright of this contribution:
+ Copyright 2014- TU Graz, IPPT
+------------------------------------------------------------------------- */
+
+#ifndef CFDEM_MATH_EXTRA_H
+#define CFDEM_MATH_EXTRA_H
+
+#include
+//#include "math.h"
+#include "stdio.h"
+#include "string.h"
+#include "error.h"
+#include "ctype.h"
+
+#define TOLERANCE_ORTHO 1e-10
+
+namespace MathExtra
+{
+
+// inline void outerProduct(double *vec1, double *vec2, double **m);
+// inline double spheroidGeometry(int index, double bi, double ai);
+
+
+
+//--------------------------------------------------------------------
+// Outer Product of two vectors
+inline void outerProduct(double *vec1, double *vec2, double **m)
+{
+ int i, j;
+ //debug output
+ for( i = 0; i < 3; ++i )
+// printf("OUTER PRODUCT: Input: vec1 element %d = %g", i, vec1[i]);
+ for( i = 0; i < 3; ++i )
+// printf("OUTER PRODUCT: Input: vec2 element %d=%g", i, vec2[i]);
+
+ //calculation
+ for( i = 0; i < 3; ++i )
+ for( j = 0; j < 3; ++j )
+ {
+ m[i][j] = vec1[i] * vec2[j];
+ printf("OUTER PRODUCT: Result: m[%d][%d]=%g", i, j, m[i][j]);
+ }
+
+
+}
+//--------------------------------------------------------------------
+// Compute the major, minor axis and eccentricity parameters of a prolate spheroid
+inline bool spheroidGeometry(double radius, double aspectRatio, //inputs
+ double& ai, double& bi, //outputs
+ double& ei, double& Le //outputs
+ ) //
+{
+ //INPUT
+ // radius ...volume-equivalent radius of the spheroid
+ // aspectRatio ...major/minor aspect ratio
+
+ //OUTPUT
+ // ai ...
+ // bi ...
+ // ei ...
+ // Le ...
+
+ if(radius<=0.0) //avoid troubles in case radius is 0 or negative
+ return false;
+
+ ai = radius * std::pow(aspectRatio*aspectRatio,0.33333333333333333333333);
+ bi = ai / aspectRatio;
+ ei = std::sqrt(
+ 1.0
+ - 1.0 / (aspectRatio*aspectRatio)
+ );
+ Le = std::log(
+ (1.0+ei)
+ /(1.0-ei)
+ );
+
+ return true;
+}
+
+//--------------------------------------------------------------------
+// Compute the major, minor axis and eccentricity parameters of a prolate spheroid
+inline double Pi()
+{
+ return 3.1415926535897932384626433832795;
+}
+
+
+//--------------------------------------------------------------------
+// Compute the major, minor axis and eccentricity parameters of a prolate spheroid
+inline bool spheroidGeometry2(double radius, double aspectRatio, //inputs
+ double& ai, double& bi, //outputs
+ double& XAe, double& YAe, //outputs
+ double& XCe, double& YCe, //outputs
+ double& YHe
+ ) //
+{
+ //INPUT
+ // radius ...volume-equivalent radius of the spheroid
+ // aspectRatio ...major/minor aspect ratio
+
+ //OUTPUT
+ // XAe ...Eccentricity dependet parameter
+ // YAe ...Eccentricity dependet parameter
+ // XCe ...Eccentricity dependet parameter
+ // XCe ...Eccentricity dependet parameter
+ // YCe ...Eccentricity dependet parameter
+ // YHe ...Eccentricity dependet parameter
+
+
+ double ei(0.0), Le(0.0);
+ bool result =
+ spheroidGeometry(radius, aspectRatio, //inputs
+ ai, bi, //outputs
+ ei, Le //outputs
+ );
+ if(!result)
+ return false;
+
+ XAe= 2.6666666666666666666666667
+ *ei*ei*ei
+ /(-2.0*ei+(1.0+ei*ei)*Le);
+ YAe= 5.333333333333333333333333333
+ *ei*ei*ei
+ /(2.0*ei+(3*ei*ei-1.0)*Le);
+ XCe= 1.333333333333333333333333333
+ *ei*ei*ei
+ *(1.0-ei*ei)
+ /(2.0*ei-(1.0-ei*ei)*Le);
+ YCe= 1.3333333333333333333333
+ *ei*ei*ei
+ *(2.0-ei*ei)
+ /(-2.0*ei+(1.0+ei*ei)*Le);
+ YHe= 1.3333333333333333333333
+ *ei*ei*ei*ei*ei
+ /(-2.0*ei+(1.0+ei*ei)*Le);
+
+ return true;
+
+}
+
+//--------------------------------------------------------------------
+// zeroize a 3x3x3 tensor
+inline void zeroize333(double tensor[3][3][3] )
+{
+ for(int iX=0; iX<3; iX++)
+ for(int iY=0; iY<3; iY++)
+ for(int iZ=0; iZ<3; iZ++)
+ tensor[iX][iY][iZ] = 0.0;
+}
+
+//--------------------------------------------------------------------
+// zeroize a 3x3 tensor
+inline void zeroize33(double tensor[3][3] )
+{
+ for(int iX=0; iX<3; iX++)
+ for(int iY=0; iY<3; iY++)
+ tensor[iX][iY] = 0.0;
+}
+
+//--------------------------------------------------------------------
+// multiply a 3x3x3 tensor with a scalar
+inline void multiply333(double scalar, double tensor[3][3][3] )
+{
+ for(int iX=0; iX<3; iX++)
+ for(int iY=0; iY<3; iY++)
+ for(int iZ=0; iZ<3; iZ++)
+ tensor[iX][iY][iZ] *= scalar;
+}
+//--------------------------------------------------------------------
+// Compute a dot and dyadic product of with a vector
+inline void permutationTensor(double tensor[3][3][3] )
+{
+ zeroize333(tensor);
+ tensor[0][1][2] = 1.0;
+ tensor[1][2][0] = 1.0;
+ tensor[2][0][1] = 1.0;
+ tensor[0][2][1] =-1.0;
+ tensor[2][1][0] =-1.0;
+ tensor[1][0][2] =-1.0;
+}
+
+
+
+//--------------------------------------------------------------------
+// Compute a dot product of the permutation tensor and
+// then a dyadic product of with a vector
+inline bool permutationDotDyadic(
+ double vector[3],
+ double tensor[3][3][3]
+ )
+{
+ //Generate permutation tensor
+ double permutationT[3][3][3];
+ permutationTensor(permutationT);
+
+ //Step 1: compute dot prodcut of permutation tensor
+ double permutationDotProd[3][3];
+ zeroize33(permutationDotProd);
+
+ for(int iX=0; iX<3; iX++)
+ for(int iY=0; iY<3; iY++)
+ for(int iZ=0; iZ<3; iZ++)
+ permutationDotProd[iX][iY] += permutationT[iX][iY][iZ]
+ * vector[iZ];
+
+ for(int iX=0; iX<3; iX++)
+ for(int iY=0; iY<3; iY++)
+ for(int iZ=0; iZ<3; iZ++)
+ tensor[iX][iY][iZ] = permutationDotProd[iX][iY]
+ * vector[iZ];
+ return true;
+
+}
+
+//--------------------------------------------------------------------
+// Compute a dot and dyadic product of with a vector
+inline bool doubleDotTensor333Tensor33(double tensor333[3][3][3],
+ double tensor33[3][3],
+ double result[3]
+ )
+{
+ result[0]=0.0;result[1]=0.0;result[2]=0.0;
+
+ for(int iX=0; iX<3; iX++)
+ for(int iY=0; iY<3; iY++)
+ for(int iZ=0; iZ<3; iZ++)
+ result[iX] += tensor333[iX][iY][iZ] * tensor33[iY][iZ];
+
+ return true;
+}
+
+
+}; //end of namespace
+
+#endif
diff --git a/src/lagrangian/cfdemParticle/cfdTools/newGlobal.C b/src/lagrangian/cfdemParticle/cfdTools/newGlobal.C
new file mode 100644
index 0000000..73c4eac
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/cfdTools/newGlobal.C
@@ -0,0 +1,84 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+\*---------------------------------------------------------------------------*/
+
+#include "error.H"
+
+#include "global.H"
+#include "dilute.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+autoPtr global::New
+(
+ const dictionary& dict,
+ cfdemCloud& sm
+)
+{
+ word globalType
+ (
+ dict.lookup("global")
+ );
+
+ Info<< "Selecting global "
+ << globalType << endl;
+
+
+ dictionaryConstructorTable::iterator cstrIter =
+ dictionaryConstructorTablePtr_->find(globalType);
+
+ if (cstrIter == dictionaryConstructorTablePtr_->end())
+ {
+ FatalError
+ << "global::New(const dictionary&, const spray&) : "
+ << endl
+ << " unknown globalType type "
+ << globalType
+ << ", constructor not in hash table" << endl << endl
+ << " Valid global types are :"
+ << endl;
+ Info<< dictionaryConstructorTablePtr_->toc()
+ << abort(FatalError);
+ }
+
+ return autoPtr(cstrIter()(dict,sm));
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H
index 4fbc1be..f4bfe4a 100755
--- a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H
+++ b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H
@@ -1,9 +1,44 @@
-word CFDEMversion="cfdem-2.7.1";
-word compatibleLIGGGHTSversion="3.0.2";
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef versionInfo_H
+#define versionInfo_H
+
+word CFDEMversion="cfdem-2.9.0";
+word compatibleLIGGGHTSversion="3.1.0";
word OFversion="2.3.x-commit-4d6f4a3115ff76ec4154c580eb041bc95ba4ec09";
-Info << "\nCFDEMcoupling version: " << CFDEMversion << "\n" << endl;
-Info << "\n, compatible to LIGGGHTS version: " << compatibleLIGGGHTSversion << "\n" << endl;
-Info << "\n, compatible to OF version: " << OFversion << "\n" << endl;
-
+Info << "\nCFDEMcoupling version: " << CFDEMversion << endl;
+Info << ", compatible to LIGGGHTS version: " << compatibleLIGGGHTSversion << endl;
+Info << ", compatible to OF version and build: " << OFversion << endl;
+#endif
diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C
index a56df91..4820d62 100644
--- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C
+++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C
@@ -31,6 +31,7 @@ Description
#include "fileName.H"
#include "cfdemCloud.H"
+#include "global.H"
#include "forceModel.H"
#include "locateModel.H"
#include "momCoupleModel.H"
@@ -80,6 +81,7 @@ Foam::cfdemCloud::cfdemCloud
positions_(NULL),
velocities_(NULL),
fluidVel_(NULL),
+ fAcc_(NULL),
impForces_(NULL),
expForces_(NULL),
DEMForces_(NULL),
@@ -89,7 +91,9 @@ Foam::cfdemCloud::cfdemCloud
cellIDs_(NULL),
particleWeights_(NULL),
particleVolumes_(NULL),
+ particleV_(NULL),
numberOfParticles_(0),
+ d32_(-1),
numberOfParticlesChanged_(false),
arraysReallocated_(false),
forceModels_(couplingProperties_.lookup("forceModels")),
@@ -99,7 +103,9 @@ Foam::cfdemCloud::cfdemCloud
cg_(1.),
cgOK_(true),
impDEMdrag_(false),
+ impDEMdragAcc_(false),
imExSplitFactor_(1.0),
+ treatVoidCellsAsExplicitForce_(false),
useDDTvoidfraction_(false),
ddtVoidfraction_
(
@@ -117,7 +123,7 @@ Foam::cfdemCloud::cfdemCloud
turbulence_
(
#if defined(version21) || defined(version16ext)
- #ifdef comp
+ #ifdef compre
mesh.lookupObject
#else
mesh.lookupObject
@@ -213,12 +219,16 @@ Foam::cfdemCloud::cfdemCloud
)
{
#include "versionInfo.H"
+ global buildInfo(couplingProperties_,*this);
+ buildInfo.info();
Info << "If BC are important, please provide volScalarFields -imp/expParticleForces-" << endl;
if (couplingProperties_.found("solveFlow"))
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")
@@ -276,6 +286,7 @@ Foam::cfdemCloud::~cfdemCloud()
dataExchangeM().destroy(positions_,3);
dataExchangeM().destroy(velocities_,3);
dataExchangeM().destroy(fluidVel_,3);
+ dataExchangeM().destroy(fAcc_,3);
dataExchangeM().destroy(impForces_,3);
dataExchangeM().destroy(expForces_,3);
dataExchangeM().destroy(DEMForces_,3);
@@ -285,6 +296,7 @@ Foam::cfdemCloud::~cfdemCloud()
dataExchangeM().destroy(cellIDs_,1);
dataExchangeM().destroy(particleWeights_,1);
dataExchangeM().destroy(particleVolumes_,1);
+ dataExchangeM().destroy(particleV_,1);
}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
void Foam::cfdemCloud::getDEMdata()
@@ -292,6 +304,9 @@ void Foam::cfdemCloud::getDEMdata()
dataExchangeM().getData("radius","scalar-atom",radii_);
dataExchangeM().getData("x","vector-atom",positions_);
dataExchangeM().getData("v","vector-atom",velocities_);
+
+ if(impDEMdragAcc_)
+ dataExchangeM().getData("dragAcc","vector-atom",fAcc_); // array is used twice - might be necessary to clean it first
}
void Foam::cfdemCloud::giveDEMdata()
@@ -302,6 +317,7 @@ void Foam::cfdemCloud::giveDEMdata()
if(impDEMdrag_)
{
+ if(verbose_) Info << "sending Ksl and uf" << endl;
dataExchangeM().giveData("Ksl","scalar-atom",Cds_);
dataExchangeM().giveData("uf","vector-atom",fluidVel_);
}
@@ -441,6 +457,16 @@ label Foam::cfdemCloud::liggghtsCommandModelIndex(word name)
return index;
}
+std::vector< std::vector >* Foam::cfdemCloud::getVprobe()
+{
+ return probeModel_->getVprobe();
+}
+
+std::vector< std::vector >* Foam::cfdemCloud::getSprobe()
+{
+ return probeModel_->getSprobe();
+}
+
// * * * * * * * * * * * * * * * WRITE * * * * * * * * * * * * * //
// * * * write cfdemCloud internal data * * * //
@@ -458,9 +484,10 @@ bool Foam::cfdemCloud::evolve
if(!ignore())
{
- if (dataExchangeM().couple())
+ if (dataExchangeM().doCoupleNow())
{
Info << "\n Coupling..." << endl;
+ dataExchangeM().couple(0);
doCouple=true;
// reset vol Fields
@@ -496,7 +523,7 @@ bool Foam::cfdemCloud::evolve
// set void fraction field
clockM().start(19,"setvoidFraction");
if(verbose_) Info << "- setvoidFraction()" << endl;
- voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_);
+ voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_,particleV_);
if(verbose_) Info << "setvoidFraction done." << endl;
clockM().stop("setvoidFraction");
@@ -508,7 +535,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");
}
@@ -560,6 +592,8 @@ bool Foam::cfdemCloud::evolve
clockM().start(23,"giveDEMdata");
giveDEMdata();
clockM().stop("giveDEMdata");
+
+ dataExchangeM().couple(1);
}//end dataExchangeM().couple()
@@ -584,15 +618,40 @@ bool Foam::cfdemCloud::reAllocArrays() const
dataExchangeM().allocateArray(positions_,0.,3);
dataExchangeM().allocateArray(velocities_,0.,3);
dataExchangeM().allocateArray(fluidVel_,0.,3);
+ dataExchangeM().allocateArray(fAcc_,0.,3);
dataExchangeM().allocateArray(impForces_,0.,3);
dataExchangeM().allocateArray(expForces_,0.,3);
dataExchangeM().allocateArray(DEMForces_,0.,3);
dataExchangeM().allocateArray(Cds_,0.,1);
dataExchangeM().allocateArray(radii_,0.,1);
dataExchangeM().allocateArray(voidfractions_,1.,voidFractionM().maxCellsPerParticle());
- dataExchangeM().allocateArray(cellIDs_,0.,voidFractionM().maxCellsPerParticle());
+ dataExchangeM().allocateArray(cellIDs_,-1.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(particleWeights_,0.,voidFractionM().maxCellsPerParticle());
dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle());
+ dataExchangeM().allocateArray(particleV_,0.,1);
+ arraysReallocated_ = true;
+ return true;
+ }
+ return false;
+}
+
+bool Foam::cfdemCloud::reAllocArrays(int nP, bool forceRealloc) const
+{
+ if( (numberOfParticlesChanged_ && !arraysReallocated_) || forceRealloc)
+ {
+ // get arrays of new length
+ dataExchangeM().allocateArray(positions_,0.,3,nP);
+ dataExchangeM().allocateArray(velocities_,0.,3,nP);
+ dataExchangeM().allocateArray(fluidVel_,0.,3,nP);
+ dataExchangeM().allocateArray(impForces_,0.,3,nP);
+ dataExchangeM().allocateArray(expForces_,0.,3,nP);
+ dataExchangeM().allocateArray(DEMForces_,0.,3,nP);
+ dataExchangeM().allocateArray(Cds_,0.,1,nP);
+ dataExchangeM().allocateArray(radii_,0.,1,nP);
+ dataExchangeM().allocateArray(voidfractions_,1.,voidFractionM().maxCellsPerParticle(),nP);
+ dataExchangeM().allocateArray(cellIDs_,0.,voidFractionM().maxCellsPerParticle(),nP);
+ dataExchangeM().allocateArray(particleWeights_,0.,voidFractionM().maxCellsPerParticle(),nP);
+ dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle(),nP);
arraysReallocated_ = true;
return true;
}
@@ -604,7 +663,7 @@ tmp cfdemCloud::divVoidfractionTau(volVectorField& U,volScalarFi
return
(
- fvm::laplacian(voidfractionNuEff(voidfraction), U)
- - fvc::div(voidfractionNuEff(voidfraction)*dev(fvc::grad(U)().T()))
+ - fvc::div(voidfractionNuEff(voidfraction)*dev2(fvc::grad(U)().T()))
);
}
@@ -637,11 +696,11 @@ void cfdemCloud::calcDdtVoidfraction(volScalarField& voidfraction) const
tmp cfdemCloud::voidfractionNuEff(volScalarField& voidfraction) const
{
- if (modelType_=="B")
+ if (modelType_=="B" || modelType_=="Bfull")
{
return tmp
(
- #ifdef comp
+ #ifdef compre
new volScalarField("viscousTerm", (turbulence_.mut() + turbulence_.mu()))
#else
new volScalarField("viscousTerm", (turbulence_.nut() + turbulence_.nu()))
@@ -652,7 +711,7 @@ tmp cfdemCloud::voidfractionNuEff(volScalarField& voidfraction)
{
return tmp
(
- #ifdef comp
+ #ifdef compre
new volScalarField("viscousTerm", voidfraction*(turbulence_.mut() + turbulence_.mu()))
#else
new volScalarField("viscousTerm", voidfraction*(turbulence_.nut() + turbulence_.nu()))
diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H
index 31b98f1..6feff1d 100644
--- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H
+++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H
@@ -44,6 +44,7 @@ SourceFiles
// choose version
#include "OFversion.H"
+#include
#include "fvCFD.H"
#include "IFstream.H"
@@ -102,6 +103,8 @@ protected:
mutable double **fluidVel_;
+ mutable double **fAcc_;
+
mutable double **impForces_;
mutable double **expForces_;
@@ -120,8 +123,12 @@ protected:
mutable double **particleVolumes_;
+ mutable double **particleV_;
+
int numberOfParticles_;
+ scalar d32_;
+
bool numberOfParticlesChanged_;
mutable bool arraysReallocated_;
@@ -140,14 +147,18 @@ protected:
bool impDEMdrag_;
+ bool impDEMdragAcc_;
+
mutable scalar imExSplitFactor_;
+ mutable bool treatVoidCellsAsExplicitForce_; //will treat the coupling force in cells with no Us data explicitly
+
bool useDDTvoidfraction_;
mutable volScalarField ddtVoidfraction_;
#if defined(version21) || defined(version16ext)
- #ifdef comp
+ #ifdef compre
const compressible::turbulenceModel& turbulence_;
#else
const incompressible::turbulenceModel& turbulence_;
@@ -200,6 +211,7 @@ public:
friend class dataExchangeModel;
friend class voidFractionModel;
friend class forceModel;
+ friend class forceSubModel;
// Constructors
@@ -243,8 +255,12 @@ public:
inline const bool& impDEMdrag() const;
+ inline const bool& impDEMdragAcc() const;
+
inline const scalar& imExSplitFactor() const;
+ inline const bool& treatVoidCellsAsExplicitForce() const;
+
inline const bool& ignore() const;
inline const fvMesh& mesh() const;
@@ -261,6 +277,8 @@ public:
inline double ** fluidVels() const;
+ inline double ** fAccs() const;
+
inline double ** impForces() const;
inline double ** expForces() const;
@@ -289,6 +307,7 @@ public:
virtual inline double d(int);
+ inline scalar d32(bool recalc=true);
virtual inline double dMin() {return -1;}
virtual inline double dMax() {return -1;}
virtual inline int minType() {return -1;}
@@ -298,9 +317,19 @@ 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);};
+ //Detector if SRF module is enable or not
+ virtual inline bool SRFOn(){return false;}
+
inline int numberOfParticles() const;
inline bool numberOfParticlesChanged() const;
@@ -336,7 +365,7 @@ public:
inline autoPtr* liggghtsCommand() const;
#if defined(version21) || defined(version16ext)
- #ifdef comp
+ #ifdef compre
inline const compressible::turbulenceModel& turbulence() const;
#else
inline const incompressible::turbulenceModel& turbulence() const;
@@ -352,6 +381,9 @@ public:
virtual bool reAllocArrays() const;
+ virtual bool reAllocArrays(int nP, bool forceRealloc) const; //force number of particles during reallocation
+
+
// IO
void writeScalarFieldToTerminal(double**&);
@@ -369,6 +401,11 @@ public:
tmp voidfractionNuEff(volScalarField&) const;
void resetArray(double**&,int,int,double resetVal=0.);
+
+ std::vector< std::vector >* getVprobe();
+
+ std::vector< std::vector >* getSprobe();
+
};
diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H
index 91b7b10..dae69d8 100644
--- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H
+++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H
@@ -55,11 +55,21 @@ inline const bool& cfdemCloud::impDEMdrag() const
return impDEMdrag_;
};
+inline const bool& cfdemCloud::impDEMdragAcc() const
+{
+ return impDEMdragAcc_;
+};
+
inline const scalar& cfdemCloud::imExSplitFactor() const
{
return imExSplitFactor_;
};
+inline const bool& cfdemCloud::treatVoidCellsAsExplicitForce() const
+{
+ return treatVoidCellsAsExplicitForce_;
+}
+
inline const scalar& cfdemCloud::cg() const
{
return cg_;
@@ -105,6 +115,11 @@ inline double ** cfdemCloud::fluidVels() const
return fluidVel_;
}
+inline double ** cfdemCloud::fAccs() const
+{
+ return fAcc_;
+}
+
inline double ** cfdemCloud::impForces() const
{
return impForces_;
@@ -169,7 +184,7 @@ inline label Foam::cfdemCloud::body(int index)
inline double cfdemCloud::particleVolume(int index)
{
- return particleVolumes_[index][0];
+ return particleV_[index][0];
}
inline scalar cfdemCloud::radius(int index)
@@ -182,6 +197,25 @@ inline double cfdemCloud::d(int index)
return 2*radii_[index][0];
}
+inline double cfdemCloud::d32(bool recalc)
+{
+ if(d32_<0 || recalc)
+ {
+ scalar Ntot(0);
+ scalar Dtot(0);
+ scalar r(0);
+ for(int index = 0;index < numberOfParticles(); ++index)
+ {
+ r=radii_[index][0];
+ Ntot+=2*r*r*r;
+ Dtot+=r*r;
+ }
+ d32_=Ntot/Dtot;
+ }
+
+ return d32_;
+}
+
inline int cfdemCloud::numberOfParticles() const
{
return numberOfParticles_;
@@ -269,7 +303,7 @@ inline autoPtr* cfdemCloud::liggghtsCommand() const
}
#if defined(version21) || defined(version16ext)
- #ifdef comp
+ #ifdef compre
inline const compressible::turbulenceModel& cfdemCloud::turbulence() const
#else
inline const incompressible::turbulenceModel& cfdemCloud::turbulence() const
diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C
index 828a859..19d9d07 100644
--- a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C
+++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C
@@ -101,9 +101,10 @@ bool Foam::cfdemCloudIB::evolve()
arraysReallocated_=false;
bool doCouple=false;
- if (dataExchangeM().couple())
+ if (dataExchangeM().doCoupleNow())
{
Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl;
+ dataExchangeM().couple(0);
doCouple=true;
// Info << "skipLagrangeToEulerMapping_: " << skipLagrangeToEulerMapping_
@@ -121,7 +122,7 @@ bool Foam::cfdemCloudIB::evolve()
// set void fraction field
if(verbose_) Info << "- setvoidFraction()" << endl;
- voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_);
+ voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_,particleV_);
if(verbose_) Info << "setvoidFraction done." << endl;
}
@@ -140,6 +141,8 @@ bool Foam::cfdemCloudIB::evolve()
// write DEM data
if(verbose_) Info << " -giveDEMdata()" << endl;
giveDEMdata();
+
+ dataExchangeM().couple(1);
haveEvolvedOnce_=true;
}
@@ -190,6 +193,7 @@ void Foam::cfdemCloudIB::calcVelocityCorrection
}
//}
}
+ U.correctBoundaryConditions();
// make field divergence free - set reference value in case it is needed
fvScalarMatrix phiIBEqn
diff --git a/src/lagrangian/cfdemParticle/etc/additionalLibs b/src/lagrangian/cfdemParticle/etc/additionalLibs
new file mode 100644
index 0000000..771640a
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/etc/additionalLibs
@@ -0,0 +1,8 @@
+# paths for additional libraries
+CFDEM_ADD_LIB_PATHS = \
+
+# additional libraries to be linked to solvers
+CFDEM_ADD_LIBS = \
+
+# additional static libraries to be linked to lagrangian library
+CFDEM_ADD_STATICLIBS = \
diff --git a/src/lagrangian/cfdemParticle/etc/bashrc b/src/lagrangian/cfdemParticle/etc/bashrc
index 0e9b3fb..141ec10 100755
--- a/src/lagrangian/cfdemParticle/etc/bashrc
+++ b/src/lagrangian/cfdemParticle/etc/bashrc
@@ -37,12 +37,32 @@
#- export environment variables (adapt to your paths)
#------------------------------------------------------------------------------
+#check if default lammps lib path should be used
+if [[ $CFDEM_LAMMPS_LIB_DIR == "" ]]; then
+ export CFDEM_LAMMPS_LIB_DIR=$CFDEM_LIGGGHTS_SRC_DIR/../lib/
+else
+ echo "using CFDEM_LAMMPS_LIB_DIR=$CFDEM_LAMMPS_LIB_DIR defined by user."
+fi
+
#- LIGGGHTS lib name
export CFDEM_LIGGGHTS_LIB_NAME=lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME
#- CFDEM lib name
export CFDEM_LIB_NAME=lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
+#- CFDEM compressible lib name
+export CFDEM_LIB_COMP_NAME=lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSION
+
+#check if additional libraries should be compiled together with solvers
+if [[ $CFDEM_ADD_LIBS_DIR == "" ]]; then
+ export CFDEM_ADD_LIBS_DIR=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc
+else
+ echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user."
+fi
+
+#-----------------------------------------------------
+# additional libraries
+
#- LMP Many2Many lib path and makefile
export CFDEM_Many2ManyLIB_PATH=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library
export CFDEM_Many2ManyLIB_MAKEFILENAME=$CFDEM_LIGGGHTS_MAKEFILE_NAME
@@ -52,9 +72,17 @@ export CFDEM_M2MLIB_PATH=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataE
export CFDEM_M2MLIB_MAKEFILENAME=$CFDEM_LIGGGHTS_MAKEFILE_NAME
#- LMP POEMS lib path and makefile
-export CFDEM_POEMSLIB_PATH=$CFDEM_LIGGGHTS_SRC_DIR/../lib/poems
+export CFDEM_POEMSLIB_PATH=$CFDEM_LAMMPS_LIB_DIR/poems
export CFDEM_POEMSLIB_MAKEFILENAME=g++
+#- LMP ASPHERE lib path and makefile
+export CFDEM_ASPHERELIB_PATH=$CFDEM_LAMMPS_LIB_DIR/poems
+export CFDEM_ASPHERELIB_MAKEFILENAME=g++
+
+#-C3PO library
+export C3PO_SRC_DIR=$CFDEM_SRC_DIR/c3po
+#-----------------------------------------------------
+
#- path to test harness
export CFDEM_TEST_HARNESS_PATH=$CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
@@ -145,6 +173,9 @@ alias cfdemCompCFDEMuti='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compil
#- shortcut to test basic tutorials
alias cfdemTestTUT='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/testTutorials.sh'
+#- shortcut to visualize the clock model data
+alias vizClock='python $CFDEM_UT_DIR/vizClock/matPlot.py'
+
#- recursive touch of current directory
alias touchRec='find ./* -exec touch {} \;'
@@ -160,6 +191,11 @@ export -f cfdemLiggghtsPar
cfdemGrep() { grep -rl "$1" ./* | xargs gedit; }
export -f cfdemGrep
+#- shortcut lo list files in a directory
+#cfdemListFiles() { find $1 | sed s:""$1"":: > listOfFiles.txt; } #leave out the dir iteslf in list
+cfdemListFiles() { find $1 > listOfFiles.txt; } #keep the dir in list
+export -f cfdemListFiles
+
# check if the run directory exists
if [ -d "$CFDEM_PROJECT_USER_DIR" ]; then
:
diff --git a/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh b/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh
index c3da9ab..66b686a 100755
--- a/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh
+++ b/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh
@@ -11,10 +11,15 @@ source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
#- show gcc settings
checkGPP="true"
+#- sys check for add on
+checkAddOn="true"
+
#- system settings
-echo "*******************"
-echo "system settings:"
-echo "*******************"
+printHeader
+
+echo "*********************************"
+echo "CFDEM(R)coupling system settings:"
+echo "*********************************"
echo "CFDEM_VERSION=$CFDEM_VERSION"
echo "couple to OF_VERSION=$WM_PROJECT_VERSION"
@@ -29,8 +34,10 @@ checkDirComment "$CFDEM_SOLVER_DIR" '$CFDEM_SOLVER_DIR' "yes"
checkDirComment "$CFDEM_TUT_DIR" '$CFDEM_TUT_DIR' "yes"
checkDirComment "$CFDEM_LIGGGHTS_SRC_DIR" '$CFDEM_LIGGGHTS_SRC_DIR' "yes"
checkDirComment "$CFDEM_LPP_DIR" '$CFDEM_LPP_DIR' "yes"
+checkDirComment "$CFDEM_ADD_LIBS_DIR" '$CFDEM_ADD_LIBS_DIR' "yes"
checkDirComment "$CFDEM_PIZZA_DIR" '$CFDEM_PIZZA_DIR' "no"
checkDirComment "$CFDEM_TEST_HARNESS_PATH" '$CFDEM_TEST_HARNESS_PATH' "no"
+checkDirComment "$C3PO_SRC_DIR" '$C3PO_SRC_DIR' "no"
echo ""
echo "library names"
@@ -61,3 +68,16 @@ if [ $checkGPP == "true" ]
mpirun --version
fi
+echo "**********************"
+echo "additional packages..."
+
+if [ $checkAddOn == "true" ]
+ then
+ packageName=c3po
+ filePath=$CFDEM_SRC_DIR/$packageName
+ if [ $(checkDir $filePath) == "true" ]; then
+ source $filePath/etc/$packageName"SystemTest.sh"
+ else
+ echo "$packageName does not exist."
+ fi
+fi
diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh b/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh
index a8aa9c5..6dbbb3a 100755
--- a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh
+++ b/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh
@@ -51,15 +51,16 @@ else
logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
##number of solvers compiled at a time
- nsteps=$WM_NCOMPPROCS
- echo "do compilation on $nsteps procs"
- nchunk=`echo $njobs/$nsteps+1 | bc`
- if [[ $WM_NCOMPPROCS == "" ]]; then
- echo "do compilation in serial"
+
+ if [[ $WM_NCOMPPROCS == "" ]] || [ $WM_NCOMPPROCS -eq 1 ]; then
nsteps=1
- nchunk=1
- else
- echo "do compilation on $nsteps procs in $nchunk chunks"
+ let nchunk=$njobs+1 # +1, to wait for the last compilation too
+ echo "do compilation in serial"
+ else
+ nsteps=$WM_NCOMPPROCS
+ nchunk=`echo $njobs/$nsteps+1 | bc`
+ echo "do compilation on $nsteps procs in $nchunk chunks"
+ let nchunk++ # +1, to wait for the last compilation too
fi
counter=0
@@ -108,6 +109,8 @@ else
let counter++
fi
done
+
+ sleep 1 # wait a second until compilation starts
done
echo "compilation done."
diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh b/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh
index a763dac..a4b531c 100755
--- a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh
+++ b/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh
@@ -20,48 +20,48 @@ mkdir -p $logDir
#================================================================================#
# compile src
#================================================================================#
- whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/library-list.txt"
- echo ""
- echo "Please provide the libraries to be compiled in the $CWD/$whitelist file."
+whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/library-list.txt"
+echo ""
+echo "Please provide the libraries to be compiled in the $CWD/$whitelist file."
- if [ ! -f "$CWD/$whitelist" ];then
- echo "$whitelist does not exist in $CWD. Nothing will be done."
- NLINES=0
- COUNT=0
- else
- NLINES=`wc -l < $CWD/$whitelist`
- COUNT=0
- fi
+if [ ! -f "$CWD/$whitelist" ];then
+ echo "$whitelist does not exist in $CWD. Nothing will be done."
+ NLINES=0
+ COUNT=0
+else
+ NLINES=`wc -l < $CWD/$whitelist`
+ COUNT=0
+fi
- while [ $COUNT -lt $NLINES ]
- do
- let COUNT++
- LINE=`head -n $COUNT $CWD/$whitelist | tail -1`
-
- # white lines
- if [[ "$LINE" == "" ]]; then
- echo "compile $LINE"
- continue
- # comments
- elif [[ "$LINE" == \#* ]]; then
- continue
- # paths
- elif [[ "$LINE" == */dir ]]; then
- echo "will change path..."
- LINE=$(echo "${LINE%????}")
- path="$CFDEM_SRC_DIR/$LINE"
- cd $path
- #continue
- fi
- #--------------------------------------------------------------------------------#
- #- define variables
- logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
- logfileName="log_compileCFDEMcoupling_"$(basename $LINE)""
- casePath="$path"
- headerText="$logfileName""-$NOW"
- #--------------------------------------------------------------------------------#
- # remove old log file
- rm "$logpath/$logfileName"*
- compileLib $logpath $logfileName $casePath $headerText
- done
+while [ $COUNT -lt $NLINES ]
+do
+ let COUNT++
+ LINE=`head -n $COUNT $CWD/$whitelist | tail -1`
+
+ # white lines
+ if [[ "$LINE" == "" ]]; then
+ echo "compile $LINE"
+ continue
+ # comments
+ elif [[ "$LINE" == \#* ]]; then
+ continue
+ # paths
+ elif [[ "$LINE" == */dir ]]; then
+ echo "will change path..."
+ LINE=$(echo "${LINE%????}")
+ path="$CFDEM_SRC_DIR/$LINE"
+ cd $path
+ #continue
+ fi
+ #--------------------------------------------------------------------------------#
+ #- define variables
+ logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
+ logfileName="log_compileCFDEMcoupling_"$(basename $LINE)""
+ casePath="$path"
+ headerText="$logfileName""-$NOW"
+ #--------------------------------------------------------------------------------#
+ # remove old log file
+ rm "$logpath/$logfileName"*
+ compileLib $logpath $logfileName $casePath $headerText
+done
diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh b/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh
index 8b91bfe..d4e0306 100644
--- a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh
+++ b/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh
@@ -1,36 +1,115 @@
#!/bin/bash
#===================================================================#
-# compile routine for CFDEMcoupling solvers, part of CFDEMproject
+# compile routine for CFDEMcoupling utilities, part of CFDEMproject
# Christoph Goniva - May. 2012, DCS Computing GmbH
#===================================================================#
+whitelist="utilities-list.txt"
+
#- include functions
source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
-
-NOW="$(date +"%Y-%m-%d-%H:%M")"
logDir="log"
-
-
cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc
mkdir -p $logDir
-#================================================================================#
-# compile utilities
-#================================================================================#
+CWD="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
+NOW="$(date +"%Y-%m-%d-%H:%M")"
+echo ""
+echo "This routine will compile the utilities specified in utilities-list.txt"
+echo ""
+#echo "Are the variables CFDEM_UT_DIR=$CFDEM_UT_DIR"
+#echo "and CFDEM_SRC_DIR=$CFDEM_SRC_DIR/lagrangian/cfdemParticle correct? (y/n)"
+#read YN
+#if [ "$YN" != "y" ];then
+# echo "Aborted by user."
+# exit 1
+#fi
+
+echo ""
+echo "Please provide the utilities to be compiled in the $CWD/$whitelist file."
+echo "structure:"
+echo "path to provide the path relative to CFDEM_UT_DIR"
+echo ""
+echo "example:"
+echo "cfdemPostproc/dir"
+echo ""
+
+if [ ! -f "$CWD/$whitelist" ];then
+ echo "$whitelist does not exist in $CWD"
+else
+ njobs=`wc -l < $CWD/$whitelist`
+ echo ""
+ echo "running compilation in pseudo-parallel mode of $njobs utilities"
-for utName in "cfdemPostproc"
-do
#--------------------------------------------------------------------------------#
- #- define variables
logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
- logfileName="log_compileCFDEMcoupling""_$utName"
- casePath="$CFDEM_UT_DIR/$utName"
- headerText="$logfileName""_$utName""-$NOW"
- #--------------------------------------------------------------------------------#
- compileSolver $logpath $logfileName $casePath $headerText
-done
-echo "Note: the list of utilities compiled might be incomplete."
-echo "please check $CFDEM_UT_DIR for more utilities available"
+ ##number of utilities compiled at a time
+
+ if [[ $WM_NCOMPPROCS == "" ]] || [ $WM_NCOMPPROCS -eq 1 ]; then
+ nsteps=1
+ let nchunk=$njobs+1 # +1, to wait for the last compilation too
+ echo "do compilation in serial"
+ else
+ nsteps=$WM_NCOMPPROCS
+ nchunk=`echo $njobs/$nsteps+1 | bc`
+ echo "do compilation on $nsteps procs in $nchunk chunks"
+ let nchunk++ # +1, to wait for the last compilation too
+ fi
+
+ counter=0
+ for i in `seq $nchunk`
+ do
+
+ #wait until prev. compilation is finished
+ echo "waiting..."
+ until [ `ps -C make | wc -l` -eq 1 ];
+ do
+ sleep 2
+ done
+
+ for j in `seq $nsteps`
+ do
+ let solNr=($i-1)*$nsteps+$j
+ LINE=`head -n $solNr $CWD/$whitelist | tail -1`
+
+ # white lines
+ if [[ "$LINE" == "" ]]; then
+ continue
+ # comments
+ elif [[ "$LINE" == \#* ]]; then
+ continue
+ # paths
+ elif [[ "$LINE" == */dir ]]; then
+ #echo "change path"
+ LINE=$(echo "${LINE%????}")
+ path="$CFDEM_UT_DIR/$LINE"
+ #cd $path
+ let solNr++
+ fi
+
+ if [[ "$counter" -lt "$njobs" ]]; then
+ #--------------------------------------------------------------------------------#
+ #- define variables
+ #logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
+ logfileName="log_compileCFDEMcoupling""_$LINE"
+ casePath="$CFDEM_UT_DIR/$LINE"
+ headerText="$logfileName""_$LINE""-$NOW"
+ parallel="true"
+ #--------------------------------------------------------------------------------#
+
+ #echo "compiling $LINE"
+ compileSolver $logpath $logfileName $casePath $headerText $parallel
+ let counter++
+ fi
+ done
+
+ sleep 1 # wait a second until compilation starts
+ done
+
+ echo "compilation done."
+fi
+
+
diff --git a/src/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh b/src/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh
index ac9f18d..4461d7d 100755
--- a/src/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh
+++ b/src/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh
@@ -33,6 +33,8 @@ mkdir -p $logDir
COUNT=0
fi
+ logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
+
while [ $COUNT -lt $NLINES ]
do
let COUNT++
@@ -57,7 +59,7 @@ mkdir -p $logDir
#--------------------------------------------------------------------------------#
#- define variables
- logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
+ #logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
logfileName="log_compile$LINE""lib"
headerText="$logfileName""-$NOW"
libVarMakefileName="CFDEM_$LINE""LIB_MAKEFILENAME"
diff --git a/src/lagrangian/cfdemParticle/etc/cshrc b/src/lagrangian/cfdemParticle/etc/cshrc
index 1bc6818..54154df 100755
--- a/src/lagrangian/cfdemParticle/etc/cshrc
+++ b/src/lagrangian/cfdemParticle/etc/cshrc
@@ -37,12 +37,32 @@
#- export environment variables (adapt to your paths)
#------------------------------------------------------------------------------
+#check if default lammps lib path should be used
+if ( ! ($?CFDEM_LAMMPS_LIB_DIR) ) then
+ setenv CFDEM_LAMMPS_LIB_DIR $CFDEM_LIGGGHTS_SRC_DIR"/../lib/"
+else
+ echo "using CFDEM_LAMMPS_LIB_DIR=$CFDEM_LAMMPS_LIB_DIR defined by user."
+endif
+
#- LIGGGHTS lib name
setenv CFDEM_LIGGGHTS_LIB_NAME lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME
#- CFDEM lib name
setenv CFDEM_LIB_NAME lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
+#- CFDEM compressible lib name
+setenv CFDEM_LIB_COMP_NAME lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSION
+
+#check if additional libraries should be compiled together with solvers
+if ( ! ($?CFDEM_ADD_LIBS_DIR) ) then
+ setenv CFDEM_ADD_LIBS_DIR $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc
+else
+ echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user."
+endif
+
+#-----------------------------------------------------
+# additional libraries
+
#- LMP Many2Many lib path and makefile
setenv CFDEM_Many2ManyLIB_PATH $CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library
setenv CFDEM_Many2ManyLIB_MAKEFILENAME $CFDEM_LIGGGHTS_MAKEFILE_NAME
@@ -143,6 +163,9 @@ alias cfdemCompCFDEMuti 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compil
#- shortcut to test basic tutorials
alias cfdemTestTUT 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/testTutorials.sh'
+#- shortcut to visualize the clock model data
+alias vizClock 'python $CFDEM_UT_DIR/vizClock/matPlot.py'
+
#- shortcut to run liggghts in serial
alias cfdemLiggghts '$CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME'
diff --git a/src/lagrangian/cfdemParticle/etc/functions.sh b/src/lagrangian/cfdemParticle/etc/functions.sh
index c0286cc..e9dd946 100755
--- a/src/lagrangian/cfdemParticle/etc/functions.sh
+++ b/src/lagrangian/cfdemParticle/etc/functions.sh
@@ -71,6 +71,21 @@ compileLib()
#- wclean and wmake
#if [ $doClean != "noClean" ]; then
+ # check library to compile is compressible
+ str=$casePath
+ i=$((${#str}-4))
+ ending=${str:$i:4}
+ if [[ $ending == "Comp" ]]; then
+ echo "Compiling a compressible library - so doing an rmdepall of incomp library first."
+ echo "Please make sure to have the compressible libraries first in the library-list.txt!"
+ cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle
+ echo "changing to $PWD"
+ rmdepall 2>&1 | tee -a $logpath/$logfileName
+ cd $casePath
+ echo "changing to $PWD"
+ else
+ echo "Compiling a incompressible library."
+ fi
rmdepall 2>&1 | tee -a $logpath/$logfileName
wclean 2>&1 | tee -a $logpath/$logfileName
#fi
@@ -139,6 +154,7 @@ compileLIGGGHTS()
logpath="$1"
logfileName="$2"
headerText="$3"
+ clean="$4"
#--------------------------------------------------------------------------------#
#- clean up old log file
@@ -157,9 +173,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
@@ -189,7 +210,13 @@ compileLMPlib()
rm $logpath/$logfileName
#- change path
- cd $libraryPath
+ if [ -d "$libraryPath" ]; then
+ cd $libraryPath
+ else
+ echo ""
+ echo "lib path $libraryPath does not exist - check settings in .../etc/bashrc."
+ read
+ fi
#- header
echo 2>&1 | tee -a $logpath/$logfileName
@@ -550,6 +577,7 @@ parCFDDEMrun()
machineFileName="$7"
debugMode="$8"
reconstuctCase="$9"
+ cleanCase="$10"
#--------------------------------------------------------------------------------#
if [ $debugMode == "on" ]; then
@@ -903,6 +931,52 @@ checkDirComment()
fi
}
+#========================================#
+#- function to check if a variable exits
+checkEnv()
+{
+ #--------------------------------------------------------------------------------#
+ #- define variables
+ var="$1"
+ #--------------------------------------------------------------------------------#
+ if [[ $var == "" ]]; then
+ echo "false"
+ else
+ echo "true"
+ fi
+}
+
+#========================================#
+#- function to check if a variable exits
+checkEnvComment()
+{
+ #--------------------------------------------------------------------------------#
+ #- define variables
+ var="$1"
+ varName="$2"
+ critical="$3"
+ #--------------------------------------------------------------------------------#
+ if [ $(checkEnv $var) == "true" ]; then
+ echo "valid:yes critical:$critical - $varName = $var"
+ else
+ echo "valid:NO critical:$critical - $varName = $var variable not set!"
+ fi
+}
+
+#========================================#
+#- function to print a header to terminal
+printHeader()
+{
+ echo ""
+ echo "*********************************************"
+ echo "* C F D E M (R) c o u p l i n g *"
+ echo "* *"
+ echo "* by DCS Computing GmbH *"
+ echo "* www.dcs-computing.com *"
+ echo "*********************************************"
+ echo ""
+}
+
#========================================#
#- track memory usage
trackMem()
diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C
index c2fd0e6..0883d0e 100644
--- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C
+++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C
@@ -50,6 +50,15 @@ int IOModel::dumpDEMdata() const
return -1;
}
+bool IOModel::dumpNow() const
+{
+ //bool dmp(false);
+ //if (time_.value()+SMALL > time_.endTime().value()-time_.deltaT().value() || time_.outputTime())
+ // dmp=true;
+
+ return time_.outputTime();
+}
+
fileName IOModel::createTimeDir(fileName path) const
{
fileName timeDirPath(path/time_.timeName());
diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H
index 2824333..d266fc0 100644
--- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H
+++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H
@@ -113,6 +113,8 @@ public:
virtual int dumpDEMdata() const;
+ bool dumpNow() const;
+
fileName createTimeDir(fileName) const;
fileName createLagrangianDir(fileName) const;
diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C
index c229bef..37214e6 100644
--- a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C
+++ b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C
@@ -84,7 +84,7 @@ basicIO::~basicIO()
int basicIO::dumpDEMdata() const
{
- if (time_.outputTime())
+ if (dumpNow())
{
// make time directory
if (parOutput_) lagPath_=buildFilePath(dirName_);
diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C
index 98014ee..e540c5a 100644
--- a/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C
+++ b/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C
@@ -79,7 +79,7 @@ int sophIO::dumpDEMdata() const
{
int npProcs(-1);
- if (time_.outputTime())
+ if (dumpNow())
{
npProcs=basicIO::dumpDEMdata();
diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C
index 2f981e2..888a08f 100644
--- a/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C
+++ b/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C
@@ -77,7 +77,7 @@ int trackIO::dumpDEMdata() const
{
int npProcs(-1);
- if (time_.outputTime())
+ if (dumpNow())
{
npProcs = sophIO::dumpDEMdata();
diff --git a/src/lagrangian/cfdemParticle/subModels/averagingModel/dense/dense.C b/src/lagrangian/cfdemParticle/subModels/averagingModel/dense/dense.C
index 374ef8e..7789244 100644
--- a/src/lagrangian/cfdemParticle/subModels/averagingModel/dense/dense.C
+++ b/src/lagrangian/cfdemParticle/subModels/averagingModel/dense/dense.C
@@ -150,6 +150,9 @@ void dense::setVectorAverage
{
for(int i=0;i<3;i++) valueVec[i] = value[index][i];
weightP = weight[index][subCell];
+
+ if(weightP calcShift() const; //detects empty indices in vector, when times are evaluated
- void Hist() const; //calc Histogram
- virtual void normHist() const; //calc normalized Histogram
+ std::vector calcShift() const; //detects empty indices in vector, when times are evaluated
+ void Hist() const; //calc Histogram
+ virtual void normHist() const; //calc normalized Histogram
void plotHist(double,std::string,int,int) const; //plot histogramm to terminal
void getRAMUsage() const;
diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C
index c932fda..7bb5d3e 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);
}
@@ -203,7 +203,7 @@ void Foam::dataExchangeModel::destroy(double* array) const
//====
-bool Foam::dataExchangeModel::couple() const
+bool Foam::dataExchangeModel::couple(int i) const
{
bool coupleNow = false;
if (doCoupleNow())
@@ -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 db14e44..a1794f6 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_;
@@ -71,7 +69,6 @@ protected:
int couplingInterval_;
// Protected member functions
- void setNumberOfParticles(int) const;
public:
@@ -118,9 +115,9 @@ public:
// Member Function
- inline const int& maxNumberOfParticles() const {return maxNumberOfParticles_;};
+ void setNumberOfParticles(int) const;
- inline int nClumpTypes() const {return nClumpTypes_;};
+ inline const int& maxNumberOfParticles() const {return maxNumberOfParticles_;};
template
void getData
@@ -179,7 +176,7 @@ public:
virtual void destroy(double*) const;
//====
- virtual bool couple() const;
+ virtual bool couple(int) const;
virtual scalar timeStepFraction() const;
@@ -240,6 +237,8 @@ public:
virtual int getNumberOfParticles() const;
virtual int getNumberOfClumps() const;
+ virtual int getNumberOfTypes() const;
+ virtual double* getTypeVol() const;
inline void setPositions(label n,double* pos) const
{
diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C
index 1947682..cedbb9d 100644
--- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C
+++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C
@@ -112,8 +112,9 @@ twoWayMPI::twoWayMPI
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
twoWayMPI::~twoWayMPI()
-{}
-
+{
+ if (liggghts == 1) delete lmp;
+}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
char* twoWayMPI::wordToChar(word& inWord) const
@@ -124,6 +125,7 @@ char* twoWayMPI::wordToChar(word& inWord) const
// * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //
+
void twoWayMPI::getData
(
word name,
@@ -251,10 +253,10 @@ void Foam::twoWayMPI::destroy(double* array) const
}
//============
-bool Foam::twoWayMPI::couple() const
+bool Foam::twoWayMPI::couple(int i) const
{
bool coupleNow = false;
- if (doCoupleNow())
+ if (i==0)
{
couplingStep_++;
coupleNow = true;
@@ -306,9 +308,9 @@ bool Foam::twoWayMPI::couple() const
DEMstepsToInterrupt[ind] -= DEMstepsToInterrupt[ind-1];
}
- Info << "Foam::twoWayMPI::couple(): interruptTimes=" << interruptTimes << endl;
- Info << "Foam::twoWayMPI::couple(): DEMstepsToInterrupt=" << DEMstepsToInterrupt << endl;
- Info << "Foam::twoWayMPI::couple(): lcModel=" << lcModel << endl;
+ Info << "Foam::twoWayMPI::couple(i): interruptTimes=" << interruptTimes << endl;
+ Info << "Foam::twoWayMPI::couple(i): DEMstepsToInterrupt=" << DEMstepsToInterrupt << endl;
+ Info << "Foam::twoWayMPI::couple(i): lcModel=" << lcModel << endl;
}
if(particleCloud_.liggghtsCommand()[i]().type()=="runLiggghts")
@@ -391,7 +393,6 @@ bool Foam::twoWayMPI::couple() const
// give nr of particles to cloud
double newNpart = liggghts_get_maxtag(lmp);
-
setNumberOfParticles(newNpart);
// re-allocate arrays of cloud
@@ -414,9 +415,29 @@ int Foam::twoWayMPI::getNumberOfClumps() const
return liggghts_get_maxtag_ms(lmp);
#endif
- Warning << "liggghts_get_maxtag_ms(lmp) is commented here!" << endl;
+ Warning << "liggghts_get_maxtag_ms(lmp) is not available here!" << endl;
return -1;
}
+
+int Foam::twoWayMPI::getNumberOfTypes() const
+{
+ #ifdef multisphere
+ return liggghts_get_ntypes_ms(lmp);
+ #endif
+ Warning << "liggghts_get_maxtag_ms(lmp) is not available here!" << endl;
+ return -1;
+}
+
+double* Foam::twoWayMPI::getTypeVol() const
+{
+ #ifdef multisphere
+ return liggghts_get_vclump_ms(lmp);
+ #endif
+
+ Warning << "liggghts_get_vclump_ms(lmp) is not available here!" << endl;
+ return NULL;
+}
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.H
index 2efc605..1c06d5e 100644
--- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.H
+++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.H
@@ -91,12 +91,13 @@ private:
MPI_Comm comm_liggghts;
- LAMMPS_NS::LAMMPS *lmp;
-
// private member functions
char* wordToChar(word&) const;
+protected:
+ LAMMPS_NS::LAMMPS *lmp;
+
public:
//- Runtime type information
@@ -118,6 +119,7 @@ public:
// Member Functions
+
void getData
(
word name,
@@ -160,10 +162,12 @@ public:
void destroy(int*) const;
//==============
- bool couple() const;
+ bool couple(int) const;
int getNumberOfParticles() const;
int getNumberOfClumps() const;
+ int getNumberOfTypes() const;
+ double* getTypeVol() const;
word myType() const{return typeName; };
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C
index b65f483..05120ce 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C
@@ -63,8 +63,6 @@ Archimedes::Archimedes
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
twoDimensional_(false),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
gravityFieldName_(propsDict_.lookup("gravityFieldName")),
#if defined(version21) || defined(version16ext)
g_(sm.mesh().lookupObject (gravityFieldName_))
@@ -86,14 +84,25 @@ Archimedes::Archimedes
Info << "2-dimensional simulation - make sure DEM side is 2D" << endl;
}
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
- if (modelType_=="A"){
- treatDEM_=true;
- Info << "accounting for Archimedes only on DEM side!" << endl;
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(1,true); // activate treatForceDEM switch
+ forceSubM(0).readSwitches();
+
+ if (modelType_=="A" || modelType_=="Bfull"){
+ if(!forceSubM(0).switches()[1]) // treatDEM != true
+ {
+ Warning << "Usually model type A and Bfull need Archimedes only on DEM side only (treatForceDEM=true)! are you sure about your settings?" << endl;
+ }
}
if (modelType_=="B"){
- treatDEM_=false;
- Info << "accounting for Archimedes on DEM and CFD side!" << endl;
+ if(forceSubM(0).switches()[1]) // treatDEM = true
+ {
+ Warning << "Usually model type B needs Archimedes on CFD and DEM side (treatForceDEM=false)! are you sure about your settings?" << endl;
+ }
}
particleCloud_.checkCG(true);
@@ -127,12 +136,21 @@ void Archimedes::setForce() const
if(twoDimensional_)
{
- force = -g_.value()*rho_[cellI]*pow(dp,2)/4*M_PI;
+ force = -g_.value()*forceSubM(0).rhoField()[cellI]*pow(dp,2)/4*M_PI;
Warning << "Archimedes::setForce() : this functionality is not tested!" << endl;
}else{
- force = -g_.value()*rho_[cellI]*particleCloud_.particleVolume(index);
+ force = -g_.value()*forceSubM(0).rhoField()[cellI]*particleCloud_.particleVolume(index);
}
+ //if(index >=0 && index <100)
+ //{
+ // Pout << "cellI = " << cellI << endl;
+ // Pout << "index = " << index << endl;
+ // Pout << "forceSubM(0).rhoField()[cellI] = " << forceSubM(0).rhoField()[cellI] << endl;
+ // Pout << "particleCloud_.particleVolume(index) = " << particleCloud_.particleVolume(index) << endl;
+ // Pout << "force = " << force << endl;
+ //}
+
//Set value fields and write the probe
if(probeIt_)
{
@@ -143,14 +161,8 @@ void Archimedes::setForce() const
}
}
- if(!treatDEM_)
- {
- if(treatExplicit_)
- for(int j=0;j<3;j++) expForces()[index][j] += force[j];
- else
- for(int j=0;j<3;j++) impForces()[index][j] += force[j];
- }
- for(int j=0;j<3;j++) DEMForces()[index][j] += force[j];
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,force,vector::zero);
//}
}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.H b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.H
index 59747b8..41d3c51 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.H
@@ -63,10 +63,6 @@ private:
bool twoDimensional_;
- word densityFieldName_;
-
- const volScalarField& rho_; // ref to fluid density
-
word gravityFieldName_;
#ifdef version21
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C
index d2ab3da..846f43a 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C
@@ -63,8 +63,6 @@ ArchimedesIB::ArchimedesIB
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
twoDimensional_(false),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")), //mod by alice
voidfractions_(sm.mesh().lookupObject (voidfractionFieldName_)),//mod by alice
gravityFieldName_(propsDict_.lookup("gravityFieldName")),
@@ -85,9 +83,18 @@ ArchimedesIB::ArchimedesIB
Info << "2-dimensional simulation - make sure DEM side is 2D" << endl;
}
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
- treatDEM_=true;
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
+ forceSubM(0).setSwitches(1,true); // treatDEM = true
Info << "accounting for Archimedes only on DEM side!" << endl;
+
particleCloud_.checkCG(true);
}
@@ -116,8 +123,8 @@ void ArchimedesIB::setForce() const
label cellI = particleCloud_.cellIDs()[index][subCell];
if (cellI > -1) // particle Found
{
- //force += -g_.value()*rho_[cellI]*rho_.mesh().V()[cellI]*(1-particleCloud_.voidfractions()[index][subCell]);//mod by alice
- force += -g_.value()*rho_[cellI]*rho_.mesh().V()[cellI]*(1-voidfractions_[cellI]);//mod by alice
+ //force += -g_.value()*forceSubM(0).rhoField()[cellI]*forceSubM(0).rhoField().mesh().V()[cellI]*(1-particleCloud_.voidfractions()[index][subCell]);//mod by alice
+ force += -g_.value()*forceSubM(0).rhoField()[cellI]*particleCloud_.mesh().V()[cellI]*(1-voidfractions_[cellI]);//mod by alice
}
}
@@ -131,12 +138,9 @@ void ArchimedesIB::setForce() const
// set force on particle
if(twoDimensional_) Warning<<"ArchimedesIB model doesn't work for 2D right now!!\n"<< endl;
- if(!treatDEM_)
- {
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += force[j];
- else for(int j=0;j<3;j++) impForces()[index][j] += force[j];
- }
- for(int j=0;j<3;j++) DEMForces()[index][j] += force[j];
+
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,force,vector::zero);
//}
}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.H b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.H
index a117e52..7b1ff8e 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.H
@@ -65,10 +65,6 @@ private:
bool twoDimensional_;
- word densityFieldName_;
-
- const volScalarField& rho_; // ref to fluid density
-
word voidfractionFieldName_;
const volScalarField& voidfractions_;
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C
index b5b7c4c..674b0b3 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C
@@ -64,15 +64,10 @@ DiFeliceDrag::DiFeliceDrag
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
- verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject (velFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject (voidfractionFieldName_)),
- interpolation_(false),
- splitImplicitExplicit_(false),
UsFieldName_(propsDict_.lookup("granVelFieldName")),
UsField_(sm.mesh().lookupObject (UsFieldName_)),
scaleDia_(1.),
@@ -87,25 +82,24 @@ DiFeliceDrag::DiFeliceDrag
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
- if (propsDict_.found("verbose")) verbose_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
- if (propsDict_.found("interpolation"))
- {
- Info << "using interpolated value of U." << endl;
- interpolation_=true;
- }
- if (propsDict_.found("splitImplicitExplicit"))
- {
- Info << "will split implicit / explicit force contributions." << endl;
- splitImplicitExplicit_ = true;
- if(!interpolation_)
- Info << "WARNING: will only consider fluctuating particle velocity in implicit / explicit force split!" << endl;
- }
particleCloud_.checkCG(true);
if (propsDict_.found("scale"))
scaleDia_=scalar(readScalar(propsDict_.lookup("scale")));
if (propsDict_.found("scaleDrag"))
scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag")));
+
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(2,true); // activate implDEM switch
+ forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+ forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
}
@@ -125,18 +119,16 @@ void DiFeliceDrag::setForce() const
scaleDia_=particleCloud_.cg();
Info << "DiFeliceDrag using scale from liggghts cg = " << scaleDia_ << endl;
}
-
- // get viscosity field
- #ifdef comp
- const volScalarField nufField = particleCloud_.turbulence().mu() / rho_;
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- #endif
+ const volScalarField& nufField = forceSubM(0).nuField();
+ const volScalarField& rhoField = forceSubM(0).rhoField();
+
vector position(0,0,0);
scalar voidfraction(1);
vector Ufluid(0,0,0);
vector drag(0,0,0);
+ vector dragExplicit(0,0,0);
+ scalar dragCoefficient(0);
label cellI=0;
vector Us(0,0,0);
vector Ur(0,0,0);
@@ -147,11 +139,6 @@ void DiFeliceDrag::setForce() const
scalar Rep(0);
scalar Cd(0);
- vector UfluidFluct(0,0,0);
- vector UsFluct(0,0,0);
- vector dragExplicit(0,0,0);
- scalar dragCoefficient(0);
-
interpolationCellPoint voidfractionInterpolator_(voidfraction_);
interpolationCellPoint UInterpolator_(U_);
@@ -159,15 +146,15 @@ void DiFeliceDrag::setForce() const
for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{
- //if(mask[index][0])
- //{
-
cellI = particleCloud_.cellIDs()[index][0];
drag = vector(0,0,0);
+ dragExplicit = vector(0,0,0);
+ dragCoefficient=0;
+ Ufluid =vector(0,0,0);
if (cellI > -1) // particle Found
{
- if(interpolation_)
+ if(forceSubM(0).interpolation())
{
position = particleCloud_.position(index);
voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
@@ -182,11 +169,10 @@ void DiFeliceDrag::setForce() const
Ur = Ufluid-Us;
ds = 2*particleCloud_.radius(index);
nuf = nufField[cellI];
- rho = rho_[cellI];
+ rho = rhoField[cellI];
magUr = mag(Ur);
Rep = 0;
Cd = 0;
- dragCoefficient = 0;
if (magUr > 0)
{
@@ -212,16 +198,10 @@ void DiFeliceDrag::setForce() const
drag = dragCoefficient*Ur; //total drag force!
- //Split forces
- if(splitImplicitExplicit_)
- {
- UfluidFluct = Ufluid - U_[cellI];
- UsFluct = Us - UsField_[cellI];
- dragExplicit = dragCoefficient*(UfluidFluct - UsFluct); //explicit part of force
- }
+ forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose(),index);
}
- if(verbose_ && index >-1 && index <102)
+ if(forceSubM(0).verbose() && index >-1 && index <102)
{
Pout << "index = " << index << endl;
Pout << "Us = " << Us << endl;
@@ -233,12 +213,6 @@ void DiFeliceDrag::setForce() const
Pout << "Rep = " << Rep << endl;
Pout << "Cd = " << Cd << endl;
Pout << "drag (total) = " << drag << endl;
- if(splitImplicitExplicit_)
- {
- Pout << "UfluidFluct = " << UfluidFluct << endl;
- Pout << "UsFluct = " << UsFluct << endl;
- Pout << "dragExplicit = " << dragExplicit << endl;
- }
}
//Set value fields and write the probe
@@ -253,20 +227,10 @@ void DiFeliceDrag::setForce() const
particleCloud_.probeM().writeProbe(index, sValues, vValues);
}
}
- // set force on particle
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += drag[j];
- else //implicit treatment, taking explicit force contribution into account
- {
- for(int j=0;j<3;j++)
- {
- impForces()[index][j] += drag[j] - dragExplicit[j]; //only consider implicit part!
- expForces()[index][j] += dragExplicit[j];
- }
- }
-
- for(int j=0;j<3;j++) DEMForces()[index][j] += drag[j];
+
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,drag,dragExplicit,Ufluid,dragCoefficient);
}
- //}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H
index 5d788bf..a043b28 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H
@@ -60,24 +60,14 @@ class DiFeliceDrag
private:
dictionary propsDict_;
- bool verbose_;
-
word velFieldName_;
const volVectorField& U_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
word voidfractionFieldName_;
const volScalarField& voidfraction_;
- bool interpolation_; // use interpolated U field values
-
- bool splitImplicitExplicit_; // use splitting of implicit and explict force contribution
-
word UsFieldName_;
const volVectorField& UsField_; // the average particle velocity field (for implicit/expliti force split)
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C
index c4f8e88..eaaeb94 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C
@@ -63,17 +63,16 @@ GidaspowDrag::GidaspowDrag
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
- verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject (velFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject (voidfractionFieldName_)),
phi_(readScalar(propsDict_.lookup("phi"))),
- interpolation_(false),
+ UsFieldName_(propsDict_.lookup("granVelFieldName")),
+ UsField_(sm.mesh().lookupObject (UsFieldName_)),
scaleDia_(1.),
- scaleDrag_(1.)
+ scaleDrag_(1.),
+ switchingVoidfraction_(0.8)
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "gidaspowDrag.logDat");
@@ -84,23 +83,24 @@ GidaspowDrag::GidaspowDrag
particleCloud_.probeM().scalarFields_.append("voidfraction");
particleCloud_.probeM().writeHeader();
- if (propsDict_.found("verbose")) verbose_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
- if (propsDict_.found("interpolation")) interpolation_=true;
- if (propsDict_.found("implDEM"))
- {
- treatExplicit_=false;
- implDEM_=true;
- setImpDEMdrag();
- Info << "Using implicit DEM drag formulation." << endl;
- }
+ // init force sub model
+ setForceSubModels(propsDict_);
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(2,true); // activate implDEM switch
+ forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+ forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
+ forceSubM(0).readSwitches();
+
particleCloud_.checkCG(true);
if (propsDict_.found("scale"))
scaleDia_=scalar(readScalar(propsDict_.lookup("scale")));
if (propsDict_.found("scaleDrag"))
scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag")));
- Info << "Gidaspow - interpolation switch: " << interpolation_ << endl;
+ if (propsDict_.found("switchingVoidfraction"))
+ switchingVoidfraction_ = readScalar(propsDict_.lookup("switchingVoidfraction"));
}
@@ -121,12 +121,8 @@ void GidaspowDrag::setForce() const
Info << "Gidaspow using scale from liggghts cg = " << scaleDia_ << endl;
}
- // get viscosity field
- #ifdef comp
- const volScalarField nufField = particleCloud_.turbulence().mu() / rho_;
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- #endif
+ const volScalarField& nufField = forceSubM(0).nuField();
+ const volScalarField& rhoField = forceSubM(0).rhoField();
vector position(0,0,0);
scalar voidfraction(1);
@@ -145,9 +141,11 @@ void GidaspowDrag::setForce() const
scalar localPhiP(0);
scalar CdMagUrLag(0); //Cd of the very particle
- scalar KslLag(0); //momentum exchange of the very particle (per unit volume)
scalar betaP(0); //momentum exchange of the very particle
+ vector dragExplicit(0,0,0);
+ scalar dragCoefficient(0);
+
interpolationCellPoint voidfractionInterpolator_(voidfraction_);
interpolationCellPoint UInterpolator_(U_);
@@ -159,15 +157,17 @@ void GidaspowDrag::setForce() const
//{
cellI = particleCloud_.cellIDs()[index][0];
drag = vector(0,0,0);
+ dragExplicit = vector(0,0,0);
betaP = 0;
Vs = 0;
Ufluid =vector(0,0,0);
voidfraction=0;
+ dragCoefficient = 0;
if (cellI > -1) // particle Found
{
- if(interpolation_)
+ if( forceSubM(0).interpolation() )
{
position = particleCloud_.position(index);
voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
@@ -186,46 +186,47 @@ void GidaspowDrag::setForce() const
Us = particleCloud_.velocity(index);
Ur = Ufluid-Us;
magUr = mag(Ur);
- ds = 2*particleCloud_.radius(index)*phi_;
- rho = rho_[cellI];
+ ds = 2*particleCloud_.radius(index);
+ rho = rhoField[cellI];
nuf = nufField[cellI];
Rep=0.0;
localPhiP = 1.0f-voidfraction+SMALL;
Vs = ds*ds*ds*M_PI/6;
- //Compute specific drag coefficient (i.e., Force per unit slip velocity and per m³ SUSPENSION)
- if(voidfraction > 0.8) //dilute
+ // calc particle's drag coefficient (i.e., Force per unit slip velocity and per m³ PARTICLE)
+ if(voidfraction > switchingVoidfraction_) //dilute
{
Rep=ds/scaleDia_*voidfraction*magUr/nuf;
- CdMagUrLag = (24.0*nuf/(ds/scaleDia_*voidfraction)) //1/magUr missing here, but compensated in expression for KslLag!
- *(scalar(1)+0.15*Foam::pow(Rep, 0.687));
+ CdMagUrLag = (24.0*nuf/(ds/scaleDia_*voidfraction)) //1/magUr missing here, but compensated in expression for betaP!
+ *(scalar(1.0)+0.15*Foam::pow(Rep, 0.687));
- KslLag = 0.75*(
- rho*localPhiP*voidfraction*CdMagUrLag
+ betaP = 0.75*( //this is betaP = beta / localPhiP!
+ rho*voidfraction*CdMagUrLag
/
(ds/scaleDia_*Foam::pow(voidfraction,2.65))
);
}
else //dense
{
- KslLag = (150*Foam::pow(localPhiP,2)*nuf*rho)/
- (voidfraction*ds/scaleDia_*ds/scaleDia_+SMALL)
+ betaP = (150 * localPhiP*nuf*rho) //this is betaP = beta / localPhiP!
+ / (voidfraction*ds/scaleDia_*phi_*ds/scaleDia_*phi_)
+
- (1.75*(localPhiP) * magUr * rho)/
- ((ds/scaleDia_));
+ (1.75 * magUr * rho)
+ /((ds/scaleDia_*phi_));
}
- // calc particle's drag coefficient (i.e., Force per unit slip velocity and per m³ PARTICLE)
- betaP = KslLag / localPhiP;
-
// calc particle's drag
- drag = Vs * betaP * Ur * scaleDrag_;
-
+ dragCoefficient = Vs*betaP*scaleDrag_;
if (modelType_=="B")
- drag /= voidfraction;
+ dragCoefficient /= voidfraction;
- if(verbose_ && index >=0 && index <2)
+ drag = dragCoefficient * Ur;
+
+ // explicitCorr
+ forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose());
+
+ if(forceSubM(0).verbose() && index >=0 && index <2)
{
Pout << "cellI = " << cellI << endl;
Pout << "index = " << index << endl;
@@ -255,23 +256,8 @@ void GidaspowDrag::setForce() const
}
}
- // set force on particle
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += drag[j];
- else for(int j=0;j<3;j++) impForces()[index][j] += drag[j];
-
- // set Cd
- if(implDEM_)
- {
- for(int j=0;j<3;j++) fluidVel()[index][j]=Ufluid[j];
-
- if (modelType_=="B" && cellI > -1)
- Cds()[index][0] = Vs*betaP/voidfraction*scaleDrag_;
- else
- Cds()[index][0] = Vs*betaP*scaleDrag_;
-
- }else{
- for(int j=0;j<3;j++) DEMForces()[index][j] += drag[j];
- }
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,drag,dragExplicit,Ufluid,dragCoefficient);
//}// end if mask
}// end loop particles
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H
index 978ca69..61c7d19 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H
@@ -31,6 +31,8 @@ Description
Gidaspow drag law
- only valid for low-Reynolds number systems (Re_p<1000)
- including interpolation of the velocity to the exact position
+ - splits off explicit drag component due to fluctuation in fluid and particle
+ velocity (optional via forceSubModel "ImExCorr")
Class
GidaspowDrag
@@ -62,28 +64,26 @@ class GidaspowDrag
private:
dictionary propsDict_;
- bool verbose_;
-
word velFieldName_;
const volVectorField& U_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
word voidfractionFieldName_;
const volScalarField& voidfraction_;
const scalar phi_;
- bool interpolation_; // use interpolated field values
+ word UsFieldName_;
+
+ const volVectorField& UsField_; // the average particle velocity field
mutable scalar scaleDia_;
mutable scalar scaleDrag_;
+ mutable scalar switchingVoidfraction_; //voidfraction above which dilute formulation will be used
+
public:
//- Runtime type information
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C
index 4dc7802..e722e9a 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C
@@ -64,14 +64,12 @@ KochHillDrag::KochHillDrag
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
- verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject (velFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject (voidfractionFieldName_)),
- interpolation_(false),
+ UsFieldName_(propsDict_.lookupOrDefault("granVelFieldName",word("Us"))),
+ UsField_(sm.mesh().lookupObject (UsFieldName_)),
scaleDia_(1.),
scaleDrag_(1.)
{
@@ -84,16 +82,20 @@ KochHillDrag::KochHillDrag
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
- if (propsDict_.found("verbose")) verbose_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
- if (propsDict_.found("interpolation")) interpolation_=true;
- if (propsDict_.found("implDEM"))
- {
- treatExplicit_=false;
- implDEM_=true;
- setImpDEMdrag();
- Info << "Using implicit DEM drag formulation." << endl;
- }
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(2,true); // activate implDEM switch
+ forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+ forceSubM(0).setSwitchesList(7,true); // activate implForceDEMacc switch
+ forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
particleCloud_.checkCG(true);
if (propsDict_.found("scale"))
@@ -120,17 +122,15 @@ void KochHillDrag::setForce() const
Info << "KochHill using scale from liggghts cg = " << scaleDia_ << endl;
}
- // get viscosity field
- #ifdef comp
- const volScalarField nufField = particleCloud_.turbulence().mu()/rho_;
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- #endif
+ const volScalarField& nufField = forceSubM(0).nuField();
+ const volScalarField& rhoField = forceSubM(0).rhoField();
vector position(0,0,0);
scalar voidfraction(1);
vector Ufluid(0,0,0);
vector drag(0,0,0);
+ vector dragExplicit(0,0,0);
+ scalar dragCoefficient(0);
label cellI=0;
vector Us(0,0,0);
@@ -144,6 +144,8 @@ void KochHillDrag::setForce() const
scalar volumefraction(0);
scalar betaP(0);
+ int couplingInterval(particleCloud_.dataExchangeM().couplingInterval());
+
interpolationCellPoint voidfractionInterpolator_(voidfraction_);
interpolationCellPoint UInterpolator_(U_);
@@ -151,10 +153,10 @@ void KochHillDrag::setForce() const
for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{
- //if(mask[index][0])
- //{
cellI = particleCloud_.cellIDs()[index][0];
drag = vector(0,0,0);
+ dragExplicit = vector(0,0,0);
+ dragCoefficient=0;
betaP = 0;
Vs = 0;
Ufluid =vector(0,0,0);
@@ -162,7 +164,7 @@ void KochHillDrag::setForce() const
if (cellI > -1) // particle Found
{
- if(interpolation_)
+ if(forceSubM(0).interpolation())
{
position = particleCloud_.position(index);
voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
@@ -181,11 +183,11 @@ void KochHillDrag::setForce() const
Ur = Ufluid-Us;
ds = particleCloud_.d(index);
nuf = nufField[cellI];
- rho = rho_[cellI];
+ rho = rhoField[cellI];
magUr = mag(Ur);
Rep = 0;
Vs = ds*ds*ds*M_PI/6;
- volumefraction = 1-voidfraction+SMALL;
+ volumefraction = max(SMALL,min(1-SMALL,1-voidfraction));
if (magUr > 0)
{
@@ -209,20 +211,32 @@ void KochHillDrag::setForce() const
// calc model coefficient F3
scalar F3 = 0.0673+0.212*volumefraction+0.0232/pow(voidfraction,5);
- //Calculate F
+ //Calculate F (the factor 0.5 is introduced, since Koch and Hill, ARFM 33:619–47, use the radius
+ //to define Rep, and we use the particle diameter, see vanBuijtenen et al., CES 66:2368–2376.
scalar F = voidfraction * (F0 + 0.5*F3*Rep);
// calc drag model coefficient betaP
betaP = 18.*nuf*rho/(ds/scaleDia_*ds/scaleDia_)*voidfraction*F;
// calc particle's drag
- drag = Vs*betaP*Ur*scaleDrag_;
-
+ dragCoefficient = Vs*betaP*scaleDrag_;
if (modelType_=="B")
- drag /= voidfraction;
+ dragCoefficient /= voidfraction;
+
+ if(forceSubM(0).switches()[7]) // implForceDEMaccumulated=true
+ {
+ //get drag from the particle itself
+ for (int j=0 ; j<3 ; j++) drag[j] = particleCloud_.fAccs()[index][j]/couplingInterval;
+ }else
+ {
+ drag = dragCoefficient * Ur;
+
+ // explicitCorr
+ forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose());
+ }
}
- if(verbose_ && index >=0 && index <2)
+ if(forceSubM(0).verbose() && index >=0 && index <2)
{
Pout << "cellI = " << cellI << endl;
Pout << "index = " << index << endl;
@@ -250,25 +264,9 @@ void KochHillDrag::setForce() const
particleCloud_.probeM().writeProbe(index, sValues, vValues);
}
}
- // set force on particle
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += drag[j];
- else for(int j=0;j<3;j++) impForces()[index][j] += drag[j];
- // set Cd
- if(implDEM_)
- {
- for(int j=0;j<3;j++) fluidVel()[index][j]=Ufluid[j];
-
- if (modelType_=="B" && cellI > -1)
- Cds()[index][0] = Vs*betaP/voidfraction*scaleDrag_;
- else
- Cds()[index][0] = Vs*betaP*scaleDrag_;
-
- }else{
- for(int j=0;j<3;j++) DEMForces()[index][j] += drag[j];
- }
-
- //}
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,drag,dragExplicit,Ufluid,dragCoefficient);
}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H
index 8937a45..95d6712 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H
@@ -64,21 +64,17 @@ class KochHillDrag
private:
dictionary propsDict_;
- bool verbose_;
-
word velFieldName_;
const volVectorField& U_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
word voidfractionFieldName_;
const volScalarField& voidfraction_;
- bool interpolation_; // use interpolated field values
+ word UsFieldName_;
+
+ const volVectorField& UsField_;
mutable scalar scaleDia_;
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C
index d92e225..57a5da6 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C
@@ -63,7 +63,6 @@ LaEuScalarTemp::LaEuScalarTemp
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
- verbose_(false),
tempFieldName_(propsDict_.lookup("tempFieldName")),
tempField_(sm.mesh().lookupObject (tempFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
@@ -76,10 +75,7 @@ LaEuScalarTemp::LaEuScalarTemp
partHeatFluxName_(propsDict_.lookup("partHeatFluxName")),
partHeatFlux_(NULL),
lambda_(readScalar(propsDict_.lookup("lambda"))),
- Cp_(readScalar(propsDict_.lookup("Cp"))),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
- interpolation_(false)
+ Cp_(readScalar(propsDict_.lookup("Cp")))
{
allocateMyArrays();
@@ -88,10 +84,18 @@ LaEuScalarTemp::LaEuScalarTemp
maxSource_=readScalar(propsDict_.lookup ("maxSource"));
Info << "limiting eulerian source field to: " << maxSource_ << endl;
}
- if (propsDict_.found("interpolation")) interpolation_=true;
- if (propsDict_.found("verbose")) verbose_=true;
-Info << "verbose_" << verbose_ << endl;
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+ forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
particleCloud_.checkCG(false);
}
@@ -131,12 +135,8 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
// get DEM data
particleCloud_.dataExchangeM().getData(partTempName_,"scalar-atom",partTemp_);
- // get viscosity field
- #ifdef comp
- const volScalarField& nufField = particleCloud_.turbulence().mu() / rho_;
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- #endif
+ const volScalarField& nufField = forceSubM(0).nuField();
+ const volScalarField& rhoField = forceSubM(0).rhoField();
// calc La based heat flux
vector position(0,0,0);
@@ -158,6 +158,8 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
interpolationCellPoint UInterpolator_(U_);
interpolationCellPoint TInterpolator_(tempField_);
+ scalar h1(0);
+ scalar h2(0);
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{
//if(particleCloud_.regionM().inRegion()[index][0])
@@ -165,7 +167,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
cellI = particleCloud_.cellIDs()[index][0];
if(cellI >= 0)
{
- if(interpolation_)
+ if(forceSubM(0).interpolation())
{
position = particleCloud_.position(index);
voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
@@ -185,7 +187,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
As = ds*ds*M_PI;
nuf = nufField[cellI];
Rep = ds*magUr/nuf;
- Pr = Cp_*nuf*rho_[cellI]/lambda_;
+ Pr = max(SMALL,Cp_*nuf*rhoField[cellI]/lambda_);
if (Rep < 200)
{
@@ -193,8 +195,9 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
}
else if (Rep < 1500)
{
- Nup = 2+0.5*pow(voidfraction,n)*sqrt(Rep)*pow(Pr,0.33)
- +0.02*pow(voidfraction,n)*pow(Rep,0.8)*pow(Pr,0.33);
+ h1=pow(voidfraction,n);
+ h2=pow(Pr,0.33);
+ Nup = 2+0.5*h1*sqrt(Rep)*h2+0.02*h1*pow(Rep,0.8)*h2;
}
else
{
@@ -207,7 +210,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
partHeatFlux_[index][0] = partHeatFlux;
- if(verbose_ && index >=0 && index <2)
+ if(forceSubM(0).verbose() && index >=0 && index <2)
{
Info << "partHeatFlux = " << partHeatFlux << endl;
Info << "magUr = " << magUr << endl;
@@ -233,7 +236,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
);
// scale with -1/(Vcell*rho*Cp)
- EuField.internalField() /= -rho_.internalField()*Cp_*EuField.mesh().V();
+ EuField.internalField() /= -rhoField.internalField()*Cp_*EuField.mesh().V();
// limit source term
scalar EuFieldInCell;
@@ -247,7 +250,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
}
}
- Info << "total convective particle-fluid heat flux [W] (Eulerian) = " << gSum(EuField*rho_*Cp_*EuField.mesh().V()) << endl;
+ Info << "total convective particle-fluid heat flux [W] (Eulerian) = " << gSum(EuField*rhoField*Cp_*EuField.mesh().V()) << endl;
// give DEM data
particleCloud_.dataExchangeM().giveData(partHeatFluxName_,"scalar-atom", partHeatFlux_);
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H
index fe72dc0..01e6354 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H
@@ -65,8 +65,6 @@ private:
dictionary propsDict_;
- bool verbose_;
-
word tempFieldName_;
const volScalarField& tempField_; // ref to temperature field
@@ -93,12 +91,6 @@ private:
scalar Cp_; // specific heat capacity [W*s/(kg*K)]
- word densityFieldName_;
-
- const volScalarField& rho_; // ref to fluid density field
-
- bool interpolation_; // use interpolated field values
-
void allocateMyArrays() const;
public:
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C
index 38d5527..cc745a4 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C
@@ -66,22 +66,20 @@ MeiLift::MeiLift
propsDict_(dict.subDict(typeName + "Props")),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject (velFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
- useSecondOrderTerms_(false),
- interpolation_(false),
- verbose_(false)
-/*,
- vorticityFieldName_(propsDict_.lookup("vorticityFieldName")),
- vorticity_(sm.mesh().lookupObject (vorticityFieldName_))*/
+ useSecondOrderTerms_(false)
{
if (propsDict_.found("useSecondOrderTerms")) useSecondOrderTerms_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
- if (propsDict_.found("interpolation")) interpolation_=true;
- if (propsDict_.found("verbose")) verbose_=true;
+ // init force sub model
+ setForceSubModels(propsDict_);
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+ forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
+ forceSubM(0).readSwitches();
- particleCloud_.checkCG(false);
+ particleCloud_.checkCG(false);
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "meiLift.logDat");
@@ -106,12 +104,8 @@ MeiLift::~MeiLift()
void MeiLift::setForce() const
{
- // get viscosity field
- #ifdef comp
- const volScalarField nufField = particleCloud_.turbulence().mu() / rho_;
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- #endif
+ const volScalarField& nufField = forceSubM(0).nuField();
+ const volScalarField& rhoField = forceSubM(0).rhoField();
vector position(0,0,0);
vector lift(0,0,0);
@@ -151,7 +145,7 @@ void MeiLift::setForce() const
{
Us = particleCloud_.velocity(index);
- if(interpolation_)
+ if( forceSubM(0).interpolation() )
{
position = particleCloud_.position(index);
Ur = UInterpolator_.interpolate(position,cellI)
@@ -172,7 +166,7 @@ void MeiLift::setForce() const
{
ds = 2*particleCloud_.radius(index);
nuf = nufField[cellI];
- rho = rho_[cellI];
+ rho = rhoField[cellI];
// calc dimensionless properties
Rep = ds*magUr/nuf;
@@ -228,7 +222,7 @@ void MeiLift::setForce() const
//**********************************
//SAMPLING AND VERBOSE OUTOUT
- if(verbose_ )
+ if( forceSubM(0).verbose() )
{
Pout << "index = " << index << endl;
Pout << "Us = " << Us << endl;
@@ -261,13 +255,8 @@ void MeiLift::setForce() const
//**********************************
}
- // set force on particle
- if(!treatDEM_)
- {
- if(!treatExplicit_) for(int j=0;j<3;j++) impForces()[index][j] += lift[j];
- else for(int j=0;j<3;j++) expForces()[index][j] += lift[j];
- }
- for(int j=0;j<3;j++) DEMForces()[index][j] += lift[j];
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,lift,vector::zero);
//}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H
index 86eb066..6a6016b 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H
@@ -80,20 +80,8 @@ private:
const volVectorField& U_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
bool useSecondOrderTerms_;
- bool interpolation_;
-
- bool verbose_;
-
- /*word vorticityFieldName_;
-
- volVectorField& vorticity_;*/
-
public:
//- Runtime type information
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C
index 0630b0f..6aa7f20 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C
@@ -66,9 +66,7 @@ SchillerNaumannDrag::SchillerNaumannDrag
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
- U_(sm.mesh().lookupObject (velFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_))
+ U_(sm.mesh().lookupObject (velFieldName_))
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "schillerNaumannDrag.logDat");
@@ -79,7 +77,16 @@ SchillerNaumannDrag::SchillerNaumannDrag
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
+
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
particleCloud_.checkCG(false);
}
@@ -94,15 +101,11 @@ SchillerNaumannDrag::~SchillerNaumannDrag()
void SchillerNaumannDrag::setForce() const
{
- // get viscosity field
- #ifdef comp
- const volScalarField nufField = particleCloud_.turbulence().mu() / rho_;
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- #endif
-
#include "setupProbeModel.H"
+ const volScalarField& nufField = forceSubM(0).nuField();
+ const volScalarField& rhoField = forceSubM(0).rhoField();
+
for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{
//if(mask[index][0])
@@ -117,7 +120,7 @@ void SchillerNaumannDrag::setForce() const
vector Ur = U_[cellI]-Us;
scalar ds = 2*particleCloud_.radius(index);
scalar nuf = nufField[cellI];
- scalar rho = rho_[cellI];
+ scalar rho = rhoField[cellI];
scalar voidfraction = particleCloud_.voidfraction(index);
scalar magUr = mag(Ur);
scalar Rep = 0;
@@ -163,10 +166,9 @@ void SchillerNaumannDrag::setForce() const
particleCloud_.probeM().writeProbe(index, sValues, vValues);
}
}
- // set force on particle
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += drag[j];
- else for(int j=0;j<3;j++) impForces()[index][j] += drag[j];
- for(int j=0;j<3;j++) DEMForces()[index][j] += drag[j];
+
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,drag,vector::zero);
//}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.H
index f898a66..4b7dc8d 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.H
@@ -66,10 +66,6 @@ private:
const volVectorField& U_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
public:
//- Runtime type information
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C
index 4396869..59569a4 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C
@@ -68,8 +68,6 @@ ShirgaonkarIB::ShirgaonkarIB
depth_(1),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject (velFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
pressureFieldName_(propsDict_.lookup("pressureFieldName")),
p_(sm.mesh().lookupObject (pressureFieldName_))
{
@@ -86,7 +84,16 @@ ShirgaonkarIB::ShirgaonkarIB
Info << "2-dimensional simulation - make sure DEM side is 2D" << endl;
Info << "depth of domain is assumed to be :" << depth_ << endl;
}
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
+
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
particleCloud_.checkCG(false);
}
@@ -105,15 +112,7 @@ void ShirgaonkarIB::setForce() const
label cellI;
vector drag;
- #ifdef comp
- // get viscosity field
- const volScalarField& mufField = particleCloud_.turbulence().mu();
- volVectorField h = (mufField*fvc::laplacian(U_)-fvc::grad(p_));
- #else
- // get viscosity field
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- volVectorField h = rho_*(nufField*fvc::laplacian(U_)-fvc::grad(p_));
- #endif
+ volVectorField h=forceSubM(0).IBDragPerV(U_,p_);
#include "setupProbeModel.H"
@@ -146,9 +145,8 @@ void ShirgaonkarIB::setForce() const
particleCloud_.probeM().writeProbe(index, sValues, vValues);
}
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += drag[j];
- else for(int j=0;j<3;j++) impForces()[index][j] += drag[j];
- for(int j=0;j<3;j++) DEMForces()[index][j] += drag[j];
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,drag,vector::zero);
if(verbose_) Info << "impForces = " << impForces()[index][0]<<","< (densityFieldName_)),
rhoP_(readScalar(propsDict_.lookup("rhoP")))
-{}
+{
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@@ -82,12 +86,9 @@ void checkCouplingInterval::setForce() const
{
if(particleCloud_.mesh().time().write())
{
- // get viscosity field
- #ifdef comp
- const volScalarField nufField = particleCloud_.turbulence().mu() / rho_;
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
- #endif
+
+ const volScalarField& nufField = forceSubM(0).nuField();
+ const volScalarField& rhoField = forceSubM(0).rhoField();
// find min particle relaxation time
scalar minTauP = 1000;
@@ -101,7 +102,7 @@ void checkCouplingInterval::setForce() const
{
scaledRad = particleCloud_.radius(index)/particleCloud_.cg();
tauP = rhoP_*4*scaledRad*scaledRad/
- (18 * nufField[cellI] * rho_[cellI]);
+ (18 * nufField[cellI] * rhoField[cellI]);
minTauP = min(minTauP,tauP);
}
}
@@ -113,7 +114,8 @@ void checkCouplingInterval::setForce() const
double accNrAll=-1.;
MPI_Allreduce(&accNr, &accNrAll, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
-
+ Info << "min. occurring particle relaxation time [s]: " << minTauP << endl;
+ Info << "coupling interval [s]: " << DEMtime << endl;
Info << "max. occurring acceleration nr: " << accNrAll << endl;
if(accNrAll > 0.1) Warning << "you should use a smaller coupling interval!" << endl;
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/checkCouplingInterval/checkCouplingInterval.H b/src/lagrangian/cfdemParticle/subModels/forceModel/checkCouplingInterval/checkCouplingInterval.H
index 0ff44ac..01d1943 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/checkCouplingInterval/checkCouplingInterval.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/checkCouplingInterval/checkCouplingInterval.H
@@ -62,10 +62,6 @@ class checkCouplingInterval
private:
dictionary propsDict_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
const scalar rhoP_;
public:
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/fieldStore/fieldStore.C b/src/lagrangian/cfdemParticle/subModels/forceModel/fieldStore/fieldStore.C
new file mode 100644
index 0000000..24a299b
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/fieldStore/fieldStore.C
@@ -0,0 +1,164 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+\*---------------------------------------------------------------------------*/
+
+#include "error.H"
+
+#include "fieldStore.H"
+#include "addToRunTimeSelectionTable.H"
+#include "dataExchangeModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(fieldStore, 0);
+
+addToRunTimeSelectionTable
+(
+ forceModel,
+ fieldStore,
+ dictionary
+);
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+// Construct from components
+fieldStore::fieldStore
+(
+ const dictionary& dict,
+ cfdemCloud& sm
+)
+:
+ forceModel(dict,sm),
+ propsDict_(dict.subDict(typeName + "Props")),
+ mesh_(particleCloud_.mesh()),
+ scalarFieldNames_(propsDict_.lookup("scalarFieldNames")),
+ vectorFieldNames_(propsDict_.lookup("vectorFieldNames")),
+ scalarFields_(NULL),
+ vectorFields_(NULL)
+{
+ // create time average scalar fields
+ scalarFields_.setSize(scalarFieldNames_.size());
+
+ for (int i=0;i < scalarFieldNames_.size(); i++)
+ {
+ word fieldName = "stored_" + scalarFieldNames_[i];
+
+ Info<< "Creating field " << fieldName << endl;
+ scalarFields_.set
+ (
+ i,
+ new volScalarField
+ (
+ IOobject
+ (
+ fieldName,
+ mesh_.time().timeName(),
+ mesh_,
+ IOobject::NO_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_,
+ dimensionedScalar("0", mesh_.lookupObject(scalarFieldNames_[i]).dimensions(), 0)
+ )
+ );
+ }
+
+ // create time average vector fields
+ vectorFields_.setSize(vectorFieldNames_.size());
+
+ for (int i=0;i < vectorFieldNames_.size(); i++)
+ {
+ word fieldName = "stored_" + vectorFieldNames_[i];
+
+ Info<< "Creating field " << fieldName << endl;
+ vectorFields_.set
+ (
+ i,
+ new volVectorField
+ (
+ IOobject
+ (
+ fieldName,
+ mesh_.time().timeName(),
+ mesh_,
+ IOobject::NO_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_,
+ dimensionedVector("0", mesh_.lookupObject(vectorFieldNames_[i]).dimensions(), vector::zero)
+ )
+ );
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+fieldStore::~fieldStore()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void fieldStore::setForce() const
+{
+ if(particleCloud_.verbose()) Info << "fieldStore.C - setForce()" << endl;
+
+ for (int i=0;i < scalarFieldNames_.size(); i++)
+ {
+ // get reference to actual field
+ volScalarField& field = (volScalarField&) mesh_.lookupObject(scalarFieldNames_[i]);
+
+ // save field
+ scalarFields_[i] = field;
+ }
+
+ for (int i=0;i < vectorFieldNames_.size(); i++)
+ {
+ // get reference to actual field
+ volVectorField& field = (volVectorField&) mesh_.lookupObject(vectorFieldNames_[i]);
+
+ // save field
+ vectorFields_[i] = field;
+ }
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/fieldStore/fieldStore.H b/src/lagrangian/cfdemParticle/subModels/forceModel/fieldStore/fieldStore.H
new file mode 100644
index 0000000..f9caf1d
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/fieldStore/fieldStore.H
@@ -0,0 +1,106 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+
+ calc time average of scalar or vector field
+
+Class
+ fieldStore
+
+SourceFiles
+ fieldStore.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fieldStore_H
+#define fieldStore_H
+
+#include "forceModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class fieldStore Declaration
+\*---------------------------------------------------------------------------*/
+
+class fieldStore
+:
+ public forceModel
+{
+private:
+
+ dictionary propsDict_;
+
+ const fvMesh& mesh_;
+
+ const wordList scalarFieldNames_;
+
+ const wordList vectorFieldNames_;
+
+ mutable PtrList scalarFields_;
+
+ mutable PtrList vectorFields_;
+
+public:
+
+ //- Runtime type information
+ TypeName("fieldStore");
+
+
+ // Constructors
+
+ //- Construct from components
+ fieldStore
+ (
+ const dictionary& dict,
+ cfdemCloud& sm
+ );
+
+ // Destructor
+
+ ~fieldStore();
+
+
+ // Member Functions
+ void setForce() const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C
index d87a304..0930df4 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C
@@ -31,7 +31,7 @@ Description
#include "error.H"
#include "forceModel.H"
-
+#include "mathExtra.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@@ -56,9 +56,9 @@ forceModel::forceModel
:
dict_(dict),
particleCloud_(sm),
- treatExplicit_(false),
- treatDEM_(false),
- implDEM_(false),
+ //treatExplicit_(false),
+ //treatDEM_(false),
+ //implDEM_(false),
impParticleForces_
( IOobject
(
@@ -86,7 +86,9 @@ forceModel::forceModel
coupleForce_(true),
modelType_(sm.modelType()),
probeIt_(sm.probeM().active()),
- requiresEx_(false)
+ requiresEx_(false),
+ forceSubModels_(wordList(0)),
+ forceSubModel_(new autoPtr[nrForceSubModels()])
{}
@@ -145,6 +147,49 @@ void forceModel::repartitionImExForces() const
}
}
+void forceModel::treatVoidCells() const
+{
+ //force coupling force in cells where there are no particles to be explicit force
+ if(particleCloud_.treatVoidCellsAsExplicitForce())
+ {
+ int counter(0);
+ volVectorField& Us = particleCloud_.averagingM().UsNext();
+ forAll(Us,cellI)
+ {
+ if ( mag(Us[cellI]) == 0.0) // cell is void of particles
+ {
+ expParticleForces_[cellI] += impParticleForces_[cellI];
+ impParticleForces_[cellI] *= 0.0;
+ counter +=1;
+ }
+ }
+ Info << "Re-partitioned "<< counter << " cells void of particles" << endl;
+ }
+}
+
+void forceModel::setForceSubModels(dictionary& dict)
+{
+ if (dict.found("forceSubModels"))
+ forceSubModels_ = wordList(dict.lookup("forceSubModels"));
+ else{
+ forceSubModels_ = wordList(1);
+ forceSubModels_[0] = "ImEx";
+ }
+
+ delete[] forceSubModel_;
+ forceSubModel_ = new autoPtr[nrForceSubModels()];
+ Info << "nrForceSubModels()=" << nrForceSubModels() << endl;
+ for (int i=0;i* forceSubModel_;
+
public:
//- Runtime type information
@@ -150,12 +153,19 @@ public:
inline const bool& coupleForce() const { return coupleForce_;};
- void const setImpDEMdrag() const {particleCloud_.impDEMdrag_=true;};
-
virtual inline bool& requiresEx() { return requiresEx_;};
- //Repartition Implixit/Explicit forces
- void repartitionImExForces() const;
+ void repartitionImExForces() const; //Repartition Implixit/Explicit forces
+
+ void treatVoidCells() const;
+
+ inline const wordList& forceSubModels(){ return forceSubModels_; };
+
+ inline const forceSubModel& forceSubM(int i) const { return forceSubModel_[i]; };
+
+ inline int nrForceSubModels(){ return forceSubModels_.size(); };
+
+ void setForceSubModels(dictionary& dict);
};
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ImEx/ImEx.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ImEx/ImEx.C
new file mode 100644
index 0000000..63595bb
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ImEx/ImEx.C
@@ -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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+\*---------------------------------------------------------------------------*/
+
+#include "error.H"
+
+#include "ImEx.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(ImEx, 0);
+
+addToRunTimeSelectionTable
+(
+ forceSubModel,
+ ImEx,
+ dictionary
+);
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+// Construct from components
+ImEx::ImEx
+(
+ const dictionary& dict,
+ cfdemCloud& sm,
+ forceModel& fm
+)
+:
+ forceSubModel(dict,sm,fm)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+ImEx::~ImEx()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ImEx/ImEx.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ImEx/ImEx.H
new file mode 100644
index 0000000..7d017b9
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ImEx/ImEx.H
@@ -0,0 +1,95 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+
+Class
+ ImEx
+
+SourceFiles
+ ImEx.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef ImEx_H
+#define ImEx_H
+
+#include "forceSubModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class ImEx Declaration
+\*---------------------------------------------------------------------------*/
+
+class ImEx
+:
+ public forceSubModel
+{
+private:
+
+
+public:
+
+ //- Runtime type information
+ TypeName("ImEx");
+
+
+ // Constructors
+
+ //- Construct from components
+ ImEx
+ (
+ const dictionary& dict,
+ cfdemCloud& sm,
+ forceModel& fm
+ );
+
+ // Destructor
+
+ ~ImEx();
+
+
+ // Member Functions
+
+ word myType() const{return typeName; };
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C
new file mode 100644
index 0000000..7548a91
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C
@@ -0,0 +1,338 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+\*---------------------------------------------------------------------------*/
+
+#include "error.H"
+#include "forceSubModel.H"
+#include "forceModel.H"
+#include "mathExtra.H"
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(forceSubModel, 0);
+
+defineRunTimeSelectionTable(forceSubModel, dictionary);
+
+// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+// Construct from components
+forceSubModel::forceSubModel
+(
+ const dictionary& dict,
+ cfdemCloud& sm,
+ forceModel& fm
+)
+:
+ dict_(dict),
+ particleCloud_(sm),
+ forceModel_(fm),
+ nrDefaultSwitches_(9), // !!!
+ switchesNameList_(wordList(nrDefaultSwitches_)),
+ switchesList_(List(nrDefaultSwitches_)),
+ switches_(List(nrDefaultSwitches_)),
+ nu_
+ (
+ IOobject
+ (
+ "scalarViscosity",
+ sm.mesh().time().timeName(),
+ sm.mesh(),
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ sm.mesh(),
+ dimensionedScalar("nu0", dimensionSet(0, 2, -1, 0, 0), 1.)
+ ),
+ divTau_
+ (
+ IOobject
+ (
+ "divTau",
+ sm.mesh().time().timeName(),
+ sm.mesh(),
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ sm.mesh(),
+ dimensionedVector("divTau", dimensionSet(1, -2, -2, 0, 0), vector::zero)
+ ),
+ IBDragPerV_
+ (
+ IOobject
+ (
+ "IBDragPerV",
+ sm.mesh().time().timeName(),
+ sm.mesh(),
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ sm.mesh(),
+ dimensionedVector("IBDragPerV", dimensionSet(1, -2, -2, 0, 0), vector::zero)
+ ),
+ densityFieldName_(dict_.lookupOrDefault("densityFieldName","rho")),
+ rho_(sm.mesh().lookupObject (densityFieldName_))
+{
+ // init standard switch list
+ int iCounter(0);
+ switchesNameList_[iCounter]="treatForceExplicit"; iCounter++; //0
+ switchesNameList_[iCounter]="treatForceDEM";iCounter++; //1
+ switchesNameList_[iCounter]="implForceDEM";iCounter++; //2
+ switchesNameList_[iCounter]="verbose";iCounter++; //3
+ switchesNameList_[iCounter]="interpolation";iCounter++; //4
+ switchesNameList_[iCounter]="useFilteredDragModel";iCounter++; //5
+ switchesNameList_[iCounter]="useParcelSizeDependentFilteredDrag";iCounter++; //6
+ switchesNameList_[iCounter]="implForceDEMaccumulated";iCounter++; //7
+ switchesNameList_[iCounter]="scalarViscosity";iCounter++; //8
+
+ for(int i=0;i 0+SMALL) //check if switch is required
+ {
+ Info << " looking for " << switchesNameList_[i] << " ..." << endl;
+ if (dict_.found(switchesNameList_[i]))
+ switches_[i]=Switch(dict_.lookup(switchesNameList_[i]));
+
+ Info << "\t" << switchesNameList_[i] << " = " << switches_[i] << endl;
+ }
+ }
+ Info << endl;
+
+ if(switches_[2]) // implForceDEM=true
+ {
+ // communicate implForceDEM to particleCloud
+ particleCloud_.impDEMdrag_=true;
+
+ // do sanity check
+ // This can work if the accumulator is used, but is explicitely applied on the CFD side
+ // Sanity check is therefore not necessary here
+ /*
+ if(switches_[0]) // treatExplicit=true
+ {
+ FatalError << "Please check your settings, treatExplicit together with implForceDEM does not work!."
+ << abort(FatalError);
+ }
+ */
+ }
+
+ if(switches_[7]) // implForceDEMaccumulated=true
+ {
+ // sanity check for implForceDEMaccumulated
+ if(!switches_[2]) //implForceDEM=false
+ {
+ Warning<< "please check your settings, implForceDEMaccumulated without implForceDEM does not work! (using implForceDEMaccumulated=false)" << endl;
+ switches_[3]=false;
+ }else
+ {
+ particleCloud_.impDEMdragAcc_=true;
+ }
+ }
+
+ if(switches_[8]) // scalarViscosity=true
+ {
+ Info << "Using a constant viscosity for this force model." << endl;
+ dimensionedScalar nu0_("nu", dimensionSet(0, 2, -1, 0, 0), dict_.lookup("nu"));
+ nu_=volScalarField
+ (
+ IOobject
+ (
+ "scalarViscosity",
+ particleCloud_.mesh().time().timeName(),
+ particleCloud_.mesh(),
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ particleCloud_.mesh(),
+ nu0_
+ );
+ }
+
+ // look for old nomenclature
+ if (dict_.found("treatExplicit") || dict_.found("treatDEM") || dict_.found("implDEM"))
+ FatalError<< "You are using an old nomenclature for force model settings, please have a look at the forceSubModel doc." << abort(FatalError);
+
+ // look for old nomenclature
+ if (dict_.found("verbose"))
+ Warning<< "Please make sure you use the new nomenclature for verbose force model settings, please have a look at the forceSubModel doc." << endl;
+
+ //if (dict_.found("interpolation"))
+ // FatalError<< "Please make sure you use the new nomenclature for interpolation in force model settings, please have a look at the forceSubModel doc." << endl;
+}
+
+const volScalarField& forceSubModel::nuField() const
+{
+ #ifdef compre
+ nu_=particleCloud_.turbulence().mu() / rho_;
+ return nu_;
+ #else
+ if(switches_[8]) // scalarViscosity=true
+ return nu_;
+ else
+ return particleCloud_.turbulence().nu();
+ #endif
+}
+
+const volScalarField& forceSubModel::muField() const
+{
+ #ifdef compre
+ return particleCloud_.turbulence().mu();
+ #else
+ // passing the ref to nu*rho will not work->generate a mu_ field like nu_
+ FatalError<< "implementation not complete!" << abort(FatalError);
+
+ if(switches_[8]) // scalarViscosity=true
+ return nu_*rho_;
+ else
+ return particleCloud_.turbulence().nu()*rho_;
+ #endif
+}
+
+const volScalarField& forceSubModel::rhoField() const
+{
+ return rho_;
+}
+
+const volVectorField& forceSubModel::divTauField(const volVectorField& U) const
+{
+ // calc div(Tau)
+ #ifdef compre
+ const volScalarField& mu_ = muField();
+ divTau_ = -fvc::laplacian(mu_, U) - fvc::div(mu_*dev(fvc::grad(U)().T()));
+ return divTau_;
+ #else
+ const volScalarField& nu_ = nuField();
+ const volScalarField& rho_ = rhoField();
+ divTau_ = -fvc::laplacian(nu_*rho_, U)- fvc::div(nu_*rho_*dev(fvc::grad(U)().T()));
+ return divTau_;
+ #endif
+}
+
+const volVectorField& forceSubModel::IBDragPerV(const volVectorField& U,const volScalarField& p) const
+{
+ #ifdef compre
+ IBDragPerV_ = muField()*fvc::laplacian(U)-fvc::grad(p);
+ #else
+ IBDragPerV_ = rhoField()*(nuField()*fvc::laplacian(U)-fvc::grad(p));
+ #endif
+ return IBDragPerV_;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H
new file mode 100644
index 0000000..935adac
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H
@@ -0,0 +1,183 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+
+Class
+ forceSubModel
+
+SourceFiles
+ forceSubModel.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef forceSubModel_H
+#define forceSubModel_H
+
+#include "fvCFD.H"
+#include "cfdemCloud.H"
+#include "probeModel.H"
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class forceSubModel Declaration
+\*---------------------------------------------------------------------------*/
+
+class forceSubModel
+{
+
+protected:
+
+ // Protected data
+ const dictionary& dict_;
+
+ cfdemCloud& particleCloud_;
+
+ forceModel& forceModel_;
+
+ label nrDefaultSwitches_; // nr of switches defined in mother class
+
+ wordList switchesNameList_; // names of switches available
+
+ mutable List switchesList_; // switches which are requested in dict
+
+ mutable List switches_;
+
+ mutable volScalarField nu_;
+
+ mutable volVectorField divTau_;
+
+ mutable volVectorField IBDragPerV_;
+
+ word densityFieldName_;
+
+ const volScalarField& rho_;
+
+public:
+
+ //- Runtime type information
+ TypeName("forceSubModel");
+
+ // Declare runtime constructor selection table
+
+ declareRunTimeSelectionTable
+ (
+ autoPtr,
+ forceSubModel,
+ dictionary,
+ (
+ const dictionary& dict,
+ cfdemCloud& sm,
+ forceModel& fm
+ ),
+ (dict,sm,fm)
+ );
+
+
+ // Constructors
+
+ //- Construct from components
+ forceSubModel
+ (
+ const dictionary& dict,
+ cfdemCloud& sm,
+ forceModel& fm
+ );
+
+
+ // Destructor
+
+ virtual ~forceSubModel();
+
+
+ // Selector
+
+ static autoPtr New
+ (
+ const dictionary& dict,
+ cfdemCloud& sm,
+ forceModel& fm,
+ word forceType
+ );
+
+
+ // Member Functions
+ void partToArray(label&, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const;
+
+ virtual void explicitCorr(vector&, vector&, scalar&, vector&, const vector&, vector&, const vector&, bool,label index=100) const;
+
+ // Access
+
+ inline bool verbose() const { return switches_[3]; };
+
+ inline bool interpolation() const { return switches_[4]; };
+
+ inline bool useFilteredDragModel() const { return switches_[5]; };
+
+ inline bool useParcelSizeDependentFilteredDrag() const { return switches_[6]; };
+
+ virtual word myType() const=0;
+
+ inline forceModel& myForceM() const { return forceModel_;};
+
+ inline const List& switches() const { return switches_;};
+
+ inline const wordList& switchesNameList() const { return switchesNameList_;};
+
+ void setSwitchesList(label i, bool v) const { switchesList_[i] = label(v);};
+
+ void setSwitches(label i, Switch v) const { switches_[i] = v;};
+
+ virtual void readSwitches() const;
+
+ const label& nrDefaultSwitches() const {return nrDefaultSwitches_;};
+
+ const volScalarField& nuField() const;
+
+ const volScalarField& muField() const;
+
+ const volScalarField& rhoField() const;
+
+ const volVectorField& divTauField(const volVectorField&) const;
+
+ const volVectorField& IBDragPerV(const volVectorField&,const volScalarField&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/newForceSubModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/newForceSubModel.C
new file mode 100644
index 0000000..cc2d34f
--- /dev/null
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/newForceSubModel.C
@@ -0,0 +1,79 @@
+/*---------------------------------------------------------------------------*\
+ 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(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
+\*---------------------------------------------------------------------------*/
+
+#include "error.H"
+
+#include "forceSubModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+autoPtr forceSubModel::New
+(
+ const dictionary& dict,
+ cfdemCloud& sm,
+ forceModel& fm,
+ word forceType
+)
+{
+ Info<< "Selecting forceSubModel "
+ << forceType << endl;
+
+ dictionaryConstructorTable::iterator cstrIter =
+ dictionaryConstructorTablePtr_->find(forceType);
+
+ if (cstrIter == dictionaryConstructorTablePtr_->end())
+ {
+ FatalError
+ << "forceSubModel::New(const dictionary&, const spray&) : "
+ << endl
+ << " unknown forceSubModelType type "
+ << forceType
+ << ", constructor not in hash table" << endl << endl
+ << " Valid forceSubModel types are :"
+ << endl;
+ Info<< dictionaryConstructorTablePtr_->toc()
+ << abort(FatalError);
+ }
+
+ return autoPtr(cstrIter()(dict,sm,fm));
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C
index a4db6cd..1885294 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C
@@ -62,28 +62,44 @@ gradPForce::gradPForce
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
- verbose_(false),
pFieldName_(propsDict_.lookup("pFieldName")),
p_(sm.mesh().lookupObject (pFieldName_)),
velocityFieldName_(propsDict_.lookup("velocityFieldName")),
U_(sm.mesh().lookupObject (velocityFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
useRho_(false),
useU_(false),
- addedMassCoeff_(0.0),
- interpolation_(false)
+ addedMassCoeff_(0.0)
{
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(1,true); // activate treatForceDEM switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
if (modelType_ == "B")
{
FatalError <<"using model gradPForce with model type B is not valid\n" << abort(FatalError);
- }else
+ }else if (modelType_ == "Bfull")
{
- treatDEM_=true;
- Info << "gradPForce is applied only to DEM side" << endl;
+ if(forceSubM(0).switches()[1])
+ {
+ Info << "Using treatForceDEM false!" << endl;
+ forceSubM(0).setSwitches(1,false); // treatForceDEM = false
+ }
+ }else // modelType_=="A"
+ {
+ if(!forceSubM(0).switches()[1])
+ {
+ Info << "Using treatForceDEM true!" << endl;
+ forceSubM(0).setSwitches(1,true); // treatForceDEM = true
+ }
}
- if (propsDict_.found("verbose")) verbose_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
+
if (propsDict_.found("useU")) useU_=true;
if (propsDict_.found("useAddedMass"))
{
@@ -91,11 +107,6 @@ gradPForce::gradPForce
Info << "gradP will also include added mass with coefficient: " << addedMassCoeff_ << endl;
Info << "WARNING: use fix nve/sphere/addedMass in LIGGGHTS input script to correctly account for added mass effects!" << endl;
}
- if (propsDict_.found("interpolation"))
- {
- Info << "using interpolated value of pressure gradient." << endl;
- interpolation_=true;
- }
if(p_.dimensions()==dimensionSet(0,2,-2,0,0))
useRho_ = true;
@@ -128,10 +139,9 @@ void gradPForce::setForce() const
if (useRho_)
gradPField = fvc::grad(0.5*U2);
else
- gradPField = fvc::grad(0.5*rho_*U2);
+ gradPField = fvc::grad(0.5*forceSubM(0).rhoField()*U2);
}*/
vector gradP;
- scalar ds;
scalar Vs;
scalar rho;
vector position;
@@ -153,7 +163,7 @@ void gradPForce::setForce() const
{
position = particleCloud_.position(index);
- if(interpolation_) // use intepolated values for alpha (normally off!!!)
+ if(forceSubM(0).interpolation()) // use intepolated values for alpha (normally off!!!)
{
gradP = gradPInterpolator_.interpolate(position,cellI);
}else
@@ -162,7 +172,7 @@ void gradPForce::setForce() const
}
Vs = particleCloud_.particleVolume(index);
- rho = rho_[cellI];
+ rho = forceSubM(0).rhoField()[cellI];
// calc particle's pressure gradient force
if (useRho_)
@@ -170,7 +180,7 @@ void gradPForce::setForce() const
else
force = -Vs*gradP*(1.0+addedMassCoeff_);
- if(verbose_ && index >=0 && index <2)
+ if(forceSubM(0).verbose() && index >=0 && index <2)
{
Info << "index = " << index << endl;
Info << "gradP = " << gradP << endl;
@@ -188,12 +198,8 @@ void gradPForce::setForce() const
}
}
- // set force on particle
- if(!treatDEM_){
- if(!treatExplicit_) for(int j=0;j<3;j++) impForces()[index][j] += force[j];
- else for(int j=0;j<3;j++) expForces()[index][j] += force[j];
- }
- for(int j=0;j<3;j++) DEMForces()[index][j] += force[j];
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,force,vector::zero);
//}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.H b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.H
index 85ffe18..68001a6 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.H
@@ -63,8 +63,6 @@ class gradPForce
private:
dictionary propsDict_;
- bool verbose_;
-
word pFieldName_;
const volScalarField& p_;
@@ -73,18 +71,12 @@ private:
const volVectorField& U_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
bool useRho_;
bool useU_; // if false: substitution p=0.5*rho*U^2
mutable double addedMassCoeff_; //added mass coefficient
- bool interpolation_; // use interpolated field values
-
public:
//- Runtime type information
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C b/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C
index 23d2c7f..3507f08 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C
@@ -78,7 +78,15 @@ interface::interface
{
if (propsDict_.found("C")) C_=readScalar(propsDict_.lookup("C"));
if (propsDict_.found("interpolation")) interpolation_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
+
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
Info << "check if interpolation really works - use directly interpolationCellPoint ???" << endl;
particleCloud_.checkCG(false);
@@ -179,9 +187,9 @@ Info << "interface::setForce" << endl;
Info << "interface force is limited to " << interfaceForce << endl;
}*/
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += interfaceForce[j];
- else for(int j=0;j<3;j++) impForces()[index][j] += interfaceForce[j];
- for(int j=0;j<3;j++) DEMForces()[index][j] += interfaceForce[j];
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,interfaceForce,vector::zero);
+
} // end if particle found on proc domain
//}// end if in mask
}// end loop particles
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C
index e3073a2..0a403a0 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C
@@ -68,6 +68,15 @@ noDrag::noDrag
if(dict.found(word(typeName + "Props")))
propsDict_=dictionary(dict.subDict(typeName + "Props"));
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
if (propsDict_.found("noDEMForce")) noDEMForce_=true;
if (propsDict_.found("keepCFDForce")) keepCFDForce_=true;
@@ -89,15 +98,21 @@ void noDrag::setForce() const
// Do nothing
Info << "noDrag::setForce" << endl;
label cellI=0;
+ bool treatExplicit=forceSubM(0).switches()[0];
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{
cellI = particleCloud_.cellIDs()[index][0];
if (cellI > -1) // particle Found
{
- // set force on particle
+ //==========================
+ // set force on particle (new code)
+ // write particle based data to global array
+ //forceSubM(0).partToArray(index,drag,dragExplicit);
+ //==========================
+ // set force on particle (old code)
if(!keepCFDForce_)
{
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] = 0.;
+ if(treatExplicit) for(int j=0;j<3;j++) expForces()[index][j] = 0.;
else for(int j=0;j<3;j++) impForces()[index][j] = 0.;
}
if(noDEMForce_)
@@ -109,6 +124,7 @@ void noDrag::setForce() const
for(int j=0;j<3;j++) fluidVel()[index][j] = 0.;
}
}
+ //==========================
}
}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C
index 89ab4a7..5443d94 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C
@@ -40,6 +40,8 @@ Description
namespace Foam
{
+#define NOTONCPU 9999
+
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(virtualMassForce, 0);
@@ -63,21 +65,42 @@ virtualMassForce::virtualMassForce
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
- verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject (velFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
- UrelOld_(NULL)
+ phiFieldName_(propsDict_.lookup("phiFieldName")),
+ phi_(sm.mesh().lookupObject (phiFieldName_)),
+ UrelOld_(NULL),
+ splitUrelCalculation_(false),
+ Cadd_(0.5)
{
- if (propsDict_.found("verbose")) verbose_=true;
if (particleCloud_.dataExchangeM().maxNumberOfParticles() > 0)
{
// get memory for 2d array
- particleCloud_.dataExchangeM().allocateArray(UrelOld_,0.,3);
+ particleCloud_.dataExchangeM().allocateArray(UrelOld_,NOTONCPU,3);
}
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
+
+ // init force sub model
+ setForceSubModels(propsDict_);
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+ forceSubM(0).readSwitches();
+
+ //Extra switches/settings
+ if(propsDict_.found("splitUrelCalculation"))
+ {
+ splitUrelCalculation_ = readBool(propsDict_.lookup("splitUrelCalculation"));
+ if(splitUrelCalculation_)
+ Info << "Virtual mass model: will split the Urel calculation\n";
+ Info << "WARNING: be sure that LIGGGHTS integration takes ddtv_p implicitly into account! \n";
+ }
+ if(propsDict_.found("Cadd"))
+ {
+ Cadd_ = readScalar(propsDict_.lookup("Cadd"));
+ Info << "Virtual mass model: using non-standard Cadd = " << Cadd_ << endl;
+ }
+
particleCloud_.checkCG(true);
//Append the field names to be probed
@@ -85,6 +108,7 @@ virtualMassForce::virtualMassForce
particleCloud_.probeM().vectorFields_.append("virtualMassForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel");
particleCloud_.probeM().vectorFields_.append("UrelOld");
+ particleCloud_.probeM().vectorFields_.append("ddtUrel");
particleCloud_.probeM().scalarFields_.append("Vs");
particleCloud_.probeM().scalarFields_.append("rho");
particleCloud_.probeM().writeHeader();
@@ -107,32 +131,88 @@ void virtualMassForce::setForce() const
scalar dt = U_.mesh().time().deltaT().value();
+ vector position(0,0,0);
+ vector Ufluid(0,0,0);
+ vector Ur(0,0,0);
+ vector DDtU(0,0,0);
+
+ //Compute extra vfields in case it is needed
+ volVectorField DDtU_(0.0*U_/U_.mesh().time().deltaT());
+ if(splitUrelCalculation_)
+ DDtU_ = fvc::ddt(U_) + fvc::div(phi_, U_); //Total Derivative of fluid velocity
+
+ interpolationCellPoint UInterpolator_( U_);
+ interpolationCellPoint DDtUInterpolator_(DDtU_);
+
#include "setupProbeModel.H"
+ bool haveUrelOld_(false);
+
for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{
- //if(mask[index][0])
- //{
vector virtualMassForce(0,0,0);
label cellI = particleCloud_.cellIDs()[index][0];
if (cellI > -1) // particle Found
{
- vector Us = particleCloud_.velocity(index);
- vector Ur = U_[cellI]-Us;
- vector UrelOld;
- for(int j=0;j<3;j++)
+
+ if(forceSubM(0).interpolation())
{
- UrelOld[j] = UrelOld_[index][j];
- UrelOld_[index][j] = Ur[j];
+ position = particleCloud_.position(index);
+ Ufluid = UInterpolator_.interpolate(position,cellI);
+ }
+ else
+ {
+ Ufluid = U_[cellI];
+ }
+
+
+ if(splitUrelCalculation_) //if split, just use total derivative of fluid velocity
+ if(forceSubM(0).interpolation())
+ {
+ DDtU = DDtUInterpolator_.interpolate(position,cellI);
+ }
+ else
+ {
+ DDtU = DDtU_[cellI];
+ }
+ else
+ {
+ vector Us = particleCloud_.velocity(index);
+ Ur = Ufluid - Us;
}
- vector ddtUrel = (Ur-UrelOld)/dt;
+
+ //Check of particle was on this CPU the last step
+ if(UrelOld_[index][0]==NOTONCPU) //use 1. element to indicate that particle was on this CPU the last time step
+ haveUrelOld_ = false;
+ else
+ haveUrelOld_ = true;
+
+ vector UrelOld(0.,0.,0.);
+ vector ddtUrel(0.,0.,0.);
+ for(int j=0;j<3;j++)
+ {
+ UrelOld[j] = UrelOld_[index][j];
+ UrelOld_[index][j] = Ur[j];
+ }
+ if(haveUrelOld_ ) //only compute force if we have old (relative) velocity
+ ddtUrel = (Ur-UrelOld)/dt;
+
+ if(splitUrelCalculation_) //we can always compute the total derivative in case we split
+ ddtUrel = DDtU;
+
scalar ds = 2*particleCloud_.radius(index);
scalar Vs = ds*ds*ds*M_PI/6;
- scalar rho = rho_[cellI];
+ scalar rho = forceSubM(0).rhoField()[cellI];
- virtualMassForce = 0.5 * rho * Vs * ddtUrel;
+ virtualMassForce = Cadd_ * rho * Vs * ddtUrel;
+
+ if( forceSubM(0).verbose() ) //&& index>100 && index < 105)
+ {
+ Pout << "index / cellI = " << index << tab << cellI << endl;
+ Pout << "position = " << particleCloud_.position(index) << endl;
+ }
//Set value fields and write the probe
if(probeIt_)
@@ -141,26 +221,27 @@ void virtualMassForce::setForce() const
vValues.append(virtualMassForce); //first entry must the be the force
vValues.append(Ur);
vValues.append(UrelOld);
+ vValues.append(ddtUrel);
sValues.append(Vs);
sValues.append(rho);
particleCloud_.probeM().writeProbe(index, sValues, vValues);
}
}
- // set force on particle
- if(treatExplicit_) for(int j=0;j<3;j++) expForces()[index][j] += virtualMassForce[j];
- else for(int j=0;j<3;j++) impForces()[index][j] += virtualMassForce[j];
- for(int j=0;j<3;j++) DEMForces()[index][j] += virtualMassForce[j];
- //}
+ else //particle not on this CPU
+ UrelOld_[index][0]=NOTONCPU;
+
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,virtualMassForce,vector::zero);
}
-
}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::virtualMassForce::reAllocArrays() const
{
if(particleCloud_.numberOfParticlesChanged())
{
- // get arrays of new length
- particleCloud_.dataExchangeM().allocateArray(UrelOld_,1.,1);
+ Pout << "virtualMassForce::reAllocArrays..." << endl;
+ particleCloud_.dataExchangeM().allocateArray(UrelOld_,NOTONCPU,3);
}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.H b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.H
index 7eb5d62..ff2ee4d 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.H
@@ -41,6 +41,7 @@ SourceFiles
#include "forceModel.H"
#include "dataExchangeModel.H"
+#include "interpolationCellPoint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -58,18 +59,22 @@ class virtualMassForce
private:
dictionary propsDict_;
- bool verbose_;
-
word velFieldName_;
const volVectorField& U_;
- word densityFieldName_;
+ word phiFieldName_;
- const volScalarField& rho_;
+ const surfaceScalarField& phi_;
mutable double **UrelOld_;
+ mutable bool splitUrelCalculation_; //indicator to split calculation of Urel between CFDEM and LIGGGHTS
+ //requires the integration fix to take dv/dt into account!
+
+ mutable double Cadd_; //indicator to split calculation of Urel between CFDEM and LIGGGHTS
+ //requires the integration fix to take dv/dt into account!
+
public:
//- Runtime type information
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C
index a35ed3e..571915a 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C
@@ -62,24 +62,42 @@ viscForce::viscForce
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
- verbose_(false),
velocityFieldName_(propsDict_.lookup("velocityFieldName")),
U_(sm.mesh().lookupObject (velocityFieldName_)),
- densityFieldName_(propsDict_.lookup("densityFieldName")),
- rho_(sm.mesh().lookupObject (densityFieldName_)),
- addedMassCoeff_(0.0),
- interpolation_(false)
+ addedMassCoeff_(0.0)
{
+
+ // init force sub model
+ setForceSubModels(propsDict_);
+
+ // define switches which can be read from dict
+ forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
+ forceSubM(0).setSwitchesList(1,true); // activate treatForceDEM switch
+ forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
+ forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
+
+ // read those switches defined above, if provided in dict
+ forceSubM(0).readSwitches();
+
if (modelType_ == "B")
{
FatalError <<"using model viscForce with model type B is not valid\n" << abort(FatalError);
- }else
+ }else if (modelType_ == "Bfull")
{
- treatDEM_=true;
- Info << "viscForce is applied only to DEM side" << endl;
+ if(forceSubM(0).switches()[1])
+ {
+ Info << "Using treatForceDEM false!" << endl;
+ forceSubM(0).setSwitches(1,false); // treatForceDEM = false
+ }
+
+ }else // modelType_=="A"
+ {
+ if(!forceSubM(0).switches()[1])
+ {
+ Info << "Using treatForceDEM true!" << endl;
+ forceSubM(0).setSwitches(1,true); // treatForceDEM = true
+ }
}
- if (propsDict_.found("verbose")) verbose_=true;
- if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("useAddedMass"))
{
@@ -88,11 +106,6 @@ viscForce::viscForce
Info << "WARNING: use fix nve/sphere/addedMass in LIGGGHTS input script to correctly account for added mass effects!" << endl;
}
- if (propsDict_.found("interpolation"))
- {
- Info << "using interpolated value of pressure gradient." << endl;
- interpolation_=true;
- }
particleCloud_.checkCG(true);
//Append the field names to be probed
@@ -113,26 +126,9 @@ viscForce::~viscForce()
void viscForce::setForce() const
{
-
- // get viscosity field
- #ifdef comp
- const volScalarField& mufField = particleCloud_.turbulence().mu();
-
- // calc div(Tau)
- volVectorField divTauField =
- - fvc::laplacian(mufField, U_)
- - fvc::div(mufField*dev(fvc::grad(U_)().T()));
- #else
- const volScalarField& nufField = particleCloud_.turbulence().nu();
-
- // calc div(Tau)
- volVectorField divTauField =
- - fvc::laplacian(nufField*rho_, U_)
- - fvc::div(nufField*rho_*dev(fvc::grad(U_)().T()));
- #endif
+ const volVectorField& divTauField = forceSubM(0).divTauField(U_);
vector divTau;
- scalar ds;
scalar Vs;
vector position;
vector force;
@@ -154,7 +150,7 @@ void viscForce::setForce() const
position = particleCloud_.position(index);
- if(interpolation_) // use intepolated values for alpha (normally off!!!)
+ if(forceSubM(0).interpolation()) // use intepolated values for alpha (normally off!!!)
{
divTau = divTauInterpolator_.interpolate(position,cellI);
}else
@@ -168,7 +164,7 @@ void viscForce::setForce() const
// to the generalized buoyancy force
force = -Vs*divTau*(1.0+addedMassCoeff_);
- if(verbose_ && index >0 && index <2)
+ if(forceSubM(0).verbose() && index >0 && index <2)
{
Info << "index = " << index << endl;
Info << "gradP = " << divTau << endl;
@@ -185,13 +181,8 @@ void viscForce::setForce() const
}
}
- // set force on particle
- if(!treatDEM_){
- if(!treatExplicit_) for(int j=0;j<3;j++) impForces()[index][j] += force[j];
- else for(int j=0;j<3;j++) expForces()[index][j] += force[j];
- }
- for(int j=0;j<3;j++) DEMForces()[index][j] += force[j];
-
+ // write particle based data to global array
+ forceSubM(0).partToArray(index,force,vector::zero);
//}
}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.H b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.H
index 2632fbd..772556c 100644
--- a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.H
+++ b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.H
@@ -59,19 +59,12 @@ class viscForce
private:
dictionary propsDict_;
- bool verbose_;
-
word velocityFieldName_;
const volVectorField& U_;
- word densityFieldName_;
-
- const volScalarField& rho_;
-
mutable double addedMassCoeff_; //added mass coefficient
- bool interpolation_; // use interpolated field values
public:
diff --git a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C
index ae85ed1..409ea3e 100644
--- a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C
+++ b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C
@@ -30,6 +30,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
+#include
#include "liggghtsCommandModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -115,14 +116,14 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict)
if(runLast_) // last run
{
// read time options from subdict
- endTime_ = particleCloud_.mesh().time().endTime().value();
+ endTime_ = particleCloud_.mesh().time().endTime().value()-particleCloud_.mesh().time().startTime().value();
startTime_ = endTime_;
- timeInterval_ = 1;
+ timeInterval_ = -1;
// calculate coupling times
firstCouplingStep_ = floor(startTime_/DEMts/couplingInterval);
lastCouplingStep_ = floor(endTime_/DEMts/couplingInterval);
- couplingStepInterval_ = floor(timeInterval_/DEMts/couplingInterval);
+ couplingStepInterval_ = -1;
}
else //runEveryCouplingStep of every n steps or every writeStep
{
@@ -150,7 +151,7 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict)
{
firstCouplingStep_ =1;
lastCouplingStep_ =1;
- couplingStepInterval_ =1;
+ couplingStepInterval_ =-1;
}
if(verbose_){
@@ -238,6 +239,14 @@ DynamicList liggghtsCommandModel::executionsWithinPeriod(scalar TSstart,
return executions;
}
+bool liggghtsCommandModel::checkPath(fileName path)
+{
+ string strPath = string(path);
+ struct stat buffer;
+ return (stat (strPath.c_str(), &buffer) == 0);
+}
+
+
void liggghtsCommandModel::parseCommandList(wordList& commandList,labelList& labelList,scalarList& scalarList,word& command, dictionary& propsDict, bool timeStamp)
{
bool addBlank = true; // std no blanks after each word
diff --git a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.H b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.H
index cba3288..57144f5 100644
--- a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.H
+++ b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.H
@@ -160,6 +160,8 @@ public:
DynamicList executionsWithinPeriod(scalar,scalar);
+ bool checkPath(fileName);
+
// Access
int nextRun(){return nextRun_;};
diff --git a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C
index 4d63958..0f6b23d 100644
--- a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C
+++ b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C
@@ -67,7 +67,7 @@ writeLiggghts::writeLiggghts
path_(word("..")/word("DEM")),
writeName_("liggghts.restartCFDEM"),
writeLast_(true),
- overwrite_(true)
+ overwrite_(false)
{
if (dict.found(typeName + "Props"))
{
@@ -81,10 +81,25 @@ writeLiggghts::writeLiggghts
writeLast_=Switch(propsDict_.lookup("writeLast"));
}
+ if (propsDict_.found("path"))
+ {
+ path_=fileName(propsDict_.lookup("path"));
+ if (!checkPath(path_))
+ FatalError<<"The path you provided in writeLiggghtsProps is incorrect: " << path_ << "\n" << abort(FatalError);
+ else
+ Info << "Using user defined path to write LIGGGHTS restart file: " << path_ << endl;
+ }
+
+ if(propsDict_.found("writeName"))
+ {
+ propsDict_.lookup("writeName") >> writeName_;
+ }
+
if (!writeLast_ && propsDict_.found("overwrite"))
{
overwrite_=Switch(propsDict_.lookup("overwrite"));
}
+
}
if(writeLast_)
runLast_=true;
diff --git a/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.C b/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.C
index 450fbd2..bb0f850 100644
--- a/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.C
+++ b/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.C
@@ -68,6 +68,75 @@ meshMotionModel::~meshMotionModel()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+volVectorField& meshMotionModel::f() const
+{
+ volVectorField tmp
+ (
+ IOobject
+ (
+ "xxx",
+ particleCloud_.mesh().time().timeName(),
+ particleCloud_.mesh(),
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ particleCloud_.mesh(),
+ dimensionedVector
+ (
+ "zero",
+ dimensionSet(0, 1, -1, 0, 0),
+ vector::zero
+ )
+ );
+ return tmp;
+}
+
+volScalarField& meshMotionModel::body() const
+{
+ volScalarField tmp
+ (
+ IOobject
+ (
+ "xxx",
+ particleCloud_.mesh().time().timeName(),
+ particleCloud_.mesh(),
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ particleCloud_.mesh(),
+ dimensionedScalar
+ (
+ "zero",
+ dimensionSet(0, 1, -1, 0, 0),
+ 0.
+ )
+ );
+ return tmp;
+}
+
+volScalarField& meshMotionModel::inside() const
+{
+ volScalarField tmp
+ (
+ IOobject
+ (
+ "xxx",
+ particleCloud_.mesh().time().timeName(),
+ particleCloud_.mesh(),
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ particleCloud_.mesh(),
+ dimensionedScalar
+ (
+ "zero",
+ dimensionSet(0, 1, -1, 0, 0),
+ 0.
+ )
+ );
+ return tmp;
+}
+
} // End namespace Foam
// ************************************************************************* //
diff --git a/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.H b/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.H
index cf3da10..41d80d8 100644
--- a/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.H
+++ b/src/lagrangian/cfdemParticle/subModels/meshMotionModel/meshMotionModel/meshMotionModel.H
@@ -109,6 +109,16 @@ public:
// Member Function
virtual tmp setMotion() const=0;
+ virtual void correctF(volVectorField&) const {};
+
+ virtual void correctUo(volVectorField&) const {};
+
+ virtual volVectorField& f() const;
+
+ virtual volScalarField& body() const;
+
+ virtual volScalarField& inside() const;
+
// Access
};
diff --git a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C
index dc480bd..b36752e 100644
--- a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C
+++ b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C
@@ -101,7 +101,9 @@ particleProbe::particleProbe
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
particleProbe::~particleProbe()
-{}
+{
+ clearProbes();
+}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@@ -114,6 +116,7 @@ void particleProbe::setOutputFile() const
else
currItemId_+=1;
sPtr = sPtrList_[currItemId_-1]; //set the pointer to the output file from list
+ probeIndex_=currItemId_-1;
}
@@ -127,7 +130,7 @@ void particleProbe::initialize(word typeName, word logFileName) const
//propsDict_ = particleCloud_.couplingProperties().subDict(typeName + "Props");
name_ = typeName;
const char* fileNameOut_ = wordToChar(logFileName);
-
+
if(verboseToFile_)
{
@@ -204,7 +207,7 @@ void particleProbe::writeHeader() const
*sPtr<<"|| scalarData: " << " ";
forAll(scalarFields_, iter)
{
- *sPtr << scalarFields_(iter) << " ";
+ *sPtr << scalarFields_(iter) << " ";
}
}
@@ -214,8 +217,86 @@ void particleProbe::writeHeader() const
}
+void particleProbe::clearProbes() const
+{
+ for (unsigned int i=0; i sValues, Field vValues) const
+{
+ int vSize_=vProbes_.size();
+ int sSize_=sProbes_.size();
+
+ //check if the particle already has an allocated vector. If not, create it. It should be only called at the beginning.
+ while(index >= vSize_)
+ {
+ std::vector particleVector_;
+ vProbes_.push_back(particleVector_);
+ vSize_=vProbes_.size();
+ }
+
+ while(index >= sSize_)
+ {
+ std::vector particleScalar_;
+ sProbes_.push_back(particleScalar_);
+ sSize_=sProbes_.size();
+ }
+
+ //register vector probes on the corresponding vector
+ forAll(vValues, iter)
+ {
+ int ProbeSize_=vProbes_[index].size();
+
+ if(probeIndex_ sValues, Field vValues) const
{
+ updateProbes(index,sValues,vValues); //update probe vectors
+
+
if(printNow_ && checkIDForPrint(index) && verboseToFile_)
{
@@ -224,15 +305,16 @@ void particleProbe::writeProbe(int index, Field sValues, Field v
*sPtr << index << tab
<< particleCloud_.mesh().time().value() << " " ;
*sPtr << "|| ";
-
+
//vectorFields
*sPtr << setprecision(writePrecision_) ;
forAll(vValues, iter)
{
- if(!probeDebug_ && iter>0) break;
+ // if(!probeDebug_ && iter>0) break;
*sPtr << vValues[iter][0] << " ";
- *sPtr << vValues[iter][1] << " ";
- *sPtr << vValues[iter][2] << " ";
+ *sPtr << vValues[iter][1] << " ";
+ *sPtr << vValues[iter][2] << " ";
+
}
//scalarFields
@@ -256,8 +338,9 @@ void particleProbe::writeProbe(int index, Field sValues, Field v
else *sPtr << endl;
}
-
+
return;
+
}
bool particleProbe::checkIDForPrint(int index) const
diff --git a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H
index 6d07f23..4f30eeb 100644
--- a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H
+++ b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H
@@ -44,7 +44,7 @@ SourceFiles
#include "polyMesh.H"
#include "cfdemCloud.H"
#include "OFstream.H"
-
+#include
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@@ -101,6 +101,15 @@ private:
mutable bool printNow_;
+ mutable std::vector< std::vector > sProbes_;
+
+ mutable std::vector< std::vector > vProbes_;
+
+ mutable std::vector probeName_;
+
+ mutable int probeIndex_;
+
+
public:
//- Runtime type information
@@ -123,12 +132,18 @@ public:
~particleProbe();
// Member Functions
+ void updateProbes(int index, Field sValues, Field vValues) const;
void initialize(word typeName, word logFileName) const;
void setOutputFile() const;
void writeHeader() const;
void writeProbe(int index, Field sValues, Field vValues) const;
bool checkIDForPrint(int) const;
void setCounter() const;
+ void clearProbes() const;
+ std::vector< std::vector >* getVprobe() { return &vProbes_; };
+ std::vector< std::vector >* getSprobe() {return &sProbes_; };
+
+
};
diff --git a/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H b/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H
index 0330dc1..d917d1d 100644
--- a/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H
+++ b/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H
@@ -41,6 +41,7 @@ SourceFiles
#include "fvCFD.H"
#include "cfdemCloud.H"
+#include
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@@ -139,7 +140,11 @@ public:
virtual bool checkIDForPrint(int) const {return false;};
virtual void setCounter() const {};
virtual bool active() const {return true;};
+ virtual std::vector< std::vector >* getVprobe() {return NULL;};
+ virtual std::vector< std::vector >* getSprobe() {return NULL;};
+ virtual void clearProbes() const {};
const char* wordToChar(word&) const;
+
// Access
diff --git a/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C b/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C
index 17844f7..695e515 100644
--- a/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C
+++ b/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C
@@ -77,6 +77,8 @@ constDiffSmoothing::constDiffSmoothing
if(propsDict_.found("smoothingLengthReferenceField"))
smoothingLengthReferenceField_.value() = double(readScalar(propsDict_.lookup("smoothingLengthReferenceField")));
+ checkFields(sSmoothField_);
+ checkFields(vSmoothField_);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@@ -94,65 +96,74 @@ bool constDiffSmoothing::doSmoothing() const
void Foam::constDiffSmoothing::smoothen(volScalarField& fieldSrc) const
{
- // transfer data to working field to not mess up ddt
- volScalarField field=fieldSrc;
- field.correctBoundaryConditions();
- field.oldTime()=fieldSrc;
- field.oldTime().correctBoundaryConditions();
+ // Create scalar smooth field from virgin scalar smooth field template
+ volScalarField sSmoothField = sSmoothField_;
- double deltaT = field.mesh().time().deltaTValue();
+ sSmoothField.dimensions().reset(fieldSrc.dimensions());
+ sSmoothField.internalField()=fieldSrc.internalField();
+ sSmoothField.correctBoundaryConditions();
+ sSmoothField.oldTime().dimensions().reset(fieldSrc.dimensions());
+ sSmoothField.oldTime()=fieldSrc;
+ sSmoothField.oldTime().correctBoundaryConditions();
+
+ double deltaT = sSmoothField.mesh().time().deltaTValue();
DT_.value() = smoothingLength_.value() * smoothingLength_.value() / deltaT;
// do smoothing
solve
(
- fvm::ddt(field)
- -fvm::laplacian(DT_, field)
+ fvm::ddt(sSmoothField)
+ -fvm::laplacian(DT_, sSmoothField)
);
- // bound field
- forAll(field,cellI)
+ // bound sSmoothField_
+ forAll(sSmoothField,cellI)
{
- field[cellI]=max(lowerLimit_,min(upperLimit_,field[cellI]));
+ sSmoothField[cellI]=max(lowerLimit_,min(upperLimit_,sSmoothField[cellI]));
}
- // get data from working field - will copy only values at new time
- fieldSrc=field;
+ // get data from working sSmoothField - will copy only values at new time
+ fieldSrc=sSmoothField;
fieldSrc.correctBoundaryConditions();
if(verbose_)
{
- Info << "min/max(fieldoldTime) (unsmoothed): " << min(field.oldTime()) << tab << max(field.oldTime()) << endl;
+ Info << "min/max(fieldoldTime) (unsmoothed): " << min(sSmoothField.oldTime()) << tab << max(sSmoothField.oldTime()) << endl;
Info << "min/max(fieldSrc): " << min(fieldSrc) << tab << max(fieldSrc) << endl;
Info << "min/max(fieldSrc.oldTime): " << min(fieldSrc.oldTime()) << tab << max(fieldSrc.oldTime()) << endl;
}
+
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::constDiffSmoothing::smoothen(volVectorField& fieldSrc) const
{
- // transfer data to working field to not mess up ddt
- volVectorField field=fieldSrc;
- field.correctBoundaryConditions();
- field.oldTime()=fieldSrc;
- field.oldTime().correctBoundaryConditions();
+ // Create scalar smooth field from virgin scalar smooth field template
+ volVectorField vSmoothField = vSmoothField_;
- double deltaT = field.mesh().time().deltaTValue();
+ vSmoothField.dimensions().reset(fieldSrc.dimensions());
+ vSmoothField.internalField()=fieldSrc.internalField();
+ vSmoothField.correctBoundaryConditions();
+ vSmoothField.oldTime().dimensions().reset(fieldSrc.dimensions());
+ vSmoothField.oldTime()=fieldSrc;
+ vSmoothField.oldTime().correctBoundaryConditions();
+
+ double deltaT = vSmoothField_.mesh().time().deltaTValue();
DT_.value() = smoothingLength_.value() * smoothingLength_.value() / deltaT;
// do smoothing
solve
(
- fvm::ddt(field)
- -fvm::laplacian(DT_, field)
+ fvm::ddt(vSmoothField)
+ -fvm::laplacian(DT_, vSmoothField)
);
- // get data from working field
- fieldSrc=field;
+ // get data from working vSmoothField
+ fieldSrc=vSmoothField;
fieldSrc.correctBoundaryConditions();
if(verbose_)
{
- Info << "min/max(fieldoldTime) (unsmoothed): " << min(field.oldTime()) << tab << max(field.oldTime()) << endl;
+ Info << "min/max(fieldoldTime) (unsmoothed): " << min(vSmoothField.oldTime()) << tab << max(vSmoothField.oldTime()) << endl;
Info << "min/max(fieldSrc): " << min(fieldSrc) << tab << max(fieldSrc) << endl;
Info << "min/max(fieldSrc.oldTime): " << min(fieldSrc.oldTime()) << tab << max(fieldSrc.oldTime()) << endl;
}
@@ -161,15 +172,19 @@ void Foam::constDiffSmoothing::smoothen(volVectorField& fieldSrc) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::constDiffSmoothing::smoothenReferenceField(volVectorField& fieldSrc) const
{
- // transfer data to working field to not mess up ddt
- volVectorField field=fieldSrc;
- field.correctBoundaryConditions();
- field.oldTime()=fieldSrc;
- field.oldTime().correctBoundaryConditions();
+ // Create scalar smooth field from virgin scalar smooth field template
+ volVectorField vSmoothField = vSmoothField_;
+
+ vSmoothField.dimensions().reset(fieldSrc.dimensions());
+ vSmoothField.internalField()=fieldSrc.internalField();
+ vSmoothField.correctBoundaryConditions();
+ vSmoothField.oldTime().dimensions().reset(fieldSrc.dimensions());
+ vSmoothField.oldTime()=fieldSrc;
+ vSmoothField.oldTime().correctBoundaryConditions();
double sourceStrength = 1e5; //large number to keep reference values constant
- dimensionedScalar deltaT = field.mesh().time().deltaT();
+ dimensionedScalar deltaT = vSmoothField.mesh().time().deltaT();
DT_.value() = smoothingLengthReferenceField_.value()
* smoothingLengthReferenceField_.value() / deltaT.value();
@@ -192,29 +207,29 @@ void Foam::constDiffSmoothing::smoothenReferenceField(volVectorField& fieldSrc)
//loop over particles and map max particle diameter to Euler Grid
- forAll(field,cellI)
+ forAll(vSmoothField,cellI)
{
- if ( mag(field.oldTime().internalField()[cellI]) > 0.0f) // have a vector in the OLD field, so keep it!
+ if ( mag(vSmoothField.oldTime().internalField()[cellI]) > 0.0f) // have a vector in the OLD vSmoothField, so keep it!
NLarge()[cellI] = sourceStrength;
}
// do the smoothing
solve
(
- fvm::ddt(field)
- -fvm::laplacian( DT_, field)
+ fvm::ddt(vSmoothField)
+ -fvm::laplacian( DT_, vSmoothField)
==
- NLarge() / deltaT * field.oldTime() //add source to keep cell values constant
- -fvm::Sp( NLarge() / deltaT, field) //add sink to keep cell values constant
+ NLarge() / deltaT * vSmoothField.oldTime() //add source to keep cell values constant
+ -fvm::Sp( NLarge() / deltaT, vSmoothField) //add sink to keep cell values constant
);
- // get data from working field
- fieldSrc=field;
+ // get data from working vSmoothField
+ fieldSrc=vSmoothField;
fieldSrc.correctBoundaryConditions();
if(verbose_)
{
- Info << "min/max(fieldoldTime) (unsmoothed): " << min(field.oldTime()) << tab << max(field.oldTime()) << endl;
+ Info << "min/max(fieldoldTime) (unsmoothed): " << min(vSmoothField.oldTime()) << tab << max(vSmoothField.oldTime()) << endl;
Info << "min/max(fieldSrc): " << min(fieldSrc) << tab << max(fieldSrc) << endl;
Info << "min/max(fieldSrc.oldTime): " << min(fieldSrc.oldTime()) << tab << max(fieldSrc.oldTime()) << endl;
}
diff --git a/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C b/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C
index 6eb3407..b906a16 100644
--- a/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C
+++ b/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C
@@ -57,7 +57,33 @@ Foam::smoothingModel::smoothingModel
)
:
dict_(dict),
- particleCloud_(sm)
+ particleCloud_(sm),
+ vSmoothField_
+ (
+ IOobject
+ (
+ "vSmoothField",
+ particleCloud_.mesh().time().timeName(),
+ particleCloud_.mesh(),
+ IOobject::READ_IF_PRESENT,
+ IOobject::NO_WRITE
+ ),
+ particleCloud_.mesh(),
+ dimensionedVector("zero", dimensionSet(0,0,0,0,0), vector::zero)
+ ),
+ sSmoothField_
+ (
+ IOobject
+ (
+ "sSmoothField",
+ particleCloud_.mesh().time().timeName(),
+ particleCloud_.mesh(),
+ IOobject::READ_IF_PRESENT,
+ IOobject::NO_WRITE
+ ),
+ particleCloud_.mesh(),
+ dimensionedScalar("zero", dimensionSet(0,0,0,0,0), 0)
+ )
{}
@@ -69,6 +95,28 @@ Foam::smoothingModel::~smoothingModel()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+void smoothingModel::checkFields(volScalarField& sSmoothField_) const
+{
+ // currently it is detected if field was auto generated or defined
+ // improvement would be changing the type here automatically
+ forAll(sSmoothField_.boundaryField(),patchI)
+ if(sSmoothField_.boundaryField()[patchI].type()=="calculated")
+ FatalError <<"Scalar field:"<< sSmoothField_.name() << " must be defined.\n" << abort(FatalError);
+
+ sSmoothField_.writeOpt() = IOobject::AUTO_WRITE;
+}
+
+void smoothingModel::checkFields(volVectorField& vSmoothField_) const
+{
+ // currently it is detected if field was auto generated or defined
+ // improvement would be changing the type here automatically
+ forAll(vSmoothField_.boundaryField(),patchI)
+ if(vSmoothField_.boundaryField()[patchI].type()=="calculated")
+ FatalError <<"Vector field:"<< vSmoothField_.name() << " must be defined.\n" << abort(FatalError);
+
+ vSmoothField_.writeOpt() = IOobject::AUTO_WRITE;
+}
+
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool smoothingModel::doSmoothing() const
{
diff --git a/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.H b/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.H
index 336bf75..d0c56a6 100644
--- a/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.H
+++ b/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.H
@@ -59,6 +59,12 @@ protected:
const dictionary& dict_;
cfdemCloud& particleCloud_;
+ mutable volVectorField vSmoothField_;
+ mutable volScalarField sSmoothField_;
+
+ void checkFields(volScalarField&) const;
+ void checkFields(volVectorField&) const;
+
public:
//- Runtime type information
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C
index a00514b..60a8eb8 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C
@@ -87,7 +87,7 @@ GaussVoidFraction::~GaussVoidFraction()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes) const
+void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
{
reAllocArrays();
@@ -109,6 +109,7 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract
particleVolumes[index][subcell]=0;
}
cellsPerParticle_[index][0]=1.0;
+ particleV[index][0]=0;
//collecting data
label particleCenterCellID=particleCloud_.cellIDs()[index][0];
@@ -161,6 +162,7 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract
particleWeights[index][0] += core;
particleVolumes[index][0] += occupiedVolume;
+ particleV[index][0] += occupiedVolume;
//Info << "Centre:set voidfraction in cellI=" << particleCenterCellID
// << ", voidfraction =" << voidfractionNext_[particleCenterCellID] << endl;
@@ -177,6 +179,7 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract
voidfractionNext_[cellI] -=occupiedVolume/particleCloud_.mesh().V()[cellI];
particleWeights[index][i+1] += core;
particleVolumes[index][i+1] += occupiedVolume;
+ particleV[index][0] += occupiedVolume;
//Info << "AFTER:set voidfraction in cellI=" << cellI
// << ", voidfraction =" << voidfractionNext_[cellI] << endl;
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.H
index 23aee91..535166b 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.H
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.H
@@ -86,7 +86,7 @@ public:
// Member Functions
- void setvoidFraction(double** const& ,double**&, double**&, double**&) const;
+ void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
void buildLabelHashSet
(
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C
index a0fb584..a5d327e 100755
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C
@@ -90,7 +90,7 @@ IBVoidFraction::~IBVoidFraction()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes) const
+void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
{
int numprocs, me;
@@ -113,6 +113,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction
particleVolumes[index][subcell]=0;
}
cellsPerParticle_[index][0]=1.0;
+ particleV[index][0]=0;
//collecting data
label particleCenterCellID=particleCloud_.cellIDs()[index][0];
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H
index 4ca146f..7862071 100755
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H
@@ -91,7 +91,7 @@ public:
// Member Functions
- void setvoidFraction(double** const& ,double**&, double**&, double**&) const;
+ void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
void buildLabelHashSet
(
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C
index 3859153..2fd72ea 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C
@@ -86,7 +86,7 @@ bigParticleVoidFraction::~bigParticleVoidFraction()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes) const
+void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
{
reAllocArrays();
@@ -108,6 +108,7 @@ void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voi
particleVolumes[index][subcell]=0;
}
cellsPerParticle_[index][0]=1.0;
+ particleV[index][0]=0;
//collecting data
label particleCenterCellID=particleCloud_.cellIDs()[index][0];
@@ -153,6 +154,7 @@ void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voi
particleWeights[index][0] += 1.0/hashSetLength;
particleVolumes[index][0] += occupiedVolume;
+ particleV[index][0] += occupiedVolume;
//Info << "Centre:set voidfraction in cellI=" << particleCenterCellID
// << ", voidfraction =" << voidfractionNext_[particleCenterCellID] << endl;
@@ -166,6 +168,7 @@ void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voi
voidfractionNext_[cellI] -=occupiedVolume/particleCloud_.mesh().V()[cellI];
particleWeights[index][i+1] += 1.0/hashSetLength;
particleVolumes[index][i+1] += occupiedVolume;
+ particleV[index][0] += occupiedVolume;
//Info << "AFTER:set voidfraction in cellI=" << cellI
// << ", voidfraction =" << voidfractionNext_[cellI] << endl;
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.H
index e4a56ba..8e470a4 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.H
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.H
@@ -83,7 +83,7 @@ public:
// Member Functions
- void setvoidFraction(double** const& ,double**&, double**&, double**&) const;
+ void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
void buildLabelHashSet
(
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C
index 9edd105..f04cfc0 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C
@@ -78,7 +78,7 @@ centreVoidFraction::~centreVoidFraction()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes) const
+void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
{
reAllocArrays();
@@ -105,6 +105,7 @@ void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfrac
// store volume for each particle
particleVolumes[index][0] = volume;
+ particleV[index][0] = volume;
voidfractionNext_[cellI] -= volume/cellVol;
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.H
index c84291b..1519992 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.H
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.H
@@ -83,7 +83,7 @@ public:
// Member Functions
- void setvoidFraction(double** const& ,double**&, double**&, double**&) const;
+ void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
};
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C
index 384bc8b..88ba06a 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C
@@ -69,7 +69,8 @@ dividedVoidFraction::dividedVoidFraction
alphaMin_(readScalar(propsDict_.lookup("alphaMin"))),
alphaLimited_(0),
tooMuch_(0.0),
- interpolation_(false)
+ interpolation_(false),
+ cfdemUseOnly_(false)
{
maxCellsPerParticle_ = 29;
@@ -83,6 +84,11 @@ dividedVoidFraction::dividedVoidFraction
checkWeightNporosity(propsDict_);
if (propsDict_.found("verbose")) verbose_=true;
+
+ if (propsDict_.found("cfdemUseOnly"))
+ {
+ cfdemUseOnly_ = readBool(propsDict_.lookup("cfdemUseOnly"));
+ }
}
@@ -94,9 +100,13 @@ dividedVoidFraction::~dividedVoidFraction()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes) const
+void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes, double**& particleV) const
{
- reAllocArrays();
+
+ if(cfdemUseOnly_)
+ reAllocArrays(particleCloud_.numberOfParticles());
+ else
+ reAllocArrays();
scalar pi = M_PI;
vector position(0,0,0);
@@ -114,11 +124,13 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra
//if(mask[index][0])
//{
// reset
+
for(int subcell=0;subcell(nPoints);
particleVolumes[index][storeInIndex] += particleVolume;
+ particleV[index][0] += particleVolume;
//====================================================//
}
}
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C
index c600606..d6276c3 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C
@@ -177,6 +177,15 @@ void Foam::voidFractionModel::reAllocArrays() const
}
}
+void Foam::voidFractionModel::reAllocArrays(int nP) const
+{
+ if(particleCloud_.numberOfParticlesChanged())
+ {
+ // get arrays of new length
+ particleCloud_.dataExchangeM().allocateArray(cellsPerParticle_,1,1,nP);
+ }
+}
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H
index 9f76616..4491cb7 100644
--- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H
+++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H
@@ -122,7 +122,7 @@ public:
// public member functions
- virtual void setvoidFraction(double** const&,double**&,double**&,double**&) const = 0;
+ virtual void setvoidFraction(double** const&,double**&,double**&,double**&,double**&) const = 0;
tmp voidFractionInterp() const;
@@ -150,6 +150,8 @@ public:
void reAllocArrays() const;
+ void reAllocArrays(int nP) const; //force number of particles during reallocation, for CFD offline-use
+
virtual void setParticleType(label type) const {};
virtual bool checkParticleType(label) const {return true;}; //consider all particles by default
diff --git a/tutorials/.gitignore b/tutorials/.gitignore
new file mode 100644
index 0000000..6154fde
--- /dev/null
+++ b/tutorials/.gitignore
@@ -0,0 +1,8 @@
+*.vtk
+*.o
+*.d
+*.a
+*.dep
+log_*
+log.*
+*~
diff --git a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh
index 24c64a6..3ebdb7d 100755
--- a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh
+++ b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh
@@ -19,7 +19,7 @@ cfdemPostProc="true"
postproc="true"
# check if mesh was built
-if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
+if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh
index f05a3d2..0c5232c 100755
--- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh
+++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh
@@ -14,7 +14,7 @@ casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
echo $casePath
# check if mesh was built
-if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
+if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
@@ -23,7 +23,5 @@ else
fi
-#gnome-terminal --title='cfdemSolverIB two settling disks CFD' -e "CFDrun()"
-gnome-terminal --title='cfdemSolverIB twoSpheresGlowinskiMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
-#gnome-terminal --title='cfdemSolverIB two settling disks DEM' -e "DEMrun()"
-#gnome-terminal --title='cfdemSolverIB twoSpheresGlowinskiMPI DEM' -e "bash $casePath/DEMrun.sh"
+#gnome-terminal --title='cfdemSolverIB twoSpheresGlowinskiMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
+bash $casePath/parCFDDEMrun.sh
diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/constant/couplingProperties b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/constant/couplingProperties
index a4d8f86..f50b696 100644
--- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/constant/couplingProperties
+++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/constant/couplingProperties
@@ -70,14 +70,12 @@ turbulenceModelType RASProperties;//LESProperties; //
ShirgaonkarIBProps
{
velFieldName "U";
- densityFieldName "rho";
pressureFieldName "p";
verbose;
}
ArchimedesIBProps
{
- densityFieldName "rho";
gravityFieldName "g";
voidfractionFieldName "voidfractionNext";
}
@@ -91,7 +89,7 @@ twoWayFilesProps
twoWayMPIProps
{
maxNumberOfParticles 10100;
- liggghtsPath "../DEM/in.liggghts_init";
+ liggghtsPath "../DEM/in.liggghts_run";
}
IBProps
diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/in.liggghts_run b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/in.liggghts_run
new file mode 100644
index 0000000..9259bbe
--- /dev/null
+++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/in.liggghts_run
@@ -0,0 +1,95 @@
+#echo both
+log ../DEM/log.liggghts
+thermo_log ../DEM/post/thermo.txt
+
+atom_style granular
+atom_modify map array
+communicate single vel yes
+
+boundary f f f
+newton off
+
+units si
+processors 2 2 1
+
+region reg block 0. 1. 0. 1. 0. 4. units box
+create_box 1 reg
+
+neighbor 0.3 bin
+neigh_modify delay 0 binsize 0.01
+
+
+# Material properties required for new pair styles
+
+fix m1 all property/global youngsModulus peratomtype 5.e7
+fix m2 all property/global poissonsRatio peratomtype 0.45
+fix m3 all property/global coefficientRestitution peratomtypepair 1 0.9
+fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
+
+# pair style
+pair_style gran model hertz tangential history #Hertzian without cohesion
+pair_coeff * *
+
+# timestep, gravity
+timestep 0.00003
+
+fix gravi all gravity 981 vector 0.0 0.0 -1.0
+
+# walls
+fix xwalls1 all wall/gran model hertz tangential history primitive type 1 xplane 0.
+fix xwalls2 all wall/gran model hertz tangential history primitive type 1 xplane 1.
+fix ywalls1 all wall/gran model hertz tangential history primitive type 1 yplane 0.
+fix ywalls2 all wall/gran model hertz tangential history primitive type 1 yplane 1.
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 4.
+
+# cfd coupling
+fix cfd all couple/cfd couple_every 10 mpi
+fix cfd2 all couple/cfd/force
+
+
+# create single partciles
+create_atoms 1 single .5 .5 3.5 units box
+create_atoms 1 single .5 .5 3.16 units box
+set atom 1 diameter 0.167 density 1.5 vx 0 vy 0 vz 0
+set atom 2 diameter 0.167 density 1.5 vx 0 vy 0 vz 0
+
+variable vx1 equal vx[1]
+variable vy1 equal vy[1]
+variable vz1 equal vz[1]
+variable vx2 equal vx[2]
+variable vy2 equal vy[2]
+variable vz2 equal vz[2]
+variable x1 equal x[1]
+variable y1 equal y[1]
+variable z1 equal z[1]
+variable x2 equal x[2]
+variable y2 equal y[2]
+variable z2 equal z[2]
+variable time equal step*dt
+
+fix extra1 all print 100 "${time} ${vx1} ${vy1} ${vz1}" file ../DEM/post/velocity_particle_1.txt title "%" screen no
+fix extra2 all print 100 "${time} ${vx2} ${vy2} ${vz2}" file ../DEM/post/velocity_particle_2.txt title "%" screen no
+fix extra3 all print 100 "${time} ${x1} ${y1} ${z1}" file ../DEM/post/position_particle_1.txt title "%" screen no
+fix extra4 all print 100 "${time} ${x2} ${y2} ${z2}" file ../DEM/post/position_particle_2.txt title "%" screen no
+
+
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere #wenn das ausgeblendet, dann kein vel update
+
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol
+thermo 1000
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
+
+# insert the first particles so that dump is not empty
+dump dmp all custom 100 ../DEM/post/dump.liggghts_run id 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 1
+
diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/post/.gitignore b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/post/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh
index d22d9e4..47d3b2c 100644
--- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh
+++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh
@@ -45,7 +45,7 @@ if [ $postproc == "true" ]
then
#- get VTK data from liggghts dump file
cd $casePath/DEM/post
- python -i $CFDEM_LPP_DIR/lpp.py dump.liggghts_init
+ python -i $CFDEM_LPP_DIR/lpp.py dump.liggghts_run
#- get VTK data from CFD sim
cd $casePath/CFD
@@ -65,20 +65,13 @@ cp ../../$logfileName $testHarnessPath
#- clean up case
echo "deleting data at: $casePath"
-rm -r $casePath/CFD/0.*
-rm -r $casePath/CFD/callgrind.*
-rm -r $casePath/CFD/*.out
-rm -r $casePath/CFD/VTK
-rm -r $casePath/CFD/couplingFiles/*
-rm -r $casePath/CFD/processor*
-rm -r $casePath/CFD/particles*
-rm -r $casePath/CFD/probes
-rm -r $casePath/DEM/post/*
-rm -r $casePath/DEM/log.*
-rm -r $casePath/log_*
+source $WM_PROJECT_DIR/bin/tools/CleanFunctions
+cd $casePath/CFD
+cleanCase
+rm -r $casePath/CFD/clockData
+rm $casePath/DEM/post/*.*
+#rm -r $casePath/DEM/post/restart/*.*
+#- preserve post directory
+touch $casePath/DEM/post/.gitignore
echo "done"
-#- preserve post directory
-echo "dummyfile" >> $casePath/DEM/post/dummy
-
-
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/Allrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI/Allrun.sh
index 7ef8738..fdfed50 100755
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/Allrun.sh
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/Allrun.sh
@@ -10,7 +10,7 @@
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
# check if mesh was built
-if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
+if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
@@ -18,5 +18,13 @@ else
blockMesh
fi
+if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
+ echo "LIGGGHTS init was run before - using existing restart file"
+else
+ #- run DEM in new terminal
+ $casePath/parDEMrun.sh
+fi
+
#- run parallel CFD-DEM in new terminal
-gnome-terminal --title='cfdemSolverPiso ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
+#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
+bash $casePath/parCFDDEMrun.sh
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/0/p b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/0/p
index be1cbf5..3a45674 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/0/p
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/0/p
@@ -16,7 +16,7 @@ FoamFile
dimensions [0 2 -2 0 0 0 0];
-internalField uniform 1.0e5;
+internalField uniform 1;
boundaryField
{
@@ -37,7 +37,7 @@ boundaryField
//type zeroGradient;
type fixedValue;
- value uniform 1.0e5;
+ value $internalField;
}
}
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties
index aa9fa97..2c6aee7 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/couplingProperties
@@ -26,6 +26,9 @@ FoamFile
//===========================================================================//
// sub-models & settings
+syncMode false;
+//verbose;
+
modelType "A"; // A or B
couplingInterval 100;
@@ -55,9 +58,11 @@ forceModels
//GidaspowDrag
//BeetstraDrag
//DiFeliceDrag
- KochHillDrag
gradPForce
viscForce
+ KochHillDrag
+ //DEMbasedDrag
+ //RongDrag
//Archimedes
//volWeightedAverage
//totalMomentumExchange
@@ -99,23 +104,20 @@ implicitCoupleProps
ArchimedesProps
{
- densityFieldName "rho";
gravityFieldName "g";
}
gradPForceProps
{
pFieldName "p";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
- interpolation;
+ interpolation true;
}
viscForceProps
{
velocityFieldName "U";
- densityFieldName "rho";
- interpolation;
+ interpolation true;
}
volWeightedAverageProps
{
@@ -128,7 +130,7 @@ volWeightedAverageProps
);
upperThreshold 0.999;
lowerThreshold 0;
- verbose;
+ verbose true;
}
totalMomentumExchangeProps
{
@@ -136,37 +138,48 @@ totalMomentumExchangeProps
explicitMomExFieldName "none";
fluidVelFieldName "U";
granVelFieldName "Us";
- densityFieldName "rho";
}
GidaspowDragProps
{
- verbose;
+ verbose true;
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
- interpolation;
+ interpolation true;
phi 1;
}
-DiFeliceDragProps
+DEMbasedDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
}
+DiFeliceDragProps
+{
+ //verbose true;
+ velFieldName "U";
+ voidfractionFieldName "voidfraction";
+ granVelFieldName "Us";
+ interpolation true;
+}
+
KochHillDragProps
{
- //verbose;
+ //verbose true;
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
- interpolation;
+ interpolation true;
+ //forceSubModels
+ //(
+ // ImExCorr
+ //);
+ implForceDEM true;
+ //implForceDEMaccumulated true;
+ //explicitCorr true;
}
BeetstraDragProps
{
velFieldName "U";
- densityFieldName "rho";
gravityFieldName "g";
rhoParticle 2000.;
voidfractionFieldName "voidfraction";
@@ -175,20 +188,42 @@ BeetstraDragProps
useParcelSizeDependentFilteredDrag ;
k 0.05;
aLimit 0.0;
-// verbose ;
+// verbose true;
+}
+
+RongDragProps
+{
+ verbose true;
+ velFieldName "U";
+ voidfractionFieldName "voidfraction";
+ interpolation true;
+ implForceDEM true;
+ implForceDEMaccumulated true;
+ granVelFieldName "Us";
}
virtualMassForceProps
{
velFieldName "U";
- densityFieldName "rho";
}
particleCellVolumeProps
{
upperThreshold 0.999;
lowerThreshold 0.;
- verbose;
+ verbose true;
+}
+
+fieldStoreProps
+{
+ scalarFieldNames
+ (
+ );
+
+ vectorFieldNames
+ (
+ "U"
+ );
}
oneWayVTKProps
@@ -228,11 +263,11 @@ dividedProps
twoWayMPIProps
{
- liggghtsPath "../DEM/in.liggghts_resume";
+ liggghtsPath "../DEM/in.liggghts_run";
}
twoWayM2MProps
{
maxNumberOfParticles 10100;
- liggghtsPath "../DEM/in.liggghts_resume";
+ liggghtsPath "../DEM/in.liggghts_run";
}
// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands
index a5ffcae..d9e1ce8 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/constant/liggghtsCommands
@@ -26,6 +26,7 @@ FoamFile
liggghtsCommandModels
(
runLiggghts
+ writeLiggghts
);
// ************************************************************************* //
@@ -33,3 +34,10 @@ liggghtsCommandModels
{
preNo false;
}*/
+
+writeLiggghtsProps
+{
+ writeLast off;
+ writeName "post/restart/liggghts.restartCFDEM";
+ overwrite on;
+}
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/octave/totalPressureDrop.m b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/octave/totalPressureDrop.m
index b6ec7d7..5a7d1a3 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/octave/totalPressureDrop.m
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/octave/totalPressureDrop.m
@@ -53,7 +53,7 @@ fprintf('so the result does not depend on density\n')
%==================================
% min fluidization velocity in m/s
%==================================
-rhoP = 2000 % particle density in kg/m3
+rhoP = 2000 % particle density in kg/m3
g = 9.81 % gravity m/s2
Umf = dp^2*(rhoP-rhoG)*g/(150*muG)*(epsilon^3*phip^2)/(1-epsilon);
@@ -96,8 +96,4 @@ axis([0,Uend,0,dpErgun(length(dpErgun))])
%print('cfdemSolverPiso_settlingTest.eps','-deps2')
print -color "cfdemSolverPiso_ErgunTestMPI.eps"
-replot;
-
-
-
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict
index 55a2adb..596886d 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict
@@ -63,27 +63,27 @@ functions
name probes;
probeLocations
(
- (0 0 0.0001)
- (0 0 0.0026)
- (0 0 0.0051)
- (0 0 0.0076)
- (0 0 0.0101)
- (0 0 0.0126)
- (0 0 0.0151)
- (0 0 0.0176)
- (0 0 0.0201)
- (0 0 0.0226)
- (0 0 0.0251)
- (0 0 0.0276)
- (0 0 0.0301)
- (0 0 0.0326)
- (0 0 0.0351)
- (0 0 0.0375)
- (0 0 0.0401)
- (0 0 0.0426)
- (0 0 0.0451)
- (0 0 0.0476)
- (0 0 0.0529)
+ (0.00003 0 0.0001)
+ (0.00003 0 0.0026)
+ (0.00003 0 0.0051)
+ (0.00003 0 0.0076)
+ (0.00003 0 0.0101)
+ (0.00003 0 0.0126)
+ (0.00003 0 0.0151)
+ (0.00003 0 0.0176)
+ (0.00003 0 0.0201)
+ (0.00003 0 0.0226)
+ (0.00003 0 0.0251)
+ (0.00003 0 0.0276)
+ (0.00003 0 0.0301)
+ (0.00003 0 0.0326)
+ (0.00003 0 0.0351)
+ (0.00003 0 0.0375)
+ (0.00003 0 0.0401)
+ (0.00003 0 0.0426)
+ (0.00003 0 0.0451)
+ (0.00003 0 0.0476)
+ (0.00003 0 0.0529)
);
// Fields to be probed
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init
index e6f325c..363df49 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init
@@ -1,64 +1,64 @@
# Pour granular particles into chute container, then induce flow
-echo both
-atom_style granular
-atom_modify map array
-communicate single vel yes
+echo both
+atom_style granular
+atom_modify map array
+communicate single vel yes
-boundary m m m
-newton off
+boundary m m m
+newton off
-units si
+units si
-region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box
-create_box 1 reg
+region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box
+create_box 1 reg
-neighbor 0.001 bin
-neigh_modify delay 0
+neighbor 0.001 bin
+neigh_modify delay 0
-#Material properties required for new pair styles
+# Material properties required for granular pair styles
-fix m1 all property/global youngsModulus peratomtype 5.e6
-fix m2 all property/global poissonsRatio peratomtype 0.45
-fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
-fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history #Hertzian without cohesion
-pair_coeff * *
+# pair style
+pair_style gran model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
-#timestep, gravity
-timestep 0.00001
-fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
-#walls
-fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
-fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
-fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
+# walls
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
+fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
-#particle distributions and insertion
-region bc cylinder z 0.0 0.0 0.012 0. 0.055 units box
-fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2000 radius constant 0.0005
-fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0
+# particle distributions and insertion
+region bc cylinder z 0.0 0.0 0.012 0. 0.055 units box
+fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2000 radius constant 0.0005
+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 10000 region bc
+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 10000 region bc
-#apply nve integration to all particles that are inserted as single particles
-fix integr all nve/sphere
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
-#screen output
-compute 1 all erotate/sphere
-thermo_style custom step atoms ke c_1 vol
-thermo 1000
-thermo_modify lost ignore norm no
-compute_modify thermo_temp dynamic yes
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol
+thermo 1000
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
-#insert the first particles so that dump is not empty
-run 1
-dump dmp all custom 5000 post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
+# insert the first particles so that dump is not empty
+run 1
+dump dmp all custom 5000 post/dump.liggghts_init id 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 10000 upto
-write_restart liggghts.restart
+run 10000 upto
+write_restart post/restart/liggghts.restart
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_run
new file mode 100644
index 0000000..2d49863
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_run
@@ -0,0 +1,68 @@
+# Pour granular particles into chute container, then induce flow
+log ../DEM/log.liggghts
+thermo_log ../DEM/post/thermo.txt
+
+atom_style granular
+atom_modify map array
+communicate single vel yes
+
+boundary m m m
+newton off
+
+units si
+processors 2 2 1
+
+# read the restart file
+read_restart ../DEM/post/restart/liggghts.restart
+
+neighbor 0.0005 bin
+neigh_modify delay 0
+
+# Material properties required for granular pair styles
+
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
+
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
+
+# walls
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
+fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
+
+# change the particles density
+set group all density 2000
+
+# cfd coupling
+fix cfd all couple/cfd couple_every 100 mpi
+fix cfd2 all couple/cfd/force/implicit
+#fix cfd2 all couple/cfd/force/accumulator RongDrag 10 1.5e-3
+#fix cfd2 all couple/cfd/force/implicit/accumulated #CrankNicolson 0.5
+
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
+
+# center of mass
+compute centerOfMass all com
+
+# compute total dragforce
+compute dragtotal all reduce sum f_dragforce[1] f_dragforce[2] f_dragforce[3]
+
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol c_centerOfMass[3] c_dragtotal[1] c_dragtotal[2] c_dragtotal[3]
+thermo 10
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
+
+dump dmp all custom 5000 ../DEM/post/dump*.liggghts_run id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius
+
+run 1
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/post/restart/.gitignore b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/post/restart/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh
index de2c30b..73c92d2 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh
@@ -21,7 +21,7 @@ logfileName="log_$headerText"
solverName="cfdemSolverPiso"
nrProcs="4"
machineFileName="none" # yourMachinefileName | none
-debugMode="off" # on | off| strict # on | off| strict
+debugMode="off" # on | off| strict
testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
runOctave="true"
postproc="false"
@@ -62,7 +62,7 @@ if [ $postproc == "true" ]
#- get VTK data from liggghts dump file
cd $casePath/DEM/post
- python -i $CFDEM_LPP_DIR/lpp.py dump*.liggghts_restart
+ python -i $CFDEM_LPP_DIR/lpp.py dump*.liggghts_run
#- get VTK data from CFD sim
cd $casePath/CFD
@@ -86,6 +86,9 @@ source $WM_PROJECT_DIR/bin/tools/CleanFunctions
cd $casePath/CFD
cleanCase
rm -r $casePath/CFD/clockData
-rm -r $casePath/DEM/post/*
-(cd $casePath/DEM/post && touch dummy)
+rm $casePath/DEM/post/*.*
+touch $casePath/DEM/post/.gitignore
+#rm $casePath/DEM/post/restart/*.*
+rm $casePath/DEM/post/restart/liggghts.restartCFDEM*
+touch $casePath/DEM/post/restart/.gitignore
echo "done"
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh
new file mode 100755
index 0000000..d1e3a03
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+#===================================================================#
+# DEMrun script for ErgunTestMPI testcase
+# init ErgunTestMPI
+# Christoph Goniva - July 2014
+#===================================================================#
+
+#- source CFDEM env vars
+. ~/.bashrc
+
+#- include functions
+source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
+
+echo "starting DEM run in parallel..."
+#--------------------------------------------------------------------------------#
+#- define variables
+casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
+logpath="$casePath"
+headerText="run_liggghts_init_DEM"
+logfileName="log_$headerText"
+solverName="in.liggghts_init"
+nrProcs=4
+machineFileName="none"
+debugMode="off"
+#--------------------------------------------------------------------------------#
+
+#- call function to run DEM case
+parDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode
+
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/Allrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/Allrun.sh
index bfbb0e2..8a87b18 100755
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/Allrun.sh
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/Allrun.sh
@@ -10,7 +10,7 @@
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
# check if mesh was built
-if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
+if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
@@ -18,17 +18,13 @@ else
blockMesh
fi
-echo "WARNING:copying a CGS based controlDict to $HOME/.OpenFOAM/$WM_PROJECT_VERSION"
-echo "this will make your simulations use CGS unit system"
-read
-echo "Make sure $HOME/.OpenFOAM/$WM_PROJECT_VERSION/controlDict is removed after this simulation."
-
-mkdir -p $FOAM_INST_DIR/.OpenFOAM//$WM_PROJECT_VERSION
-cp $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/controlDict_cgs_$WM_PROJECT_VERSION $FOAM_INST_DIR/.OpenFOAM/$WM_PROJECT_VERSION/controlDict
+if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
+ echo "LIGGGHTS init was run before - using existing restart file"
+else
+ #- run DEM
+ $casePath/parDEMrun.sh
+fi
#- run parallel CFD-DEM in new terminal
-gnome-terminal --title='cfdemSolverPiso ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
-
-echo "removing $FOAM_INST_DIR/.OpenFOAM/$WM_PROJECT_VERSION/controlDict?"
-read
-rm -r $FOAM_INST_DIR/.OpenFOAM/$WM_PROJECT_VERSION/controlDict*
+#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_cgs CFD' -e "bash $casePath/parCFDDEMrun.sh"
+bash $casePath/parCFDDEMrun.sh
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/constant/couplingProperties b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/constant/couplingProperties
index 558e491..c3ca876 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/constant/couplingProperties
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/constant/couplingProperties
@@ -81,23 +81,20 @@ implicitCoupleProps
ArchimedesProps
{
- densityFieldName "rho";
gravityFieldName "g";
}
gradPForceProps
{
pFieldName "p";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
- //interpolation;
+ //interpolation true;
}
viscForceProps
{
velocityFieldName "U";
- densityFieldName "rho";
- interpolation;
+ interpolation true;
}
volWeightedAverageProps
{
@@ -118,17 +115,14 @@ totalMomentumExchangeProps
explicitMomExFieldName "none";
fluidVelFieldName "U";
granVelFieldName "Us";
- densityFieldName "rho";
}
GidaspowDragProps
{
velFieldName "U";
- densityFieldName "rho";
}
DiFeliceDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
granVelFieldName "Us";
}
@@ -136,14 +130,12 @@ DiFeliceDragProps
KochHillDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
}
virtualMassForceProps
{
velFieldName "U";
- densityFieldName "rho";
}
oneWayVTKProps
@@ -184,11 +176,11 @@ dividedProps
twoWayMPIProps
{
//maxNumberOfParticles 10100;
- liggghtsPath "../DEM/in.liggghts_resume";
+ liggghtsPath "../DEM/in.liggghts_run";
}
twoWayM2MProps
{
maxNumberOfParticles 10100;
- liggghtsPath "../DEM/in.liggghts_resume";
+ liggghtsPath "../DEM/in.liggghts_run";
}
// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/octave/totalPressureDrop.m b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/octave/totalPressureDrop.m
index 15cf540..d1e329f 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/octave/totalPressureDrop.m
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/octave/totalPressureDrop.m
@@ -5,6 +5,7 @@ clc;
%====================================%
% simulation data 1
%====================================%
+rhoG = 0.01 % density in g/cm3
%path = '../probes/0/p'; % 2.1.x
path = '../postProcessing/probes/0/p'; % 2.2.x
columns=22;
@@ -12,7 +13,7 @@ headerlines=4;
data = loaddata(path,columns,headerlines);
data=transpose(data);
[x,y]=size(data)
-dp_sim = (data(:,2)-data(:,y))*0.01/10; % *rhoG to get pressure, then *10 to get from Ba in Pa
+dp_sim = (data(:,2)-data(:,y))*rhoG*0.1; % *rhoG to get pressure, then *0.1 to get from Ba in Pa
t_sim = data(:,1);
%fprintf('final pressureDrop of sim = %f Pa\n',dp_sim(length(dp_sim)) )
@@ -96,8 +97,4 @@ ylabel("pressure drop [Pa]")
%print('cfdemSolverPiso_settlingTest.eps','-deps2')
print -color "cfdemSolverPiso_ErgunTestMPI.eps"
-replot;
-
-
-
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict
index 1b7262f..6fcc089 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict
@@ -23,7 +23,7 @@ startTime 0;
stopAt endTime;
-endTime 0.1;//0.1;
+endTime 0.1;
deltaT 0.001;
@@ -49,7 +49,104 @@ adjustTimeStep no;
maxCo 0.1;
-libs ( "libgroovyBC.so" );
+//libs ( "libgroovyBC.so" );
+DimensionedConstants
+{
+ unitSet CGS; // SI; // USCS; //
+
+ CGSCoeffs
+ {
+ universal
+ {
+ c c [ 0 1 -1 0 0 0 0 ] 2.99792e+10; // speed of light in vacuum (cm/s)
+ G G [ -1 3 -2 0 0 0 0 ] 6.67429e-8; // gravitational constant (cm^3/(gs^2))
+ h h [ 1 2 -1 0 0 0 0 ] 6.62607e-27; // Planck's constant (erg.s)
+ }
+ electromagnetic
+ {
+ e e [ 0 0 1 0 0 1 0 ] 4.803204e-10; // elementary charge (statcoulomb)
+ }
+ atomic
+ {
+ me me [ 1 0 0 0 0 0 0 ] 9.10938e-28; // electron mass (g)
+ mp mp [ 1 0 0 0 0 0 0 ] 1.67262e-24; // proton mass (g)
+ }
+ physicoChemical
+ {
+ mu mu [ 1 0 0 0 0 0 0 ] 1.66054e-24; // atomic mass unit (g)
+ k k [ 1 2 -2 -1 0 0 0 ] 1.38065e-16; // Boltzman constant (erg/K)
+ }
+ standard
+ {
+ //- Standard pressure [bar]
+ Pstd Pstd [ 1 -1 -2 0 0 0 0 ] 1000000; // 1 bar (barye)
+ //- Standard temperature [degK]
+ Tstd Tstd [ 0 0 0 1 0 0 0 ] 298.15; // should be same as in SI unit system
+ }
+ }
+
+ SICoeffs
+ {
+ universal
+ {
+ c c [ 0 1 -1 0 0 0 0 ] 2.99792e+08;
+ G G [ -1 3 -2 0 0 0 0 ] 6.67429e-11;
+ h h [ 1 2 -1 0 0 0 0 ] 6.62607e-34;
+ }
+ electromagnetic
+ {
+ e e [ 0 0 1 0 0 1 0 ] 1.60218e-19;
+ }
+ atomic
+ {
+ me me [ 1 0 0 0 0 0 0 ] 9.10938e-31;
+ mp mp [ 1 0 0 0 0 0 0 ] 1.67262e-27;
+ }
+ physicoChemical
+ {
+ mu mu [ 1 0 0 0 0 0 0 ] 1.66054e-27;
+ k k [ 1 2 -2 -1 0 0 0 ] 1.38065e-23;
+ }
+ standard
+ {
+ //- Standard pressure [Pa]
+ Pstd Pstd [ 1 -1 -2 0 0 0 0 ] 100000;
+ //- Standard temperature [degK]
+ Tstd Tstd [ 0 0 0 1 0 0 0 ] 298.15;
+ }
+ }
+
+ USCSCoeffs
+ {
+ universal
+ {
+ c c [ 0 1 -1 0 0 0 0 ] 9.83558e+08;
+ G G [ -1 3 -2 0 0 0 0 ] 1.06909e-09;
+ h h [ 1 2 -1 0 0 0 0 ] 1.57234e-32;
+ }
+ electromagnetic
+ {
+ e e [ 0 0 1 0 0 1 0 ] 1.60218e-19;
+ }
+ atomic
+ {
+ me me [ 1 0 0 0 0 0 0 ] 2.00825e-30;
+ mp mp [ 1 0 0 0 0 0 0 ] 3.68746e-27;
+ }
+ physicoChemical
+ {
+ mu mu [ 1 0 0 0 0 0 0 ] 3.66083e-27;
+ k k [ 1 2 -2 -1 0 0 0 ] 1.82012e-22;
+ }
+ standard
+ {
+ //- Standard pressure [lbm/ft^2]
+ Pstd Pstd [ 1 -1 -2 0 0 0 0 ] 2088.6;
+ //- Standard temperature [degR]
+ Tstd Tstd [ 0 0 0 1 0 0 0 ] 536.67;
+ }
+ }
+}
functions
(
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init
index 72bda98..dbb6f11 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init
@@ -1,63 +1,64 @@
# Pour granular particles into chute container, then induce flow
-echo both
-atom_style granular
-atom_modify map array
-communicate single vel yes
+echo both
+atom_style granular
+atom_modify map array
+communicate single vel yes
-boundary m m m
-newton off
-units cgs
+boundary m m m
+newton off
-region reg block -1.5 1.5 -1.5 1.5 -0.1 5.54 units box
-create_box 1 reg
+units cgs
-neighbor 0.1 bin
-neigh_modify delay 0
+region reg block -1.5 1.5 -1.5 1.5 -0.1 5.54 units box
+create_box 1 reg
+
+neighbor 0.1 bin
+neigh_modify delay 0
-#Material properties required for new pair styles
+# Material properties required for granular pair styles
-fix m1 all property/global youngsModulus peratomtype 5.e6
-fix m2 all property/global poissonsRatio peratomtype 0.45
-fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
-fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history #Hertzian without cohesion
-pair_coeff * *
+# pair style
+pair_style gran model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
-#timestep, gravity
-timestep 0.00001
-fix gravi all gravity 981 vector 0.0 0.0 -1.0
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 981 vector 0.0 0.0 -1.0
-#walls
-fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
-fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 5.53
-fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 1.385 0. 0.
+# walls
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 5.53
+fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 1.385 0. 0.
-#particle distributions and insertion
-region bc cylinder z 0.0 0.0 1.2 0. 5.5 units box
-fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2. radius constant 0.05
-fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0
+# particle distributions and insertion
+region bc cylinder z 0.0 0.0 1.2 0. 5.5 units box
+fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2. radius constant 0.05
+fix pdd1 all particledistribution/discrete 1 1 pts1 1.0
-fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -100. insert_every once overlapcheck yes all_in yes particles_in_region 10000 region bc
+fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -100. insert_every once overlapcheck yes all_in yes particles_in_region 10000 region bc
-#apply nve integration to all particles that are inserted as single particles
-fix integr all nve/sphere
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
-#screen output
-compute 1 all erotate/sphere
-thermo_style custom step atoms ke c_1 vol
-thermo 1000
-thermo_modify lost ignore norm no
-compute_modify thermo_temp dynamic yes
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol
+thermo 1000
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
-#insert the first particles so that dump is not empty
-run 1
-dump dmp all custom 5000 post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
+# insert the first particles so that dump is not empty
+run 1
+dump dmp all custom 5000 post/dump.liggghts_init id 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 10000 upto
-write_restart liggghts.restart
+run 10000 upto
+write_restart post/restart/liggghts.restart
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_run
new file mode 100644
index 0000000..1eeccc1
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_run
@@ -0,0 +1,66 @@
+# Pour granular particles into chute container, then induce flow
+log ../DEM/log.liggghts
+thermo_log ../DEM/post/thermo.txt
+
+atom_style granular
+atom_modify map array
+communicate single vel yes
+
+boundary m m m
+newton off
+
+units cgs
+processors 2 2 1
+
+# read the restart file
+read_restart ../DEM/post/restart/liggghts.restart
+
+neighbor 0.1 bin
+neigh_modify delay 0
+
+# Material properties required for granular pair styles
+
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
+
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 981 vector 0.0 0.0 -1.0
+
+# walls
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 5.53
+fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 1.385 0. 0.
+
+# change the particles density
+set group all density 2.0
+
+# cfd coupling
+fix cfd all couple/cfd couple_every 100 mpi
+fix cfd2 all couple/cfd/force
+
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
+
+# center of mass
+compute centerOfMass all com
+
+# compute total dragforce
+compute dragtotal all reduce sum f_dragforce[1] f_dragforce[2] f_dragforce[3]
+
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol c_centerOfMass[3] c_dragtotal[1] c_dragtotal[2] c_dragtotal[3]
+thermo 10
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
+
+dump dmp all custom 5000 ../DEM/post/dump*.liggghts_run id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius
+
+run 1
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/post/restart/.gitignore b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/post/restart/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh
index a5145f8..e6c4a06 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh
@@ -62,7 +62,7 @@ if [ $postproc == "true" ]
#- get VTK data from liggghts dump file
cd $casePath/DEM/post
- python -i $CFDEM_LPP_DIR/lpp.py dump*.liggghts_restart
+ python -i $CFDEM_LPP_DIR/lpp.py dump*.liggghts_run
#- get VTK data from CFD sim
cd $casePath/CFD
@@ -82,22 +82,12 @@ fi
#- clean up case
echo "deleting data at: $casePath :\n"
-rm -r $casePath/CFD/0.*
-rm -r $casePath/CFD/callgrind.*
-rm -r $casePath/CFD/*.out
-rm -r $casePath/CFD/log.*
-rm -r $casePath/CFD/octave/octave-core
-rm -r $casePath/CFD/VTK
-rm -r $casePath/CFD/processor*
-rm -r $casePath/CFD/couplingFiles/*
-rm -r $casePath/DEM/post/*
-rm -r $casePath/DEM/log.*
-rm -r $casePath/DEM/liggghts.restartCFDEM*
-rm -r $casePath/CFD/probes
-rm -r $casePath/CFD/postProcessing
-rm -r $casePath/CFD/lagrangian
+source $WM_PROJECT_DIR/bin/tools/CleanFunctions
+cd $casePath/CFD
+cleanCase
rm -r $casePath/CFD/clockData
+rm $casePath/DEM/post/*.*
+#rm -r $casePath/DEM/post/restart/*.*
+touch $casePath/DEM/post/.gitignore
+touch $casePath/DEM/post/restart/.gitignore
echo "done"
-
-#- preserve post directory
-echo "dummyfile" >> $casePath/DEM/post/dummy
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh
new file mode 100755
index 0000000..9b431c5
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+#===================================================================#
+# DEMrun script for ErgunTestMPI testcase
+# init ErgunTestMPI
+# Daniel Queteschiner - June 2014
+#===================================================================#
+
+#- source CFDEM env vars
+. ~/.bashrc
+
+#- include functions
+source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
+
+#--------------------------------------------------------------------------------#
+#- define variables
+casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
+logpath="$casePath"
+headerText="run_liggghts_init_DEM"
+logfileName="log_$headerText"
+solverName="in.liggghts_init"
+nrProcs="4"
+machineFileName="none" # yourMachinefileName | none
+#--------------------------------------------------------------------------------#
+
+#- call function to run DEM case
+parDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName
+
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh
index 9141759..a5564ad 100755
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh
@@ -12,7 +12,7 @@ runOctave="true"
postproc="false"
# check if mesh was built
-if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
+if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
@@ -20,11 +20,18 @@ else
blockMesh
fi
+if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
+ echo "LIGGGHTS init was run before - using existing restart file"
+else
+ #- run DEM in new terminal
+ $casePath/parDEMrun.sh
+fi
+
#-------------------------------------------------------#
# adapt settings for init run
-cp $casePath/CFD/constant/liggghtsCommands_init $casePath/CFD/constant/liggghtsCommands
-cp $casePath/CFD/constant/couplingProperties_init $casePath/CFD/constant/couplingProperties
-cp $casePath/CFD/system/controlDict_init $casePath/CFD/system/controlDict
+cp $casePath/CFD/constant/liggghtsCommands_run $casePath/CFD/constant/liggghtsCommands
+cp $casePath/CFD/constant/couplingProperties_run $casePath/CFD/constant/couplingProperties
+cp $casePath/CFD/system/controlDict_run $casePath/CFD/system/controlDict
#-------------------------------------------------------#
#- run parallel CFD-DEM in new terminal
@@ -42,7 +49,8 @@ cp $casePath/CFD/constant/couplingProperties_restart $casePath/CFD/constant/coup
cp $casePath/CFD/system/controlDict_restart $casePath/CFD/system/controlDict
#- run parallel CFD-DEM in new terminal
-gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh"
+#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh"
+bash $casePath/parCFDDEMrun.sh
#- wait until sim has finished then run octave
@@ -102,7 +110,8 @@ source $WM_PROJECT_DIR/bin/tools/CleanFunctions
cd $casePath/CFD
cleanCase
rm -r $casePath/CFD/clockData
-rm -r $casePath/DEM/post/*
-rm $casePath/DEM/liggghts.restartCFDEM*
-(cd $casePath/DEM/post && touch dummy)
-echo "done"
\ No newline at end of file
+rm -r $casePath/DEM/post/*.*
+#rm -r $casePath/DEM/post/restart/*.*
+touch $casePath/DEM/post/.gitignore
+touch $casePath/DEM/post/restart/.gitignore
+echo "done"
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/couplingProperties_restart b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/couplingProperties_restart
index 311b8ac..4dae9fb 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/couplingProperties_restart
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/couplingProperties_restart
@@ -98,23 +98,20 @@ implicitCoupleProps
ArchimedesProps
{
- densityFieldName "rho";
gravityFieldName "g";
}
gradPForceProps
{
pFieldName "p";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
- //interpolation;
+ //interpolation true;
}
viscForceProps
{
velocityFieldName "U";
- densityFieldName "rho";
- interpolation;
+ interpolation true;
}
volWeightedAverageProps
{
@@ -135,20 +132,17 @@ totalMomentumExchangeProps
explicitMomExFieldName "none";
fluidVelFieldName "U";
granVelFieldName "Us";
- densityFieldName "rho";
}
GidaspowDragProps
{
verbose;
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
phi 1;
}
DiFeliceDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
}
@@ -156,14 +150,12 @@ KochHillDragProps
{
//verbose;
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
}
BeetstraDragProps
{
velFieldName "U";
- densityFieldName "rho";
gravityFieldName "g";
rhoParticle 2000.;
voidfractionFieldName "voidfraction";
@@ -178,7 +170,6 @@ BeetstraDragProps
virtualMassForceProps
{
velFieldName "U";
- densityFieldName "rho";
}
particleCellVolumeProps
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/couplingProperties_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/couplingProperties_run
new file mode 100644
index 0000000..95b9fe7
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/couplingProperties_run
@@ -0,0 +1,226 @@
+/*---------------------------------------------------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: 1.4 |
+| \\ / A nd | Web: http://www.openfoam.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+
+
+FoamFile
+{
+ version 2.0;
+ format ascii;
+
+ root "";
+ case "";
+ instance "";
+ local "";
+
+ class dictionary;
+ object couplingProperties;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+//===========================================================================//
+// sub-models & settings
+
+modelType "A"; // A or B
+
+couplingInterval 100;
+
+voidFractionModel divided;//centre;//
+
+locateModel engine;//turboEngineM2M;//
+
+meshMotionModel noMeshMotion;
+
+regionModel allRegion;
+
+IOModel basicIO;
+
+probeModel off;
+
+dataExchangeModel twoWayMPI;//twoWayM2M;//twoWayFiles;//oneWayVTK;//
+
+averagingModel dense;//dilute;//
+
+clockModel standardClock;//off;
+
+smoothingModel off;// localPSizeDiffSmoothing;// constDiffSmoothing; //
+
+forceModels
+(
+ //GidaspowDrag
+ //BeetstraDrag
+ //DiFeliceDrag
+ KochHillDrag
+ gradPForce
+ viscForce
+ //Archimedes
+ //volWeightedAverage
+ //totalMomentumExchange
+ //particleCellVolume
+);
+
+momCoupleModels
+(
+ implicitCouple
+);
+
+turbulenceModelType "RASProperties";//"LESProperties";//
+
+//===========================================================================//
+// sub-model properties
+
+localPSizeDiffSmoothingProps
+{
+ lowerLimit 0.1;
+ upperLimit 1e10;
+ dSmoothingLength 1.5e-3;
+ Csmoothing 1.0;
+}
+
+constDiffSmoothingProps
+{
+ lowerLimit 0.1;
+ upperLimit 1e10;
+ smoothingLength 1.5e-3;
+}
+
+implicitCoupleProps
+{
+ velFieldName "U";
+ granVelFieldName "Us";
+ voidfractionFieldName "voidfraction";
+}
+
+ArchimedesProps
+{
+ gravityFieldName "g";
+}
+gradPForceProps
+{
+ pFieldName "p";
+ voidfractionFieldName "voidfraction";
+ velocityFieldName "U";
+ //interpolation true;
+}
+
+viscForceProps
+{
+ velocityFieldName "U";
+ interpolation true;
+}
+volWeightedAverageProps
+{
+ scalarFieldNames
+ (
+ voidfraction
+ );
+ vectorFieldNames
+ (
+ );
+ upperThreshold 0.999;
+ lowerThreshold 0;
+ verbose;
+}
+totalMomentumExchangeProps
+{
+ implicitMomExFieldName "Ksl";
+ explicitMomExFieldName "none";
+ fluidVelFieldName "U";
+ granVelFieldName "Us";
+}
+GidaspowDragProps
+{
+ verbose;
+ velFieldName "U";
+ voidfractionFieldName "voidfraction";
+ phi 1;
+}
+DiFeliceDragProps
+{
+ velFieldName "U";
+ voidfractionFieldName "voidfraction";
+}
+
+KochHillDragProps
+{
+ //verbose;
+ velFieldName "U";
+ voidfractionFieldName "voidfraction";
+}
+
+BeetstraDragProps
+{
+ velFieldName "U";
+ gravityFieldName "g";
+ rhoParticle 2000.;
+ voidfractionFieldName "voidfraction";
+ interpolation ;
+ useFilteredDragModel ;
+ useParcelSizeDependentFilteredDrag ;
+ k 0.05;
+ aLimit 0.0;
+// verbose ;
+}
+
+virtualMassForceProps
+{
+ velFieldName "U";
+}
+
+particleCellVolumeProps
+{
+ upperThreshold 0.999;
+ lowerThreshold 0.;
+ verbose;
+}
+
+oneWayVTKProps
+{
+ couplingFilename "vtk_out%4.4d.vtk";
+ maxNumberOfParticles 30000;
+}
+
+twoWayFilesProps
+{
+ maxNumberOfParticles 10100;
+}
+
+centreProps
+{
+ alphaMin 0.10;
+}
+
+engineProps
+{
+ treeSearch true;
+}
+
+turboEngineM2MProps
+{
+ turboEngineProps
+ {
+ treeSearch true;
+ }
+}
+
+dividedProps
+{
+ alphaMin 0.01;
+ scaleUpVol 1.0;
+}
+
+twoWayMPIProps
+{
+ liggghtsPath "../DEM/in.liggghts_run";
+}
+twoWayM2MProps
+{
+ maxNumberOfParticles 10100;
+ liggghtsPath "../DEM/in.liggghts_run";
+}
+// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/liggghtsCommands_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/liggghtsCommands_run
new file mode 100644
index 0000000..ebd482f
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/constant/liggghtsCommands_run
@@ -0,0 +1,45 @@
+/*---------------------------------------------------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: 1.4 |
+| \\ / A nd | Web: http://www.openfoam.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+
+
+FoamFile
+{
+ version 2.0;
+ format ascii;
+
+ root "";
+ case "";
+ instance "";
+ local "";
+
+ class dictionary;
+ object liggghtsCommands;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+liggghtsCommandModels
+(
+ runLiggghts
+ writeLiggghts
+);
+
+runLiggghtsProps
+{
+ preNo false;
+}
+
+//- optional
+writeLiggghtsProps
+{
+ writeLast off;
+ writeName "post/restart/liggghts.restartCFDEM";
+ overwrite on;
+}
+
+// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/octave/totalPressureDrop.m b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/octave/totalPressureDrop.m
index c04819d..a687301 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/octave/totalPressureDrop.m
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/octave/totalPressureDrop.m
@@ -112,8 +112,4 @@ axis([0,Uend,0,dpErgun(length(dpErgun))])
%print('cfdemSolverPiso_settlingTest.eps','-deps2')
print -color "cfdemSolverPiso_ErgunTestMPI.eps"
-replot;
-
-
-
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_run
new file mode 100644
index 0000000..1d2f9b5
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_run
@@ -0,0 +1,117 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: 1.6 |
+| \\ / A nd | Web: www.OpenFOAM.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ version 2.0;
+ format ascii;
+ class dictionary;
+ location "system";
+ object controlDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+application pisoFoam;
+
+startFrom startTime;
+
+startTime 0;
+
+stopAt endTime;
+
+endTime 0.05;
+
+deltaT 0.001;
+
+writeControl adjustableRunTime;
+
+writeInterval 0.01;
+
+purgeWrite 0;
+
+writeFormat ascii;
+
+writePrecision 6;
+
+writeCompression uncompressed;
+
+timeFormat general;
+
+timePrecision 6;
+
+runTimeModifiable yes;
+
+adjustTimeStep no;
+
+maxCo 0.1;
+
+//libs ( "libgroovyBC.so" "libfiniteVolumeCFDEM.so");
+
+functions
+(
+
+ probes
+ {
+ type probes;
+ // Where to load it from
+ functionObjectLibs ( "libsampling.so" );
+ // Name of the directory for probe data
+ name probes;
+ probeLocations
+ (
+ (0 0 0.0001)
+ (0 0 0.0026)
+ (0 0 0.0051)
+ (0 0 0.0076)
+ (0 0 0.0101)
+ (0 0 0.0126)
+ (0 0 0.0151)
+ (0 0 0.0176)
+ (0 0 0.0201)
+ (0 0 0.0226)
+ (0 0 0.0251)
+ (0 0 0.0276)
+ (0 0 0.0301)
+ (0 0 0.0326)
+ (0 0 0.0351)
+ (0 0 0.0375)
+ (0 0 0.0401)
+ (0 0 0.0426)
+ (0 0 0.0451)
+ (0 0 0.0476)
+ (0 0 0.0529)
+ );
+
+ // Fields to be probed
+ fields ( p U voidfraction volAverage_voidfraction voidfractionNext voidfractionPrev);
+
+ // Write at same frequency as fields
+ outputControl timeStep;//outputTime;
+ outputInterval 1;
+ }
+
+ /*pressureDrop
+ {
+ type patchAverage;
+ functionObjectLibs
+ (
+ "libsimpleFunctionObjects.so"
+ );
+ verbose true;
+ patches
+ (
+ inlet
+ outlet
+ );
+ fields
+ (
+ p
+ );
+ factor 1;
+ }*/
+);
+// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init
index e6f325c..5f28012 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init
@@ -1,64 +1,64 @@
# Pour granular particles into chute container, then induce flow
-echo both
-atom_style granular
-atom_modify map array
-communicate single vel yes
+echo both
+atom_style granular
+atom_modify map array
+communicate single vel yes
-boundary m m m
-newton off
+boundary m m m
+newton off
-units si
+units si
-region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box
-create_box 1 reg
+region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box
+create_box 1 reg
-neighbor 0.001 bin
-neigh_modify delay 0
+neighbor 0.001 bin
+neigh_modify delay 0
-#Material properties required for new pair styles
+# Material properties required for granular pair styles
-fix m1 all property/global youngsModulus peratomtype 5.e6
-fix m2 all property/global poissonsRatio peratomtype 0.45
-fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
-fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history #Hertzian without cohesion
-pair_coeff * *
+# pair style
+pair_style gran model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
-#timestep, gravity
-timestep 0.00001
-fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
-#walls
-fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
-fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
-fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
+# walls
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
+fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
-#particle distributions and insertion
-region bc cylinder z 0.0 0.0 0.012 0. 0.055 units box
-fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2000 radius constant 0.0005
-fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0
+# particle distributions and insertion
+region bc cylinder z 0.0 0.0 0.012 0. 0.055 units box
+fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2000 radius constant 0.0005
+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 10000 region bc
+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 10000 region bc
-#apply nve integration to all particles that are inserted as single particles
-fix integr all nve/sphere
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
-#screen output
-compute 1 all erotate/sphere
-thermo_style custom step atoms ke c_1 vol
-thermo 1000
-thermo_modify lost ignore norm no
-compute_modify thermo_temp dynamic yes
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol
+thermo 1000
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
-#insert the first particles so that dump is not empty
-run 1
-dump dmp all custom 5000 post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
+# insert the first particles so that dump is not empty
+run 1
+dump dmp all custom 5000 post/dump.liggghts_init id 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 10000 upto
-write_restart liggghts.restart
+run 10000 upto
+write_restart post/restart/liggghts.restart
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart
index 5dc462e..251ce3e 100644
--- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart
@@ -1,71 +1,65 @@
# Pour granular particles into chute container, then induce flow
+log ../DEM/log.liggghts
+thermo_log ../DEM/post/thermo.txt
-atom_style granular
-atom_modify map array
-communicate single vel yes
+atom_style granular
+atom_modify map array
+communicate single vel yes
-boundary m m m
-newton off
+boundary m m m
+newton off
-units si
-processors 2 2 1
+units si
+processors 2 2 1
-#read the restart file
-read_restart ../DEM/liggghts.restartCFDEM_0.050000
+# read the restart file
+read_restart ../DEM/post/restart/liggghts.restartCFDEM
-#do not do this here, the simulation box is in the restart file!
-#region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box
-#create_box 1 reg
+neighbor 0.0005 bin
+neigh_modify delay 0
-neighbor 0.0005 bin
-neigh_modify delay 0
+# Material properties required for granular pair styles
-#Material properties required for new pair styles
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
+fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
-fix m1 all property/global youngsModulus peratomtype 5.e6
-fix m2 all property/global poissonsRatio peratomtype 0.45
-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 model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
-#pair style
-pair_style gran model hertz tangential history #Hertzian without cohesion
-pair_coeff * *
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
-#timestep, gravity
-timestep 0.00001
-fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
-
-fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
-fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
-fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
+fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
# change the particles density
-set group all density 2000
+set group all density 2000
-#cfd coupling
-fix cfd all couple/cfd couple_every 100 mpi
-fix cfd2 all couple/cfd/force
+# cfd coupling
+fix cfd all couple/cfd couple_every 100 mpi
+fix cfd2 all couple/cfd/force
-#apply nve integration to all particles that are inserted as single particles
-fix integr all nve/sphere
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
-#center of mass
-compute centerOfMass all com
+# center of mass
+compute centerOfMass all com
-#compute total dragforce
-compute dragtotal all reduce sum f_dragforce[1] f_dragforce[2] f_dragforce[3]
+# compute total dragforce
+compute dragtotal all reduce sum f_dragforce[1] f_dragforce[2] f_dragforce[3]
-#screen output
-compute 1 all erotate/sphere
-thermo_style custom step atoms ke c_1 vol c_centerOfMass[3] c_dragtotal[1] c_dragtotal[2] c_dragtotal[3]
-thermo 10
-thermo_modify lost ignore norm no
-compute_modify thermo_temp dynamic yes
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol c_centerOfMass[3] c_dragtotal[1] c_dragtotal[2] c_dragtotal[3]
+thermo 10
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
-#insert the first particles so that dump is not empty
-dump myDump all stl 1 post/dump_*.stl
-#run 1
-dump dmp all custom 5000 ../DEM/post/dump*.liggghts_restart id type type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius
-undump myDump
+dump dmp all custom 5000 ../DEM/post/dump*.liggghts_restart id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius
-run 1
+run 1
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_run
new file mode 100644
index 0000000..1a1d48c
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_run
@@ -0,0 +1,65 @@
+# Pour granular particles into chute container, then induce flow
+log ../DEM/log.liggghts
+thermo_log ../DEM/post/thermo.txt
+
+atom_style granular
+atom_modify map array
+communicate single vel yes
+
+boundary m m m
+newton off
+
+units si
+processors 2 2 1
+
+# read the restart file
+read_restart ../DEM/post/restart/liggghts.restart
+
+neighbor 0.0005 bin
+neigh_modify delay 0
+
+# Material properties required for granular pair styles
+
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
+
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
+
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553
+fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0.
+
+# change the particles density
+set group all density 2000
+
+# cfd coupling
+fix cfd all couple/cfd couple_every 100 mpi
+fix cfd2 all couple/cfd/force
+
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
+
+# center of mass
+compute centerOfMass all com
+
+# compute total dragforce
+compute dragtotal all reduce sum f_dragforce[1] f_dragforce[2] f_dragforce[3]
+
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol c_centerOfMass[3] c_dragtotal[1] c_dragtotal[2] c_dragtotal[3]
+thermo 10
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
+
+dump dmp all custom 5000 ../DEM/post/dump*.liggghts_restart id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius
+
+run 1
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/post/restart/.gitignore b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/post/restart/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh
new file mode 100755
index 0000000..138c740
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+#===================================================================#
+# DEMrun script for ErgunTestMPI_restart testcase
+# init ErgunTestMPI_restart
+# Daniel Queteschiner - June 2014, DCS Computing GmbH
+#===================================================================#
+
+#- source CFDEM env vars
+. ~/.bashrc
+
+#- include functions
+source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
+
+#--------------------------------------------------------------------------------#
+#- define variables
+casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
+logpath="$casePath"
+headerText="run_liggghts_init_DEM"
+logfileName="log_$headerText"
+solverName="in.liggghts_init"
+nrProcs="2"
+machineFileName="none" # yourMachinefileName | none
+#--------------------------------------------------------------------------------#
+
+#- call function to run DEM case
+parDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName
+
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/Allrun.sh b/tutorials/cfdemSolverPiso/settlingTestMPI/Allrun.sh
index 3425265..3ccf874 100755
--- a/tutorials/cfdemSolverPiso/settlingTestMPI/Allrun.sh
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/Allrun.sh
@@ -10,7 +10,7 @@
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
# check if mesh was built
-if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
+if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
@@ -19,5 +19,5 @@ else
fi
#- run parallel CFD-DEM in new terminal
-gnome-terminal --title='cfdemSolverPiso settlingTest CFD' -e "bash $casePath/parCFDDEMrun.sh"
-
+#gnome-terminal --title='cfdemSolverPiso settlingTest CFD' -e "bash $casePath/parCFDDEMrun.sh"
+bash $casePath/parCFDDEMrun.sh
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/f b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/f
new file mode 100644
index 0000000..2599795
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/f
@@ -0,0 +1,30 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: 1.6 |
+| \\ / A nd | Web: http://www.OpenFOAM.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ version 2.0;
+ format ascii;
+ class volVectorField;
+ object f;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [1 -2 -2 0 0 0 0];
+
+internalField uniform (0 0 0);
+
+boundaryField
+{
+ "(inlet|outlet|walls)"
+ {
+ type zeroGradient;
+ value uniform (0 0 0);
+ }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/sSmoothField b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/sSmoothField
new file mode 100755
index 0000000..447a450
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/sSmoothField
@@ -0,0 +1,31 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: 1.6 |
+| \\ / A nd | Web: www.OpenFOAM.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ version 2.0;
+ format ascii;
+ class volScalarField;
+ location "0";
+ object sSmoothField;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 0 0 0 0 0 0];
+
+internalField uniform 0;
+
+boundaryField
+{
+ ".*"
+ {
+ type zeroGradient;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/vSmoothField b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/vSmoothField
new file mode 100644
index 0000000..afefb5e
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/0/vSmoothField
@@ -0,0 +1,31 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: 1.6 |
+| \\ / A nd | Web: www.OpenFOAM.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ version 2.0;
+ format ascii;
+ class volVectorField;
+ location "0";
+ object vSmoothField;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 0 0 0 0 0 0];
+
+internalField uniform (0 0 0);
+
+boundaryField
+{
+ ".*"
+ {
+ type zeroGradient;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties
index 50e6c9d..491ba5d 100755
--- a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/couplingProperties
@@ -25,7 +25,6 @@ FoamFile
//===========================================================================//
// sub-models & settings
-
modelType B; // A or B
couplingInterval 100;
@@ -91,10 +90,13 @@ implicitCoupleProps
DiFeliceDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
granVelFieldName "Us";
- verbose;
+ verbose true;
+
+ //- use of scalar viscosity for drag
+ //scalarViscosity true;
+ //nu nu [ 0 2 -1 0 0 0 0 ] 1e-04;
}
SchillerNaumannDragProps
@@ -120,7 +122,6 @@ ArchimedesProps
{
densityFieldName "rho";
gravityFieldName "g";
- treatDEM;
}
virtualMassForceProps
@@ -137,7 +138,7 @@ oneWayVTKProps
twoWayMPIProps
{
- liggghtsPath "../DEM/in.liggghts_init";
+ liggghtsPath "../DEM/in.liggghts_run";
}
twoWayFilesProps
@@ -166,7 +167,7 @@ bigParticleProps
engineProps
{
- treeSearch true;
+ treeSearch true;
}
// ************************************************************************* //
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/liggghtsCommands b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/liggghtsCommands
index 7431b21..6517f08 100644
--- a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/liggghtsCommands
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/constant/liggghtsCommands
@@ -25,7 +25,16 @@ FoamFile
liggghtsCommandModels
(
- runLiggghts
+ runLiggghts
+ writeLiggghts
);
// ************************************************************************* //
+
+writeLiggghtsProps
+{
+ writeLast off;
+ //writeName "name";
+ overwrite on;
+ verbose;
+}
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/system/fvSolution b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/system/fvSolution
index 96a1d5c..276538b 100644
--- a/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/system/fvSolution
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/CFD/system/fvSolution
@@ -41,7 +41,7 @@ solvers
relTol 0;
}
- "(voidfraction|Ksl|UsNext|voidfractionNext)"
+ "(voidfraction|Ksl|UsNext|voidfractionNext|sSmoothField|vSmoothField|fSmooth)"
{
solver PCG;
preconditioner DIC;
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/in.liggghts_run
new file mode 100644
index 0000000..fbb0636
--- /dev/null
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/in.liggghts_run
@@ -0,0 +1,73 @@
+# Pour granular particles into chute container, then induce flow
+echo both
+log ../DEM/log.liggghts
+thermo_log ../DEM/post/thermo.txt
+
+atom_style granular
+atom_modify map array sort 0 0
+communicate single vel yes
+
+boundary f f f
+newton off
+
+units si
+
+region reg block 0 0.1 0 0.1 0 0.1 units box
+create_box 1 reg
+
+neighbor 0.003 bin
+neigh_modify delay 0 binsize 0.01
+
+
+# Material properties required for granular pair styles
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
+fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
+#fix m5 all property/global characteristicVelocity scalar 2.0
+
+# pair style
+pair_style gran model hertz tangential history # hertz without cohesion
+pair_coeff * *
+
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 9.81 vector 0.0 -1.0 0.0
+
+# walls
+fix xwalls1 all wall/gran model hertz tangential history primitive type 1 xplane 0.0
+fix xwalls2 all wall/gran model hertz tangential history primitive type 1 xplane 0.1
+fix ywalls1 all wall/gran model hertz tangential history primitive type 1 yplane 0.0
+fix ywalls2 all wall/gran model hertz tangential history primitive type 1 yplane 0.1
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.01
+
+# create single partciles
+create_atoms 1 single 0.05 0.025 0.05 units box
+set group all diameter 0.0001 density 3000
+
+# cfd coupling
+fix cfd all couple/cfd couple_every 100 mpi
+fix cfd2 all couple/cfd/force
+
+variable vx equal vx[1]
+variable vy equal vy[1]
+variable vz equal vz[1]
+variable time equal step*dt
+fix extra all print 100 "${time} ${vx} ${vy} ${vz}" file ../DEM/post/velocity.txt title "#" screen no
+
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
+
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol
+thermo 1000
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
+
+# insert the first particles so that dump is not empty
+run 0
+dump dmp all custom 1000 ../DEM/post/dump.liggghts_run id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
+
+run 0 upto
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/post/.gitignore b/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/post/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh
index 5d20182..2d622d7 100644
--- a/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh
+++ b/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh
@@ -24,7 +24,7 @@ machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off| strict
testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
runOctave="true"
-cleanCase="true"
+cleanUp="true"
postproc="false"
#--------------------------------------------------------------------------------#
@@ -59,7 +59,7 @@ if [ $postproc == "true" ]
#- get VTK data from liggghts dump file
cd $casePath/DEM/post
- python -i $CFDEM_LPP_DIR/lpp.py dump.liggghts_init
+ python -i $CFDEM_LPP_DIR/lpp.py dump.liggghts_run
#- get VTK data from CFD sim
cd $casePath/CFD
@@ -77,7 +77,7 @@ if [ $postproc == "true" ]
fi
#- clean up case
-if [ $cleanCase == "true" ]
+if [ $cleanUp == "true" ]
then
echo "deleting data at: $casePath :\n"
source $WM_PROJECT_DIR/bin/tools/CleanFunctions
@@ -86,9 +86,10 @@ if [ $cleanCase == "true" ]
cd $casePath
rm -r $casePath/CFD/clockData
rm -r $casePath/DEM/post/*
+ rm -r $casePath/DEM/liggghts.restartCFDEM*
echo "done"
fi
#- preserve post directory
-echo "dummyfile" >> $casePath/DEM/post/dummy
+touch $casePath/DEM/post/.gitignore
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/Allrun.sh b/tutorials/cfdemSolverPisoScalar/packedBedTemp/Allrun.sh
index 0aad13d..4bb0814 100755
--- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/Allrun.sh
+++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/Allrun.sh
@@ -10,7 +10,7 @@
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
# check if mesh was built
-if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
+if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
@@ -18,6 +18,13 @@ else
blockMesh
fi
-#- run parallel CFD-DEM in new terminal
-gnome-terminal --title='cfdemSolverPisoScalar packedBedTemp CFD' -e "bash $casePath/parCFDDEMrun.sh"
+if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
+ echo "LIGGGHTS init was run before - using existing restart file"
+else
+ #- run DEM init
+ $casePath/parDEMrun.sh
+fi
+#- run parallel CFD-DEM in new terminal
+#gnome-terminal --title='cfdemSolverPisoScalar packedBedTemp CFD' -e "bash $casePath/parCFDDEMrun.sh"
+bash $casePath/parCFDDEMrun.sh
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties
index a609b6d..8bb9002 100644
--- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties
+++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/constant/couplingProperties
@@ -53,7 +53,7 @@ smoothingModel off;
forceModels
(
KochHillDrag
- LaEuScalarTemp
+ LaEuScalarTemp // must be 2nd pos!
Archimedes
);
@@ -72,12 +72,10 @@ LaEuScalarTempProps
velFieldName "U";
tempFieldName "T";
voidfractionFieldName "voidfraction";
- tempSourceFieldName "Tsource";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
lambda 0.0256;
Cp 1007;
- densityFieldName "rho";
}
implicitCoupleProps
@@ -91,36 +89,31 @@ implicitCoupleProps
KochHillDragProps
{
velFieldName "U";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
}
DiFeliceDragProps
{
velFieldName "U";
- densityFieldName "rho";
- //verbose;
+ //verbose true;
}
ArchimedesProps
{
- densityFieldName "rho";
gravityFieldName "g";
}
gradPForceProps
{
pFieldName "p";
- densityFieldName "rho";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
- //interpolation;
+ //interpolation true;
}
viscForceProps
{
velocityFieldName "U";
- densityFieldName "rho";
- interpolation;
+ interpolation true;
}
oneWayVTKProps
@@ -132,7 +125,7 @@ oneWayVTKProps
twoWayMPIProps
{
maxNumberOfParticles 10000;
- liggghtsPath "../DEM/in.liggghts_init";
+ liggghtsPath "../DEM/in.liggghts_run";
}
centreProps
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/octave/totalPressureDropAndNusselt.m b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/octave/totalPressureDropAndNusselt.m
index b572108..e60ef38 100644
--- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/octave/totalPressureDropAndNusselt.m
+++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/octave/totalPressureDropAndNusselt.m
@@ -51,7 +51,6 @@ legend("analytical - Ergun","simulation")
%print('cfdemSolverPiso_settlingTest.eps','-deps2')
print -color "cfdemSolverPisoScalar_pressureDrop.eps"
-replot;
%*********************************************************************%
% heat transfer
@@ -126,7 +125,6 @@ legend("analytical - ","simulation")
%print('cfdemSolverPisoScalar_NusseltNr.eps','-deps2')
print -color "cfdemSolverPisoScalar_Nusselt.eps"
-replot;
figure(3)
plot(t_sim,Tin_sim,t_sim,Tout_sim)
@@ -135,5 +133,4 @@ legend("inlet","outlet")
%print('cfdemSolverPisoScalar_NusseltNr.eps','-deps2')
print -color "cfdemSolverPisoScalar_temperatures.eps"
-replot;
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init
index 423e05e..f739d16 100644
--- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init
+++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init
@@ -1,83 +1,73 @@
+# Particle packing by insertion and successive growing of particles
-# read packed bed and calc convective heat transfer
+atom_style granular
+atom_modify map array
+boundary m m m
+newton off
+echo both
-atom_style granular
-atom_modify map array
-communicate single vel yes
-boundary m m m
-newton off
-echo both
-units si
-processors 1 1 2
+communicate single vel yes
-#read the restart file
-read_restart ../DEM/liggghts.restart
+units si
+processors 1 1 2
-neighbor 0.003 bin
-neigh_modify delay 0 binsize 0.01
+region reg block 0. 0.1 0. 0.1 0. 1.1 units box
+create_box 1 reg
+
+neighbor 0.002 bin
+neigh_modify delay 0
-#Material properties required for new pair styles
+# Material properties required for granular pair styles
-fix m1 all property/global youngsModulus peratomtype 5.e6
-fix m2 all property/global poissonsRatio peratomtype 0.45
-fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
-fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history #Hertzian without cohesion
-pair_coeff * *
+# pair style
+pair_style gran model hertz tangential history #Hertzian without cohesion
+pair_coeff * *
-#timestep, gravity
-timestep 0.00001
-fix gravi all gravity 9.81 vector 0. 0. -1.
+timestep 0.00001
-#walls
-#walls
-fix xwalls1 all wall/gran model hertz tangential history primitive type 1 xplane 0.
-fix xwalls2 all wall/gran model hertz tangential history primitive type 1 xplane 0.1
-fix ywalls1 all wall/gran model hertz tangential history primitive type 1 yplane 0.
-fix ywalls2 all wall/gran model hertz tangential history primitive type 1 yplane 0.1
-fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.
-fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 1.1
+# walls
+fix xwalls1 all wall/gran model hertz tangential history primitive type 1 xplane 0.0
+fix xwalls2 all wall/gran model hertz tangential history primitive type 1 xplane 0.1
+fix ywalls1 all wall/gran model hertz tangential history primitive type 1 yplane 0.0
+fix ywalls2 all wall/gran model hertz tangential history primitive type 1 yplane 0.1
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 1.1
+fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
-#heat transfer
-fix ftco all property/global thermalConductivity peratomtype 5. # lambda in [W/(K*m)]
-fix ftca all property/global thermalCapacity peratomtype 0.1 # cp in [J/(kg*K)]
-fix heattransfer all heat/gran initial_temperature 600.
+# heat transfer
+fix ftco all property/global thermalConductivity peratomtype 5.
+fix ftca all property/global thermalCapacity peratomtype 10.
+fix heattransfer all heat/gran initial_temperature 263.
-#set particle temperature for the bed
-run 0
-region total block INF INF INF INF INF INF units box
-set region total property/atom Temp 600. # former property/paratom
+# particle distributions and insertion
+region bc block 0. 0.1 0. 0.1 0. 1.1 units box
+fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2500 radius constant 0.011
+fix pdd1 all particledistribution/discrete 1 1 pts1 1.0
-#cfd coupling
-fix cfd all couple/cfd couple_every 100 mpi
-fix cfd2 all couple/cfd/force
+fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -3. insert_every 10000 overlapcheck yes all_in yes particles_in_region 1005 region bc
-#this one invokes heat transfer calculation, transfers per-particle temperature and adds convective heat flux to particles
-fix cfd3 all couple/cfd/convection T0 600
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
-#variable vx equal vx[1]
-#variable vy equal vy[1]
-#variable vz equal vz[1]
-#variable time equal step*dt
-#fix extra all print 500 "${time} ${vx} ${vy} ${vz}" file ../DEM/post/velocity.txt title "%" screen no
-
-#apply nve integration to all particles that are inserted as single particles
-fix integr all nve/sphere
-
-
-#screen output
-compute 1 all erotate/sphere
-thermo_style custom step atoms ke c_1 vol
-thermo 1000
-thermo_modify lost ignore norm no
-compute_modify thermo_temp dynamic yes
-
-#insert the first particles so that dump is not empty
-run 1
-dump dmp all custom 100 ../DEM/post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius f_Temp[0] f_heatFlux[0]
+# output settings, include total thermal energy
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke f_heattransfer vol
+thermo 1000
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
+#insert the first particles
run 1
+dump dmp all custom 1000 post/dump.liggghts_init id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius f_heattransfer[0] f_heatFlux[0]
+
+run 150000
+
+write_restart post/restart/liggghts.restart
+
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_run b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_run
new file mode 100644
index 0000000..7350ff1
--- /dev/null
+++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_run
@@ -0,0 +1,75 @@
+# read packed bed and calc convective heat transfer
+log ../DEM/log.liggghts
+thermo_log ../DEM/post/thermo.txt
+
+atom_style granular
+atom_modify map array
+communicate single vel yes
+boundary m m m
+newton off
+echo both
+units si
+processors 1 1 2
+
+# read the restart file
+read_restart ../DEM/post/restart/liggghts.restart
+
+neighbor 0.003 bin
+neigh_modify delay 0 binsize 0.01
+
+
+# Material properties required for granular pair styles
+
+fix m1 all property/global youngsModulus peratomtype 5.e6
+fix m2 all property/global poissonsRatio peratomtype 0.45
+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 model hertz tangential history # Hertzian without cohesion
+pair_coeff * *
+
+# timestep, gravity
+timestep 0.00001
+fix gravi all gravity 9.81 vector 0. 0. -1.
+
+# walls
+fix xwalls1 all wall/gran model hertz tangential history primitive type 1 xplane 0.0
+fix xwalls2 all wall/gran model hertz tangential history primitive type 1 xplane 0.1
+fix ywalls1 all wall/gran model hertz tangential history primitive type 1 yplane 0.0
+fix ywalls2 all wall/gran model hertz tangential history primitive type 1 yplane 0.1
+fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
+fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 1.1
+
+
+# heat transfer
+fix ftco all property/global thermalConductivity peratomtype 5. # lambda in [W/(K*m)]
+fix ftca all property/global thermalCapacity peratomtype 0.1 # cp in [J/(kg*K)]
+fix heattransfer all heat/gran initial_temperature 600.
+
+# set particle temperature for the bed
+run 0
+region total block INF INF INF INF INF INF units box
+set region total property/atom Temp 600.
+
+# cfd coupling
+fix cfd all couple/cfd couple_every 100 mpi
+fix cfd2 all couple/cfd/force
+
+# this one invokes heat transfer calculation, transfers per-particle temperature and adds convective heat flux to particles
+fix cfd3 all couple/cfd/convection T0 600
+
+# apply nve integration to all particles that are inserted as single particles
+fix integr all nve/sphere
+
+
+# screen output
+compute rke all erotate/sphere
+thermo_style custom step atoms ke c_rke vol
+thermo 1000
+thermo_modify lost ignore norm no
+compute_modify thermo_temp dynamic yes
+
+dump dmp all custom 100 ../DEM/post/dump.liggghts_run id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius f_Temp[0] f_heatFlux[0]
+
+run 1
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/post/restart/.gitignore b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/post/restart/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh
index 5ab664b..c0073d9 100644
--- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh
+++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh
@@ -65,7 +65,7 @@ if [ $postproc == "true" ]
#- get VTK data from liggghts dump file
cd $casePath/DEM/post
- python -i $CFDEM_LPP_DIR/lpp.py dump.liggghts_init
+ python -i $CFDEM_LPP_DIR/lpp.py dump.liggghts_run
#- get VTK data from CFD sim
cd $casePath/CFD
@@ -84,24 +84,16 @@ fi
#- clean up case
echo "deleting data at: $casePath : ???\n"
-rm -r $casePath/CFD/0.*
-rm -r $casePath/CFD/1
-rm -r $casePath/CFD/callgrind.*
-rm -r $casePath/CFD/*.out
-rm -r $casePath/CFD/octave/*.eps
-rm -r $casePath/CFD/octave/octave-core
-rm -r $casePath/CFD/VTK
-rm -r $casePath/CFD/processor*
-rm -r $casePath/DEM/post/*
-rm -r $casePath/DEM/log.*
-rm -r $casePath/CFD/log.*
-rm -r $casePath/DEM/log.*
-rm -r $casePath/CFD/probes
-rm -r $casePath/CFD/postProcessing
-rm -r $casePath/log_*
+source $WM_PROJECT_DIR/bin/tools/CleanFunctions
+cd $casePath/CFD
+cleanCase
+rm -r $casePath/CFD/clockData
+rm $casePath/DEM/post/*.*
+#rm -r $casePath/DEM/post/restart/*.*
echo "done"
#- preserve post directory
-echo "dummyfile" >> $casePath/DEM/post/dummy
+touch $casePath/DEM/post/.gitignore
+touch $casePath/DEM/post/restart/.gitignore
diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh
new file mode 100755
index 0000000..660b45a
--- /dev/null
+++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+#===================================================================#
+# DEMrun script for ErgunTestMPI testcase
+# init ErgunTestMPI
+# Daniel Queteschiner - June 2014
+#===================================================================#
+
+#- source CFDEM env vars
+. ~/.bashrc
+
+#- include functions
+source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
+
+#--------------------------------------------------------------------------------#
+#- define variables
+casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
+logpath="$casePath"
+headerText="run_liggghts_init_DEM"
+logfileName="log_$headerText"
+solverName="in.liggghts_init"
+nrProcs="2"
+machineFileName="none" # yourMachinefileName | none
+#--------------------------------------------------------------------------------#
+
+#- call function to run DEM case
+parDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName
+