release on 2015-01-05_13-56-45

This commit is contained in:
Christoph Goniva, DCS Computing GmbH
2015-01-05 13:56:45 +01:00
parent 7fa304d58b
commit 88743b79fd
56 changed files with 1348 additions and 316 deletions

26
README
View File

@ -25,16 +25,17 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM. Note: this code is not part of OpenFOAM (see DISCLAIMER).
This code provides models and solvers to realize coupled CFD-DEM simulations
using LIGGGHTS and OpenFOAM.
Note: this code is not part of OpenFOAM (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
CFDEM coupling provides an open source parallel coupled CFD-DEM framework
combining the strengths of LIGGGHTS DEM code and the Open Source
CFD package OpenFOAM(R)(*). The CFDEMcoupling toolbox allows to expand
CFDEM(R) coupling provides an open source parallel coupled CFD-DEM framework
combining the strengths of LIGGGHTS(R) DEM code and the Open Source
CFD package OpenFOAM(R)(*). The CFDEM(R)coupling toolbox allows to expand
standard CFD solvers of OpenFOAM(R)(*) to include a coupling to the DEM
code LIGGGHTS. In this toolbox the particle representation within the
code LIGGGHTS(R). In this toolbox the particle representation within the
CFD solver is organized by "cloud" classes. Key functionalities are organised
in sub-models (e.g. force models, data exchange models, etc.) which can easily
be selected and combined by dictionary settings.
@ -54,7 +55,7 @@ The file structure:
- "src" directory including the source files of the coupling toolbox and models
- "applications" directory including the solver files for coupled CFD-DEM simulations
- "doc" directory including the documentation of CFDEMcoupling
- "doc" directory including the documentation of CFDEM(R)coupling
- "tutorials" directory including basic tutorial cases showing the functionality
@ -64,18 +65,17 @@ Details on installation are given on the "www.cfdem.com"
The functionality of this CFD-DEM framwork is described via "tutorial cases" showing
how to use different solvers and models.
CFDEMcoupling stands for Computational Fluid Dynamics (CFD) -
CFDEM(R)coupling stands for Computational Fluid Dynamics (CFD) -
Discrete Element Method (DEM) coupling.
CFDEMcoupling is an open-source code, distributed freely under the terms of the
CFDEM(R)coupling is an open-source code, distributed freely under the terms of the
GNU Public License (GPL).
Core development of CFDEMcoupling is done by
Core development of CFDEM(R)coupling is done by
Christoph Goniva and Christoph Kloss, both at DCS Computing GmbH, 2012
\*---------------------------------------------------------------------------*/
(*) "OpenFOAM(R)"_of is a registered trade mark of the ESI Group.
This offering is not affiliated, approved or endorsed by ESI Group,
the producer of the OpenFOAM® software and owner of the OpenFOAM® trade mark.
(*) "OpenFOAM(R)"_of is a registered trade mark of OpenCFD Limited, a wholly owned subsidiary of the ESI Group.
This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks.
\*---------------------------------------------------------------------------*/

7
applications/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*.o
*.d
*.a
*.dep
log_*
log.*
*~

View File

@ -72,7 +72,7 @@ int main(int argc, char *argv[])
#include "initContinuityErrs.H"
#if defined(version22)
#include "createFvOptions.H"
#include "createFvOptions.H"
#endif
// create cfdemCloud
@ -128,10 +128,12 @@ int main(int argc, char *argv[])
for (int corr=0; corr<nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rUAf(fvc::interpolate(rUA));
U = rUA*UEqn.H();
#ifdef version23
phi = (fvc::interpolate(U) & mesh.Sf()); // there is a new version in 23x
phi = (fvc::interpolate(U) & mesh.Sf())
+ rUAf*fvc::ddtCorr(U, phi);
#else
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

View File

@ -63,7 +63,7 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
{
particleCloud.clockM().start(1,"Global");
particleCloud.clockM().start(1,"Global");
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -76,11 +76,6 @@ int main(int argc, char *argv[])
if(hasEvolved)
{
//Smoothen implicit momCoupling force
//fSmooth.internalField() = particleCloud.forceM(0).impParticleForces() ;
//particleCloud.smoothingM().smoothen(fSmooth);
//fSmooth.correctBoundaryConditions();
//particleCloud.forceM(0).impParticleForces() = fSmooth;
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
}
@ -115,15 +110,11 @@ int main(int argc, char *argv[])
- fvm::Sp(Ksl/rho,U)
);
if (modelType=="B" || modelType=="Bfull")
UEqn == - fvc::grad(p) + Ksl/rho*Us;
else
UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us;
UEqn.relax();
if (momentumPredictor)
solve(UEqn);
if (momentumPredictor && (modelType=="B" || modelType=="Bfull"))
solve(UEqn == - fvc::grad(p) + Ksl/rho*Us);
else if (momentumPredictor)
solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us);
// --- PISO loop
@ -136,11 +127,17 @@ int main(int argc, char *argv[])
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
surfaceScalarField rUAfvoidfraction("(voidfraction2|A(U)F)", fvc::interpolate(rUAvoidfraction));
U = rUA*UEqn.H();
phi = (fvc::interpolate(U*voidfraction) & mesh.Sf() );
//+ fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
#ifdef version23
phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ rUAfvoidfraction*fvc::ddtCorr(U, phi);
#else
phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
#endif
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);
@ -173,6 +170,7 @@ int main(int argc, char *argv[])
if (nonOrth == nNonOrthCorr)
{
phiGes -= pEqn.flux();
phi = phiGes;
}
} // end non-orthogonal corrector loop
@ -207,7 +205,7 @@ int main(int argc, char *argv[])
}
Info<< "End\n" << endl;
return 0;
}

View File

@ -89,22 +89,6 @@
mesh
);
/*
volVectorField fSmooth
(
IOobject
(
"fSmooth",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
mesh,
dimensionedVector("0", dimensionSet(1, 1, -2, 0, 0), vector::zero)
);
*/
//===============================
//# include "createPhi.H"

View File

@ -30,7 +30,7 @@ Application
Description
Transient solver for incompressible flow.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
The code is an evolution of the solver pisoFoam in OpenFOAM(R) 1.6,
The code is an evolution of the solver pisoFoam in OpenFOAM(R) 1.6,
where additional functionality for CFD-DEM coupling is added.
\*---------------------------------------------------------------------------*/
@ -68,11 +68,15 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
// do particle stuff
Info << "- evolve()" << endl;
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
Ksl.internalField() = particleCloud.momCoupleM(0).impMomSource();
particleCloud.smoothingM().smoothen(Ksl);
if(hasEvolved)
{
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
}
Info << "update Ksl.internalField()" << endl;
Ksl = particleCloud.momCoupleM(0).impMomSource();
Ksl.correctBoundaryConditions();
@ -83,107 +87,116 @@ int main(int argc, char *argv[])
Tsource.correctBoundaryConditions();
// solve scalar transport equation
phi = fvc::interpolate(U*voidfraction) & mesh.Sf();
solve
fvScalarMatrix TEqn
(
fvm::ddt(voidfraction,T)
+ fvm::div(phi, T)
- fvm::laplacian(DT*voidfraction, T)
==
Tsource
fvm::ddt(voidfraction,T) - fvm::Sp(fvc::ddt(voidfraction),T)
+ fvm::div(phi, T) - fvm::Sp(fvc::div(phi),T)
- fvm::laplacian(DT*voidfraction, T)
==
Tsource
);
TEqn.relax();
TEqn.solve();
// Pressure-velocity PISO corrector
if(particleCloud.solveFlow())
{
// Momentum predictor
fvVectorMatrix UEqn
(
fvm::ddt(voidfraction,U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
==
- fvm::Sp(Ksl/rho,U)
);
UEqn.relax();
if (momentumPredictor)
// Pressure-velocity PISO corrector
{
//solve UEqn
if (modelType=="B" || modelType=="Bfull")
// Momentum predictor
fvVectorMatrix UEqn
(
fvm::ddt(voidfraction,U) - fvm::Sp(fvc::ddt(voidfraction),U)
+ fvm::div(phi,U) - fvm::Sp(fvc::div(phi),U)
// + turbulence->divDevReff(U)
+ particleCloud.divVoidfractionTau(U, voidfraction)
==
- fvm::Sp(Ksl/rho,U)
);
UEqn.relax();
if (momentumPredictor && (modelType=="B" || modelType=="Bfull"))
solve(UEqn == - fvc::grad(p) + Ksl/rho*Us);
else
else if (momentumPredictor)
solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us);
// --- PISO loop
//for (int corr=0; 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));
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
surfaceScalarField rUAfvoidfraction("(voidfraction2|A(U)F)", fvc::interpolate(rUAvoidfraction));
U = rUA*UEqn.H();
#ifdef version23
phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ rUAfvoidfraction*fvc::ddtCorr(U, phi);
#else
phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
#endif
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);
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) + particleCloud.ddtVoidfraction()
);
pEqn.setReference(pRefCell, pRefValue);
if
(
corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
phiGes -= pEqn.flux();
phi = phiGes;
}
} // end non-orthogonal corrector loop
#include "continuityErrorPhiPU.H"
if (modelType=="B" || modelType=="Bfull")
U -= rUA*fvc::grad(p) - Ksl/rho*Us*rUA;
else
U -= voidfraction*rUA*fvc::grad(p) - Ksl/rho*Us*rUA;
U.correctBoundaryConditions();
} // end piso loop
}
// --- 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));
volScalarField rUAvoidfraction("(voidfraction2|A(U))",rUA*voidfraction);
U = rUA*UEqn.H();
#ifdef version23
phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() );
#else
phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
#endif
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);
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) + particleCloud.ddtVoidfraction()
);
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" || modelType=="Bfull")
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();
}// end solveFlow
else
{
Info << "skipping flow solution." << endl;
}
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

