release on 2012-10-23_10-36-40

This commit is contained in:
cfdem
2012-10-23 10:36:40 +02:00
parent 93fcd16a45
commit 5fb9e6cd84
79 changed files with 3796 additions and 153 deletions

82
README
View File

@ -1,82 +0,0 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM. Note: this code is not part of OpenFOAM (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
CFDEM coupling provides an open source parallel coupled CFD-DEM framework
combining the strengths of LIGGGHTS DEM code and the Open Source
CFD package OpenFOAM(R)(*). The CFDEMcoupling toolbox allows to expand
standard CFD solvers of OpenFOAM(R)(*) to include a coupling to the DEM
code LIGGGHTS. In this toolbox the particle representation within the
CFD solver is organized by "cloud" classes. Key functionalities are organised
in sub-models (e.g. force models, data exchange models, etc.) which can easily
be selected and combined by dictionary settings.
The coupled solvers run fully parallel on distributed-memory clusters.
Features are:
- its modular approach allows users to easily implement new models
- its MPI parallelization enables to use it for large scale problems
- the "forum"_lws on CFD-DEM gives the possibility to exchange with other
users / developers
- the use of GIT allows to easily update to the latest version
- basic documentation is provided
The file structure:
- "src" directory including the source files of the coupling toolbox and models
- "applications" directory including the solver files for coupled CFD-DEM simulations
- "doc" directory including the documentation of CFDEMcoupling
- "tutorials" directory including basic tutorial cases showing the functionality
Details on installation are given on the "www.cfdem.com"
The functionality of this CFD-DEM framwork is described via "tutorial cases" showing
how to use different solvers and models.
CFDEMcoupling stands for Computational Fluid Dynamics (CFD) -
Discrete Element Method (DEM) coupling.
CFDEMcoupling is an open-source code, distributed freely under the terms of the
GNU Public License (GPL).
Core development of CFDEMcoupling is done by
Christoph Goniva and Christoph Kloss, both at DCS Computing GmbH, 2012
\*---------------------------------------------------------------------------*/
(*) "OpenFOAM(R)"_of is a registered trade mark of Silicon Graphics
International Corp. This offering is not affiliated, approved or endorsed by
Silicon Graphics International Corp., the producer of the OpenFOAM(R) software
and owner of the OpenFOAM(R) trademark.
\*---------------------------------------------------------------------------*/

View File

@ -93,7 +93,7 @@ int main(int argc, char *argv[])
fvVectorMatrix UEqn fvVectorMatrix UEqn
( (
fvm::ddt(U) fvm::ddt(voidfraction,U)
+ fvm::div(phi, U) + fvm::div(phi, U)
+ turbulence->divDevReff(U) + turbulence->divDevReff(U)
); );
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::laplacian(rUA, p) == fvc::div(phi) fvm::laplacian(rUA, p) == fvc::div(phi) + fvc::ddt(voidfraction)
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
@ -157,7 +157,8 @@ int main(int argc, char *argv[])
turbulence->correct(); turbulence->correct();
Info << "particleCloud.calcVelocityCorrection() " << endl; Info << "particleCloud.calcVelocityCorrection() " << endl;
particleCloud.calcVelocityCorrection(p,U,phiIB); volScalarField voidfractionNext=mesh.lookupObject<volScalarField>("voidfractionNext");
particleCloud.calcVelocityCorrection(p,U,phiIB,voidfractionNext);
runTime.write(); runTime.write();

View File

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
#include "solverDebugInfo.H" #include "solverDebugInfo.H"
particleCloud.clockM().stop("Coupling"); particleCloud.clockM().stop("Coupling");
particleCloud.clockM().start(10,"Flow"); particleCloud.clockM().start(16,"Flow");
// Pressure-velocity PISO corrector // Pressure-velocity PISO corrector
{ {
// Momentum predictor // Momentum predictor
@ -94,16 +94,15 @@ int main(int argc, char *argv[])
- fvm::Sp(Ksl/rho,U) - 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(); UEqn.relax();
if (momentumPredictor) if (momentumPredictor)
{ solve(UEqn);
//solve UEqn
if (modelType=="B")
solve(UEqn == - fvc::grad(p) + Ksl/rho*Us);
else
solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us);
}
// --- PISO loop // --- PISO loop
@ -114,15 +113,15 @@ int main(int argc, char *argv[])
{ {
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA)); surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
U = rUA*UEqn.H(); U = rUA*UEqn.H();
phi = fvc::interpolate(U*voidfraction) & mesh.Sf(); phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
//+ fvc::ddtPhiCorr(rUA, U, phi) + fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf()); surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS); surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
if (modelType=="A") if (modelType=="A")
rUAvoidfraction = volScalarField("(voidfraction2|A(U))",rUA*voidfraction*voidfraction); rUAvoidfraction = volScalarField("(voidfraction2|A(U))",rUA*voidfraction*voidfraction);
@ -156,7 +155,7 @@ int main(int argc, char *argv[])
} // end non-orthogonal corrector loop } // end non-orthogonal corrector loop
#include "continuityErrs.H" #include "continuityErrorPhiPU.H"
if (modelType=="B") if (modelType=="B")
U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA; U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA;

View File

@ -0,0 +1,3 @@
cfdemSolverPisoMS.C
EXE=$(FOAM_USER_APPBIN)/cfdemSolverPisoMS

View File

@ -0,0 +1,16 @@
EXE_INC = \
-I$(CFDEM_SRC_DIR)/lnInclude \
-I ../cfdemSolverPiso \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(CFDEM_SRC_DIR)/cfdTools \
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN)\
-lincompressibleRASModels \
-lincompressibleLESModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-l$(CFDEM_LIB_NAME)

View File

