release on 2013-01-22_11-50-26

This commit is contained in:
goniva
2013-01-22 11:50:26 +01:00
parent bb17489887
commit a6bf0969ac
18 changed files with 71 additions and 131 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

@ -112,13 +112,14 @@ int main(int argc, char *argv[])
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();
phi = ( fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
phi = (fvc::interpolate(U*voidfraction) & mesh.Sf() )
+ fvc::ddtPhiCorr(rUAvoidfraction, U, phi);
surfaceScalarField phiS(fvc::interpolate(Us*voidfraction) & mesh.Sf());
surfaceScalarField phiGes = phi + rUAf*(fvc::interpolate(Ksl/rho) * phiS);

Binary file not shown.

Binary file not shown.

View File

@ -6,7 +6,6 @@ voidFractionModels = subModels/voidFractionModel
locateModels = subModels/locateModel
meshMotionModels = subModels/meshMotionModel
momCoupleModels = subModels/momCoupleModel
regionModels = subModels/regionModel
dataExchangeModels = subModels/dataExchangeModel
averagingModels = subModels/averagingModel
clockModels = subModels/clockModel
@ -20,18 +19,33 @@ $(forceModels)/forceModel/forceModel.C
$(forceModels)/forceModel/newForceModel.C
$(forceModels)/noDrag/noDrag.C
$(forceModels)/DiFeliceDrag/DiFeliceDrag.C
$(forceModels)/DiFeliceDragNLift/DiFeliceDragNLift.C
$(forceModels)/GidaspowDrag/GidaspowDrag.C
$(forceModels)/SchillerNaumannDrag/SchillerNaumannDrag.C
$(forceModels)/Archimedes/Archimedes.C
$(forceModels)/ArchimedesIB/ArchimedesIB.C
$(forceModels)/interface/interface.C
$(forceModels)/ShirgaonkarIB/ShirgaonkarIB.C
$(forceModels)/fieldTimeAverage/fieldTimeAverage.C
$(forceModels)/fieldBound/fieldBound.C
$(forceModels)/volWeightedAverage/volWeightedAverage.C
$(forceModels)/totalMomentumExchange/totalMomentumExchange.C
$(forceModels)/KochHillDrag/KochHillDrag.C
$(forceModels)/BeetstraDrag/multiphaseFlowBasic/multiphaseFlowBasic.C
$(forceModels)/BeetstraDrag/BeetstraDrag.C
$(forceModels)/LaEuScalarLiquid/LaEuScalarLiquid.C
$(forceModels)/LaEuScalarTemp/LaEuScalarTemp.C
$(forceModels)/LaEuScalarDust/LaEuScalarDust.C
$(forceModels)/virtualMassForce/virtualMassForce.C
$(forceModels)/gradPForce/gradPForce.C
$(forceModels)/gradULiftForce/gradULiftForce.C
$(forceModels)/viscForce/viscForce.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
@ -42,6 +56,7 @@ $(IOModels)/IOModel/newIOModel.C
$(IOModels)/noIO/noIO.C
$(IOModels)/basicIO/basicIO.C
$(IOModels)/trackIO/trackIO.C
$(IOModels)/sophIO/sophIO.C
$(voidFractionModels)/voidFractionModel/voidFractionModel.C
$(voidFractionModels)/voidFractionModel/newVoidFractionModel.C
@ -60,21 +75,18 @@ $(locateModels)/turboEngineSearch/turboEngineSearch.C
$(locateModels)/turboEngineSearchM2M/turboEngineSearchM2M.C
$(locateModels)/engineSearchIB/engineSearchIB.C
$(meshMotionModels)/meshMotionModel/meshMotionModel.C
$(meshMotionModels)/meshMotionModel/newMeshMotionModel.C
$(meshMotionModels)/noMeshMotion/noMeshMotion.C
$(meshMotionModels)/DEMdrivenMeshMotion/DEMdrivenMeshMotion.C
$(momCoupleModels)/momCoupleModel/momCoupleModel.C
$(momCoupleModels)/momCoupleModel/newMomCoupleModel.C
$(momCoupleModels)/explicitCouple/explicitCouple.C
$(momCoupleModels)/explicitCoupleSource/explicitCoupleSource.C
$(momCoupleModels)/implicitCouple/implicitCouple.C
$(momCoupleModels)/noCouple/noCouple.C
$(regionModels)/regionModel/regionModel.C
$(regionModels)/regionModel/newRegionModel.C
$(regionModels)/allRegion/allRegion.C
$(dataExchangeModels)/dataExchangeModel/dataExchangeModel.C
$(dataExchangeModels)/dataExchangeModel/newDataExchangeModel.C
$(dataExchangeModels)/oneWayVTK/oneWayVTK.C

View File

@ -43,6 +43,13 @@ namespace Foam
defineTypeNameAndDebug(noClock, 0);
addToRunTimeSelectionTable
(
clockModel,
noClock,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components

View File

@ -130,15 +130,15 @@ twoWayM2M::twoWayM2M
id_lammpsVec_ = NULL;
nlocal_foam_ = -1;
id_foam_ = NULL;
id_foam_vec_ = NULL;
id_foamVec_ = NULL;
tmp_ = NULL;
tmpI_ = NULL;
pos_lammps_=NULL;
nlocal_foam_lost_ = -1;
id_foam_lost_ = NULL;
id_foam_lost_all = NULL;
id_foamLost_ = NULL;
id_foamLostAll = NULL;
lost_pos_ = NULL;
lost_pos_all = NULL;
lost_posAll = NULL;
cellID_foam_ = NULL;
pos_foam_ = NULL;
}
@ -150,14 +150,14 @@ twoWayM2M::~twoWayM2M()
{
free(id_lammps_);
free(id_lammpsVec_);
free(id_foam_vec_);
free(id_foamVec_);
free(id_foam_);
free(id_foam_lost_);
free(id_foamLost_);
free(pos_foam_);
free(cellID_foam_);
delete[] lost_pos_all;
delete[] lost_posAll;
free(lost_pos_);
delete[] id_foam_lost_all;
delete[] id_foamLostAll;
destroy(tmpI_);
destroy(tmp_);
destroy(pos_lammps_);
@ -469,8 +469,8 @@ void Foam::twoWayM2M::syncIDs() const
// make setup of m2m
lmp2foam_->setup(nlocal_lammps_,id_lammpsSync,nlocal_foam_,id_foam_);
lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foam_vec_);
foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammpsVec_);
lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foamVec_);
foam2lmp_vec_->setup(nlocal_foam_*3,id_foamVec_,nlocal_lammps_*3,id_lammpsVec_);
// map data according to last TS
allocateArray(id_lammps_,-1.,nlocal_foam_);
@ -526,7 +526,7 @@ void Foam::twoWayM2M::syncIDs() const
}
for (int i = 0; i < nlocal_foam_*3; i++)
{
Pout << couplingStep_ << "st id_foam_vec_[" << i << "]=" << id_foam_vec_[i] << " - "<<endl;
Pout << couplingStep_ << "st id_foamVec_[" << i << "]=" << id_foamVec_[i] << " - "<<endl;
}
Pout << couplingStep_ << "st nlocal_lammps_=" << nlocal_lammps_ << endl;
Pout << couplingStep_ << "st nlocal_foam_=" << nlocal_foam_ << endl;*/
@ -545,15 +545,15 @@ void Foam::twoWayM2M::syncIDs() const
if(firstRun_)
{
lmp2foam_->setup(nlocal_lammps_,id_lammps_,nlocal_foam_,id_foam_);
lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foam_vec_);
foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammpsVec_);
lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foamVec_);
foam2lmp_vec_->setup(nlocal_foam_*3,id_foamVec_,nlocal_lammps_*3,id_lammpsVec_);
id_lammps_=NULL; // free pointer from LIG
pos_lammps_ = NULL; // free pointer from LIG
}else
{
lmp2foam_->setup(nlocal_lammps_,id_lammpsSync,nlocal_foam_,id_foam_);
lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foam_vec_);
foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammpsVec_);
lmp2foam_vec_->setup(nlocal_lammps_*3,id_lammpsVec_,nlocal_foam_*3,id_foamVec_);
foam2lmp_vec_->setup(nlocal_foam_*3,id_foamVec_,nlocal_lammps_*3,id_lammpsVec_);
}
particleCloud_.clockM().stop("setup_Comm");
}
@ -563,12 +563,13 @@ void Foam::twoWayM2M::locateParticle() const
int nop = particleCloud_.numberOfParticles();
// realloc array of lost particles // these arrays will be too long, but we do not know their length a priori???
allocateArray(id_foam_lost_,0,nop);
allocateArray(id_foamLost_,0,nop);
allocateArray(lost_pos_,0.,nop*3);
allocateArray(id_foam_,0,nop);
allocateArray(id_foam_vec_,0,nop*3);
allocateArray(id_foamVec_,0,nop*3);
allocateArray(cellID_foam_,0,nop);
allocateArray(pos_foam_,0,nop*3);
if(firstRun_)
allocateArray(pos_foam_,0,nop*3);
// stage 1 - look on proc or send or prepare for all-to-all
particleCloud_.clockM().start(7,"locate_Stage1");
@ -599,7 +600,7 @@ void Foam::twoWayM2M::locateParticle() const
// IDs for vectors
for (int j=0;j<3;j++)
{
id_foam_vec_[nlocal_foam_*3+j] = id_lammps_[i]*3+j;
id_foamVec_[nlocal_foam_*3+j] = id_lammps_[i]*3+j;
pos_foam_[nlocal_foam_*3+j] = pos[j];
}
cellID_foam_[nlocal_foam_] = cellID;
@ -631,12 +632,13 @@ void Foam::twoWayM2M::locateParticle() const
particleTransferID[n].append(id_lammps_[i]);
particleTransferPos[n].append(pos);
commPart=true;
//Pout << couplingStep_ << "st communicating particle " << id_lammps_[i] << ", to proc# " << n << endl;
}
}
if (!commPart)
{
// prepare for all to all comm
id_foam_lost_[nlocal_foam_lost_] = id_lammps_[i];
id_foamLost_[nlocal_foam_lost_] = id_lammps_[i];
for (int j=0; j<3; j++)
lost_pos_[nlocal_foam_lost_*3+j] = pos[j];
@ -715,13 +717,13 @@ void Foam::twoWayM2M::locateParticle() const
// IDs for vectors
for (int j=0;j<3;j++)
{
id_foam_vec_[nlocal_foam_*3+j] = recvParticleTransferID[i]*3+j;
id_foamVec_[nlocal_foam_*3+j] = recvParticleTransferID[i]*3+j;
pos_foam_[nlocal_foam_*3+j] = pos[j];
}
cellID_foam_[nlocal_foam_] = cellID;
// mark that ID was finally found
//id_foam_lost_all[i]=-1;
//id_foamLostAll[i]=-1;
nlocal_foam_ += 1;
//Pout << couplingStep_ << "st stage2 found particle at pos=" << pos << " ,id_foam_[i]=" << id_foam_[i] << endl;
@ -729,7 +731,7 @@ void Foam::twoWayM2M::locateParticle() const
else // might have been comm to wrong proc
{
// prepare for all to all comm
id_foam_lost_[nlocal_foam_lost_] = recvParticleTransferID[i];
id_foamLost_[nlocal_foam_lost_] = recvParticleTransferID[i];
for (int j=0; j<3; j++)
lost_pos_[nlocal_foam_lost_*3+j] = pos[j];
@ -752,24 +754,24 @@ void Foam::twoWayM2M::locateParticle() const
if (nlocal_foam_lostAll > 0)
{
Info << "all-to-all necessary: nlocal_foam_lostAll=" << nlocal_foam_lostAll << endl;
if(lost_pos_all)
if(lost_posAll)
{
delete[] lost_pos_all;
lost_pos_all = NULL;
delete[] lost_posAll;
lost_posAll = NULL;
}
if(id_foam_lost_all)
if(id_foamLostAll)
{
delete[] id_foam_lost_all;
id_foam_lost_all = NULL;
delete[] id_foamLostAll;
id_foamLostAll = NULL;
}
int nlocal_foam_lostAll = LAMMPS_NS::MPI_Allgather_Vector(lost_pos_, nlocal_foam_lost_*3, lost_pos_all, MPI_COMM_WORLD)/3; // new[] für lost_pos_all!!!
LAMMPS_NS::MPI_Allgather_Vector(id_foam_lost_, nlocal_foam_lost_, id_foam_lost_all, MPI_COMM_WORLD);
int nlocal_foam_lostAll = LAMMPS_NS::MPI_Allgather_Vector(lost_pos_, nlocal_foam_lost_*3, lost_posAll, MPI_COMM_WORLD)/3; // new[] für lost_posAll!!!
LAMMPS_NS::MPI_Allgather_Vector(id_foamLost_, nlocal_foam_lost_, id_foamLostAll, MPI_COMM_WORLD);
//Info << couplingStep_ << "st nlocal_foam_lostAll=" << nlocal_foam_lostAll << endl;
// locate lost particles
for (int i = 0; i < nlocal_foam_lostAll; i++)
{
pos = vector(lost_pos_all[i*3+0],lost_pos_all[i*3+1],lost_pos_all[i*3+2]);
pos = vector(lost_posAll[i*3+0],lost_posAll[i*3+1],lost_posAll[i*3+2]);
//Pout << "stage3 look for particle at pos=" << pos << endl;
cellID = particleCloud_.locateM().findSingleCell(pos,searchCellID);
@ -777,21 +779,21 @@ void Foam::twoWayM2M::locateParticle() const
if (cellID >= 0)
{
// IDs for scalars
id_foam_[nlocal_foam_] = id_foam_lost_all[i];
id_foam_[nlocal_foam_] = id_foamLostAll[i];
// IDs for vectors
for (int j=0;j<3;j++)
{
id_foam_vec_[nlocal_foam_*3+j] = id_foam_lost_all[i]*3+j;
id_foamVec_[nlocal_foam_*3+j] = id_foamLostAll[i]*3+j;
pos_foam_[nlocal_foam_*3+j] = pos[j];
}
cellID_foam_[nlocal_foam_] = cellID;
// mark that ID was finally found
//id_foam_lost_all[i]=-1;
//id_foamLostAll[i]=-1;
nlocal_foam_ += 1;
//Pout << "stage3 found particle at pos=" << pos << " ,id="<< id_foam_lost_all[i] << endl;
//Pout << "stage3 found particle at pos=" << pos << " ,id="<< id_foamLostAll[i] << endl;
}
}
}
@ -800,7 +802,7 @@ void Foam::twoWayM2M::locateParticle() const
/* // check if really all particles were found
particleCloud_.clockM().start(10,"locate_Stage3");
Foam::dataExchangeModel::allocateArray(id_foam_nowhere_all,1,nlocal_foam_lostAll);
MPI_Allreduce(id_foam_lost_all, id_foam_nowhere_all, nlocal_foam_lostAll, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
MPI_Allreduce(id_foamLostAll, id_foam_nowhere_all, nlocal_foam_lostAll, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
int i=0;
while (i < nlocal_foam_lostAll)

View File

@ -98,15 +98,15 @@ private:
mutable int *id_lammpsVec_;
mutable int nlocal_foam_;
mutable int *id_foam_;
mutable int *id_foam_vec_;
mutable int *id_foamVec_;
mutable double *tmp_;
mutable int *tmpI_;
mutable double **pos_lammps_;
mutable int nlocal_foam_lost_;
mutable int *id_foam_lost_;
mutable int *id_foam_lost_all;
mutable int *id_foamLost_;
mutable int *id_foamLostAll;
mutable double *lost_pos_;
mutable double *lost_pos_all;
mutable double *lost_posAll;
mutable int *cellID_foam_;
mutable double *pos_foam_;