7
doc/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*.o
*.d
*.a
*.dep
log_*
log.*
*~

View File

@ -218,25 +218,25 @@ listing below of styles within certain commands.
<TR ALIGN="center"><TD ><A HREF = "forceModel_GidaspowDrag.html">forceModel_GidaspowDrag</A></TD><TD ><A HREF = "forceModel_KochHillDrag.html">forceModel_KochHillDrag</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceModel_LaEuScalarTemp.html">forceModel_LaEuScalarTemp</A></TD><TD ><A HREF = "forceModel_MeiLift.html">forceModel_MeiLift</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceModel_SchillerNaumannDrag.html">forceModel_SchillerNaumannDrag</A></TD><TD ><A HREF = "forceModel_ShirgaonkarIB.html">forceModel_ShirgaonkarIB</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceModel_gradPForce.html">forceModel_gradPForce</A></TD><TD ><A HREF = "forceModel_noDrag.html">forceModel_noDrag</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceModel_particleCellVolume.html">forceModel_particleCellVolume</A></TD><TD ><A HREF = "forceModel_virtualMassForce.html">forceModel_virtualMassForce</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceModel_viscForce.html">forceModel_viscForce</A></TD><TD ><A HREF = "forceSubModel.html">forceSubModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceSubModel_ImEx.html">forceSubModel_ImEx</A></TD><TD ><A HREF = "forceSubModel_ImExCorr.html">forceSubModel_ImExCorr</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "liggghtsCommandModel.html">liggghtsCommandModel</A></TD><TD ><A HREF = "liggghtsCommandModel_execute.html">liggghtsCommandModel_execute</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "liggghtsCommandModel_readLiggghtsData.html">liggghtsCommandModel_readLiggghtsData</A></TD><TD ><A HREF = "liggghtsCommandModel_runLiggghts.html">liggghtsCommandModel_runLiggghts</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "liggghtsCommandModel_writeLiggghts.html">liggghtsCommandModel_writeLiggghts</A></TD><TD ><A HREF = "locateModel.html">locateModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "locateModel_engineSearch.html">locateModel_engineSearch</A></TD><TD ><A HREF = "locateModel_engineSearchIB.html">locateModel_engineSearchIB</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "locateModel_standardSearch.html">locateModel_standardSearch</A></TD><TD ><A HREF = "locateModel_turboEngineSearch.html">locateModel_turboEngineSearch</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "meshMotionModel.html">meshMotionModel</A></TD><TD ><A HREF = "meshMotionModel_noMeshMotion.html">meshMotionModel_noMeshMotion</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "momCoupleModel.html">momCoupleModel</A></TD><TD ><A HREF = "momCoupleModel_explicitCouple.html">momCoupleModel_explicitCouple</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "momCoupleModel_implicitCouple.html">momCoupleModel_implicitCouple</A></TD><TD ><A HREF = "momCoupleModel_noCouple.html">momCoupleModel_noCouple</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "probeModel.html">probeModel</A></TD><TD ><A HREF = "probeModel_noProbe.html">probeModel_noProbe</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "regionModel.html">regionModel</A></TD><TD ><A HREF = "regionModel_allRegion.html">regionModel_allRegion</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "smoothingModel.html">smoothingModel</A></TD><TD ><A HREF = "smoothingModel_constDiffSmoothing.html">smoothingModel_constDiffSmoothing</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "smoothingModel_noSmoothing.html">smoothingModel_noSmoothing</A></TD><TD ><A HREF = "voidFractionModel.html">voidfractionModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "voidFractionModel_GaussVoidFraction.html">voidfractionModel_GaussVoidFraction</A></TD><TD ><A HREF = "voidFractionModel_IBVoidFraction.html">voidfractionModel_IBVoidFraction</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "voidFractionModel_bigParticleVoidFraction.html">voidfractionModel_bigParticleVoidFraction</A></TD><TD ><A HREF = "voidFractionModel_centreVoidFraction.html">voidfractionModel_centreVoidFraction</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "voidFractionModel_dividedVoidFraction.html">voidfractionModel_dividedVoidFraction</A>
<TR ALIGN="center"><TD ><A HREF = "forceModel_fieldStore.html">forceModel_fieldStore</A></TD><TD ><A HREF = "forceModel_gradPForce.html">forceModel_gradPForce</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceModel_noDrag.html">forceModel_noDrag</A></TD><TD ><A HREF = "forceModel_particleCellVolume.html">forceModel_particleCellVolume</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceModel_virtualMassForce.html">forceModel_virtualMassForce</A></TD><TD ><A HREF = "forceModel_viscForce.html">forceModel_viscForce</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceSubModel.html">forceSubModel</A></TD><TD ><A HREF = "forceSubModel_ImEx.html">forceSubModel_ImEx</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "forceSubModel_ImExCorr.html">forceSubModel_ImExCorr</A></TD><TD ><A HREF = "liggghtsCommandModel.html">liggghtsCommandModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "liggghtsCommandModel_execute.html">liggghtsCommandModel_execute</A></TD><TD ><A HREF = "liggghtsCommandModel_readLiggghtsData.html">liggghtsCommandModel_readLiggghtsData</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "liggghtsCommandModel_runLiggghts.html">liggghtsCommandModel_runLiggghts</A></TD><TD ><A HREF = "liggghtsCommandModel_writeLiggghts.html">liggghtsCommandModel_writeLiggghts</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "locateModel.html">locateModel</A></TD><TD ><A HREF = "locateModel_engineSearch.html">locateModel_engineSearch</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "locateModel_engineSearchIB.html">locateModel_engineSearchIB</A></TD><TD ><A HREF = "locateModel_standardSearch.html">locateModel_standardSearch</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "locateModel_turboEngineSearch.html">locateModel_turboEngineSearch</A></TD><TD ><A HREF = "meshMotionModel.html">meshMotionModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "meshMotionModel_noMeshMotion.html">meshMotionModel_noMeshMotion</A></TD><TD ><A HREF = "momCoupleModel.html">momCoupleModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "momCoupleModel_explicitCouple.html">momCoupleModel_explicitCouple</A></TD><TD ><A HREF = "momCoupleModel_implicitCouple.html">momCoupleModel_implicitCouple</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "momCoupleModel_noCouple.html">momCoupleModel_noCouple</A></TD><TD ><A HREF = "probeModel.html">probeModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "probeModel_noProbe.html">probeModel_noProbe</A></TD><TD ><A HREF = "regionModel.html">regionModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "regionModel_allRegion.html">regionModel_allRegion</A></TD><TD ><A HREF = "smoothingModel.html">smoothingModel</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "smoothingModel_constDiffSmoothing.html">smoothingModel_constDiffSmoothing</A></TD><TD ><A HREF = "smoothingModel_noSmoothing.html">smoothingModel_noSmoothing</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "voidFractionModel.html">voidfractionModel</A></TD><TD ><A HREF = "voidFractionModel_GaussVoidFraction.html">voidfractionModel_GaussVoidFraction</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "voidFractionModel_IBVoidFraction.html">voidfractionModel_IBVoidFraction</A></TD><TD ><A HREF = "voidFractionModel_bigParticleVoidFraction.html">voidfractionModel_bigParticleVoidFraction</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "voidFractionModel_centreVoidFraction.html">voidfractionModel_centreVoidFraction</A></TD><TD ><A HREF = "voidFractionModel_dividedVoidFraction.html">voidfractionModel_dividedVoidFraction</A>
</TD></TR></TABLE></DIV>
</HTML>