@ -0,0 +1,191 @@
/*---------------------------------------------------------------------------*\
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 <http://www.gnu.org/licenses/>.
Application
cfdemSolverPisoMS
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,
where additional functionality for CFD-DEM coupling is added.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"
#include "cfdemCloudMS.H"
#include "implicitCouple.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"
cfdemCloudMS particleCloud(mesh);
#include "checkModelType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readPISOControls.H"
#include "CourantNo.H"
// do particle stuff
Info << "- evolve()" << endl;
particleCloud.evolve(voidfraction,Us,U);
Info << "update Ksl.internalField()" << endl;
Ksl.internalField() = particleCloud.momCoupleM(0).impMomSource();
Ksl.correctBoundaryConditions();
// debug info
//Info << "totaldragforceEuler calculus" << endl;
//vector totaldragforceEuler(0,0,0);
//forAll(Ksl,cellI)
//{
// totaldragforceEuler += Ksl[cellI]*(Us[cellI]-U[cellI])/rho[cellI] * Ksl.mesh().V()[cellI];
//}
//Pout <<"totaldragforceEuler = "<< mag(totaldragforceEuler) << endl;
//Pout << "dv/dt =" << sum(fvc::ddt(voidfraction)) << endl;
//-----------
// Pressure-velocity PISO corrector
{
// Momentum predictor
fvVectorMatrix UEqn
(
fvm::ddt(voidfraction,U)
+ fvm::div(phi, U)
// + turbulence->divDevReff(U)
+ particleCloud.divVoidfractionTau(U, voidfraction)
==
- fvm::Sp(Ksl/rho,U)
);
UEqn.relax();
if (momentumPredictor)
{
//solve UEqn
if (modelType=="B")
solve(UEqn == - fvc::grad(p) + Ksl/rho*Us);
else
solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us);
}
// --- PISO loop
//for (int corr=0; corr<nCorr; corr++)
int nCorrSoph = nCorr + 5 * pow((1-particleCloud.dataExchangeM().timeStepFraction()),1);
for (int corr=0; corr<nCorrSoph; corr++)
{
volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
U = rUA*UEqn.H();
phi = fvc::interpolate(U*voidfraction) & mesh.Sf();
//+ fvc::ddtPhiCorr(rUA, U, phi)
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
if (modelType=="A")
rUAvoidfraction = volScalarField("(voidfraction2|A(U))",rUA*voidfraction*voidfraction);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::laplacian(rUAvoidfraction, p) == fvc::div(phiGes) + fvc::ddt(voidfraction)
);
pEqn.setReference(pRefCell, pRefValue);
if
(
corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phiGes -= pEqn.flux();
}
} // end non-orthogonal corrector loop
#include "continuityErrorPhiPU.H"
if (modelType=="B")
U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA;
else
U -= voidfraction*rUA*fvc::grad(p) - Ksl/rho*Us*rUA;
U.correctBoundaryConditions();
} // end piso loop
}
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -126,14 +126,14 @@ int main(int argc, char *argv[])
{ {
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA)); surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
U = rUA*UEqn.H(); U = rUA*UEqn.H();
phi = fvc::interpolate(U*voidfraction) & mesh.Sf(); phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
//+ fvc::ddtPhiCorr(rUA, U, phi) + fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf()); surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS); surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
if (modelType=="A") if (modelType=="A")
rUAvoidfraction = volScalarField("(voidfraction2|A(U))",rUA*voidfraction*voidfraction); rUAvoidfraction = volScalarField("(voidfraction2|A(U))",rUA*voidfraction*voidfraction);
@ -167,7 +167,7 @@ int main(int argc, char *argv[])
} // end non-orthogonal corrector loop } // end non-orthogonal corrector loop
#include "continuityErrs.H" #include "continuityErrorPhiPU.H"
if (modelType=="B") if (modelType=="B")
U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA; U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA;

View File

@ -162,6 +162,21 @@ In order to get the latest code version, please use the git repository at http:/
</P> </P>
<P>Reasonable example settings for the "couplingProperties" dictionary are given in the tutorial cases. <P>Reasonable example settings for the "couplingProperties" dictionary are given in the tutorial cases.
</P> </P>
<PRE>modelType
</PRE>
<P>"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 appliccability", JFM. "A" requres the use of the force models gradPForce and viscForce, whereas "B" requires the force model "Archimedes".
</P>
<PRE>couplingInterval
</PRE>
<P>The coupling interval determines the time passing between two CFD-DEM data exchanges.
</P>
<P>A useful procedure would be:
1) Set the DEM TS in the in.xxx according to the needs of the pure DEM problem.
2) Set the "couplingInterval", which refers to the DEM timesteps. Depending on the problem you will need to have a close (small couplingInterval) or loose coupling.
3) Choose the CFD timestep in the controlDict. it must be equal or smaller than the coupling time, otherwise you will get the error: "Error - TS bigger than coupling interval!".
</P>
<P>Example: DEMts=0.00001s, couplingInterval=10 exchange data (=couple) will happen every 0.0001s.
</P>
<HR> <HR>
<H4><A NAME = "1_5"></A>1.5 "liggghtsCommands" dictionary <H4><A NAME = "1_5"></A>1.5 "liggghtsCommands" dictionary

Binary file not shown.

View File

@ -131,6 +131,21 @@ In "sub-model properties" sub-dictionaries might be defined to specify model spe
Reasonable example settings for the "couplingProperties" dictionary are given in the tutorial cases. Reasonable example settings for the "couplingProperties" dictionary are given in the tutorial cases.
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 appliccability", JFM. "A" requres the use of the force models gradPForce and viscForce, whereas "B" requires the force model "Archimedes".
couplingInterval :pre
The coupling interval determines the time passing between two CFD-DEM data exchanges.
A useful procedure would be:
1) Set the DEM TS in the in.xxx according to the needs of the pure DEM problem.
2) Set the "couplingInterval", which refers to the DEM timesteps. Depending on the problem you will need to have a close (small couplingInterval) or loose coupling.
3) Choose the CFD timestep in the controlDict. it must be equal or smaller than the coupling time, otherwise you will get the error: "Error - TS bigger than coupling interval!".
Example: DEMts=0.00001s, couplingInterval=10 exchange data (=couple) will happen every 0.0001s.
:line :line
1.5 "liggghtsCommands" dictionary :h4,link(1_5) 1.5 "liggghtsCommands" dictionary :h4,link(1_5)
@ -404,6 +419,14 @@ Reasonable example settings for the "liggghtsCommands" dictionary are given in t

View File

@ -31,7 +31,7 @@ KochHillDragProps
<LI><I>voidfraction</I> = name of the finite volume voidfraction field <LI><I>voidfraction</I> = name of the finite volume voidfraction field
<LI><I>interpolation</I> = flag to use interolate interpolated voidfraction and fluid velocity values (normally off) <LI><I>interpolation</I> = flag to use interpolated voidfraction and fluid velocity values (normally off)
</UL> </UL>

View File

@ -26,7 +26,7 @@ KochHillDragProps
{U} = name of the finite volume fluid velocity field :ulb,l {U} = name of the finite volume fluid velocity field :ulb,l
{density} = name of the finite volume gravity field :l {density} = name of the finite volume gravity field :l
{voidfraction} = name of the finite volume voidfraction field :l {voidfraction} = name of the finite volume voidfraction field :l
{interpolation} = flag to use interolate interpolated voidfraction and fluid velocity values (normally off) :l {interpolation} = flag to use interpolated voidfraction and fluid velocity values (normally off) :l
:ule :ule
[Examples:] [Examples:]

Binary file not shown.

View File

@ -18,12 +18,15 @@ dividedProps
{ {
alphaMin number1; alphaMin number1;
scaleUpVol number2; scaleUpVol number2;
interpolation;
} }
</PRE> </PRE>
<UL><LI><I>number1</I> = mininmum limit for voidfraction <UL><LI><I>number1</I> = mininmum limit for voidfraction
<LI><I>number2</I> = diameter of the particle's representation is artificially increased according to <I>number2</I> * Vparticle, volume remains unaltered! <LI><I>number2</I> = diameter of the particle's representation is artificially increased according to <I>number2</I> * Vparticle, volume remains unaltered!
<LI><I>interpolation</I> = flag to interpolate voidfraction to particle positions (normally off)
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>

View File

@ -16,10 +16,12 @@ dividedProps
\{ \{
alphaMin number1; alphaMin number1;
scaleUpVol number2; scaleUpVol number2;
interpolation;
\} :pre \} :pre
{number1} = mininmum limit for voidfraction :ulb,l {number1} = mininmum limit for voidfraction :ulb,l
{number2} = diameter of the particle's representation is artificially increased according to {number2} * Vparticle, volume remains unaltered! :l {number2} = diameter of the particle's representation is artificially increased according to {number2} * Vparticle, volume remains unaltered! :l
{interpolation} = flag to interpolate voidfraction to particle positions (normally off) :l
:ule :ule
[Examples:] [Examples:]

View File

@ -1,5 +1,6 @@
cfdemCloud = cfdemCloud cfdemCloud = cfdemCloud
forceModels = subModels/forceModel forceModels = subModels/forceModel
forceModelsMS = subModels/forceModelMS
IOModels = subModels/IOModel IOModels = subModels/IOModel
voidFractionModels = subModels/voidFractionModel voidFractionModels = subModels/voidFractionModel
locateModels = subModels/locateModel locateModels = subModels/locateModel
@ -13,34 +14,56 @@ liggghtsCommandModels = subModels/liggghtsCommandModel
$(cfdemCloud)/cfdemCloud.C $(cfdemCloud)/cfdemCloud.C
derived/cfdemCloudIB/cfdemCloudIB.C derived/cfdemCloudIB/cfdemCloudIB.C
derived/cfdemCloudMS/cfdemCloudMS.C
$(forceModels)/forceModel/forceModel.C $(forceModels)/forceModel/forceModel.C
$(forceModels)/forceModel/newForceModel.C $(forceModels)/forceModel/newForceModel.C
$(forceModels)/noDrag/noDrag.C $(forceModels)/noDrag/noDrag.C
$(forceModels)/DiFeliceDrag/DiFeliceDrag.C $(forceModels)/DiFeliceDrag/DiFeliceDrag.C
$(forceModels)/DiFeliceDragNLift/DiFeliceDragNLift.C
$(forceModels)/GidaspowDrag/GidaspowDrag.C $(forceModels)/GidaspowDrag/GidaspowDrag.C
$(forceModels)/SchillerNaumannDrag/SchillerNaumannDrag.C $(forceModels)/SchillerNaumannDrag/SchillerNaumannDrag.C
$(forceModels)/Archimedes/Archimedes.C $(forceModels)/Archimedes/Archimedes.C
$(forceModels)/ArchimedesIB/ArchimedesIB.C $(forceModels)/ArchimedesIB/ArchimedesIB.C
$(forceModels)/interface/interface.C $(forceModels)/interface/interface.C
$(forceModels)/ShirgaonkarIB/ShirgaonkarIB.C $(forceModels)/ShirgaonkarIB/ShirgaonkarIB.C
$(forceModels)/fieldTimeAverage/fieldTimeAverage.C
$(forceModels)/fieldBound/fieldBound.C
$(forceModels)/volWeightedAverage/volWeightedAverage.C
$(forceModels)/totalMomentumExchange/totalMomentumExchange.C
$(forceModels)/KochHillDrag/KochHillDrag.C $(forceModels)/KochHillDrag/KochHillDrag.C
$(forceModels)/BeetstraDrag/multiphaseFlowBasic/multiphaseFlowBasic.C
$(forceModels)/BeetstraDrag/BeetstraDrag.C
$(forceModels)/LaEuScalarLiquid/LaEuScalarLiquid.C
$(forceModels)/LaEuScalarTemp/LaEuScalarTemp.C $(forceModels)/LaEuScalarTemp/LaEuScalarTemp.C
$(forceModels)/LaEuScalarDust/LaEuScalarDust.C
$(forceModels)/virtualMassForce/virtualMassForce.C $(forceModels)/virtualMassForce/virtualMassForce.C
$(forceModels)/gradPForce/gradPForce.C $(forceModels)/gradPForce/gradPForce.C
$(forceModels)/gradULiftForce/gradULiftForce.C
$(forceModels)/viscForce/viscForce.C $(forceModels)/viscForce/viscForce.C
$(forceModels)/MeiLift/MeiLift.C $(forceModels)/MeiLift/MeiLift.C
$(forceModels)/KochHillDragNLift/KochHillDragNLift.C
$(forceModels)/solidsPressureForce/solidsPressureForce.C
$(forceModels)/periodicPressure/periodicPressure.C
$(forceModels)/periodicPressureControl/periodicPressureControl.C
$(forceModels)/averageSlipVel/averageSlipVel.C
$(forceModelsMS)/forceModelMS/forceModelMS.C
$(forceModelsMS)/forceModelMS/newForceModelMS.C
$(forceModelsMS)/DiFeliceDragMS/DiFeliceDragMS.C
$(IOModels)/IOModel/IOModel.C $(IOModels)/IOModel/IOModel.C
$(IOModels)/IOModel/newIOModel.C $(IOModels)/IOModel/newIOModel.C
$(IOModels)/noIO/noIO.C $(IOModels)/noIO/noIO.C
$(IOModels)/basicIO/basicIO.C $(IOModels)/basicIO/basicIO.C
$(IOModels)/trackIO/trackIO.C $(IOModels)/trackIO/trackIO.C
$(IOModels)/sophIO/sophIO.C
$(voidFractionModels)/voidFractionModel/voidFractionModel.C $(voidFractionModels)/voidFractionModel/voidFractionModel.C
$(voidFractionModels)/voidFractionModel/newVoidFractionModel.C $(voidFractionModels)/voidFractionModel/newVoidFractionModel.C
$(voidFractionModels)/centreVoidFraction/centreVoidFraction.C $(voidFractionModels)/centreVoidFraction/centreVoidFraction.C
$(voidFractionModels)/dividedVoidFraction/dividedVoidFraction.C $(voidFractionModels)/dividedVoidFraction/dividedVoidFraction.C
$(voidFractionModels)/dividedVoidFractionMS/dividedVoidFractionMS.C
$(voidFractionModels)/bigParticleVoidFraction/bigParticleVoidFraction.C $(voidFractionModels)/bigParticleVoidFraction/bigParticleVoidFraction.C
$(voidFractionModels)/GaussVoidFraction/GaussVoidFraction.C $(voidFractionModels)/GaussVoidFraction/GaussVoidFraction.C
$(voidFractionModels)/IBVoidFraction/IBVoidFraction.C $(voidFractionModels)/IBVoidFraction/IBVoidFraction.C
@ -52,20 +75,22 @@ $(locateModels)/engineSearch/engineSearch.C
$(locateModels)/turboEngineSearch/turboEngineSearch.C $(locateModels)/turboEngineSearch/turboEngineSearch.C
$(locateModels)/engineSearchIB/engineSearchIB.C $(locateModels)/engineSearchIB/engineSearchIB.C
$(meshMotionModels)/meshMotionModel/meshMotionModel.C $(meshMotionModels)/meshMotionModel/meshMotionModel.C
$(meshMotionModels)/meshMotionModel/newMeshMotionModel.C $(meshMotionModels)/meshMotionModel/newMeshMotionModel.C
$(meshMotionModels)/noMeshMotion/noMeshMotion.C $(meshMotionModels)/noMeshMotion/noMeshMotion.C
$(meshMotionModels)/DEMdrivenMeshMotion/DEMdrivenMeshMotion.C
$(momCoupleModels)/momCoupleModel/momCoupleModel.C $(momCoupleModels)/momCoupleModel/momCoupleModel.C
$(momCoupleModels)/momCoupleModel/newMomCoupleModel.C $(momCoupleModels)/momCoupleModel/newMomCoupleModel.C
$(momCoupleModels)/explicitCouple/explicitCouple.C $(momCoupleModels)/explicitCouple/explicitCouple.C
$(momCoupleModels)/explicitCoupleSource/explicitCoupleSource.C
$(momCoupleModels)/implicitCouple/implicitCouple.C $(momCoupleModels)/implicitCouple/implicitCouple.C
$(momCoupleModels)/noCouple/noCouple.C $(momCoupleModels)/noCouple/noCouple.C
$(regionModels)/regionModel/regionModel.C $(regionModels)/regionModel/regionModel.C
$(regionModels)/regionModel/newRegionModel.C $(regionModels)/regionModel/newRegionModel.C
$(regionModels)/allRegion/allRegion.C $(regionModels)/allRegion/allRegion.C
$(regionModels)/differentialRegion/differentialRegion.C
$(dataExchangeModels)/dataExchangeModel/dataExchangeModel.C $(dataExchangeModels)/dataExchangeModel/dataExchangeModel.C
$(dataExchangeModels)/dataExchangeModel/newDataExchangeModel.C $(dataExchangeModels)/dataExchangeModel/newDataExchangeModel.C

View File

@ -24,4 +24,4 @@ LIB_LIBS = \
-llagrangian \ -llagrangian \
-lmpi_cxx \ -lmpi_cxx \
-L$(CFDEM_LIGGGHTS_SRC_DIR) \ -L$(CFDEM_LIGGGHTS_SRC_DIR) \
-l$(CFDEM_LIGGGHTS_LIB_NAME) \ -l$(CFDEM_LIGGGHTS_LIB_NAME)

View File

@ -372,34 +372,41 @@ bool Foam::cfdemCloud::evolve
Info << "\n Coupling..." << endl; Info << "\n Coupling..." << endl;
doCouple=true; doCouple=true;
clockM().start(5,"defineRegion");
if(verbose_) Info << "- defineRegion()" << endl; if(verbose_) Info << "- defineRegion()" << endl;
regionM().defineRegion(); regionM().defineRegion();
if(verbose_) Info << "defineRegion done." << endl; if(verbose_) Info << "defineRegion done." << endl;
clockM().stop("defineRegion");
// reset vol Fields // reset vol Fields
clockM().start(6,"resetVolFields");
if(verbose_) Info << "- resetVolFields()" << endl; if(verbose_) Info << "- resetVolFields()" << endl;
regionM().resetVolFields(Us); regionM().resetVolFields(Us);
if(verbose_) Info << "resetVolFields done." << endl; if(verbose_) Info << "resetVolFields done." << endl;
clockM().stop("resetVolFields");
if(verbose_) Info << "- getDEMdata()" << endl; if(verbose_) Info << "- getDEMdata()" << endl;
clockM().start(4,"getDEMdata"); clockM().start(7,"getDEMdata");
getDEMdata(); getDEMdata();
clockM().stop(); clockM().stop("getDEMdata");
if(verbose_) Info << "- getDEMdata done." << endl; if(verbose_) Info << "- getDEMdata done." << endl;
// search cellID of particles // search cellID of particles
clockM().start(5,"findCell"); clockM().start(8,"findCell");
if(verbose_) Info << "- findCell()" << endl; if(verbose_) Info << "- findCell()" << endl;
findCells(); findCells();
if(verbose_) Info << "findCell done." << endl; if(verbose_) Info << "findCell done." << endl;
clockM().stop("findCell"); clockM().stop("findCell");
// set void fraction field // set void fraction field
clockM().start(9,"setvoidFraction");
if(verbose_) Info << "- setvoidFraction()" << endl; if(verbose_) Info << "- setvoidFraction()" << endl;
voidFractionM().setvoidFraction(regionM().inRegion(),voidfractions_,particleWeights_,particleVolumes_); voidFractionM().setvoidFraction(regionM().inRegion(),voidfractions_,particleWeights_,particleVolumes_);
if(verbose_) Info << "setvoidFraction done." << endl; if(verbose_) Info << "setvoidFraction done." << endl;
clockM().stop("setvoidFraction");
// set particles velocity field // set particles velocity field
clockM().start(10,"setVectorAverage");
if(verbose_) Info << "- setVectorAverage(Us,velocities_,weights_)" << endl; if(verbose_) Info << "- setVectorAverage(Us,velocities_,weights_)" << endl;
averagingM().setVectorAverage averagingM().setVectorAverage
( (
@ -410,15 +417,18 @@ bool Foam::cfdemCloud::evolve
regionM().inRegion() regionM().inRegion()
); );
if(verbose_) Info << "setVectorAverage done." << endl; if(verbose_) Info << "setVectorAverage done." << endl;
clockM().stop("setVectorAverage");
// set particles forces // set particles forces
clockM().start(11,"setForce");
if(verbose_) Info << "- setForce(forces_)" << endl; if(verbose_) Info << "- setForce(forces_)" << endl;
setForces(); setForces();
if(verbose_) Info << "setForce done." << endl; if(verbose_) Info << "setForce done." << endl;
clockM().stop("setForce");
// get next force field // get next force field
clockM().start(12,"setParticleForceField");
if(verbose_) Info << "- setParticleForceField()" << endl; if(verbose_) Info << "- setParticleForceField()" << endl;
averagingM().setVectorSum averagingM().setVectorSum
( (
forceM(0).impParticleForces(), forceM(0).impParticleForces(),
@ -433,12 +443,12 @@ bool Foam::cfdemCloud::evolve
particleWeights_, particleWeights_,
regionM().inRegion() regionM().inRegion()
); );
if(verbose_) Info << "- setParticleForceField done." << endl; if(verbose_) Info << "- setParticleForceField done." << endl;
clockM().stop("setParticleForceField");
// write DEM data // write DEM data
if(verbose_) Info << " -giveDEMdata()" << endl; if(verbose_) Info << " -giveDEMdata()" << endl;
clockM().start(6,"giveDEMdata"); clockM().start(13,"giveDEMdata");
giveDEMdata(); giveDEMdata();
clockM().stop("giveDEMdata"); clockM().stop("giveDEMdata");
@ -450,6 +460,7 @@ bool Foam::cfdemCloud::evolve
}//end dataExchangeM().couple() }//end dataExchangeM().couple()
Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl; Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl;
clockM().start(14,"interpolateEulerFields");
// update voidFractionField // update voidFractionField
alpha.internalField() = voidFractionM().voidFractionInterp(); alpha.internalField() = voidFractionM().voidFractionInterp();
alpha.correctBoundaryConditions(); alpha.correctBoundaryConditions();
@ -457,12 +468,16 @@ bool Foam::cfdemCloud::evolve
// update particle velocity Field // update particle velocity Field
Us.internalField() = averagingM().UsInterp(); Us.internalField() = averagingM().UsInterp();
Us.correctBoundaryConditions(); Us.correctBoundaryConditions();
clockM().stop("interpolateEulerFields");
if(verbose_){ if(verbose_){
#include "debugInfo.H" #include "debugInfo.H"
} }
clockM().start(15,"dumpDEMdata");
// do particle IO // do particle IO
IOM().dumpDEMdata(); IOM().dumpDEMdata();
clockM().stop("dumpDEMdata");
}//end ignore }//end ignore
return doCouple; return doCouple;

View File

@ -141,7 +141,8 @@ void Foam::cfdemCloudIB::calcVelocityCorrection
( (
volScalarField& p, volScalarField& p,
volVectorField& U, volVectorField& U,
volScalarField& phiIB volScalarField& phiIB,
volScalarField& voidfraction
) )
{ {
label cellI=0; label cellI=0;
@ -174,7 +175,7 @@ void Foam::cfdemCloudIB::calcVelocityCorrection
} }
// make field divergence free // make field divergence free
solve(fvm::laplacian(phiIB) == fvc::div(U)); solve(fvm::laplacian(phiIB) == fvc::div(U) + fvc::ddt(voidfraction));
U=U-fvc::grad(phiIB); U=U-fvc::grad(phiIB);
U.correctBoundaryConditions(); U.correctBoundaryConditions();

View File

@ -82,7 +82,7 @@ public:
bool evolve(); bool evolve();
void calcVelocityCorrection(volScalarField&,volVectorField&,volScalarField&); // this could be moved to an IB mom couple model void calcVelocityCorrection(volScalarField&,volVectorField&,volScalarField&,volScalarField&); // this could be moved to an IB mom couple model
// Access // Access
vector angularVelocity(int); vector angularVelocity(int);

View File

@ -0,0 +1,273 @@
/*---------------------------------------------------------------------------*\
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 "cfdemCloudMS.H"
#include "voidFractionModel.H"
#include "forceModelMS.H"
#include "regionModel.H"
#include "locateModel.H"
#include "dataExchangeModel.H"
//#include "mpi.h" // only for debug reason
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
cfdemCloudMS::cfdemCloudMS
(
const fvMesh& mesh
)
:
cfdemCloud(mesh),
positionsCM_(NULL),
velocitiesCM_(NULL),
cellIDsCM_(NULL),
bodies_(NULL),
nrigids_(NULL),
exCM_(NULL),
eyCM_(NULL),
ezCM_(NULL),
VclumpCM_(NULL),
SclumpCM_(NULL),
scalingCM_(NULL),
typeCM_(NULL),
Cclump_ex_(NULL),
Cclump_ey_(NULL),
impForcesCM_(NULL),
expForcesCM_(NULL),
DEMForcesCM_(NULL),
numberOfClumps_(-1),
numberOfClumpsChanged_(false),
forceModels_(couplingProperties_.lookup("forceModelsMS"))
{
forceModel_ = new autoPtr<forceModelMS>[nrForceModels()];
for (int i=0;i<nrForceModels();i++)
{
forceModel_[i] = forceModelMS::New
(
couplingProperties_,
*this,
forceModels_[i]
);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
cfdemCloudMS::~cfdemCloudMS()
{
delete positionsCM_;
delete velocitiesCM_;
delete cellIDsCM_;
delete bodies_;
delete nrigids_;
delete exCM_;
delete eyCM_;
delete ezCM_;
delete VclumpCM_;
delete SclumpCM_;
delete scalingCM_;
delete typeCM_;
delete Cclump_ex_;
delete Cclump_ey_;
delete impForcesCM_;
delete expForcesCM_;
delete DEMForcesCM_;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// PUBLIC MEMBER FUNCTIONS
void cfdemCloudMS::getDEMdata()
{
cfdemCloud::getDEMdata();
// update NClumpTypes in data exch. model
//dataExchangeM().checkNClumpTypes();
dataExchangeM().getData("xcm","vector-multisphere",positionsCM_); // position of the centre of mass
dataExchangeM().getData("vcm","vector-multisphere",velocitiesCM_); // velocity of the centre of mass
dataExchangeM().getData("body","scalar-atom",bodies_); // clump-particle connex
dataExchangeM().getData("nrigid","scalar-multisphere",nrigids_); // # particles in clump
dataExchangeM().getData("ex_space","vector-multisphere",exCM_); // axis of inertia
dataExchangeM().getData("ey_space","vector-multisphere",eyCM_); // axis of inertia
dataExchangeM().getData("ez_space","vector-multisphere",ezCM_); // axis of inertia
// dataExchangeM().getScalarData("Vclump",VclumpCM_); // Volume of the clump
// dataExchangeM().getScalarData("Sclump",SclumpCM_); // surface area of the clump
// dataExchangeM().getScalarData("scaling",scalingCM_); // scaling of the clump
// dataExchangeM().getScalarData("typeCM",typeCM_); // type of the clump
// dataExchangeM().getScalarData("Cclump_ex",Cclump_ex_); // cross section of the clump in ex normal direction
// dataExchangeM().getScalarData("Cclump_ey",Cclump_ey_); // cross section of the clump in ey normal direction
// calc Saequi, surface area of the vol aequivalent sphere
// Saequi=pi*pow(6*VclumpCM_/pi,2./3.);
// calc Caequi, cross section of the vol aequivalent sphere
// Caequi=Saequi/4;
}
void Foam::cfdemCloudMS::giveDEMdata()
{
for(int index = 0;index < numberOfClumps(); ++index)
{
for(int i=0;i<3;i++){
impForcesCM()[index][i] += expForcesCM()[index][i] + DEMForcesCM()[index][i];
}
}
if(forceM(0).coupleForce()) dataExchangeM().giveData("dragforce_cm","vector-multisphere",impForcesCM());
if(verbose_) Info << "giveDEMdata done." << endl;
}
bool cfdemCloudMS::evolve
(
volScalarField& alpha,
volVectorField& Us,
volVectorField& U
)
{
if(cfdemCloud::evolve(alpha,Us,U)) return true;
return false;
}
bool cfdemCloudMS::reAllocArrays() const
{
if(cfdemCloud::reAllocArrays())
{
int nClumpTypes = dataExchangeM().nClumpTypes();
// get arrays of new length
dataExchangeM().allocateArray(positionsCM_,0,3,"nbodies");
dataExchangeM().allocateArray(velocitiesCM_,0,3,"nbodies");
dataExchangeM().allocateArray(cellIDsCM_,0,1,"nbodies");
dataExchangeM().allocateArray(bodies_,0,3);
dataExchangeM().allocateArray(nrigids_,0,1,"nbodies");
dataExchangeM().allocateArray(exCM_,0,3,"nbodies");
dataExchangeM().allocateArray(eyCM_,0,3,"nbodies");
dataExchangeM().allocateArray(ezCM_,0,3,"nbodies");
dataExchangeM().allocateArray(VclumpCM_,0,3,nClumpTypes);
dataExchangeM().allocateArray(SclumpCM_,0,3,nClumpTypes);
dataExchangeM().allocateArray(scalingCM_,0,3,"nbodies");
dataExchangeM().allocateArray(typeCM_,0,3,"nbodies");
dataExchangeM().allocateArray(Cclump_ex_,0,3,nClumpTypes);
dataExchangeM().allocateArray(Cclump_ey_,0,3,nClumpTypes);
dataExchangeM().allocateArray(impForcesCM_,0,3,"nbodies");
dataExchangeM().allocateArray(expForcesCM_,0,3,"nbodies");
dataExchangeM().allocateArray(DEMForcesCM_,0,3,"nbodies");
return true;
}
return false;
}
void Foam::cfdemCloudMS::setNumberOfParticles(int nP)
{
cfdemCloud::setNumberOfParticles(nP);
int nC = dataExchangeM().getNumberOfClumps();
if(nC != numberOfClumps())
{
numberOfClumpsChanged_ = true;
numberOfClumps_ = nC;
}
}
void Foam::cfdemCloudMS::findCells()
{
cfdemCloud::findCells();
locateM().findCell(regionM().inRegion(),positionsCM_,cellIDsCM_,numberOfClumps());
}
void Foam::cfdemCloudMS::setForces()
{
cfdemCloud::setForces();
resetArray(impForces_,numberOfParticles(),3);
resetArray(expForces_,numberOfParticles(),3);
resetArray(DEMForces_,numberOfParticles(),3);
for (int i=0;i<cfdemCloudMS::nrForceModels();i++) cfdemCloudMS::forceM(i).setForce(regionM().inRegion(),impForces_,expForces_,DEMForces_);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// PUBLIC MEMBER FUNCTIONS
vector Foam::cfdemCloudMS::positionCM(int index)
{
vector pos;
for(int i=0;i<3;i++) pos[i] = positionsCM()[index][i];
return pos;
}
vector Foam::cfdemCloudMS::velocityCM(int index)
{
vector vel;
for(int i=0;i<3;i++) vel[i] = velocitiesCM()[index][i];
return vel;
}
label Foam::cfdemCloudMS::cellIDCM(int index)
{
return cellIDsCM_[index][0];
}
label Foam::cfdemCloudMS::body(int index)
{
return bodies_[0][index];
}
label Foam::cfdemCloudMS::nrigid(int index)
{
return nrigids_[0][index];
}
const forceModel& Foam::cfdemCloudMS::forceM(int i)
{
return forceModel_[i];
}
int Foam::cfdemCloudMS::nrForceModels()
{
return forceModels_.size();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,160 @@
/*---------------------------------------------------------------------------*\
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
Foam::cfdemCloudMS derived from cfdemCloud
Description
cloud class managing DEM data for CFD-DEM coupling including multi-sphere
functionality
SourceFiles
cfdemCloudMS.C
\*---------------------------------------------------------------------------*/
#ifndef cfdemCloudMS_H
#define cfdemCloudMS_H
#include "cfdemCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cfdemCloudMS Declaration
\*---------------------------------------------------------------------------*/
class cfdemCloudMS
:
public cfdemCloud
{
private:
mutable double **positionsCM_;
mutable double **velocitiesCM_;
mutable double **cellIDsCM_;
mutable int **bodies_;
mutable int **nrigids_;
mutable double **exCM_;
mutable double **eyCM_;
mutable double **ezCM_;
mutable double **VclumpCM_;
mutable double **SclumpCM_;
mutable double **scalingCM_;
mutable double **typeCM_;
mutable double **Cclump_ex_;
mutable double **Cclump_ey_;
mutable double **impForcesCM_;
mutable double **expForcesCM_;
mutable double **DEMForcesCM_;
int numberOfClumps_;
bool numberOfClumpsChanged_;
const wordList forceModels_;
autoPtr<class forceModelMS>* forceModel_;
// Private member functions
void getDEMdata();
void giveDEMdata();
bool reAllocArrays() const;
void setNumberOfParticles(int);
void findCells();
void setForces();
public:
// Constructors
//- Construct from components
cfdemCloudMS
(
const fvMesh& mesh
);
// Destructor
virtual ~cfdemCloudMS();
// Member Functions
// Access
vector positionCM(int);
vector velocityCM(int);
label cellIDCM(int);
label body(int);
label nrigid(int);
inline double **& positionsCM() const;
inline double **& velocitiesCM() const;
inline double **& impForcesCM() const;
inline double **& expForcesCM() const;
inline double **& DEMForcesCM() const;
inline int numberOfClumps() const;
inline bool numberOfClumpsChanged() const;
const forceModel& forceM(int);
int nrForceModels();
bool evolve(volScalarField&,volVectorField&,volVectorField&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "cfdemCloudMSI.H"
#endif
// ************************************************************************* //

View File

@ -46,6 +46,19 @@ export CFDEM_LIB_NAME=lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
#- path to test harness #- path to test harness
export CFDEM_TEST_HARNESS_PATH=$CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION export CFDEM_TEST_HARNESS_PATH=$CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
#------------------------------------------------------------------------------
#- settings for lpp postproc tool
#------------------------------------------------------------------------------
#- nr of procs for lpp tool
export CFDEM_LPP_NPROCS=1
#- nr of procs for lpp tool
export CFDEM_LPP_CHUNKSIZE=1
#- shortcut to run lpp
alias lpp='python -i $CFDEM_LPP_DIR/lpp.py --cpunum $CFDEM_LPP_NPROCS --chunksize $CFDEM_LPP_CHUNKSIZE'
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#- aliases for easy navigation (no changes necessary) #- aliases for easy navigation (no changes necessary)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -96,9 +109,6 @@ export -f cfdemLiggghts
cfdemLiggghtsPar() { mpirun -np $2 $CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME < $1; } cfdemLiggghtsPar() { mpirun -np $2 $CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME < $1; }
export -f cfdemLiggghtsPar export -f cfdemLiggghtsPar
#- shortcut to run lpp
alias lpp='python -i $CFDEM_LPP_DIR/lpp.py'
# check if the directory exists # check if the directory exists
if [ -d "$CFDEM_PROJECT_USER_DIR" ]; then if [ -d "$CFDEM_PROJECT_USER_DIR" ]; then
: :

View File

@ -25,6 +25,7 @@ checkDirComment "$CFDEM_LIGGGHTS_SRC_DIR" '$CFDEM_LIGGGHTS_SRC_DIR' "yes"
checkDirComment "$CFDEM_PROJECT_DIR" '$CFDEM_PROJECT_DIR' "yes" checkDirComment "$CFDEM_PROJECT_DIR" '$CFDEM_PROJECT_DIR' "yes"
checkDirComment "$CFDEM_PROJECT_USER_DIR" '$CFDEM_PROJECT_USER_DIR' "no" checkDirComment "$CFDEM_PROJECT_USER_DIR" '$CFDEM_PROJECT_USER_DIR' "no"
checkDirComment "$CFDEM_SRC_DIR" '$CFDEM_SRC_DIR' "yes" checkDirComment "$CFDEM_SRC_DIR" '$CFDEM_SRC_DIR' "yes"
checkDirComment "$CFDEM_LIGGGHTS_SRC_DIR" '$CFDEM_LIGGGHTS_SRC_DIR' "yes"
checkDirComment "$CFDEM_LPP_DIR" '$CFDEM_LPP_DIR' "yes" checkDirComment "$CFDEM_LPP_DIR" '$CFDEM_LPP_DIR' "yes"
checkDirComment "$CFDEM_PIZZA_DIR" '$CFDEM_PIZZA_DIR' "no" checkDirComment "$CFDEM_PIZZA_DIR" '$CFDEM_PIZZA_DIR' "no"
checkDirComment "$CFDEM_TEST_HARNESS_PATH" '$CFDEM_TEST_HARNESS_PATH' "no" checkDirComment "$CFDEM_TEST_HARNESS_PATH" '$CFDEM_TEST_HARNESS_PATH' "no"

View File

@ -26,8 +26,9 @@ logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
logfileName="log_compileCFDEMcoupling_src" #alternative: logfileName="log_compileLIGGGHTS_$NOW" logfileName="log_compileCFDEMcoupling_src" #alternative: logfileName="log_compileLIGGGHTS_$NOW"
casePath="$CFDEM_SRC_DIR" casePath="$CFDEM_SRC_DIR"
headerText="$logfileName""-$NOW" headerText="$logfileName""-$NOW"
#doClean="$1" # "" | "noClean"
#--------------------------------------------------------------------------------# #--------------------------------------------------------------------------------#
compileLib $logpath $logfileName $casePath $headerText compileLib $logpath $logfileName $casePath $headerText #$doClean
#================================================================================# #================================================================================#
# compile solvers # compile solvers
@ -42,7 +43,7 @@ do
casePath="$CFDEM_SOLVER_DIR/$solverName" casePath="$CFDEM_SOLVER_DIR/$solverName"
headerText="$logfileName""_$solverName""-$NOW" headerText="$logfileName""_$solverName""-$NOW"
#--------------------------------------------------------------------------------# #--------------------------------------------------------------------------------#
compileSolver $logpath $logfileName $casePath $headerText compileSolver $logpath $logfileName $casePath $headerText #$doClean
done done
echo "Note: the list of solvers compiled might be incomplete." echo "Note: the list of solvers compiled might be incomplete."

View File

@ -46,6 +46,19 @@ setenv CFDEM_LIB_NAME lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
#- path to test harness #- path to test harness
setenv CFDEM_TEST_HARNESS_PATH $CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION setenv CFDEM_TEST_HARNESS_PATH $CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
#------------------------------------------------------------------------------
#- settings for lpp postproc tool
#------------------------------------------------------------------------------
#- nr of procs for lpp tool
setenv CFDEM_LPP_NPROCS 4
#- nr of procs for lpp tool
setenv CFDEM_LPP_CHUNKSIZE 1
#- shortcut to run lpp
alias lpp 'python -i $CFDEM_LPP_DIR/lpp.py --cpunum $CFDEM_LPP_NPROCS --chunksize $CFDEM_LPP_CHUNKSIZE \!:1'
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#- aliases for easy navigation (no changes necessary) #- aliases for easy navigation (no changes necessary)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -18,6 +18,7 @@ compileLib()
logfileName="$2" logfileName="$2"
casePath="$3" casePath="$3"
headerText="$4" headerText="$4"
#doClean="$5"
#--------------------------------------------------------------------------------# #--------------------------------------------------------------------------------#
#- clean up old log file #- clean up old log file
@ -36,8 +37,10 @@ compileLib()
echo 2>&1 | tee -a $logpath/$logfileName echo 2>&1 | tee -a $logpath/$logfileName
#- wclean and wmake #- wclean and wmake
rmdepall 2>&1 | tee -a $logpath/$logfileName #if [ $doClean != "noClean" ]; then
wclean 2>&1 | tee -a $logpath/$logfileName rmdepall 2>&1 | tee -a $logpath/$logfileName
wclean 2>&1 | tee -a $logpath/$logfileName
#fi
wmake libso 2>&1 | tee -a $logpath/$logfileName wmake libso 2>&1 | tee -a $logpath/$logfileName
#- keep terminal open #- keep terminal open
@ -56,6 +59,7 @@ compileSolver()
logfileName="$2" logfileName="$2"
casePath="$3" casePath="$3"
headerText="$4" headerText="$4"
#doClean="$5"
#--------------------------------------------------------------------------------# #--------------------------------------------------------------------------------#
#- clean up old log file #- clean up old log file
@ -74,8 +78,10 @@ compileSolver()
echo 2>&1 | tee -a $logpath/$logfileName echo 2>&1 | tee -a $logpath/$logfileName
#- wclean and wmake #- wclean and wmake
rmdepall 2>&1 | tee -a $logpath/$logfileName #if [ $doClean != "noClean" ]; then
wclean 2>&1 | tee -a $logpath/$logfileName rmdepall 2>&1 | tee -a $logpath/$logfileName
wclean 2>&1 | tee -a $logpath/$logfileName
#fi
wmake 2>&1 | tee -a $logpath/$logfileName wmake 2>&1 | tee -a $logpath/$logfileName
#- keep terminal open #- keep terminal open
@ -118,6 +124,47 @@ compileLIGGGHTS()
} }
#==================================# #==================================#
#==================================#
#- function to compile a lammps lib
compileLMPlib()
{
#--------------------------------------------------------------------------------#
#- define variables
logpath="$1"
logfileName="$2"
headerText="$3"
makeFileName="$4"
libraryPath="$5"
#--------------------------------------------------------------------------------#
#- clean up old log file
rm $logpath/$logfileName
#- change path
cd $libraryPath
#- header
echo 2>&1 | tee -a $logpath/$logfileName
echo "// $headerText //" 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- write path
pwd 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- clean up
echo "make clean" 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
make -f $makeFileName clean 2>&1 | tee -a $logpath/$logfileName
#- compile
echo "make" 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
make -f $makeFileName 2>&1 | tee -a $logpath/$logfileName
}
#==================================#
#==================================# #==================================#
#- function to run a DEM case #- function to run a DEM case
@ -156,6 +203,50 @@ DEMrun()
} }
#==================================# #==================================#
#==================================#
#- function to run a DEM case in parallel
parDEMrun()
{
#--------------------------------------------------------------------------------#
#- define variables
logpath="$1"
logfileName="$2"
casePath="$3"
headerText="$4"
solverName="$5"
nrProcs="$6"
machineFileName="$7"
debugMode="$8"
#--------------------------------------------------------------------------------#
#- clean up old log file
rm $logpath/$logfileName
#- change path
cd $casePath/DEM
#- header
echo 2>&1 | tee -a $logpath/$logfileName
echo "// $headerText //" 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- write path
pwd 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- run applictaion
if [ $machineFileName == "none" ]; then
mpirun -np $nrProcs $debugMode $CFDEM_LIGGGHTS_SRC_DIR/$CFDEM_LIGGGHTS_LIB_NAME < $solverName 2>&1 | tee -a $logpath/$logfileName
else
mpirun -machinefile $machineFileName -np $nrProcs $debugMode $CFDEM_LIGGGHTS_SRC_DIR/$CFDEM_LIGGGHTS_LIB_NAME < $solverName 2>&1 | tee -a $logpath/$logfileName
fi
#- keep terminal open (if started in new terminal)
#read
}
#==================================#
#==================================# #==================================#
#- function to run a CFD case #- function to run a CFD case