Binary file not shown.

View File

@ -266,6 +266,7 @@ listing below of styles within certain commands.
"forceModel_MeiLift"_forceModel_MeiLift.html,
"forceModel_SchillerNaumannDrag"_forceModel_SchillerNaumannDrag.html,
"forceModel_ShirgaonkarIB"_forceModel_ShirgaonkarIB.html,
"forceModel_fieldStore"_forceModel_fieldStore.html,
"forceModel_gradPForce"_forceModel_gradPForce.html,
"forceModel_noDrag"_forceModel_noDrag.html,
"forceModel_particleCellVolume"_forceModel_particleCellVolume.html,

View File

@ -11,12 +11,14 @@
</H3>
<P><B>Description:</B>
</P>
<P>"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
<P>"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles, whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
</P>
<P>see:
</P>
<P>GONIVA, C., KLOSS, C., HAGER,A. and PIRKER, S. (2010): "An Open Source CFD-DEM Perspective", Proc. of OpenFOAM Workshop, Göteborg, June 22.-24.
</P>
<P>The heat transfer equation is implemented according to Nield & Bejan (2013), Convection in Porous Media, DOI 10.1007/978-1-4614-5541-7_2, Springer
</P>
<HR>
<P>(*) This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks. OPENFOAM® is a registered trade mark of OpenCFD Limited, a wholly owned subsidiary of the ESI Group.

View File

@ -9,12 +9,15 @@ cfdemSolverPisoScalar command :h3
[Description:]
"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
"cfdemSolverPisoScalar" is a coupled CFD-DEM solver using CFDEMcoupling, an open source parallel coupled CFD-DEM framework. Based on pisoFoam(R)(*), a finite volume based solver for turbulent Navier-Stokes equations applying PISO algorithm, "cfdemSolverPisoScalar" has additional functionality for a coupling to the DEM code "LIGGGHTS" as well as a scalar transport equation. The volume averaged Navier-Stokes Equations are solved accounting for momentum exchange and volume displacement of discrete particles, whose trajectories are calculated in the DEM code LIGGGHTS. The scalar transport equation is coupled to scalar properties of the particle phase, thus convective heat transfer in a fluid granular system can be modeled with "cfdemSolverPisoScalar".
see:
GONIVA, C., KLOSS, C., HAGER,A. and PIRKER, S. (2010): "An Open Source CFD-DEM Perspective", Proc. of OpenFOAM Workshop, Göteborg, June 22.-24.
The heat transfer equation is implemented according to Nield & Bejan (2013), Convection in Porous Media, DOI 10.1007/978-1-4614-5541-7_2, Springer
:line
(*) This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks. OPENFOAM® is a registered trade mark of OpenCFD Limited, a wholly owned subsidiary of the ESI Group.

View File

@ -21,7 +21,6 @@ LaEuScalarTempProps
{
velFieldName "U";
tempFieldName "T";
tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
@ -35,8 +34,6 @@ LaEuScalarTempProps
<LI><I>T</I> = name of the finite volume scalar temperature field
<LI><I>Tsource</I> = name of the finite volume scalar temperature source field
<LI><I>voidfraction</I> = name of the finite volume voidfraction field
<LI><I>Temp</I> = name of the DEM data representing the particles temperature
@ -63,7 +60,6 @@ LaEuScalarTempProps
{
velFieldName "U";
tempFieldName "T";
tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
@ -77,7 +73,7 @@ LaEuScalarTempProps
</P>
<P><B>Restrictions:</B>
</P>
<P>Goes only with cfdemSolverScalar.
<P>Goes only with cfdemSolverScalar. The force model has to be the second (!!!) model in the forces list.
</P>
<P><B>Related commands:</B>
</P>

View File

@ -19,7 +19,6 @@ LaEuScalarTempProps
\{
velFieldName "U";
tempFieldName "T";
tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
@ -31,7 +30,6 @@ LaEuScalarTempProps
{U} = name of the finite volume fluid velocity field :ulb,l
{T} = name of the finite volume scalar temperature field :l
{Tsource} = name of the finite volume scalar temperature source field :l
{voidfraction} = name of the finite volume voidfraction field :l
{Temp} = name of the DEM data representing the particles temperature :l
{convectiveHeatFlux} = name of the DEM data representing the particle-fluid convective heat flux :l
@ -51,7 +49,6 @@ LaEuScalarTempProps
\{
velFieldName "U";
tempFieldName "T";
tempSourceFieldName "Tsource";
voidfractionFieldName "voidfraction";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
@ -65,7 +62,7 @@ This "forceModel" does not influence the particles or the fluid flow! Using the
[Restrictions:]
Goes only with cfdemSolverScalar.
Goes only with cfdemSolverScalar. The force model has to be the second (!!!) model in the forces list.
[Related commands:]

View File

@ -0,0 +1,68 @@
<HTML>
<CENTER><A HREF = "http://www.cfdem.com">CFDEMproject WWW Site</A> - <A HREF = "CFDEMcoupling_Manual.html#comm">CFDEM Commands</A>
</CENTER>
<HR>
<H3>forceModel_fieldStore command
</H3>
<P><B>Syntax:</B>
</P>
<P>Defined in couplingProperties dictionary.
</P>
<PRE>forceModels
(
fieldStore
);
fieldStoreProps
{
scalarFieldNames
(
"scalarField"
);
vectorFieldNames
(
"vectorField"
);
};
</PRE>
<UL><LI><I>scalarField</I> = names of the finite volume scalar fields to be stored
<LI><I>vectorField</I> = names of the finite volume vector fields to be stored
</UL>
<P><B>Examples:</B>
</P>
<PRE>forceModels
(
fieldStore
);
fieldStoreProps
{
scalarFieldNames
(
"voidfraction"
);
vectorFieldNames
(
"U"
);
}
</PRE>
<P><B>Description:</B>
</P>
<P>This "forceModel" does not influence the particles or the flow - it is a tool to store a scalar/vector field! This is especially useful if you use a boundary condition which cannot interpreted correctly in your postporcessor (e.g. paraview).
</P>
<P><B>Restrictions:</B>
</P>
<P>none.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "forceModel.html">forceModel</A>
</P>
</HTML>

View File

@ -0,0 +1,63 @@
"CFDEMproject WWW Site"_lws - "CFDEM Commands"_lc :c
:link(lws,http://www.cfdem.com)
:link(lc,CFDEMcoupling_Manual.html#comm)
:line
forceModel_fieldStore command :h3
[Syntax:]
Defined in couplingProperties dictionary.
forceModels
(
fieldStore
);
fieldStoreProps
\{
scalarFieldNames
(
"scalarField"
);
vectorFieldNames
(
"vectorField"
);
\}; :pre
{scalarField} = names of the finite volume scalar fields to be stored :ulb,l
{vectorField} = names of the finite volume vector fields to be stored :l
:ule
[Examples:]
forceModels
(
fieldStore
);
fieldStoreProps
\{
scalarFieldNames
(
"voidfraction"
);
vectorFieldNames
(
"U"
);
\} :pre
[Description:]
This "forceModel" does not influence the particles or the flow - it is a tool to store a scalar/vector field! This is especially useful if you use a boundary condition which cannot interpreted correctly in your postporcessor (e.g. paraview).
[Restrictions:]
none.
[Related commands:]
"forceModel"_forceModel.html

Binary file not shown.

7
src/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*.o
*.d
*.a
*.dep
log_*
log.*
*~

View File

@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "global.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(global, 0);
defineRunTimeSelectionTable(global, dictionary);
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void global::info()
{
Info << "\nYou are currently using:" << endl;
Info << "OF version: " << FOAMversion << endl;
Info << "OF build: " << FOAMbuild << endl;
Info << "CFDEM build: " << CFDEMversion << "\n" << endl;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
global::global
(
const dictionary& dict,
cfdemCloud& sm
)
:
dict_(dict),
particleCloud_(sm),
CFDEMversion(GITVERSION)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
global::~global()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,128 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
Class
global
SourceFiles
global.Cver
\*---------------------------------------------------------------------------*/
#ifndef global_H
#define global_H
#include "fvCFD.H"
#include "cfdemCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class global Declaration
\*---------------------------------------------------------------------------*/
class global
{
protected:
// Protected data
const dictionary& dict_;
cfdemCloud& particleCloud_;
const char* const CFDEMversion;
// Protected member functions
public:
//- Runtime type information
TypeName("global");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
global,
dictionary,
(
const dictionary& dict,
cfdemCloud& sm
),
(dict,sm)
);
// Constructors
//- Construct from components
global
(
const dictionary& dict,
cfdemCloud& sm
);
// Destructor
virtual ~global();
// Selector
static autoPtr<global> New
(
const dictionary& dict,
cfdemCloud& sm
);
// Member Function
void info();
// Access
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "global.H"
#include "dilute.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
autoPtr<global> global::New
(
const dictionary& dict,
cfdemCloud& sm
)
{
word globalType
(
dict.lookup("global")
);
Info<< "Selecting global "
<< globalType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(globalType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "global::New(const dictionary&, const spray&) : "
<< endl
<< " unknown globalType type "
<< globalType
<< ", constructor not in hash table" << endl << endl
<< " Valid global types are :"
<< endl;
Info<< dictionaryConstructorTablePtr_->toc()
<< abort(FatalError);
}
return autoPtr<global>(cstrIter()(dict,sm));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,9 +1,44 @@
word CFDEMversion="cfdem-2.7.9";
word compatibleLIGGGHTSversion="3.0.3";
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#ifndef versionInfo_H
#define versionInfo_H
word CFDEMversion="cfdem-2.8.2";
word compatibleLIGGGHTSversion="3.0.6";
word OFversion="2.3.x-commit-4d6f4a3115ff76ec4154c580eb041bc95ba4ec09";
Info << "\nCFDEMcoupling version: " << CFDEMversion << "\n" << endl;
Info << "\n, compatible to LIGGGHTS version: " << compatibleLIGGGHTSversion << "\n" << endl;
Info << "\n, compatible to OF version: " << OFversion << "\n" << endl;
Info << "\nCFDEMcoupling version: " << CFDEMversion << endl;
Info << ", compatible to LIGGGHTS version: " << compatibleLIGGGHTSversion << endl;
Info << ", compatible to OF version and build: " << OFversion << endl;
#endif

View File

@ -31,6 +31,7 @@ Description
#include "fileName.H"
#include "cfdemCloud.H"
#include "global.H"
#include "forceModel.H"
#include "locateModel.H"
#include "momCoupleModel.H"
@ -121,7 +122,7 @@ Foam::cfdemCloud::cfdemCloud
turbulence_
(
#if defined(version21) || defined(version16ext)
#ifdef comp
#ifdef compre
mesh.lookupObject<compressible::turbulenceModel>
#else
mesh.lookupObject<incompressible::turbulenceModel>
@ -217,6 +218,8 @@ Foam::cfdemCloud::cfdemCloud
)
{
#include "versionInfo.H"
global buildInfo(couplingProperties_,*this);
buildInfo.info();
Info << "If BC are important, please provide volScalarFields -imp/expParticleForces-" << endl;
if (couplingProperties_.found("solveFlow"))
@ -453,6 +456,16 @@ label Foam::cfdemCloud::liggghtsCommandModelIndex(word name)
return index;
}
std::vector<double*>* Foam::cfdemCloud::getVprobe()
{
return probeModel_->getVprobe();
}
std::vector<double>* Foam::cfdemCloud::getSprobe()
{
return probeModel_->getSprobe();
}
// * * * * * * * * * * * * * * * WRITE * * * * * * * * * * * * * //
// * * * write cfdemCloud internal data * * * //
@ -467,6 +480,7 @@ bool Foam::cfdemCloud::evolve
numberOfParticlesChanged_ = false;
arraysReallocated_=false;
bool doCouple=false;
probeModel_->clearProbes();
if(!ignore())
{
@ -516,6 +530,7 @@ bool Foam::cfdemCloud::evolve
clockM().start(20,"setVectorAverage");
setVectorAverages();
//Smoothen "next" fields
smoothingM().dSmoothing();
smoothingM().smoothen(voidFractionM().voidFractionNext());
@ -617,6 +632,29 @@ bool Foam::cfdemCloud::reAllocArrays() const
return false;
}
bool Foam::cfdemCloud::reAllocArrays(int nP, bool forceRealloc) const
{
if( (numberOfParticlesChanged_ && !arraysReallocated_) || forceRealloc)
{
// get arrays of new length
dataExchangeM().allocateArray(positions_,0.,3,nP);
dataExchangeM().allocateArray(velocities_,0.,3,nP);
dataExchangeM().allocateArray(fluidVel_,0.,3,nP);
dataExchangeM().allocateArray(impForces_,0.,3,nP);
dataExchangeM().allocateArray(expForces_,0.,3,nP);
dataExchangeM().allocateArray(DEMForces_,0.,3,nP);
dataExchangeM().allocateArray(Cds_,0.,1,nP);
dataExchangeM().allocateArray(radii_,0.,1,nP);
dataExchangeM().allocateArray(voidfractions_,1.,voidFractionM().maxCellsPerParticle(),nP);
dataExchangeM().allocateArray(cellIDs_,0.,voidFractionM().maxCellsPerParticle(),nP);
dataExchangeM().allocateArray(particleWeights_,0.,voidFractionM().maxCellsPerParticle(),nP);
dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle(),nP);
arraysReallocated_ = true;
return true;
}
return false;
}
tmp<fvVectorMatrix> cfdemCloud::divVoidfractionTau(volVectorField& U,volScalarField& voidfraction) const
{
return
@ -659,7 +697,7 @@ tmp<volScalarField> cfdemCloud::voidfractionNuEff(volScalarField& voidfraction)
{
return tmp<volScalarField>
(
#ifdef comp
#ifdef compre
new volScalarField("viscousTerm", (turbulence_.mut() + turbulence_.mu()))
#else
new volScalarField("viscousTerm", (turbulence_.nut() + turbulence_.nu()))
@ -670,7 +708,7 @@ tmp<volScalarField> cfdemCloud::voidfractionNuEff(volScalarField& voidfraction)
{
return tmp<volScalarField>
(
#ifdef comp
#ifdef compre
new volScalarField("viscousTerm", voidfraction*(turbulence_.mut() + turbulence_.mu()))
#else
new volScalarField("viscousTerm", voidfraction*(turbulence_.nut() + turbulence_.nu()))

View File

@ -44,6 +44,7 @@ SourceFiles
// choose version
#include "OFversion.H"
#include <vector>
#include "fvCFD.H"
#include "IFstream.H"
@ -155,7 +156,7 @@ protected:
mutable volScalarField ddtVoidfraction_;
#if defined(version21) || defined(version16ext)
#ifdef comp
#ifdef compre
const compressible::turbulenceModel& turbulence_;
#else
const incompressible::turbulenceModel& turbulence_;
@ -323,6 +324,9 @@ public:
virtual inline double ** exArray() const {return NULL;};
virtual vector ex(int) const {return Foam::vector(0,0,0);};
//Detector if SRF module is enable or not
virtual inline bool SRFOn(){return false;}
inline int numberOfParticles() const;
inline bool numberOfParticlesChanged() const;
@ -358,7 +362,7 @@ public:
inline autoPtr<liggghtsCommandModel>* liggghtsCommand() const;
#if defined(version21) || defined(version16ext)
#ifdef comp
#ifdef compre
inline const compressible::turbulenceModel& turbulence() const;
#else
inline const incompressible::turbulenceModel& turbulence() const;
@ -374,6 +378,9 @@ public:
virtual bool reAllocArrays() const;
virtual bool reAllocArrays(int nP, bool forceRealloc) const; //force number of particles during reallocation
// IO
void writeScalarFieldToTerminal(double**&);
@ -391,6 +398,10 @@ public:
tmp<volScalarField> voidfractionNuEff(volScalarField&) const;
void resetArray(double**&,int,int,double resetVal=0.);
std::vector<double*>* getVprobe();
std::vector<double>* getSprobe();
};

View File

@ -284,7 +284,7 @@ inline autoPtr<liggghtsCommandModel>* cfdemCloud::liggghtsCommand() const
}
#if defined(version21) || defined(version16ext)
#ifdef comp
#ifdef compre
inline const compressible::turbulenceModel& cfdemCloud::turbulence() const
#else
inline const incompressible::turbulenceModel& cfdemCloud::turbulence() const

View File

@ -5,10 +5,10 @@
//#define version15
// choose comp/incomp
//#define comp // if comp is on - you must use Make/options_comp!
//#define compre // if comp is on - you must use Make/options_comp!
//define multi sphere
#define multisphere
//#define multisphere
// features of 2.1 work also in 2.3
#if defined(version23)

View File

@ -50,6 +50,9 @@ export CFDEM_LIGGGHTS_LIB_NAME=lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME
#- CFDEM lib name
export CFDEM_LIB_NAME=lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
#- CFDEM compressible lib name
export CFDEM_LIB_COMP_NAME=lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSION
#-----------------------------------------------------
# additional libraries
@ -68,6 +71,9 @@ export CFDEM_POEMSLIB_MAKEFILENAME=g++
#- LMP ASPHERE lib path and makefile
export CFDEM_ASPHERELIB_PATH=$CFDEM_LAMMPS_LIB_DIR/poems
export CFDEM_ASPHERELIB_MAKEFILENAME=g++
#-C3PO library
export C3PO_SRC_DIR=$CFDEM_SRC_DIR/c3po
#-----------------------------------------------------
#- path to test harness
@ -178,6 +184,11 @@ export -f cfdemLiggghtsPar
cfdemGrep() { grep -rl "$1" ./* | xargs gedit; }
export -f cfdemGrep
#- shortcut lo list files in a directory
#cfdemListFiles() { find $1 | sed s:""$1"":: > listOfFiles.txt; } #leave out the dir iteslf in list
cfdemListFiles() { find $1 > listOfFiles.txt; } #keep the dir in list
export -f cfdemListFiles
# check if the run directory exists
if [ -d "$CFDEM_PROJECT_USER_DIR" ]; then
:

View File

@ -20,48 +20,48 @@ mkdir -p $logDir
#================================================================================#
# compile src
#================================================================================#
whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/library-list.txt"
echo ""
echo "Please provide the libraries to be compiled in the $CWD/$whitelist file."
whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/library-list.txt"
echo ""
echo "Please provide the libraries to be compiled in the $CWD/$whitelist file."
if [ ! -f "$CWD/$whitelist" ];then
echo "$whitelist does not exist in $CWD. Nothing will be done."
NLINES=0
COUNT=0
else
NLINES=`wc -l < $CWD/$whitelist`
COUNT=0
fi
if [ ! -f "$CWD/$whitelist" ];then
echo "$whitelist does not exist in $CWD. Nothing will be done."
NLINES=0
COUNT=0
else
NLINES=`wc -l < $CWD/$whitelist`
COUNT=0
fi
while [ $COUNT -lt $NLINES ]
do
let COUNT++
LINE=`head -n $COUNT $CWD/$whitelist | tail -1`
# white lines
if [[ "$LINE" == "" ]]; then
echo "compile $LINE"
continue
# comments
elif [[ "$LINE" == \#* ]]; then
continue
# paths
elif [[ "$LINE" == */dir ]]; then
echo "will change path..."
LINE=$(echo "${LINE%????}")
path="$CFDEM_SRC_DIR/$LINE"
cd $path
#continue
fi
#--------------------------------------------------------------------------------#
#- define variables
logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
logfileName="log_compileCFDEMcoupling_"$(basename $LINE)""
casePath="$path"
headerText="$logfileName""-$NOW"
#--------------------------------------------------------------------------------#
# remove old log file
rm "$logpath/$logfileName"*
compileLib $logpath $logfileName $casePath $headerText
done
while [ $COUNT -lt $NLINES ]
do
let COUNT++
LINE=`head -n $COUNT $CWD/$whitelist | tail -1`
# white lines
if [[ "$LINE" == "" ]]; then
echo "compile $LINE"
continue
# comments
elif [[ "$LINE" == \#* ]]; then
continue
# paths
elif [[ "$LINE" == */dir ]]; then
echo "will change path..."
LINE=$(echo "${LINE%????}")
path="$CFDEM_SRC_DIR/$LINE"
cd $path
#continue
fi
#--------------------------------------------------------------------------------#
#- define variables
logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
logfileName="log_compileCFDEMcoupling_"$(basename $LINE)""
casePath="$path"
headerText="$logfileName""-$NOW"
#--------------------------------------------------------------------------------#
# remove old log file
rm "$logpath/$logfileName"*
compileLib $logpath $logfileName $casePath $headerText
done

View File

@ -1,36 +1,115 @@
#!/bin/bash
#===================================================================#
# compile routine for CFDEMcoupling solvers, part of CFDEMproject
# compile routine for CFDEMcoupling utilities, part of CFDEMproject
# Christoph Goniva - May. 2012, DCS Computing GmbH
#===================================================================#
whitelist="utilities-list.txt"
#- include functions
source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
NOW="$(date +"%Y-%m-%d-%H:%M")"
logDir="log"
cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc
mkdir -p $logDir
#================================================================================#
# compile utilities
#================================================================================#
CWD="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
NOW="$(date +"%Y-%m-%d-%H:%M")"
echo ""
echo "This routine will compile the utilities specified in utilities-list.txt"
echo ""
#echo "Are the variables CFDEM_UT_DIR=$CFDEM_UT_DIR"
#echo "and CFDEM_SRC_DIR=$CFDEM_SRC_DIR/lagrangian/cfdemParticle correct? (y/n)"
#read YN
#if [ "$YN" != "y" ];then
# echo "Aborted by user."
# exit 1
#fi
echo ""
echo "Please provide the utilities to be compiled in the $CWD/$whitelist file."
echo "structure:"
echo "path to provide the path relative to CFDEM_UT_DIR"
echo ""
echo "example:"
echo "cfdemPostproc/dir"
echo ""
if [ ! -f "$CWD/$whitelist" ];then
echo "$whitelist does not exist in $CWD"
else
njobs=`wc -l < $CWD/$whitelist`
echo ""
echo "running compilation in pseudo-parallel mode of $njobs utilities"
for utName in "cfdemPostproc"
do
#--------------------------------------------------------------------------------#
#- define variables
logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
logfileName="log_compileCFDEMcoupling""_$utName"
casePath="$CFDEM_UT_DIR/$utName"
headerText="$logfileName""_$utName""-$NOW"
#--------------------------------------------------------------------------------#
compileSolver $logpath $logfileName $casePath $headerText
done
echo "Note: the list of utilities compiled might be incomplete."
echo "please check $CFDEM_UT_DIR for more utilities available"
##number of utilities compiled at a time
if [[ $WM_NCOMPPROCS == "" ]] || [ $WM_NCOMPPROCS -eq 1 ]; then
nsteps=1
let nchunk=$njobs+1 # +1, to wait for the last compilation too
echo "do compilation in serial"
else
nsteps=$WM_NCOMPPROCS
nchunk=`echo $njobs/$nsteps+1 | bc`
echo "do compilation on $nsteps procs in $nchunk chunks"
let nchunk++ # +1, to wait for the last compilation too
fi
counter=0
for i in `seq $nchunk`
do
#wait until prev. compilation is finished
echo "waiting..."
until [ `ps -C make | wc -l` -eq 1 ];
do
sleep 2
done
for j in `seq $nsteps`
do
let solNr=($i-1)*$nsteps+$j
LINE=`head -n $solNr $CWD/$whitelist | tail -1`
# white lines
if [[ "$LINE" == "" ]]; then
continue
# comments
elif [[ "$LINE" == \#* ]]; then
continue
# paths
elif [[ "$LINE" == */dir ]]; then
#echo "change path"
LINE=$(echo "${LINE%????}")
path="$CFDEM_UT_DIR/$LINE"
#cd $path
let solNr++
fi
if [[ "$counter" -lt "$njobs" ]]; then
#--------------------------------------------------------------------------------#
#- define variables
#logpath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")/$logDir"
logfileName="log_compileCFDEMcoupling""_$LINE"
casePath="$CFDEM_UT_DIR/$LINE"
headerText="$logfileName""_$LINE""-$NOW"
parallel="true"
#--------------------------------------------------------------------------------#
#echo "compiling $LINE"
compileSolver $logpath $logfileName $casePath $headerText $parallel
let counter++
fi
done
sleep 1 # wait a second until compilation starts
done
echo "compilation done."
fi

View File

@ -43,6 +43,9 @@ setenv CFDEM_LIGGGHTS_LIB_NAME lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME
#- CFDEM lib name
setenv CFDEM_LIB_NAME lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION
#- CFDEM compressible lib name
setenv CFDEM_LIB_COMP_NAME lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSION
#- LMP Many2Many lib path and makefile
setenv CFDEM_Many2ManyLIB_PATH $CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library
setenv CFDEM_Many2ManyLIB_MAKEFILENAME $CFDEM_LIGGGHTS_MAKEFILE_NAME

View File

@ -71,6 +71,21 @@ compileLib()
#- wclean and wmake
#if [ $doClean != "noClean" ]; then
# check library to compile is compressible
str=$casePath
i=$((${#str}-4))
ending=${str:$i:4}
if [[ $ending == "Comp" ]]; then
echo "Compiling a compressible library - so doing an rmdepall of incomp library first."
echo "Please make sure to have the compressible libraries first in the library-list.txt!"
cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle
echo "changing to $PWD"
rmdepall 2>&1 | tee -a $logpath/$logfileName
cd $casePath
echo "changing to $PWD"
else
echo "Compiling a incompressible library."
fi
rmdepall 2>&1 | tee -a $logpath/$logfileName
wclean 2>&1 | tee -a $logpath/$logfileName
#fi

View File

@ -101,7 +101,7 @@ Archimedes::Archimedes
if (modelType_=="B"){
if(forceSubM(0).switches()[1]) // treatDEM = true
{
Warning << "Usually model type B needs Archimedes only on CFD and DEM side (treatForceDEM=false)! are you sure about your settings?" << endl;
Warning << "Usually model type B needs Archimedes on CFD and DEM side (treatForceDEM=false)! are you sure about your settings?" << endl;
}
}

View File

@ -187,7 +187,7 @@ void KochHillDrag::setForce() const
magUr = mag(Ur);
Rep = 0;
Vs = ds*ds*ds*M_PI/6;
volumefraction = 1-voidfraction+SMALL;
volumefraction = max(SMALL,min(1-SMALL,1-voidfraction));
if (magUr > 0)
{

View File

@ -138,8 +138,6 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
const volScalarField& nufField = forceSubM(0).nuField();
const volScalarField& rhoField = forceSubM(0).rhoField();
Info << "nufField=" << nufField << endl;
// calc La based heat flux
vector position(0,0,0);
scalar voidfraction(1);
@ -160,6 +158,8 @@ Info << "nufField=" << nufField << endl;
interpolationCellPoint<vector> UInterpolator_(U_);
interpolationCellPoint<scalar> TInterpolator_(tempField_);
scalar h1(0);
scalar h2(0);
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{
//if(particleCloud_.regionM().inRegion()[index][0])
@ -187,7 +187,7 @@ Info << "nufField=" << nufField << endl;
As = ds*ds*M_PI;
nuf = nufField[cellI];
Rep = ds*magUr/nuf;
Pr = Cp_*nuf*rhoField[cellI]/lambda_;
Pr = max(SMALL,Cp_*nuf*rhoField[cellI]/lambda_);
if (Rep < 200)
{
@ -195,8 +195,9 @@ Info << "nufField=" << nufField << endl;
}
else if (Rep < 1500)
{
Nup = 2+0.5*pow(voidfraction,n)*sqrt(Rep)*pow(Pr,0.33)
+0.02*pow(voidfraction,n)*pow(Rep,0.8)*pow(Pr,0.33);
h1=pow(voidfraction,n);
h2=pow(Pr,0.33);
Nup = 2+0.5*h1*sqrt(Rep)*h2+0.02*h1*pow(Rep,0.8)*h2;
}
else
{

View File

@ -112,14 +112,7 @@ void ShirgaonkarIB::setForce() const
label cellI;
vector drag;
#ifdef comp
const volScalarField& mufField = forceSubM(0).muField();
volVectorField h = (mufField*fvc::laplacian(U_)-fvc::grad(p_));
#else
const volScalarField& nufField = forceSubM(0).nuField();
const volScalarField& rhoField = forceSubM(0).rhoField();
volVectorField h = rhoField*(nufField*fvc::laplacian(U_)-fvc::grad(p_));
#endif
volVectorField h=forceSubM(0).IBDragPerV(U_,p_);
#include "setupProbeModel.H"

View File

@ -65,7 +65,13 @@ checkCouplingInterval::checkCouplingInterval
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
rhoP_(readScalar(propsDict_.lookup("rhoP")))
{}
{
// init force sub model
setForceSubModels(propsDict_);
// read those switches defined above, if provided in dict
forceSubM(0).readSwitches();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -108,7 +114,8 @@ void checkCouplingInterval::setForce() const
double accNrAll=-1.;
MPI_Allreduce(&accNr, &accNrAll, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
Info << "min. occurring particle relaxation time [s]: " << minTauP << endl;
Info << "coupling interval [s]: " << DEMtime << endl;
Info << "max. occurring acceleration nr: " << accNrAll << endl;
if(accNrAll > 0.1) Warning << "you should use a smaller coupling interval!" << endl;
}

View File

@ -0,0 +1,164 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "fieldStore.H"
#include "addToRunTimeSelectionTable.H"
#include "dataExchangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(fieldStore, 0);
addToRunTimeSelectionTable
(
forceModel,
fieldStore,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
fieldStore::fieldStore
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
mesh_(particleCloud_.mesh()),
scalarFieldNames_(propsDict_.lookup("scalarFieldNames")),
vectorFieldNames_(propsDict_.lookup("vectorFieldNames")),
scalarFields_(NULL),
vectorFields_(NULL)
{
// create time average scalar fields
scalarFields_.setSize(scalarFieldNames_.size());
for (int i=0;i < scalarFieldNames_.size(); i++)
{
word fieldName = "stored_" + scalarFieldNames_[i];
Info<< "Creating field " << fieldName << endl;
scalarFields_.set
(
i,
new volScalarField
(
IOobject
(
fieldName,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar("0", mesh_.lookupObject<volScalarField>(scalarFieldNames_[i]).dimensions(), 0)
)
);
}
// create time average vector fields
vectorFields_.setSize(vectorFieldNames_.size());
for (int i=0;i < vectorFieldNames_.size(); i++)
{
word fieldName = "stored_" + vectorFieldNames_[i];
Info<< "Creating field " << fieldName << endl;
vectorFields_.set
(
i,
new volVectorField
(
IOobject
(
fieldName,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedVector("0", mesh_.lookupObject<volVectorField>(vectorFieldNames_[i]).dimensions(), vector::zero)
)
);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
fieldStore::~fieldStore()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void fieldStore::setForce() const
{
if(particleCloud_.verbose()) Info << "fieldStore.C - setForce()" << endl;
for (int i=0;i < scalarFieldNames_.size(); i++)
{
// get reference to actual field
volScalarField& field = (volScalarField&) mesh_.lookupObject<volScalarField>(scalarFieldNames_[i]);
// save field
scalarFields_[i] = field;
}
for (int i=0;i < vectorFieldNames_.size(); i++)
{
// get reference to actual field
volVectorField& field = (volVectorField&) mesh_.lookupObject<volVectorField>(vectorFieldNames_[i]);
// save field
vectorFields_[i] = field;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // 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).
calc time average of scalar or vector field
Class
fieldStore
SourceFiles
fieldStore.C
\*---------------------------------------------------------------------------*/
#ifndef fieldStore_H
#define fieldStore_H
#include "forceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fieldStore Declaration
\*---------------------------------------------------------------------------*/
class fieldStore
:
public forceModel
{
private:
dictionary propsDict_;
const fvMesh& mesh_;
const wordList scalarFieldNames_;
const wordList vectorFieldNames_;
mutable PtrList<volScalarField> scalarFields_;
mutable PtrList<volVectorField> vectorFields_;
public:
//- Runtime type information
TypeName("fieldStore");
// Constructors
//- Construct from components
fieldStore
(
const dictionary& dict,
cfdemCloud& sm
);
// Destructor
~fieldStore();
// Member Functions
void setForce() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -76,7 +76,32 @@ forceSubModel::forceSubModel
sm.mesh(),
dimensionedScalar("nu0", dimensionSet(0, 2, -1, 0, 0), 1.)
),
nuField_(sm.turbulence().nu()),
divTau_
(
IOobject
(
"divTau",
sm.mesh().time().timeName(),
sm.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
sm.mesh(),
dimensionedVector("divTau", dimensionSet(1, -2, -2, 0, 0), vector::zero)
),
IBDragPerV_
(
IOobject
(
"IBDragPerV",
sm.mesh().time().timeName(),
sm.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
sm.mesh(),
dimensionedVector("IBDragPerV", dimensionSet(1, -2, -2, 0, 0), vector::zero)
),
densityFieldName_(dict_.lookupOrDefault<word>("densityFieldName","rho")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_))
{
@ -246,8 +271,9 @@ void forceSubModel::readSwitches() const
const volScalarField& forceSubModel::nuField() const
{
#ifdef comp
return particleCloud_.turbulence().mu() / rho_;
#ifdef compre
nu_=particleCloud_.turbulence().mu() / rho_;
return nu_;
#else
if(switches_[8]) // scalarViscosity=true
return nu_;
@ -258,9 +284,12 @@ const volScalarField& forceSubModel::nuField() const
const volScalarField& forceSubModel::muField() const
{
#ifdef comp
#ifdef compre
return particleCloud_.turbulence().mu();
#else
// passing the ref to nu*rho will not work->generate a mu_ field like nu_
FatalError<< "implementation not complete!" << abort(FatalError);
if(switches_[8]) // scalarViscosity=true
return nu_*rho_;
else
@ -270,7 +299,32 @@ const volScalarField& forceSubModel::muField() const
const volScalarField& forceSubModel::rhoField() const
{
return rho_;
return rho_;
}
const volVectorField& forceSubModel::divTauField(const volVectorField& U) const
{
// calc div(Tau)
#ifdef compre
const volScalarField& mu_ = muField();
divTau_ = -fvc::laplacian(mu_, U) - fvc::div(mu_*dev(fvc::grad(U)().T()));
return divTau_;
#else
const volScalarField& nu_ = nuField();
const volScalarField& rho_ = rhoField();
divTau_ = -fvc::laplacian(nu_*rho_, U)- fvc::div(nu_*rho_*dev(fvc::grad(U)().T()));
return divTau_;
#endif
}
const volVectorField& forceSubModel::IBDragPerV(const volVectorField& U,const volScalarField& p) const
{
#ifdef compre
IBDragPerV_ = muField()*fvc::laplacian(U)-fvc::grad(p)
#else
IBDragPerV_ = rhoField()*(nuField()*fvc::laplacian(U)-fvc::grad(p));
#endif
return IBDragPerV_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -73,7 +73,9 @@ protected:
mutable volScalarField nu_;
const volScalarField& nuField_;
mutable volVectorField divTau_;
mutable volVectorField IBDragPerV_;
word densityFieldName_;
@ -163,6 +165,10 @@ public:
const volScalarField& muField() const;
const volScalarField& rhoField() const;
const volVectorField& divTauField(const volVectorField&) const;
const volVectorField& IBDragPerV(const volVectorField&,const volScalarField&) const;
};

View File

@ -126,21 +126,7 @@ viscForce::~viscForce()
void viscForce::setForce() const
{
const volScalarField& nufField = forceSubM(0).nuField();
const volScalarField& rhoField = forceSubM(0).rhoField();
// get viscosity field
#ifdef comp
// calc div(Tau)
volVectorField divTauField =
- fvc::laplacian(forceSubM(0).muField(), U_)
- fvc::div(forceSubM(0).muField()*dev(fvc::grad(U_)().T()));
#else
// calc div(Tau)
volVectorField divTauField =
- fvc::laplacian(nufField*rhoField, U_)
- fvc::div(nufField*rhoField*dev(fvc::grad(U_)().T()));
#endif
const volVectorField& divTauField = forceSubM(0).divTauField(U_);
vector divTau;
scalar Vs;

View File

@ -64,12 +64,10 @@ DiFeliceDragMS::DiFeliceDragMS
:
forceModelMS(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
interpolation_(false),
splitImplicitExplicit_(false),
UsFieldName_(propsDict_.lookup("granVelFieldName")),
UsField_(sm.mesh().lookupObject<volVectorField> (UsFieldName_))
@ -85,28 +83,26 @@ DiFeliceDragMS::DiFeliceDragMS
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
// init force sub model
setForceSubModels(propsDict_);
// define switches which can be read from dict
forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
// read those switches defined above, if provided in dict
forceSubM(0).readSwitches();
if (propsDict_.found("interpolation"))
if (forceSubM(0).interpolation())
{
Info << "using interpolated value of U." << endl;
interpolation_=true;
Warning << " interpolation is commented for this force model - it seems to be unstable with AMI!" << endl;
}
if (propsDict_.found("splitImplicitExplicit"))
{
Info << "will split implicit / explicit force contributions." << endl;
splitImplicitExplicit_ = true;
if(!interpolation_)
if(!forceSubM(0).interpolation())
Info << "WARNING: will only consider fluctuating particle velocity in implicit / explicit force split!" << endl;
}
particleCloud_.checkCG(false);
@ -163,7 +159,7 @@ void DiFeliceDragMS::setForce() const
if (cellI > -1) // particle Found
{
//if(interpolation_)
//if(forceSubM(0).interpolation())
//{
// position = cloudRefMS().positionCM(index);
// voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
@ -218,7 +214,7 @@ void DiFeliceDragMS::setForce() const
}
}
if(verbose_ && index >=0 && index <10)
if(forceSubM(0).verbose() && index >=0 && index <10)
{
Pout << "index = " << index << endl;
Pout << "Us = " << Us << endl;

View File

@ -61,8 +61,6 @@ class DiFeliceDragMS
private:
dictionary propsDict_;
bool verbose_;
word velFieldName_;
const volVectorField& U_;
@ -71,8 +69,6 @@ private:
const volScalarField& voidfraction_;
bool interpolation_; // use interpolated U field values
bool splitImplicitExplicit_; // use splitting of implicit and explict force contribution
word UsFieldName_;

View File

@ -115,14 +115,14 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict)
if(runLast_) // last run
{
// read time options from subdict
endTime_ = particleCloud_.mesh().time().endTime().value();
endTime_ = particleCloud_.mesh().time().endTime().value()-particleCloud_.mesh().time().startTime().value();
startTime_ = endTime_;
timeInterval_ = 1;
timeInterval_ = -1;
// calculate coupling times
firstCouplingStep_ = floor(startTime_/DEMts/couplingInterval);
lastCouplingStep_ = floor(endTime_/DEMts/couplingInterval);
couplingStepInterval_ = floor(timeInterval_/DEMts/couplingInterval);
couplingStepInterval_ = -1;
}
else //runEveryCouplingStep of every n steps or every writeStep
{
@ -150,7 +150,7 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict)
{
firstCouplingStep_ =1;
lastCouplingStep_ =1;
couplingStepInterval_ =1;
couplingStepInterval_ =-1;
}
if(verbose_){

View File

@ -204,7 +204,7 @@ void particleProbe::writeHeader() const
*sPtr<<"|| scalarData: " << " ";
forAll(scalarFields_, iter)
{
*sPtr << scalarFields_(iter) << " ";
*sPtr << scalarFields_(iter) << " ";
}
}
@ -214,8 +214,20 @@ void particleProbe::writeHeader() const
}
void particleProbe::clearProbes() const
{
for (unsigned int i=0; i<vProbes_.size(); i++)
delete vProbes_[i];
sProbes_.clear();
vProbes_.clear();
}
void particleProbe::writeProbe(int index, Field<scalar> sValues, Field<vector> vValues) const
{
if(printNow_ && checkIDForPrint(index) && verboseToFile_)
{
@ -224,15 +236,34 @@ void particleProbe::writeProbe(int index, Field<scalar> sValues, Field<vector> v
*sPtr << index << tab
<< particleCloud_.mesh().time().value() << " " ;
*sPtr << "|| ";
int vsize_=vProbes_.size();
//vectorFields
*sPtr << setprecision(writePrecision_) ;
forAll(vValues, iter)
{
if(!probeDebug_ && iter>0) break;
// if(!probeDebug_ && iter>0) break;
*sPtr << vValues[iter][0] << " ";
*sPtr << vValues[iter][1] << " ";
*sPtr << vValues[iter][2] << " ";
if(index<vsize_)
{
vProbes_[index][0]+=vValues[iter][0];
vProbes_[index][1]+=vValues[iter][1];
vProbes_[index][2]+=vValues[iter][2];
}
else
{
double * vprobe_= new double[3];
vprobe_[0]=vValues[iter][0];
vprobe_[1]=vValues[iter][1];
vprobe_[2]=vValues[iter][2];
vProbes_.push_back(vprobe_);
}
}
//scalarFields
@ -242,6 +273,7 @@ void particleProbe::writeProbe(int index, Field<scalar> sValues, Field<vector> v
forAll(sValues, iter)
{
*sPtr << sValues[iter] << " ";
sProbes_.push_back(sValues[iter]);
}
}

View File

@ -44,7 +44,7 @@ SourceFiles
#include "polyMesh.H"
#include "cfdemCloud.H"
#include "OFstream.H"
#include <vector>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -101,6 +101,10 @@ private:
mutable bool printNow_;
mutable std::vector<double> sProbes_;
mutable std::vector<double*> vProbes_;
public:
//- Runtime type information
@ -129,6 +133,9 @@ public:
void writeProbe(int index, Field<scalar> sValues, Field<vector> vValues) const;
bool checkIDForPrint(int) const;
void setCounter() const;
void clearProbes() const;
std::vector<double*>* getVprobe() {return &vProbes_; };
std::vector<double>* getSprobe() {return &sProbes_; };
};

View File

@ -41,6 +41,7 @@ SourceFiles
#include "fvCFD.H"
#include "cfdemCloud.H"
#include <vector>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -139,6 +140,9 @@ public:
virtual bool checkIDForPrint(int) const {return false;};
virtual void setCounter() const {};
virtual bool active() const {return true;};
virtual std::vector<double*>* getVprobe() {return NULL;};
virtual std::vector<double>* getSprobe() {return NULL;};
virtual void clearProbes() const {};
const char* wordToChar(word&) const;
// Access

View File

@ -69,7 +69,8 @@ dividedVoidFraction::dividedVoidFraction
alphaMin_(readScalar(propsDict_.lookup("alphaMin"))),
alphaLimited_(0),
tooMuch_(0.0),
interpolation_(false)
interpolation_(false),
cfdemUseOnly_(false)
{
maxCellsPerParticle_ = 29;
@ -83,6 +84,11 @@ dividedVoidFraction::dividedVoidFraction
checkWeightNporosity(propsDict_);
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("cfdemUseOnly"))
{
cfdemUseOnly_ = readBool(propsDict_.lookup("cfdemUseOnly"));
}
}
@ -96,7 +102,11 @@ dividedVoidFraction::~dividedVoidFraction()
void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes, double**& particleV) const
{
reAllocArrays();
if(cfdemUseOnly_)
reAllocArrays(particleCloud_.numberOfParticles());
else
reAllocArrays();
scalar pi = M_PI;
vector position(0,0,0);
@ -114,6 +124,7 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra
//if(mask[index][0])
//{
// reset
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++)
{
particleWeights[index][subcell]=0;

View File

@ -69,6 +69,8 @@ private:
bool interpolation_;
bool cfdemUseOnly_;
virtual inline scalar Vp(int index, scalar radius, scalar scaleVol) const
{
return 4.188790205*radius*radius*radius*scaleVol; //4/3*pi=4.188790205

View File

@ -177,6 +177,15 @@ void Foam::voidFractionModel::reAllocArrays() const
}
}
void Foam::voidFractionModel::reAllocArrays(int nP) const
{
if(particleCloud_.numberOfParticlesChanged())
{
// get arrays of new length
particleCloud_.dataExchangeM().allocateArray(cellsPerParticle_,1,1,nP);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -150,6 +150,8 @@ public:
void reAllocArrays() const;
void reAllocArrays(int nP) const; //force number of particles during reallocation, for CFD offline-use
virtual void setParticleType(label type) const {};
virtual bool checkParticleType(label) const {return true;}; //consider all particles by default

8
tutorials/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
*.vtk
*.o
*.d
*.a
*.dep
log_*
log.*
*~

View File

@ -211,6 +211,18 @@ particleCellVolumeProps
verbose true;
}
fieldStoreProps
{
scalarFieldNames
(
);
vectorFieldNames
(
"U"
);
}
oneWayVTKProps
{
couplingFilename "vtk_out%4.4d.vtk";

View File

@ -26,7 +26,7 @@ FoamFile
liggghtsCommandModels
(
runLiggghts
//writeLiggghts
writeLiggghts
);
// ************************************************************************* //
@ -35,9 +35,9 @@ liggghtsCommandModels
preNo false;
}*/
/*writeLiggghtsProps
writeLiggghtsProps
{
writeLast off;
writeName "post/restart/liggghts.restartCFDEM";
overwrite on;
}*/
}

View File

@ -84,7 +84,7 @@ implicitCoupleProps
dividedProps
{
alphaMin 0.9;
alphaMin 0.1;
scaleUpVol 1.0;
}
@ -107,7 +107,12 @@ DiFeliceDragMSProps
velFieldName "U";
voidfractionFieldName "voidfraction";
granVelFieldName "Us";
//verbose;
verbose true;
manDHdev true;
dHbyV
(
1084200. // d of sphere of equal area by clump volume
);
}
GidaspowDragMSProps

View File

@ -53,7 +53,7 @@ smoothingModel off;
forceModels
(
KochHillDrag
LaEuScalarTemp
LaEuScalarTemp // must be 2nd pos!
Archimedes
);
@ -72,7 +72,6 @@ LaEuScalarTempProps
velFieldName "U";
tempFieldName "T";
voidfractionFieldName "voidfraction";
tempSourceFieldName "Tsource";
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
lambda 0.0256;