View File

@ -267,7 +267,9 @@ bool Foam::twoWayMPI::couple() const
setNumberOfParticles(newNpart); setNumberOfParticles(newNpart);
// re-allocate arrays of cloud // re-allocate arrays of cloud
particleCloud_.clockM().start(4,"LIGGGHTS_reallocArrays");
particleCloud_.reAllocArrays(); particleCloud_.reAllocArrays();
particleCloud_.clockM().stop("LIGGGHTS_reallocArrays");
} }
return coupleNow; return coupleNow;

View File

@ -75,6 +75,8 @@ KochHillDrag::KochHillDrag
if (propsDict_.found("verbose")) verbose_=true; if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true; if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("interpolation")) interpolation_=true; if (propsDict_.found("interpolation")) interpolation_=true;
// Note: dprim=ds/scale_
if (propsDict_.found("scale")) if (propsDict_.found("scale"))
scale_=scalar(readScalar(propsDict_.lookup("scale"))); scale_=scalar(readScalar(propsDict_.lookup("scale")));
} }
@ -126,7 +128,6 @@ void KochHillDrag::setForce
{ {
if(mask[index][0]) if(mask[index][0])
{ {
cellI = particleCloud_.cellIDs()[index][0]; cellI = particleCloud_.cellIDs()[index][0];
drag = vector(0,0,0); drag = vector(0,0,0);
@ -137,6 +138,10 @@ void KochHillDrag::setForce
position = particleCloud_.position(index); position = particleCloud_.position(index);
voidfraction = voidfractionInterpolator_.interpolate(position,cellI); voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
Ufluid = UInterpolator_.interpolate(position,cellI); Ufluid = UInterpolator_.interpolate(position,cellI);
//Ensure interpolated void fraction to be meaningful
// Info << " --> voidfraction: " << voidfraction << endl;
if(voidfraction>1.00) voidfraction = 1.00;
if(voidfraction<0.40) voidfraction = 0.40;
}else }else
{ {
voidfraction = particleCloud_.voidfraction(index); voidfraction = particleCloud_.voidfraction(index);
@ -162,8 +167,12 @@ void KochHillDrag::setForce
scalar F0=0.; scalar F0=0.;
if(volumefraction < 0.4) if(volumefraction < 0.4)
{ {
F0 = (1+3*sqrt((volumefraction)/2)+135/64*volumefraction*log(volumefraction)+16.14*volumefraction)/ F0 = (1+3*sqrt((volumefraction)/2)+135/64*volumefraction*log(volumefraction)
(1+0.681*volumefraction-8.48*sqr(volumefraction)+8.16*volumefraction*volumefraction*volumefraction); +16.14*volumefraction
)/
(1+0.681*volumefraction-8.48*sqr(volumefraction)
+8.16*volumefraction*volumefraction*volumefraction
);
} else { } else {
F0 = 10*volumefraction/(voidfraction*voidfraction*voidfraction); F0 = 10*volumefraction/(voidfraction*voidfraction*voidfraction);
} }
@ -171,12 +180,14 @@ void KochHillDrag::setForce
// calc model coefficient F3 // calc model coefficient F3
scalar F3 = 0.0673+0.212*volumefraction+0.0232/pow(voidfraction,5); scalar F3 = 0.0673+0.212*volumefraction+0.0232/pow(voidfraction,5);
// calc model coefficient beta //Calculate F in the formulation of van der Hoef et al. (JFM 528:233-254)
scalar beta = 18*nuf*rho*voidfraction*voidfraction*volumefraction/(ds/scale_*ds/scale_)* scalar F = voidfraction * (F0 + 0.5*F3*Rep);
(F0 + 0.5*F3*Rep);
// calc drag model coefficient betaP
scalar betaP = 18.*nuf*rho/(ds/scale_*ds/scale_)*voidfraction*F;
// calc particle's drag // calc particle's drag
drag = Vs*beta/volumefraction*Ur; drag = Vs*betaP*Ur;
if (modelType_=="B") if (modelType_=="B")
drag /= voidfraction; drag /= voidfraction;

View File

@ -0,0 +1,232 @@
/*---------------------------------------------------------------------------*\
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 "DiFeliceDragMS.H"
#include "addToRunTimeSelectionTable.H"
//#include "mpi.h"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(DiFeliceDragMS, 0);
addToRunTimeSelectionTable
(
forceModelMS,
DiFeliceDragMS,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
DiFeliceDragMS::DiFeliceDragMS
(
const dictionary& dict,
cfdemCloudMS& sm
)
:
forceModelMS(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
interpolation_(false),
//sphereToClump_(readScalar(propsDict_.lookup("sphereToClump")))
dH_(readScalar(propsDict_.lookup("hydraulicDiameter")))
{
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;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
DiFeliceDragMS::~DiFeliceDragMS()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void DiFeliceDragMS::setForce
(
double** const& mask,
double**& impForces,
double**& expForces,
double**& DEMForces
) const
{
// get viscosity field
#ifdef comp
const volScalarField& nufField = cloudRefMS().turbulence().mu() / rho_;
#else
const volScalarField& nufField = cloudRefMS().turbulence().nu();
#endif
interpolationCellPoint<vector> UInterpolator(U_);
interpolationCellPoint<scalar> voidfractionInterpolator(voidfraction_);
vector U(0,0,0);
vector position(0,0,0);
scalar voidfraction(1);
vector Us(0,0,0);
vector Ur(0,0,0);
scalar ds(0);
scalar nuf(0);
scalar rho(0);
scalar magUr(0);
scalar Rep(0);
scalar Cd(0);
cloudRefMS().resetArray(cloudRefMS().expForcesCM(),cloudRefMS().numberOfClumps(),3);
cloudRefMS().resetArray(cloudRefMS().impForcesCM(),cloudRefMS().numberOfClumps(),3);
for(int index = 0;index < cloudRefMS().numberOfClumps(); index++)
{
//if(mask[index][0]) // would have to be transformed from body ID to particle ID
//{
vector drag(0,0,0);
label cellI = cloudRefMS().cellIDCM(index);
if (cellI > -1) // particle Found
{
if(interpolation_)
{
position = cloudRefMS().positionCM(index);
U = UInterpolator.interpolate(position,cellI);
voidfraction = voidfractionInterpolator.interpolate(position,cellI);
}else
{
U = U_[cellI];
voidfraction = voidfraction_[cellI];
}
Us = cloudRefMS().velocityCM(index);
Ur = U-Us;
//ds = 2*cloudRefMS().radius(index)/sphereToClump_; // scale from particle diameter
ds = dH_; // use dict defined diameter
nuf = nufField[cellI];
rho = rho_[cellI];
magUr = mag(Ur);
Rep = 0;
Cd = 0;
scalar phi(0);
scalar phiN(0);
if (magUr > 0)
{
// calc particle Re Nr
Rep = ds*voidfraction*magUr/nuf;
// calc fluid drag Coeff
// phi=1; //AsurfAequi/Asurf;
// phiN=1; //AcrosssecAequi/Acrosssec;
// paper uses different Re definition!?
// Cd=8/(Rep*sqrt(phiN))+16/(Rep*sqrt(phi))+3/(sqrt(Rep)*pow(phi,0.75))+0.42*pow(10,(-0.4*pow(log(phi),0.2)))/phiN;
// calc fluid drag Coeff
Cd = sqr(0.63 + 4.8/sqrt(Rep));
// calc model coefficient Xi
scalar Xi = 3.7 - 0.65 * exp(-sqr(1.5-log10(Rep))/2);
// calc particle's drag
drag = 0.125*Cd*rho*M_PI*ds*ds*pow(voidfraction,(2-Xi))*magUr*Ur;
if (modelType_=="B")
drag /= voidfraction;
}
if(verbose_ && index >=0 && index <10)
{
Info << "index = " << index << endl;
Info << "Us = " << Us << endl;
Info << "Ur = " << Ur << endl;
Info << "ds = " << ds << endl;
Info << "rho = " << rho << endl;
Info << "nuf = " << nuf << endl;
Info << "voidfraction = " << voidfraction << endl;
Info << "Rep = " << Rep << endl;
Info << "Cd = " << Cd << endl;
Info << "drag = " << drag << endl;
}
}
// set force on bodies
if(treatExplicit_) for(int j=0;j<3;j++) cloudRefMS().expForcesCM()[index][j] += drag[j];
else for(int j=0;j<3;j++) cloudRefMS().impForcesCM()[index][j] += drag[j];
//}
}
// set force on particles
int nrigidC(-1);
label ind(-1);
for(int index = 0;index < cloudRefMS().numberOfParticles(); index++)
{
if (particleCloud_.cellIDs()[index][0] > -1) // particle Found
{
ind=cloudRefMS().body(index);
nrigidC=cloudRefMS().nrigid(ind);
if (nrigidC <= 0)
{
Warning <<"A BUG occurred in DiFeliceDragMS::setForce!!! nrigidC = " << nrigidC <<", ind = " << ind <<", index=" << index <<"\n" << endl;
nrigidC = 1000;
}
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += cloudRefMS().expForcesCM()[ind][j] / nrigidC;
else for(int j=0;j<3;j++) impForces[index][j] += cloudRefMS().impForcesCM()[ind][j] / nrigidC;
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
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
DiFeliceDragMS
SourceFiles
DiFeliceDragMS.C
\*---------------------------------------------------------------------------*/
#ifndef DiFeliceDragMS_H
#define DiFeliceDragMS_H
#include "cfdemCloudMS.H"
#include "forceModelMS.H"
#include "interpolationCellPoint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class DiFeliceDragMS Declaration
\*---------------------------------------------------------------------------*/
class DiFeliceDragMS
:
public forceModelMS
{
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
//scalar sphereToClump_; // ratio of sphere radius to clump radius
scalar dH_; // hydraulic diameter
public:
//- Runtime type information
TypeName("DiFeliceDragMS");
// Constructors
//- Construct from components
DiFeliceDragMS
(
const dictionary& dict,
cfdemCloudMS& sm
);
// Destructor
~DiFeliceDragMS();
// Member Functions
void setForce
(
double** const& mask,
double**&,
double**&,
double**&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,76 @@
/*---------------------------------------------------------------------------*\
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 "forceModelMS.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(forceModelMS, 0);
defineRunTimeSelectionTable(forceModelMS, dictionary);
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
forceModelMS::forceModelMS
(
const dictionary& dict,
cfdemCloudMS& sm
)
:
forceModel(dict,sm),
particleCloudMS_(sm)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
forceModelMS::~forceModelMS()
{}
// * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * //
cfdemCloudMS& forceModelMS::cloudRefMS() const
{
return particleCloudMS_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
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
forceModelMS
SourceFiles
forceModelMS.C
\*---------------------------------------------------------------------------*/
#ifndef forceModelMS_H
#define forceModelMS_H
#include "fvCFD.H"
#include "cfdemCloudMS.H"
#include "forceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class forceModelMS Declaration
\*---------------------------------------------------------------------------*/
class forceModelMS
:
public forceModel
{
protected:
cfdemCloudMS& particleCloudMS_;
public:
//- Runtime type information
TypeName("forceModelMS");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
forceModelMS,
dictionary,
(
const dictionary& dict,
cfdemCloudMS& sm
),
(dict,sm)
);
// Constructors
//- Construct from components
forceModelMS
(
const dictionary& dict,
cfdemCloudMS& sm
);
// Destructor
virtual ~forceModelMS();
// Selector
static autoPtr<forceModelMS> New
(
const dictionary& dict,
cfdemCloudMS& sm,
word forceType
);
// Member Functions
// Access
cfdemCloudMS& cloudRefMS() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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 "forceModelMS.H"
#include "DiFeliceDrag.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
autoPtr<forceModelMS> forceModelMS::New
(
const dictionary& dict,
cfdemCloudMS& sm,
word forceType
)
{
Info<< "Selecting forceModelMS "
<< forceType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(forceType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "forceModelMS::New(const dictionary&, const spray&) : "
<< endl
<< " unknown forceModelType type "
<< forceType
<< ", constructor not in hash table" << endl << endl
<< " Valid forceModelMS types are :"
<< endl;
Info<< dictionaryConstructorTablePtr_->toc()
<< abort(FatalError);
}
return autoPtr<forceModelMS>(cstrIter()(dict,sm));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -69,12 +69,18 @@ dividedVoidFraction::dividedVoidFraction
alphaMin_(readScalar(propsDict_.lookup("alphaMin"))), alphaMin_(readScalar(propsDict_.lookup("alphaMin"))),
alphaLimited_(0), alphaLimited_(0),
tooMuch_(0.0), tooMuch_(0.0),
scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))) scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))),
interpolation_(false)
{ {
maxCellsPerParticle_ = 29; maxCellsPerParticle_ = 29;
if(scaleUpVol_ > 1.3 || scaleUpVol_ < 1){ FatalError<< "scaleUpVol shloud be > 1 and < 1.3 !!!" << abort(FatalError); } if(scaleUpVol_ > 1.3 || scaleUpVol_ < 1){ FatalError<< "scaleUpVol shloud be > 1 and < 1.3 !!!" << abort(FatalError); }
if(alphaMin_ > 1 || alphaMin_ < 0.01){ FatalError<< "alphaMin shloud be > 1 and < 0.01 !!!" << abort(FatalError); } if(alphaMin_ > 1 || alphaMin_ < 0.01){ FatalError<< "alphaMin shloud be > 1 and < 0.01 !!!" << abort(FatalError); }
if (propsDict_.found("interpolation")){
interpolation_=true;
Warning << "interpolation for dividedVoidFraction does not yet work correctly!" << endl;
Info << "Using interpolated voidfraction field - do not use this in combination with interpolation in drag model!"<< endl;
}
} }
@ -90,6 +96,12 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra
{ {
reAllocArrays(); reAllocArrays();
scalar pi = M_PI;
vector position(0,0,0);
label cellID=-1;
scalar radius(-1);
scalar cellVol(0);
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) if(mask[index][0])
@ -101,14 +113,12 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra
} }
cellsPerParticle_[index][0]=1; cellsPerParticle_[index][0]=1;
position = particleCloud_.position(index);
scalar pi = M_PI; cellID = particleCloud_.cellIDs()[index][0];
vector position = particleCloud_.position(index); radius = particleCloud_.radii()[index][0];
label cellID = particleCloud_.cellIDs()[index][0];
scalar radius = particleCloud_.radii()[index][0];
scalar volume = 4./3.*radius*radius*radius*3.1415; scalar volume = 4./3.*radius*radius*radius*3.1415;
radius = radius*pow(scaleUpVol_,1/3); radius = radius*pow(scaleUpVol_,1/3);
scalar cellVol(0); cellVol=0;
//--variables for sub-search //--variables for sub-search
int nPoints = 29; int nPoints = 29;
@ -195,20 +205,53 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra
if(index == particleCloud_.numberOfParticles()-1) Info << "Total particle volume neglected: " << tooMuch_<< endl; if(index == particleCloud_.numberOfParticles()-1) Info << "Total particle volume neglected: " << tooMuch_<< endl;
}// end loop all particles }// end loop all particles
// bring voidfraction from Eulerian Field to particle array // bring voidfraction from Eulerian Field to particle arra
// interpolationCellPoint<scalar> voidfractionInterpolator_(voidfractionNext_);
scalar voidfractionAtPos(0);
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++) /* if(interpolation_)
{ {
label cellID = particleCloud_.cellIDs()[index][subcell]; label cellI = particleCloud_.cellIDs()[index][0];
if(cellI >= 0)
if(cellID >= 0)
{ {
voidfractions[index][subcell] = voidfractionNext_[cellID]; position = particleCloud_.position(index);
voidfractionAtPos=voidfractionInterpolator_.interpolate(position,cellI);
}else{
voidfractionAtPos=-1;
} }
else
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++)
{ {
voidfractions[index][subcell] = -1.; label cellID = particleCloud_.cellIDs()[index][subcell];
if(cellID >= 0)
{
if(voidfractionAtPos > 0)
voidfractions[index][subcell] = voidfractionAtPos;
else
voidfractions[index][subcell] = voidfractionNext_[cellID];
}
else
{
voidfractions[index][subcell] = -1.;
}
}
}
else*/
{
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++)
{
label cellID = particleCloud_.cellIDs()[index][subcell];
if(cellID >= 0)
{
voidfractions[index][subcell] = voidfractionNext_[cellID];
}
else
{
voidfractions[index][subcell] = -1.;
}
} }
} }
} }

View File

@ -40,6 +40,7 @@ SourceFiles
#define dividedVoidFraction_H #define dividedVoidFraction_H
#include "voidFractionModel.H" #include "voidFractionModel.H"
#include "interpolationCellPoint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,6 +67,8 @@ private:
const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle
bool interpolation_;
public: public:
//- Runtime type information //- Runtime type information

View File

@ -0,0 +1,223 @@
/*---------------------------------------------------------------------------*\
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 "dividedVoidFractionMS.H"
#include "addToRunTimeSelectionTable.H"
#include "locateModel.H"
#include "regionModel.H"
#include "dataExchangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(dividedVoidFractionMS, 0);
addToRunTimeSelectionTable
(
voidFractionModel,
dividedVoidFractionMS,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
dividedVoidFractionMS::dividedVoidFractionMS
(
const dictionary& dict,
cfdemCloud& sm
)
:
voidFractionModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
alphaMin_(readScalar(propsDict_.lookup("alphaMin"))),
alphaLimited_(0),
tooMuch_(0.0),
scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))),
clumpVol_(readScalar(propsDict_.lookup("clumpVol"))),
nrigid_(readScalar(propsDict_.lookup("nrigid")))
{
maxCellsPerParticle_ = 29;
if(scaleUpVol_ > 1.3 || scaleUpVol_ < 1){ FatalError<< "scaleUpVol shloud be > 1 and < 1.3 !!!" << abort(FatalError); }
if(alphaMin_ > 1 || alphaMin_ < 0.01){ FatalError<< "alphaMin shloud be > 1 and < 0.01 !!!" << abort(FatalError); }
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
dividedVoidFractionMS::~dividedVoidFractionMS()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void dividedVoidFractionMS::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes) const
{
reAllocArrays();
for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{
if(mask[index][0])
{
// reset
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++){
particleWeights[index][subcell]=0;
particleVolumes[index][subcell]=0;
}
cellsPerParticle_[index][0]=1;
scalar pi = M_PI;
vector position = particleCloud_.position(index);
label cellID = particleCloud_.cellIDs()[index][0];
scalar radius = particleCloud_.radii()[index][0];
scalar volume = clumpVol_/nrigid_;
radius = radius*pow(scaleUpVol_,1/3);
scalar cellVol(1);
//--variables for sub-search
int nPoints = 29;
int nNotFound=0,nUnEqual=0,nTotal=0;
vector offset(0,0,0);
int cellsSet = 0;
if (cellID >= 0) // particel centre is in domain
{
cellVol = particleCloud_.mesh().V()[cellID];
//NP for 2 different radii
for(scalar r = 0.623926*radius;r < radius;r+=0.293976*radius)
{
//NP try 8 subpoint derived from spherical coordinates
for (scalar zeta=pi/4.;zeta<(2.*pi);zeta+=(pi/2.))
{
for (scalar theta=(pi/4.);theta<pi;theta+=(pi/2.))
{
offset[0]=double(r)*Foam::sin(theta)*Foam::cos(zeta);
offset[1]=double(r)*Foam::sin(theta)*Foam::sin(zeta);
offset[2]=double(r)*Foam::cos(theta);
#include "../dividedVoidFraction/setWeightedSource.H" // set source terms at position+offset
}
}
//NP try 2 more subpoints for each coordinate direction (6 total)
for (int j=-1;j<=1;j+=2)
{
offset[0]=double(r)*(double(j));
offset[1]=double(0.);offset[2]=double(0.);
#include "../dividedVoidFraction/setWeightedSource.H" //NP set source terms at position+offset
offset[1]=double(r)*(double(j));
offset[0]=double(0.);offset[2]=double(0.);
#include "../dividedVoidFraction/setWeightedSource.H" //NP set source terms at position+offset
offset[2]=double(r)*(double(j));
offset[0]=double(0.);offset[1]=double(0.);
#include "../dividedVoidFraction/setWeightedSource.H" //NP set source terms at position+offset
}
}// end loop radiivoidfractions
if(cellsSet>29 || cellsSet<0)
{
Info << "ERROR cellsSet =" << cellsSet << endl;
}
//NP set source for particle center; source 1/nPts+weight of all subpoints that have not been found
scalar centreWeight = 1./nPoints*(nPoints-cellsSet);
// update voidfraction for each particle read
scalar newAlpha = voidfractionNext_[cellID]- volume*centreWeight/cellVol;
if(newAlpha > alphaMin_) voidfractionNext_[cellID] = newAlpha;
else
{
voidfractionNext_[cellID] = alphaMin_;
tooMuch_ += (alphaMin_-newAlpha) * cellVol;
}
// store cellweight for each particle --- this should be done for subpoints as well!!
particleWeights[index][0] += centreWeight;
// store particleVolume for each particle
particleVolumes[index][0] += volume*centreWeight;
/*//OUTPUT
if (index==0)
{
Info << "centre cellID = " << cellID << endl;
Info << "cellsPerParticle_=" << cellsPerParticle_[index][0] << endl;
for(int i=0;i<cellsPerParticle_[index][0];i++)
{
if(i==0)Info << "cellids, voidfractions, particleWeights, : \n";
Info << particleCloud_.cellIDs()[index][i] << " ," << endl;
Info << voidfractions[index][i] << " ," << endl;
Info << particleWeights[index][i] << " ," << endl;
}
}*/
}// end if in cell
}// end if in mask
//NP reset counter of lost volume
if(index == particleCloud_.numberOfParticles()-1) Info << "Total particle volume neglected: " << tooMuch_<< endl;
}// end loop all particles
// bring voidfraction from Eulerian Field to particle array
for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++)
{
label cellID = particleCloud_.cellIDs()[index][subcell];
if(cellID >= 0)
{
voidfractions[index][subcell] = voidfractionNext_[cellID];
}
else
{
voidfractions[index][subcell] = -1.;
}
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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).
Class
dividedVoidFractionMS
SourceFiles
dividedVoidFractionMS.C
\*---------------------------------------------------------------------------*/
#ifndef dividedVoidFractionMS_H
#define dividedVoidFractionMS_H
#include "voidFractionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class noDrag Declaration
\*---------------------------------------------------------------------------*/
class dividedVoidFractionMS
:
public voidFractionModel
{
private:
dictionary propsDict_;
const scalar alphaMin_; //NP min value of voidFraction
mutable bool alphaLimited_;
mutable scalar tooMuch_; //NP particle volume which is lost due to voidFraction limitation
const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle
const scalar clumpVol_;
const int nrigid_;
public:
//- Runtime type information
TypeName("dividedMS");
// Constructors
//- Construct from components
dividedVoidFractionMS
(
const dictionary& dict,
cfdemCloud& sm
);
// Destructor
~dividedVoidFractionMS();
// Member Functions
void setvoidFraction(double** const& ,double**&, double**&, double**&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -21,7 +21,7 @@ logfileName="log_$headerText"
solverName="cfdemSolverIB" solverName="cfdemSolverIB"
nrProcs="8" nrProcs="8"
machineFileName="none" # yourMachinefileName | none machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off debugMode="off" # on | off | prof
testHarnessPath="$CFDEM_TEST_HARNESS_PATH" testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
runOctave="true" runOctave="true"
postproc="false" postproc="false"
@ -66,6 +66,8 @@ cp ../../$logfileName $testHarnessPath
#- clean up case #- clean up case
echo "deleting data at: $casePath" echo "deleting data at: $casePath"
rm -r $casePath/CFD/0.* rm -r $casePath/CFD/0.*
rm -r $casePath/CFD/callgrind.*
rm -r $casePath/CFD/*.out
rm -r $casePath/CFD/VTK rm -r $casePath/CFD/VTK
rm -r $casePath/CFD/couplingFiles/* rm -r $casePath/CFD/couplingFiles/*
rm -r $casePath/CFD/processor* rm -r $casePath/CFD/processor*

View File

@ -49,8 +49,8 @@ clockModel standardClock;//off;
forceModels forceModels
( (
//GidaspowDrag //GidaspowDrag
DiFeliceDrag //DiFeliceDrag
//KochHillDrag KochHillDrag
gradPForce gradPForce
viscForce viscForce
//Archimedes //Archimedes
@ -132,6 +132,7 @@ KochHillDragProps
{ {
velFieldName "U"; velFieldName "U";
densityFieldName "rho"; densityFieldName "rho";
voidfractionFieldName "voidfraction";
} }
virtualMassForceProps virtualMassForceProps

View File

@ -29,7 +29,7 @@ deltaT 0.001;
writeControl adjustableRunTime; writeControl adjustableRunTime;
writeInterval 0.001;//0.01; writeInterval 0.01;
purgeWrite 0; purgeWrite 0;

View File

@ -21,7 +21,7 @@ logfileName="log_$headerText"
solverName="cfdemSolverPiso" solverName="cfdemSolverPiso"
nrProcs="8" nrProcs="8"
machineFileName="none" # yourMachinefileName | none machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off debugMode="off" # on | off | prof
testHarnessPath="$CFDEM_TEST_HARNESS_PATH" testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
runOctave="true" runOctave="true"
postproc="false" postproc="false"
@ -83,6 +83,8 @@ fi
#- clean up case #- clean up case
echo "deleting data at: $casePath :\n" echo "deleting data at: $casePath :\n"
rm -r $casePath/CFD/0.* rm -r $casePath/CFD/0.*
rm -r $casePath/CFD/callgrind.*
rm -r $casePath/CFD/*.out
rm -r $casePath/CFD/log.* rm -r $casePath/CFD/log.*
rm -r $casePath/CFD/octave/octave-core rm -r $casePath/CFD/octave/octave-core
rm -r $casePath/CFD/VTK rm -r $casePath/CFD/VTK

View File

@ -98,6 +98,8 @@ fi
#- clean up case #- clean up case
rm -rf $casePath/CFD/0.* rm -rf $casePath/CFD/0.*
rm -r $casePath/CFD/callgrind.*
rm -r $casePath/CFD/*.out
rm -r $casePath/CFD/clockData rm -r $casePath/CFD/clockData
rm -rf $casePath/CFD/processor* rm -rf $casePath/CFD/processor*
rm -r $casePath/CFD/VTK rm -r $casePath/CFD/VTK

View File

@ -23,3 +23,5 @@ dummyfile
dummyfile dummyfile
dummyfile dummyfile
dummyfile dummyfile
dummyfile
dummyfile

View File

@ -21,7 +21,7 @@ logfileName="log_$headerText"
solverName="cfdemSolverPiso" solverName="cfdemSolverPiso"
nrProcs="2" nrProcs="2"
machineFileName="none" # yourMachinefileName | none machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off debugMode="off" # on | off | prof
testHarnessPath="$CFDEM_TEST_HARNESS_PATH" testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
#--------------------------------------------------------------------------------# #--------------------------------------------------------------------------------#

View File

@ -21,7 +21,7 @@ logfileName="log_$headerText"
solverName="cfdemSolverPiso" solverName="cfdemSolverPiso"
nrProcs="2" nrProcs="2"
machineFileName="none" # yourMachinefileName | none machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off debugMode="off" # on | off | prof
testHarnessPath="$CFDEM_TEST_HARNESS_PATH" testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
runOctave="true" runOctave="true"
postproc="false" postproc="false"
@ -78,6 +78,8 @@ fi
#- clean up case #- clean up case
echo "deleting data at: $casePath :\n" echo "deleting data at: $casePath :\n"
rm -r $casePath/CFD/0.* rm -r $casePath/CFD/0.*
rm -r $casePath/CFD/callgrind.*
rm -r $casePath/CFD/*.out
rm -r $casePath/CFD/log.* rm -r $casePath/CFD/log.*
rm -r $casePath/CFD/octave/octave-core rm -r $casePath/CFD/octave/octave-core
rm -r $casePath/CFD/VTK rm -r $casePath/CFD/VTK

View File

@ -0,0 +1,62 @@
#!/bin/bash
#===================================================================#
# allrun script for testcase as part of test routine
# run settlingTest
# Christoph Goniva - Sept. 2010
#===================================================================#
#- define variables
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
pizzaPath="$CFDEM_PIZZA_DIR"
postproc="false"
nrPostProcProcessors=2
# check if mesh was built
if [ -d "$casePath/CFD/constant/polyMesh/boundary" ]; then
echo "mesh was built before - using old mesh"
else
echo "mesh needs to be built"
cd $casePath/CFD
blockMesh
fi
#- run parallel CFD-DEM in new terminal
gnome-terminal --title='cfdemSolverPisoMS ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
if [ $postproc == "true" ]
then
#- keep terminal open (if started in new terminal)
echo "simulation finisehd? ...press enter to proceed"
read
#- get VTK data from liggghts dump file
cd $casePath/DEM
python $pizzaPath/pizza.py -f pizzaScriptRestart
#- get VTK data from CFD sim
cd $casePath/CFD
#foamToVTK #- serial run of foamToVTK
source $CFDEM_SRC_DIR/etc/functions.sh #- include functions
pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK
#- start paraview
paraview
#- keep terminal open (if started in new terminal)
echo "...press enter to clean up case"
echo "press Ctr+C to keep data"
read
#- clean up case
echo "deleting data at: $casePath"
rm -r $casePath/CFD/0.*
rm -r $casePath/CFD/VTK
rm -r $casePath/CFD/couplingFiles/*
rm -r $casePath/DEM/post/*
rm -r $casePath/DEM/log.*
rm -r $casePath/log_*
echo "done"
fi

View File

@ -0,0 +1,41 @@
/*--------------------------------*- 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 Ksl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
wall
{
type zeroGradient;
//type fixedValue;
//value uniform 0;
}
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*--------------------------------*- 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 U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0.1);
boundaryField
{
wall
{
//type fixedValue;
//value uniform (0 0 0);
type slip;
}
inlet
{
/*type flowRateInletVelocity;
flowRate 0.001;
value uniform (0 0 0);*/
/* type fixedValue;
value uniform (0 0 0.1);*/
//type zeroGradient;
/*// superficial velocity BC
type groovyBC;
variables "Usup=vector(0,0,2);alpha=voidfraction;tEnd=0.1;"; // should be used with zeroGradient voidfraction
valueExpression "((time() < tEnd) ? Usup/alpha*(time()/tEnd) : Usup/alpha)";
value uniform (0 0 0);*/
/*// 2.0.x, ext
type timeVaryingUniformFixedValue;
fileName "steps_0p1s";
outOfBounds clamp;
value uniform (0 0 0);*/
// 2.1.x
type uniformFixedValue;
uniformValue table
(
(0.000 (0 0 0.))
(0.099 (0 0 2))
(0.100 (0 0 2))
);
}
outlet
{
/*type fluxCorrectedVelocity; //inletOutlet;
value uniform (0 0 0);
inletValue uniform (0 0 0);*/
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- 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 Us;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
wall
{
type zeroGradient;
//type fixedValue;
//value uniform (1 0 0);
}
inlet
{
type zeroGradient;
//type fixedValue;
//value uniform (1 0 0);;
}
outlet
{
type zeroGradient;
//type fixedValue;
//value uniform (1 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- 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 epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.003;
boundaryField
{
wall
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0.003;
}
outlet
{
type inletOutlet;
inletValue uniform 0.003;
value uniform 0.003;
}
inlet
{
/*type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.005;
value uniform 0.003;*/
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- 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 k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.001;
boundaryField
{
wall
{
type kqRWallFunction;
value uniform 0.001;
}
outlet
{
type inletOutlet;
inletValue uniform 0.001;
value uniform 0.001;
}
inlet
{
/*type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value uniform 0.001;*/
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- 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 nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
wall
{
type nutWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
inlet
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1.0e5;
boundaryField
{
wall
{
type zeroGradient;
}
inlet
{
type zeroGradient;
//type fixedValue;
//value uniform 100000;
}
outlet
{
//type zeroGradient;
type fixedValue;
value uniform 100000;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- 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 volScalarField;
object rho;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 0 0 0 0 0];
internalField uniform 5;
boundaryField
{
wall
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- 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 voidfraction;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
wall
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 1;
}
inlet
{
type fixedValue;
value uniform 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*--------------------------------*- 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 "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel laminar;
turbulence off;
printCoeffs on;
// ************************************************************************* //

View File

@ -0,0 +1,177 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / 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
verbose;
modelType B; // A or B
couplingInterval 100;
voidFractionModel dividedMS;
locateModel engine;
meshMotionModel noMeshMotion;
regionModel allRegion;
IOModel basicIO;
dataExchangeModel twoWayMPI;//twoWayFiles;//oneWayVTK;//
averagingModel dense;//dilute;//
clockModel off;
forceModels
(
off
Archimedes
volWeightedAverage
);
forceModelsMS
(
DiFeliceDragMS
);
momCoupleModels
(
implicitCouple
);
turbulenceModelType RASProperties;//LESProperties;//
//===========================================================================//
// sub-model properties
implicitCoupleProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
}
ArchimedesProps
{
densityFieldName "rho";
gravityFieldName "g";
}
gradPForceProps
{
pFieldName "p";
densityFieldName "rho";
velocityFieldName "U";
interpolation;
}
viscForceProps
{
velocityFieldName "U";
densityFieldName "rho";
interpolation;
}
volWeightedAverageProps
{
scalarFieldNames
(
voidfraction
);
vectorFieldNames
(
);
upperThreshold 0.999;
lowerThreshold 0;
verbose;
}
totalMomentumExchangeProps
{
implicitMomExFieldName "Ksl";
explicitMomExFieldName "none";
fluidVelFieldName "U";
granVelFieldName "Us";
densityFieldName "rho";
}
DiFeliceDragMSProps
{
velFieldName "U";
densityFieldName "rho";
voidfractionFieldName "voidfraction";
hydraulicDiameter 0.002;
verbose;
}
oneWayVTKProps
{
couplingFilename "vtk_out%4.4d.vtk";
maxNumberOfParticles 30000;
}
twoWayFilesProps
{
maxNumberOfParticles 10100;
}
centreProps
{
alphaMin 0.10;
}
dividedMSProps
{
alphaMin 0.05;
scaleUpVol 1.0;
clumpVol 1.8433e-9; // this is particles volume, not clump!
nrigid 10;
}
bigParticleProps
{
alphaMin 0.05;
scaleUpVol 50.0;
maxCellsPerParticle 1000;
}
GaussProps
{
maxCellsPerParticle 5000;
alphaMin 0.05;
scaleUpVol 10.0;
}
engineProps
{
treeSearch true;
}
twoWayMPIProps
{
maxNumberOfParticles 101000;
liggghtsPath "../DEM/in.liggghts_init";
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- 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 uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 0 0 );
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / 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
);
// ************************************************************************* //

View File

@ -0,0 +1,154 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// ************************************
meshGenApp blockMesh;
convertToMeters 1;
//64 mm column diameter
//15 cm length
//Width of middle square section
//how many cells in the square section
//how many cells from square section to perimeter
// how many cells from top to bottom
vertices
(
( 0.0069 0.0069 0.0 ) // Vertex fiveoclocksqb = 0
(-0.0069 0.0069 0.0 ) // Vertex sevenoclocksqb = 1
(-0.0069 -0.0069 0.0 ) // Vertex elevenoclocksqb = 2
( 0.0069 -0.0069 0.0 ) // Vertex oneoclocksqb = 3
( 0.00975807358913172 0.00975807357161699 0.0 ) // Vertex fiveoclockcb = 4
(-0.00975807358913172 0.00975807357161699 0.0) // Vertex sevenoclockcb = 5
(-0.00975807358913172 -0.00975807357161699 0.0) // Vertex elevenoclockcb = 6
( 0.00975807358913172 -0.00975807357161699 0.0) // Vertex oneoclockcb = 7
( 0.0069 0.0069 0.0553) // Vertex fiveoclocksqt = 8
(-0.0069 0.0069 0.0553) // Vertex sevenoclocksqt = 9
(-0.0069 -0.0069 0.0553) // Vertex elevenoclocksqt = 10
( 0.0069 -0.0069 0.0553) // Vertex oneoclocksqt = 11
( 0.00975807358913172 0.00975807357161699 0.0553) // Vertex fiveoclockct = 12
(-0.00975807358913172 0.00975807357161699 0.0553) // Vertex sevenoclockct = 13
(-0.00975807358913172 -0.00975807357161699 0.0553) // Vertex elevenoclockct = 14
( 0.00975807358913172 -0.00975807357161699 0.0553) // Vertex oneoclockct = 15
);
blocks
(
//square block
hex (
2 3 0 1
10 11 8 9
)
(4 4 12)
simpleGrading (1 1 1)
//slice1
hex (
1 0 4 5
9 8 12 13
)
(4 2 12)
simpleGrading (1 1 1)
//slice2
hex (
6 2 1 5
14 10 9 13
)
( 2 4 12)
simpleGrading (1 1 1)
//slice3
hex (
6 7 3 2
14 15 11 10
)
(4 2 12)
simpleGrading (1 1 1)
//slice4
hex (
3 7 4 0
11 15 12 8
)
(2 4 12)
simpleGrading (1 1 1)
);
//create the quarter circles
edges
(
arc 4 5 (0.0 0.0138 0.0 )
arc 5 6 (-0.0138 0.0 0.0)
arc 6 7 (0.0 -0.0138 0.0 )
arc 7 4 (0.0138 0.0 0.0)
arc 12 13 (0.0 0.0138 0.0553 )
arc 13 14 (-0.0138 0.0 0.0553 )
arc 14 15 (0.0 -0.0138 0.0553 )
arc 15 12 (0.0138 0.0 0.0553 )
);
patches
(
patch inlet
(
(0 3 2 1)
(0 4 7 3)
(4 0 1 5)
(1 2 6 5)
(3 7 6 2)
)
patch outlet
(
(8 11 10 9)
(8 12 15 11)
(12 8 9 13)
(9 10 14 13)
(11 15 14 10)
)
wall wall
(
(5 4 12 13)
(5 13 14 6)
(6 14 15 7)
(7 15 12 4)
)
);
mergePatchPairs
(
);

View File

@ -0,0 +1,37 @@
/*--------------------------------*- 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 "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.5e-05;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 1;
}
BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 0;
n n [ 0 0 0 0 0 0 0 ] 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- 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 "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RASModel;
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
clc;
close all;
clear;
%==========================================================================
%m-file to calculate the properties of the imported clump
%==========================================================================
fprintf('\n sphere10.multisphere:\n')
rhoC=440
scaling=1e-3
nP=10
rP=0.3530494
VP=nP*(2*rP*scaling)^3*pi/6
dH=2*scaling
VC=dH^3*pi/6
rhoP=rhoC*VC/VP
% -0.3301476 -3.4959164E-008 0.5563700 0.3530494
% 0.5421265 -3.2849375E-008 0.3530494 0.3530494
% 0.0822932 0.5358442 0.3530495 0.3530494
% 0.0822932 -0.5358442 0.3530494 0.3530494
% -0.5126716 -0.3946047 -2.9544078E-009 0.3530494
% -0.5126715 0.3946047 -1.7513663E-008 0.3530494
% 0.0822932 0.5358442 -0.3530494 0.3530494
% 0.0822932 -0.5358442 -0.3530495 0.3530494
% 0.5421264 -3.9639417E-008 -0.3530495 0.3530494
% -0.3301475 -1.5302462E-008 -0.5563700 0.3530494

View File

@ -0,0 +1,69 @@
function [data,colname]=loaddata(filename,columns,headerlines)
% data = loaddata(filename,columns,headerlines)
% data = loaddata(filename,0,headerlines): automatc detection of
% columns by word count in first headerline or first data line
% (if headerline==0), separated by blanks or tabs
% columns=-1: write colum assignment code lines
% works only if headerline>0 and colnames separated by
% not more than 1 blank!
% columns=-2: columns separated by 2 blanks (fluent/scheme auswertung-instat.scm)
% [data, colname] = loaddata(filename,0,headerlines)
% colname = cell string array of column names from headerline
fprintf(1,'loading %s ... ', filename);
f=fopen(filename,'r');
if f==-1
fprintf(1,'\n*** error: could not open "%s" ...\n', filename);
data=[];
else
for i=1:headerlines
if i==1 s=fgets(f); else fgets(f); end
end
if headerlines==0
s=fgets(f); frewind(f);
end
if columns<=0 % & headerlines>=1
fprintf(1,'\n');
fprintf(1,' %s',s);
pos = findstr(sprintf('\t'),s); % trennzeichenpositionen in zeile suchen
if length(pos)>0
endpos=length(s);
%if isspace(s(endpos-1)) endpos=endpos-1; end
pos = [0 pos(1,:) endpos]; % anfangs- und endposition hinzuf<EFBFBD>gen
elseif columns==-2 % spalteneintr<EFBFBD>ge durch 2 blanks getrennt (fluent/scheme)
pos=[0];
for i=1:length(s)-1
if isspace(s(i)) & isspace(s(i+1))
pos(end+1)=i+1;
end
end
pos(end+1)=length(s);
else % spalteneintr<EFBFBD>ge durch blanks getrennt
%pos = findstr(' ',s); % trennzeichenpositionen in zeile suchen
pos=[];
word=0;
for i=1:length(s)
if isspace(s(i))
word=0;
elseif ~word
word=1;
pos(end+1)=i-1;
end
end
pos(end+1)=length(s);
end
if headerlines>=1
for i=1:length(pos)-1 % alle spalten
colname{i}=s(pos(i)+1:pos(i+1)-1);
if columns==-1 fprintf(' = data(strmatch(''%s'',colname),:); %% column %d\n', colname{i},i); end
if columns==-2 fprintf('%% column %d: %s\n', i, colname{i}); end
end
end
columns = length(pos)-1;
fprintf(1,' total: %d columns ',columns);
end
data=fscanf(f,'%f',[columns,inf]);
fclose(f);
fprintf(1,'done.\n');
end

View File

@ -0,0 +1,104 @@
close all;
clear;
clc;
%====================================%
% simulation data 1
%====================================%
%path = '../probes/0/p';
path = '../probes/0/p';
columns=22;
headerlines=4;
data = loaddata(path,columns,headerlines);
data=transpose(data);
[x,y]=size(data)
dp_sim = (data(:,2)-data(:,y))/10000;
t_sim = data(:,1);
%fprintf('final pressureDrop of sim = %f Pa\n',dp_sim(length(dp_sim)) )
%====================================%
% analytical calculation
%====================================%
%===================
% Ergun Equation
%===================
fprintf('\ncalc Ergun eqn:\n')
% calc density of clump
% Note: for drag calc the clump diameter is used-> reduced density of clump
dp = 0.002 % clump diameter
ds_=0.001*0.3530494*2 % diameter of sphere
ns_=10; % nr of spheres per clump
rhos_=1000; % density of spheres
VclumpToVbody=ns_*(ds_/dp)^3 % ratio of the tot volume of the spheres to the volume of the body with d_
rhoP = VclumpToVbody*rhos_ % density of clump
nP_=2500; % nr of clumps
phip = 1 % sphericity
Ustart = 0.
Uend = 2
timeStepSize = 0.001; % time interval of pressure data
Tstart = 0;
Tend = t_sim(length(t_sim));
deltaU=(Uend-Ustart)/((Tend-Tstart)/timeStepSize);
U = Ustart+deltaU:deltaU:Uend; % velocity over time
L = 0.0212; % length of bed filled with particles
D = 0.0276; % diameter of bed
% calc epsilon from bedheight
%Vpartiles=dp^3*pi/6*nP_; % tot clump vol
Vpartiles=ds_^3*pi/6*nP_*ns_; % tot particle vol
Vfilled=D^2*pi/4*L; %volume filled with particles
epsilon = 1-Vpartiles/Vfilled % void fraction
%epsilon = 0.656968
Ua = U / epsilon; % physical velocity
rhoG = 5 % density in kg/m3
nuG = 1.5*10^-5 % kinemat Visk in m2/s
muG = nuG*rhoG % dynam visc in Pa s
dpErgun= L * (
150*((1-epsilon)^2/epsilon^3)*((muG.*U)/(phip*dp)^2)
+1.75*((1-epsilon)/epsilon^3)*((rhoG.*U.^2)/(phip*dp))
)/10000/rhoG;
fprintf('NOTE: this pressure is divided by density (according to CFD solver)\n')
fprintf('so the result does not depend on pressure\n')
%fprintf('final pressure drop (Ergun eqn)= %f Pa\n',dpErgun)
%==================================
% min fluidization velocity in m/s
%==================================
%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)
ReMF = Umf*dp*rhoG/muG % must be <20 !!!
%Umf = sqrt(phip*dp^2/1.75*(rhoP-rhoG)/rhoG*g*epsilon^3) % Re>1000
dpUmf= L * (
150*((1-epsilon)^2/epsilon^3)*((muG.*Umf)/(phip*dp)^2)
+1.75*((1-epsilon)/epsilon^3)*((rhoG.*Umf.^2)/(phip*dp))
)/10000/rhoG;
%====================================%
% plot data
%====================================%
fig=figure(1)
plot(U,dpErgun,U,dp_sim,[Umf,Uend],dpUmf*ones(1,2))
title("Ergun pressure drop vs. simulation")
a=strcat("analytical (Ergun), Umf=",num2str(Umf),", dpUmf=",num2str(dpUmf));
legend(a,"simulation")
xlabel("velocity in [m/s]")
ylabel("pressure drop [bar]")
axis([0,Uend,0,dpErgun(length(dpErgun))])
%print('cfdemSolverPiso_settlingTest.eps','-deps2')
print -color "cfdemSolverPisoMS_ErgunTestMPI.eps"
replot;
SimName="ErgunTestMPI_sphereOfSpheres"
print(fig,strcat("figure_",SimName,".png"));

View File

@ -0,0 +1,28 @@
(
(0.000 (0 0 0.002))
(0.099 (0 0 0.30))
(0.100 (0 0 0.30))
)
/*(
(0.000 (0 0 0.002))
(0.010 (0 0 0.002))
(0.011 (0 0 0.004))
(0.020 (0 0 0.004))
(0.021 (0 0 0.006))
(0.030 (0 0 0.006))
(0.031 (0 0 0.008))
(0.040 (0 0 0.008))
(0.041 (0 0 0.010))
(0.050 (0 0 0.010))
(0.051 (0 0 0.012))
(0.060 (0 0 0.012))
(0.061 (0 0 0.014))
(0.070 (0 0 0.014))
(0.071 (0 0 0.016))
(0.080 (0 0 0.016))
(0.081 (0 0 0.018))
(0.090 (0 0 0.018))
(0.091 (0 0 0.020))
(0.100 (0 0 0.020))
)*/

View File

@ -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.1;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.001;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 0.1;
//libs ("libOpenFOAM.so" "libgroovyBC.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);
// 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;
}*/
);
// ************************************************************************* //

View File

@ -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.1;//0.01;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.001;//0.05;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 0.1;
libs ("libOpenFOAM.so" "libgroovyBC.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);
// 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;
}*/
);
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*-------------------------------*- C++ -*---------------------------------*\
| ========= |
| \\ / OpenFOAM |
| \\ / |
| \\ / The Open Source CFD Toolbox |
| \\/ http://www.OpenFOAM.org |
\*-------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 2;
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
//method scotch;
// method hierarchical;
method simple;
// method metis;
// method manual;
simpleCoeffs
{
n (1 1 2);
delta 0.001;
}
hierarchicalCoeffs
{
n (2 2 1);
delta 0.001;
order xyz;
}
metisCoeffs
{
/*
processorWeights
(
1
1
1
1
);
*/
}
scotchCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
manualCoeffs
{
dataFile "decompositionData";
}
//// Is the case distributed
//distributed yes;
//// Per slave (so nProcs-1 entries) the directory above the case.
//roots
//(
// "/tmp"
// "/tmp"
//);
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
FoamFile
{
version 2.0;
format ascii;
root "/.automount/werner/Werner/bgschaid/bgschaid-foamStuff/DepositionTests";
case "neutralTest";
instance "system";
local "";
class dictionary;
object funkySetFieldsDict;
}
expressions
(
init
{
field voidfraction;
expression "1";
valuePatches 2(inlet outlet); // set value 1 at those patches
}
setGamma
{
field voidfraction;
expression "0.43";
//condition "pow(pow(pos().x-0.2,2) + pow(pos().y-0,2)+ pow(pos().z-0,2),0.5) < 0.04";
condition "pos().z < 0.01467 && pos().z > 0.0";
keepPatches true;
//valuePatches 1(inlet); // set value 1 at those patches
}
);

View File

@ -0,0 +1,76 @@
/*--------------------------------*- 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 fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}
divSchemes
{
default Gauss linear;
div(phi,U) Gauss limitedLinearV 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,R) Gauss limitedLinear 1;
div(R) Gauss linear;
div(phi,nuTilda) Gauss limitedLinear 1;
div((viscousTerm*dev(grad(U).T()))) Gauss linear;
div((nu*dev(grad(U).T()))) Gauss linear;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
laplacian(viscousTerm,U) Gauss linear corrected;
laplacian(nu,U) Gauss linear corrected;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian((voidfraction2|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(U) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*--------------------------------*- 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 fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}
pFinal
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
k
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
epsilon
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
R
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
nuTilda
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
}
PISO
{
nCorrectors 4;
nNonOrthogonalCorrectors 1;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,74 @@
echo both
# Pour granular particles into chute container
atom_style hybrid granular molecular
atom_modify map array sort 0 0
communicate single vel yes
boundary m m m
newton off
units si
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
mass 1 1.0
#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
#pair style
pair_style gran/hertz/history 1 0 #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 zwalls all wall/gran/hertz/history 1 0 zplane 0.0 0.0553 1
fix cylwalls all wall/gran/hertz/history 1 0 zcylinder 0.01385 1
#============================
#distributions for insertion
fix pts1 all particletemplate/multisphere 1 atom_type 1 density constant 1000 nspheres 10 ntry 1000000 spheres file ../DEM/sphere10.multisphere scale 0.001 type 1
fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0
#region and insertion
group rigid_group region reg
region bc cylinder z 0.0 0.0 0.012 0.001 0.05 units box
fix ins rigid_group insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. 0. insert_every once overlapcheck yes region bc ntry_mc 10000 particles_in_region 2500 # volumefraction_region 0.01 #
#integrator for multisphere rigid bodies
fix integr rigid_group rigid/multisphere
#============================
#cfd coupling
fix cfd all couple/cfd couple_every 100000 mpi
fix cfd2 all couple/cfd/force/multisphere
#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 5000 ../DEM/post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
run 80000 upto
#write_restart liggghts.restart

View File

@ -0,0 +1,4 @@
dummyfile
dummyfile
dummyfile
dummyfile

View File

@ -0,0 +1,10 @@
-0.3301476 -3.4959164E-008 0.5563700 0.3530494
0.5421265 -3.2849375E-008 0.3530494 0.3530494
0.0822932 0.5358442 0.3530495 0.3530494
0.0822932 -0.5358442 0.3530494 0.3530494
-0.5126716 -0.3946047 -2.9544078E-009 0.3530494
-0.5126715 0.3946047 -1.7513663E-008 0.3530494
0.0822932 0.5358442 -0.3530494 0.3530494
0.0822932 -0.5358442 -0.3530495 0.3530494
0.5421264 -3.9639417E-008 -0.3530495 0.3530494
-0.3301475 -1.5302462E-008 -0.5563700 0.3530494

View File

@ -0,0 +1,68 @@
#!/bin/bash
#===================================================================#
# allrun script for testcase as part of test routine
# run settlingTest CFD part
# Christoph Goniva - Feb. 2011
#===================================================================#
#- source CFDEM env vars
. ~/.bashrc
#- include functions
source $CFDEM_SRC_DIR/etc/functions.sh
#--------------------------------------------------------------------------------#
#- define variables
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
logpath=$casePath
headerText="run_parallel_cfdemSolverPisoMS_ErgunTestMPI_CFDDEM"
logfileName="log_$headerText"
solverName="cfdemSolverPisoMS"
nrProcs="2"
machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off
testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
cleanUp="true"
#--------------------------------------------------------------------------------#
#- call function to run a parallel CFD-DEM case
parCFDDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode
#------------------------------#
# octave
#- change path
cd octave
#- rmove old graph
rm cfdemSolverPisoMS_ErgunTestMPI.eps
#- run octave
octave totalPressureDrop.m
#- show plot
evince cfdemSolverPisoMS_ErgunTestMPI.eps
#------------------------------#
#- copy log file to test harness
cp ../../$logfileName $testHarnessPath
cp cfdemSolverPisoMS_ErgunTestMPI.eps $testHarnessPath
if [ $cleanUp == "true" ]
then
#- clean up case
cd ..
rm -rf 0.*
rm -rf processor*
rm -rf particles
rm -rf patchAverage_pressureDrop
rm -rf probes
rm log.liggghts
rm ../DEM/post/dump.*
fi
#- preserve post directory
echo "dummyfile" >> $casePath/DEM/post/dummy

View File

@ -21,7 +21,7 @@ logfileName="log_$headerText"
solverName="cfdemSolverPisoScalar" solverName="cfdemSolverPisoScalar"
nrProcs="2" nrProcs="2"
machineFileName="none" # yourMachinefileName | none machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off debugMode="off" # on | off | prof
testHarnessPath="$CFDEM_TEST_HARNESS_PATH" testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
runOctave="true" runOctave="true"
postproc="false" postproc="false"
@ -85,6 +85,8 @@ fi
#- clean up case #- clean up case
echo "deleting data at: $casePath : ???\n" echo "deleting data at: $casePath : ???\n"
rm -r $casePath/CFD/0.* rm -r $casePath/CFD/0.*
rm -r $casePath/CFD/callgrind.*
rm -r $casePath/CFD/*.out
rm -r $casePath/CFD/octave/*.eps rm -r $casePath/CFD/octave/*.eps
rm -r $casePath/CFD/octave/octave-core rm -r $casePath/CFD/octave/octave-core
rm -r $casePath/CFD/VTK rm -r $casePath/CFD/VTK