release on 2013-01-08_15-30-41

This commit is contained in:
cfdem
2013-01-08 15:30:42 +01:00
parent e450c06e40
commit 32ec2147b8
42 changed files with 344 additions and 162 deletions

82
README Normal file
View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
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.
\*---------------------------------------------------------------------------*/

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -34,7 +34,6 @@ Description
#include "forceModel.H" #include "forceModel.H"
#include "locateModel.H" #include "locateModel.H"
#include "momCoupleModel.H" #include "momCoupleModel.H"
#include "regionModel.H"
#include "meshMotionModel.H" #include "meshMotionModel.H"
#include "voidFractionModel.H" #include "voidFractionModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
@ -164,14 +163,6 @@ Foam::cfdemCloud::cfdemCloud
*this *this
) )
), ),
regionModel_
(
regionModel::New
(
couplingProperties_,
*this
)
),
meshMotionModel_ meshMotionModel_
( (
meshMotionModel::New meshMotionModel::New
@ -230,6 +221,7 @@ Foam::cfdemCloud::cfdemCloud
Foam::cfdemCloud::~cfdemCloud() Foam::cfdemCloud::~cfdemCloud()
{ {
clockM().evalPar(); clockM().evalPar();
clockM().normHist();
free2D(positions_); free2D(positions_);
free2D(velocities_); free2D(velocities_);
free2D(impForces_); free2D(impForces_);
@ -281,7 +273,7 @@ void Foam::cfdemCloud::setNumberOfParticles(int nP)
void Foam::cfdemCloud::findCells() void Foam::cfdemCloud::findCells()
{ {
locateM().findCell(regionM().inRegion(),positions_,cellIDs_,numberOfParticles()); locateM().findCell(NULL,positions_,cellIDs_,numberOfParticles());
} }
void Foam::cfdemCloud::setForces() void Foam::cfdemCloud::setForces()
@ -289,7 +281,7 @@ void Foam::cfdemCloud::setForces()
resetArray(impForces_,numberOfParticles(),3); resetArray(impForces_,numberOfParticles(),3);
resetArray(expForces_,numberOfParticles(),3); resetArray(expForces_,numberOfParticles(),3);
resetArray(DEMForces_,numberOfParticles(),3); resetArray(DEMForces_,numberOfParticles(),3);
for (int i=0;i<cfdemCloud::nrForceModels();i++) cfdemCloud::forceM(i).setForce(regionM().inRegion(),impForces_,expForces_,DEMForces_); for (int i=0;i<cfdemCloud::nrForceModels();i++) cfdemCloud::forceM(i).setForce(NULL,impForces_,expForces_,DEMForces_);
} }
// * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //
@ -378,16 +370,15 @@ bool Foam::cfdemCloud::evolve
Info << "\n Coupling..." << endl; Info << "\n Coupling..." << endl;
doCouple=true; doCouple=true;
clockM().start(15,"defineRegion");
if(verbose_) Info << "- defineRegion()" << endl;
regionM().defineRegion();
if(verbose_) Info << "defineRegion done." << endl;
clockM().stop("defineRegion");
// reset vol Fields // reset vol Fields
clockM().start(16,"resetVolFields"); clockM().start(16,"resetVolFields");
if(verbose_) Info << "- resetVolFields()" << endl; if(verbose_) Info << "- resetVolFields()" << endl;
regionM().resetVolFields(Us); averagingM().resetVectorAverage(averagingM().UsPrev(),averagingM().UsNext());
voidFractionM().resetVoidFractions();
averagingM().resetVectorAverage(forceM(0).impParticleForces(),forceM(0).impParticleForces(),true);
averagingM().resetVectorAverage(forceM(0).expParticleForces(),forceM(0).expParticleForces(),true);
averagingM().resetWeightFields();
momCoupleM(0).resetMomSourceField();
if(verbose_) Info << "resetVolFields done." << endl; if(verbose_) Info << "resetVolFields done." << endl;
clockM().stop("resetVolFields"); clockM().stop("resetVolFields");
@ -407,7 +398,7 @@ bool Foam::cfdemCloud::evolve
// set void fraction field // set void fraction field
clockM().start(19,"setvoidFraction"); clockM().start(19,"setvoidFraction");
if(verbose_) Info << "- setvoidFraction()" << endl; if(verbose_) Info << "- setvoidFraction()" << endl;
voidFractionM().setvoidFraction(regionM().inRegion(),voidfractions_,particleWeights_,particleVolumes_); voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_);
if(verbose_) Info << "setvoidFraction done." << endl; if(verbose_) Info << "setvoidFraction done." << endl;
clockM().stop("setvoidFraction"); clockM().stop("setvoidFraction");
@ -420,7 +411,7 @@ bool Foam::cfdemCloud::evolve
velocities_, velocities_,
particleWeights_, particleWeights_,
averagingM().UsWeightField(), averagingM().UsWeightField(),
regionM().inRegion() NULL //mask
); );
if(verbose_) Info << "setVectorAverage done." << endl; if(verbose_) Info << "setVectorAverage done." << endl;
clockM().stop("setVectorAverage"); clockM().stop("setVectorAverage");
@ -440,14 +431,14 @@ bool Foam::cfdemCloud::evolve
forceM(0).impParticleForces(), forceM(0).impParticleForces(),
impForces_, impForces_,
particleWeights_, particleWeights_,
regionM().inRegion() NULL //mask
); );
averagingM().setVectorSum averagingM().setVectorSum
( (
forceM(0).expParticleForces(), forceM(0).expParticleForces(),
expForces_, expForces_,
particleWeights_, particleWeights_,
regionM().inRegion() NULL //mask
); );
if(verbose_) Info << "- setParticleForceField done." << endl; if(verbose_) Info << "- setParticleForceField done." << endl;
clockM().stop("setParticleForceField"); clockM().stop("setParticleForceField");
@ -457,12 +448,6 @@ bool Foam::cfdemCloud::evolve
clockM().start(23,"giveDEMdata"); clockM().start(23,"giveDEMdata");
giveDEMdata(); giveDEMdata();
clockM().stop("giveDEMdata"); clockM().stop("giveDEMdata");
// expand region - call for new particles
if(verbose_) Info << "- expandRegion()" << endl;
regionM().expandRegion(U);
if(verbose_) Info << "expandRegion done." << endl;
}//end dataExchangeM().couple() }//end dataExchangeM().couple()
Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl; Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl;

View File

@ -73,7 +73,6 @@ class IOModel;
class averagingModel; class averagingModel;
class clockModel; class clockModel;
class momCoupleModel; class momCoupleModel;
class regionModel;
class meshMotionModel; class meshMotionModel;
class liggghtsCommandModel; class liggghtsCommandModel;
@ -158,8 +157,6 @@ protected:
autoPtr<clockModel> clockModel_; autoPtr<clockModel> clockModel_;
autoPtr<regionModel> regionModel_;
autoPtr<meshMotionModel> meshMotionModel_; autoPtr<meshMotionModel> meshMotionModel_;
autoPtr<liggghtsCommandModel>* liggghtsCommand_; autoPtr<liggghtsCommandModel>* liggghtsCommand_;
@ -273,8 +270,6 @@ public:
inline const clockModel& clockM() const; inline const clockModel& clockM() const;
inline const regionModel& regionM() const;
inline const meshMotionModel& meshMotionM() const; inline const meshMotionModel& meshMotionM() const;
inline const wordList& liggghtsCommandModelList() const; inline const wordList& liggghtsCommandModelList() const;

View File

@ -169,11 +169,6 @@ inline const clockModel& cfdemCloud::clockM() const
return clockModel_; return clockModel_;
} }
inline const regionModel& cfdemCloud::regionM() const
{
return regionModel_;
}
inline const meshMotionModel& cfdemCloud::meshMotionM() const inline const meshMotionModel& cfdemCloud::meshMotionM() const
{ {
return meshMotionModel_; return meshMotionModel_;

View File

@ -33,7 +33,6 @@ Description
#include "cfdemCloudIB.H" #include "cfdemCloudIB.H"
#include "voidFractionModel.H" #include "voidFractionModel.H"
#include "forceModel.H" #include "forceModel.H"
#include "regionModel.H"
#include "locateModel.H" #include "locateModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
#include "IOModel.H" #include "IOModel.H"
@ -94,22 +93,18 @@ bool Foam::cfdemCloudIB::evolve()
Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl; Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl;
doCouple=true; doCouple=true;
if(verbose_) Info << "- defineRegion()" << endl;
regionM().defineRegion();
if(verbose_) Info << "defineRegion done." << endl;
if(verbose_) Info << "- getDEMdata()" << endl; if(verbose_) Info << "- getDEMdata()" << endl;
getDEMdata(); getDEMdata();
Info << "nr particles = " << numberOfParticles() << endl; Info << "nr particles = " << numberOfParticles() << endl;
// search cellID of particles // search cellID of particles
if(verbose_) Info << "- findCell()" << endl; if(verbose_) Info << "- findCell()" << endl;
locateM().findCell(regionM().inRegion(),positions_,cellIDs_,numberOfParticles()); locateM().findCell(NULL,positions_,cellIDs_,numberOfParticles());
if(verbose_) Info << "findCell done." << endl; if(verbose_) Info << "findCell done." << endl;
// set void fraction field // set void fraction field
if(verbose_) Info << "- setvoidFraction()" << endl; if(verbose_) Info << "- setvoidFraction()" << endl;
voidFractionM().setvoidFraction(regionM().inRegion(),voidfractions_,particleWeights_,particleVolumes_); voidFractionM().setvoidFraction(NULL,voidfractions_,particleWeights_,particleVolumes_);
if(verbose_) Info << "setvoidFraction done." << endl; if(verbose_) Info << "setvoidFraction done." << endl;
// set particles forces // set particles forces
@ -120,7 +115,7 @@ bool Foam::cfdemCloudIB::evolve()
expForces_[index][i] = 0; expForces_[index][i] = 0;
} }
} }
for (int i=0;i<nrForceModels();i++) forceM(i).setForce(regionM().inRegion(),impForces_,expForces_,expForces_); for (int i=0;i<nrForceModels();i++) forceM(i).setForce(NULL,impForces_,expForces_,expForces_);
if(verbose_) Info << "setForce done." << endl; if(verbose_) Info << "setForce done." << endl;
// write DEM data // write DEM data
@ -152,8 +147,8 @@ void Foam::cfdemCloudIB::calcVelocityCorrection
vector angVel(0,0,0); vector angVel(0,0,0);
for(int index=0; index< numberOfParticles(); index++) for(int index=0; index< numberOfParticles(); index++)
{ {
if(regionM().inRegion()[index][0]) //if(regionM().inRegion()[index][0])
{ //{
for(int subCell=0;subCell<voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
//Info << "subCell=" << subCell << endl; //Info << "subCell=" << subCell << endl;
@ -171,7 +166,7 @@ void Foam::cfdemCloudIB::calcVelocityCorrection
U[cellI]=(1-voidfractions_[index][subCell])*uParticle+voidfractions_[index][subCell]*U[cellI]; U[cellI]=(1-voidfractions_[index][subCell])*uParticle+voidfractions_[index][subCell]*U[cellI];
} }
} }
} //}
} }
// make field divergence free // make field divergence free

View File

@ -32,7 +32,6 @@ Description
#include "cfdemCloudMS.H" #include "cfdemCloudMS.H"
#include "voidFractionModel.H" #include "voidFractionModel.H"
#include "forceModelMS.H" #include "forceModelMS.H"
#include "regionModel.H"
#include "locateModel.H" #include "locateModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
@ -212,7 +211,7 @@ void Foam::cfdemCloudMS::setNumberOfParticles(int nP)
void Foam::cfdemCloudMS::findCells() void Foam::cfdemCloudMS::findCells()
{ {
cfdemCloud::findCells(); cfdemCloud::findCells();
locateM().findCell(regionM().inRegion(),positionsCM_,cellIDsCM_,numberOfClumps()); locateM().findCell(NULL,positionsCM_,cellIDsCM_,numberOfClumps());
} }
void Foam::cfdemCloudMS::setForces() void Foam::cfdemCloudMS::setForces()
@ -222,7 +221,7 @@ void Foam::cfdemCloudMS::setForces()
resetArray(impForces_,numberOfParticles(),3); resetArray(impForces_,numberOfParticles(),3);
resetArray(expForces_,numberOfParticles(),3); resetArray(expForces_,numberOfParticles(),3);
resetArray(DEMForces_,numberOfParticles(),3); resetArray(DEMForces_,numberOfParticles(),3);
for (int i=0;i<cfdemCloudMS::nrForceModels();i++) cfdemCloudMS::forceM(i).setForce(regionM().inRegion(),impForces_,expForces_,DEMForces_); for (int i=0;i<cfdemCloudMS::nrForceModels();i++) cfdemCloudMS::forceM(i).setForce(NULL,impForces_,expForces_,DEMForces_);
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -66,8 +66,8 @@ void averagingModel::undoVectorAverage
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
//Info << "subCell=" << subCell << endl; //Info << "subCell=" << subCell << endl;
@ -87,7 +87,7 @@ void averagingModel::undoVectorAverage
} }
} }
} }
} //}
} }
// correct cell values to patches // correct cell values to patches
@ -108,8 +108,8 @@ void averagingModel::undoVectorSum
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
//Info << "subCell=" << subCell << endl; //Info << "subCell=" << subCell << endl;
@ -123,7 +123,7 @@ void averagingModel::undoVectorSum
field[cellI] -= valueVec*weightP; field[cellI] -= valueVec*weightP;
} }
}//forAllSubPoints }//forAllSubPoints
} //}
} }
// correct cell values to patches // correct cell values to patches
@ -144,8 +144,8 @@ void averagingModel::setVectorSum
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
cellI = particleCloud_.cellIDs()[index][subCell]; cellI = particleCloud_.cellIDs()[index][subCell];
@ -157,7 +157,7 @@ void averagingModel::setVectorSum
field[cellI] += valueVec*weightP; field[cellI] += valueVec*weightP;
} }
}//forAllSubPoints }//forAllSubPoints
} //}
} }
// correct cell values to patches // correct cell values to patches
@ -178,8 +178,8 @@ void averagingModel::setScalarSum
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
//Info << "subCell=" << subCell << endl; //Info << "subCell=" << subCell << endl;
@ -192,7 +192,7 @@ void averagingModel::setScalarSum
field[cellI] += valueScal*weightP; field[cellI] += valueScal*weightP;
} }
}//forAllSubPoints }//forAllSubPoints
} //}
} }
// correct cell values to patches // correct cell values to patches
@ -215,12 +215,12 @@ void Foam::averagingModel::undoWeightFields(double**const& mask) const
{ {
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
// undo voidfraction cause by particle // undo voidfraction cause by particle
label cellI = particleCloud_.cellIDs()[index][0]; label cellI = particleCloud_.cellIDs()[index][0];
UsWeightField_[cellI] -= particleCloud_.particleWeights()[index][0]; UsWeightField_[cellI] -= particleCloud_.particleWeights()[index][0];
} //}
} }
} }

View File

@ -89,8 +89,8 @@ void dense::setScalarAverage
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
//Info << "subCell=" << subCell << endl; //Info << "subCell=" << subCell << endl;
@ -114,7 +114,7 @@ void dense::setScalarAverage
} }
} }
} }
} //}
} }
// correct cell values to patches // correct cell values to patches
@ -136,8 +136,8 @@ void dense::setVectorAverage
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
cellI = particleCloud_.cellIDs()[index][subCell]; cellI = particleCloud_.cellIDs()[index][subCell];
@ -160,7 +160,7 @@ void dense::setVectorAverage
} }
} }
}//forAllSubPoints }//forAllSubPoints
} //}
} }
// correct cell values to patches // correct cell values to patches

View File

@ -88,8 +88,8 @@ void dilute::setScalarAverage
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
//Info << "subCell=" << subCell << endl; //Info << "subCell=" << subCell << endl;
@ -104,7 +104,7 @@ void dilute::setScalarAverage
field[cellI] = valueScal/weightP; field[cellI] = valueScal/weightP;
} }
} }
} //}
} }
// correct cell values to patches // correct cell values to patches
@ -126,8 +126,8 @@ void dilute::setVectorAverage
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
//Info << "subCell=" << subCell << endl; //Info << "subCell=" << subCell << endl;
@ -142,7 +142,7 @@ void dilute::setVectorAverage
else Warning << "!!! W A R N I N G --- weightP <= 0" << endl; else Warning << "!!! W A R N I N G --- weightP <= 0" << endl;
} }
} }
} //}
} }
// correct cell values to patches // correct cell values to patches

View File

@ -308,6 +308,125 @@ std::vector<int> Foam::clockModel::calcShift() const
} }
return shifts; return shifts;
} }
/*void Foam::clockModel::normHist() const
{
int myrank=-10;
int numprocs=-10;
MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
double buffOut=0.;
double buffIn=0.;
// code to examine
List< int > codeParts(4);
codeParts[0]=1; // Global
codeParts[1]=2; // Coupling
codeParts[2]=3; // LIGGGHTS
codeParts[3]=26;// Flow
forAll(codeParts,i)
{
Info << "i=" << i << " ,codeParts[i]=" << codeParts[i] << endl;
buffIn = double(deltaT_[codeParts[i]]);
MPI_Allreduce(&buffIn, &buffOut, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
buffIn = buffIn/buffOut;
Pout << "[" << myrank << "]: " << identifier_[codeParts[i]] << " " << buffIn << '\n';
Info << "CPU time % of " <<identifier_[codeParts[i]] << ":";
List< double > globalTime(numprocs);
forAll(globalTime,procI)
globalTime[procI]=buffIn;
forAll(globalTime,procI)
Info<< globalTime[procI] << ", ";
Info << endl;
}
return;
}*/
void Foam::clockModel::normHist() const
{
int myrank=-10;
MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
int numprocs=-10;
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
double buffOut=0.;
double buffIn=0.;
Info << "==========================" << endl;
Info << " PROCESSOR LOAD HISTOGRAM" << endl;
//Global = 1
buffIn = double(deltaT_[1]);
MPI_Allreduce(&buffIn, &buffOut, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
if(buffOut>SMALL) buffIn /= buffOut;
plotHist(buffIn,identifier_[1],numprocs,myrank);
//LIGGGHTS = 3
buffIn = double(deltaT_[3]);
MPI_Allreduce(&buffIn, &buffOut, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
if(buffOut>SMALL) buffIn /= buffOut;
plotHist(buffIn,identifier_[3],numprocs,myrank);
//Coupling - LIGGGHTS = 2 - 3
buffIn = double(deltaT_[2]) - buffIn;
MPI_Allreduce(&buffIn, &buffOut, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
if(buffOut>SMALL) buffIn /= buffOut;
plotHist(buffIn,"Coupling (routines)",numprocs,myrank);
//Flow = 26
buffIn = double(deltaT_[26]);
MPI_Allreduce(&buffIn, &buffOut, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
if(buffOut>SMALL) buffIn /= buffOut;
plotHist(buffIn,identifier_[26],numprocs,myrank);
Info << "===========================" << endl;
return;
}
void Foam::clockModel::plotHist(double buffIn,std::string identifier,int numprocs,int myrank) const
{
double* globalTime=NULL;
double* globalTime_all=NULL;
particleCloud_.dataExchangeM().allocateArray(globalTime,0.,numprocs);
particleCloud_.dataExchangeM().allocateArray(globalTime_all,0.,numprocs);
globalTime[myrank]=buffIn;
MPI_Allreduce(globalTime, globalTime_all, numprocs, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
for(int j=0;j<numprocs;j++)
printf("%4f ",globalTime_all[j]);
Info << "\t" <<identifier << endl;
free(globalTime);
free(globalTime_all);
}
void Foam::clockModel::Hist() const
{
int myrank=-10;
MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
//Global = 1 / Coupling = 2 / LIGGGHTS = 3 /Flow = 26
//Global = 1
Pout << "[" << myrank << "]: " << identifier_[1] << " " << (deltaT_[1]/CLOCKS_PER_SEC) << '\n';
//LIGGGHTS = 3
Pout << "[" << myrank << "]: " << identifier_[3] << " " << (deltaT_[3]/CLOCKS_PER_SEC) << '\n';
//Coupling - LIGGGHTS = 2 - 3
Pout << "[" << myrank << "]: " << "Coupling - LIGGGHTS" << " " << ((deltaT_[2]-deltaT_[3])/CLOCKS_PER_SEC) << '\n';
//Flow = 26
Pout << "[" << myrank << "]: " << identifier_[26] << " " << (deltaT_[26]/CLOCKS_PER_SEC) << '\n';
return;
}
// * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -43,6 +43,7 @@ SourceFiles
#include "fvCFD.H" #include "fvCFD.H"
#include "cfdemCloud.H" #include "cfdemCloud.H"
#include "dataExchangeModel.H"
#include <vector> #include <vector>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -127,6 +128,9 @@ public:
virtual void evalPar() const; virtual void evalPar() const;
void initElems(); void initElems();
std::vector<int> calcShift() const; //detects empty indices in vector, when times are evaluated std::vector<int> calcShift() const; //detects empty indices in vector, when times are evaluated
void Hist() const; //calc Histogram
void normHist() const; //calc normalized Histogram
void plotHist(double,std::string,int,int) const; //plot histogramm to terminal
}; };

View File

@ -110,8 +110,8 @@ void Archimedes::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
label cellI = particleCloud_.cellIDs()[index][0]; label cellI = particleCloud_.cellIDs()[index][0];
force=vector::zero; force=vector::zero;
@ -130,7 +130,7 @@ void Archimedes::setForce
if(treatDEM_) for(int j=0;j<3;j++) DEMForces[index][j] += force[j]; if(treatDEM_) for(int j=0;j<3;j++) DEMForces[index][j] += force[j];
else if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += force[j]; else if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += force[j];
else for(int j=0;j<3;j++) impForces[index][j] += force[j]; else for(int j=0;j<3;j++) impForces[index][j] += force[j];
} //}
} }
} }

View File

@ -111,8 +111,8 @@ void ArchimedesIB::setForce
vector force; vector force;
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
force=vector::zero; force=vector::zero;
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
{ {
@ -128,7 +128,7 @@ void ArchimedesIB::setForce
if(treatDEM_) for(int j=0;j<3;j++) DEMForces[index][j] += force[j]; if(treatDEM_) for(int j=0;j<3;j++) DEMForces[index][j] += force[j];
else if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += force[j]; else if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += force[j];
else for(int j=0;j<3;j++) impForces[index][j] += force[j]; else for(int j=0;j<3;j++) impForces[index][j] += force[j];
} //}
} }
} }

View File

@ -126,8 +126,8 @@ void DiFeliceDrag::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); index++) for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
cellI = particleCloud_.cellIDs()[index][0]; cellI = particleCloud_.cellIDs()[index][0];
drag = vector(0,0,0); drag = vector(0,0,0);
@ -190,7 +190,7 @@ void DiFeliceDrag::setForce
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j]; if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j];
else for(int j=0;j<3;j++) impForces[index][j] += drag[j]; else for(int j=0;j<3;j++) impForces[index][j] += drag[j];
} }
} //}
} }

View File

@ -99,8 +99,8 @@ void GidaspowDrag::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
vector drag(0,0,0); vector drag(0,0,0);
label cellI = particleCloud_.cellIDs()[index][0]; label cellI = particleCloud_.cellIDs()[index][0];
@ -144,7 +144,7 @@ void GidaspowDrag::setForce
// set force on particle // set force on particle
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j]; if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j];
else for(int j=0;j<3;j++) impForces[index][j] += drag[j]; else for(int j=0;j<3;j++) impForces[index][j] += drag[j];
}// end if mask //}// end if mask
}// end loop particles }// end loop particles
} }

View File

@ -126,8 +126,8 @@ void KochHillDrag::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); index++) for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
cellI = particleCloud_.cellIDs()[index][0]; cellI = particleCloud_.cellIDs()[index][0];
drag = vector(0,0,0); drag = vector(0,0,0);
@ -210,7 +210,7 @@ void KochHillDrag::setForce
// set force on particle // set force on particle
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j]; if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j];
else for(int j=0;j<3;j++) impForces[index][j] += drag[j]; else for(int j=0;j<3;j++) impForces[index][j] += drag[j];
} //}
} }
} }

View File

@ -150,8 +150,8 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{ {
if(particleCloud_.regionM().inRegion()[index][0]) //if(particleCloud_.regionM().inRegion()[index][0])
{ //{
label cellI = particleCloud_.cellIDs()[index][0]; label cellI = particleCloud_.cellIDs()[index][0];
if(cellI >= 0) if(cellI >= 0)
@ -200,7 +200,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
Info << "ptempField_[cellI] = " << tempField_[cellI] << endl ; Info << "ptempField_[cellI] = " << tempField_[cellI] << endl ;
}*/ }*/
} }
} //}
} }
particleCloud_.averagingM().setScalarSum particleCloud_.averagingM().setScalarSum
@ -208,7 +208,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const
EuField, EuField,
partHeatFlux_, partHeatFlux_,
particleCloud_.particleWeights(), particleCloud_.particleWeights(),
particleCloud_.regionM().inRegion() NULL
); );
// scale with -1/(Vcell*rho*Cp) // scale with -1/(Vcell*rho*Cp)

View File

@ -45,7 +45,6 @@ SourceFiles
#define LaEuScalarTemp_H #define LaEuScalarTemp_H
#include "forceModel.H" #include "forceModel.H"
#include "regionModel.H"
#include "averagingModel.H" #include "averagingModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -121,8 +121,8 @@ void MeiLift::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); index++) for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
lift=vector::zero; lift=vector::zero;
label cellI = particleCloud_.cellIDs()[index][0]; label cellI = particleCloud_.cellIDs()[index][0];
@ -173,7 +173,7 @@ void MeiLift::setForce
if(treatDEM_) for(int j=0;j<3;j++) DEMForces[index][j] += lift[j]; if(treatDEM_) for(int j=0;j<3;j++) DEMForces[index][j] += lift[j];
else if(!treatExplicit_) for(int j=0;j<3;j++) impForces[index][j] += lift[j]; else if(!treatExplicit_) for(int j=0;j<3;j++) impForces[index][j] += lift[j];
else for(int j=0;j<3;j++) expForces[index][j] += lift[j]; else for(int j=0;j<3;j++) expForces[index][j] += lift[j];
} //}
} }
} }

View File

@ -100,8 +100,8 @@ void SchillerNaumannDrag::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); index++) for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
vector drag(0,0,0); vector drag(0,0,0);
label cellI = particleCloud_.cellIDs()[index][0]; label cellI = particleCloud_.cellIDs()[index][0];
@ -150,7 +150,7 @@ void SchillerNaumannDrag::setForce
// set force on particle // set force on particle
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j]; if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += drag[j];
else for(int j=0;j<3;j++) impForces[index][j] += drag[j]; else for(int j=0;j<3;j++) impForces[index][j] += drag[j];
} //}
} }
} }

View File

@ -117,8 +117,8 @@ void ShirgaonkarIB::setForce
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
drag=vector::zero; drag=vector::zero;
for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++) for(int subCell=0;subCell<particleCloud_.voidFractionM().cellsPerParticle()[index][0];subCell++)
@ -139,7 +139,7 @@ void ShirgaonkarIB::setForce
else for(int j=0;j<3;j++) impForces[index][j] += drag[j]; else for(int j=0;j<3;j++) impForces[index][j] += drag[j];
if(verbose_) Info << "impForces = " << impForces[index][0]<<","<<impForces[index][1]<<","<<impForces[index][2] << endl; if(verbose_) Info << "impForces = " << impForces[index][0]<<","<<impForces[index][1]<<","<<impForces[index][2] << endl;
} //}
} }
} }

View File

@ -134,8 +134,8 @@ void gradPForce::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); index++) for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
force=vector(0,0,0); force=vector(0,0,0);
cellI = particleCloud_.cellIDs()[index][0]; cellI = particleCloud_.cellIDs()[index][0];
@ -174,7 +174,7 @@ void gradPForce::setForce
else if(!treatExplicit_) for(int j=0;j<3;j++) impForces[index][j] += force[j]; else if(!treatExplicit_) for(int j=0;j<3;j++) impForces[index][j] += force[j];
else for(int j=0;j<3;j++) expForces[index][j] += force[j]; else for(int j=0;j<3;j++) expForces[index][j] += force[j];
} //}
} }
} }

View File

@ -103,8 +103,8 @@ void interface::setForce
Info << "interface::setForce" << endl; Info << "interface::setForce" << endl;
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
// definition of spherical particle // definition of spherical particle
scalar dp = 2*particleCloud_.radius(index); scalar dp = 2*particleCloud_.radius(index);
vector position = particleCloud_.position(index); vector position = particleCloud_.position(index);
@ -187,7 +187,7 @@ Info << "interface::setForce" << endl;
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += interfaceForce[j]; if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += interfaceForce[j];
else for(int j=0;j<3;j++) impForces[index][j] += interfaceForce[j]; else for(int j=0;j<3;j++) impForces[index][j] += interfaceForce[j];
} // end if particle found on proc domain } // end if particle found on proc domain
}// end if in mask //}// end if in mask
}// end loop particles }// end loop particles
Info << "interface::setForce - done" << endl; Info << "interface::setForce - done" << endl;
} }

View File

@ -86,12 +86,12 @@ void noDrag::setForce
Info << "noDrag::setForce" << endl; Info << "noDrag::setForce" << endl;
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
// set force on particle // set force on particle
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] = 0.; if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] = 0.;
else for(int j=0;j<3;j++) impForces[index][j] = 0.; else for(int j=0;j<3;j++) impForces[index][j] = 0.;
} //}
} }
} }

View File

@ -105,8 +105,8 @@ void virtualMassForce::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); index++) for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
vector virtualMassForce(0,0,0); vector virtualMassForce(0,0,0);
label cellI = particleCloud_.cellIDs()[index][0]; label cellI = particleCloud_.cellIDs()[index][0];
@ -132,7 +132,7 @@ void virtualMassForce::setForce
// set force on particle // set force on particle
if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += virtualMassForce[j]; if(treatExplicit_) for(int j=0;j<3;j++) expForces[index][j] += virtualMassForce[j];
else for(int j=0;j<3;j++) impForces[index][j] += virtualMassForce[j]; else for(int j=0;j<3;j++) impForces[index][j] += virtualMassForce[j];
} //}
} }
} }

View File

@ -133,8 +133,8 @@ void viscForce::setForce
for(int index = 0;index < particleCloud_.numberOfParticles(); index++) for(int index = 0;index < particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
force=vector(0,0,0); force=vector(0,0,0);
cellI = particleCloud_.cellIDs()[index][0]; cellI = particleCloud_.cellIDs()[index][0];
@ -170,7 +170,7 @@ void viscForce::setForce
else if(!treatExplicit_) for(int j=0;j<3;j++) impForces[index][j] += force[j]; else if(!treatExplicit_) for(int j=0;j<3;j++) impForces[index][j] += force[j];
else for(int j=0;j<3;j++) expForces[index][j] += force[j]; else for(int j=0;j<3;j++) expForces[index][j] += force[j];
} //}
} }
} }

View File

@ -93,7 +93,8 @@ label engineSearch::findCell
{ {
cellIDs[index][0]=-1; cellIDs[index][0]=-1;
if(mask[index][0] && particleCloud_.radius(index) > SMALL) //if(mask[index][0] && particleCloud_.radius(index) > SMALL)
if(particleCloud_.radius(index) > SMALL)
{ {
// create pos vector // create pos vector

View File

@ -92,7 +92,8 @@ label engineSearchIB::findCell
{ {
cellIDs[index][0]=-1; cellIDs[index][0]=-1;
double radius=particleCloud_.radius(index); double radius=particleCloud_.radius(index);
if(mask[index][0] && radius > SMALL) //if(mask[index][0] && radius > SMALL)
if(radius > SMALL)
{ {
// create pos vector // create pos vector
for(int i=0;i<3;i++) position[i] = positions[index][i]; for(int i=0;i<3;i++) position[i] = positions[index][i];

View File

@ -85,7 +85,8 @@ label standardSearch::findCell
cellIDs[index][0]=-1; cellIDs[index][0]=-1;
if(mask[index][0] && particleCloud_.radius(index) > SMALL) //if(mask[index][0] && particleCloud_.radius(index) > SMALL)
if(particleCloud_.radius(index) > SMALL)
{ {
// create pos vector // create pos vector
for(int i=0;i<3;i++) position[i] = positions[index][i]; for(int i=0;i<3;i++) position[i] = positions[index][i];

View File

@ -94,7 +94,8 @@ label turboEngineSearch::findCell
{ {
cellIDs[index][0]=-1; cellIDs[index][0]=-1;
if(mask[index][0] && particleCloud_.radius(index) > SMALL) //if(mask[index][0] && particleCloud_.radius(index) > SMALL)
if(particleCloud_.radius(index) > SMALL)
{ {
// create pos vector // create pos vector
for(int i=0;i<3;i++) position[i] = positions[index][i]; for(int i=0;i<3;i++) position[i] = positions[index][i];

View File

@ -33,7 +33,6 @@ Description
#include "noCouple.H" #include "noCouple.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "regionModel.H"
#include "voidFractionModel.H" #include "voidFractionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,7 +25,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS 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). and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -34,7 +34,6 @@ Description
#include "GaussVoidFraction.H" #include "GaussVoidFraction.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "locateModel.H" #include "locateModel.H"
#include "regionModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
@ -96,8 +95,8 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
//reset //reset
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++) for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++)
{ {
@ -189,7 +188,7 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract
//==========================// //==========================//
}//end cells found on this proc }//end cells found on this proc
}// end found cells }// end found cells
}// end if masked //}// end if masked
}// end loop all particles }// end loop all particles
//bringing eulerian field to particle array //bringing eulerian field to particle array

View File

@ -34,7 +34,6 @@ Description
#include "IBVoidFraction.H" #include "IBVoidFraction.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "locateModel.H" #include "locateModel.H"
#include "regionModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
@ -95,8 +94,8 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
//reset //reset
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++) for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++)
{ {
@ -180,7 +179,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction
} }
}//end cells found on this proc }//end cells found on this proc
}// end found cells }// end found cells
}// end if masked //}// end if masked
}// end loop all particles }// end loop all particles
for(label index=0; index< particleCloud_.numberOfParticles(); index++) for(label index=0; index< particleCloud_.numberOfParticles(); index++)

View File

@ -34,7 +34,6 @@ Description
#include "bigParticleVoidFraction.H" #include "bigParticleVoidFraction.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "locateModel.H" #include "locateModel.H"
#include "regionModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
@ -96,8 +95,8 @@ void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voi
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
//reset //reset
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++) for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++)
{ {
@ -181,7 +180,7 @@ void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voi
//==========================// //==========================//
}//end cells found on this proc }//end cells found on this proc
}// end found cells }// end found cells
}// end if masked //}// end if masked
}// end loop all particles }// end loop all particles
//bringing eulerian field to particle array //bringing eulerian field to particle array

View File

@ -83,8 +83,8 @@ void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfrac
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
// reset // reset
particleWeights[index][0]=0; particleWeights[index][0]=0;
cellsPerParticle_[index][0]=1; cellsPerParticle_[index][0]=1;
@ -131,7 +131,7 @@ void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfrac
} }
}*/ }*/
} }
} //}
} }
// bring voidfraction from Eulerian Field to particle array // bring voidfraction from Eulerian Field to particle array

View File

@ -34,7 +34,6 @@ Description
#include "dividedVoidFraction.H" #include "dividedVoidFraction.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "locateModel.H" #include "locateModel.H"
#include "regionModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
//#include "mpi.h" //#include "mpi.h"
@ -104,8 +103,8 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
// reset // reset
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++){ for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++){
particleWeights[index][subcell]=0; particleWeights[index][subcell]=0;
@ -200,7 +199,7 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra
}*/ }*/
}// end if in cell }// end if in cell
}// end if in mask //}// end if in mask
//NP reset counter of lost volume //NP reset counter of lost volume
if(index == particleCloud_.numberOfParticles()-1) Info << "Total particle volume neglected: " << tooMuch_<< endl; if(index == particleCloud_.numberOfParticles()-1) Info << "Total particle volume neglected: " << tooMuch_<< endl;
}// end loop all particles }// end loop all particles

View File

@ -34,7 +34,6 @@ Description
#include "dividedVoidFractionMS.H" #include "dividedVoidFractionMS.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "locateModel.H" #include "locateModel.H"
#include "regionModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -93,8 +92,8 @@ void dividedVoidFractionMS::setvoidFraction(double** const& mask,double**& voidf
for(int index=0; index< particleCloud_.numberOfParticles(); index++) for(int index=0; index< particleCloud_.numberOfParticles(); index++)
{ {
if(mask[index][0]) //if(mask[index][0])
{ //{
// reset // reset
for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++){ for(int subcell=0;subcell<cellsPerParticle_[index][0];subcell++){
particleWeights[index][subcell]=0; particleWeights[index][subcell]=0;
@ -191,7 +190,7 @@ void dividedVoidFractionMS::setvoidFraction(double** const& mask,double**& voidf
}*/ }*/
}// end if in cell }// end if in cell
}// end if in mask //}// end if in mask
//NP reset counter of lost volume //NP reset counter of lost volume
if(index == particleCloud_.numberOfParticles()-1) Info << "Total particle volume neglected: " << tooMuch_<< endl; if(index == particleCloud_.numberOfParticles()-1) Info << "Total particle volume neglected: " << tooMuch_<< endl;
}// end loop all particles }// end loop all particles

View File

@ -31,7 +31,6 @@ Description
#include "error.H" #include "error.H"
#include "voidFractionModel.H" #include "voidFractionModel.H"
#include "regionModel.H"
#include "dataExchangeModel.H" #include "dataExchangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -145,7 +144,7 @@ void Foam::voidFractionModel::resetVoidFractions() const
voidfractionNext_.internalField() = 1; voidfractionNext_.internalField() = 1;
} }
void Foam::voidFractionModel::undoVoidFractions(double**const& mask) const /*void Foam::voidFractionModel::undoVoidFractions(double**const& mask) const
{ {
voidfractionPrev_.internalField() = voidfractionNext_.internalField(); voidfractionPrev_.internalField() = voidfractionNext_.internalField();
@ -159,7 +158,7 @@ void Foam::voidFractionModel::undoVoidFractions(double**const& mask) const
voidfractionNext_[cellI] += particleCloud_.particleVolumes()[index][0]/cellVolume; voidfractionNext_[cellI] += particleCloud_.particleVolumes()[index][0]/cellVolume;
} }
} }
} }*/
double** const& Foam::voidFractionModel::cellsPerParticle() const double** const& Foam::voidFractionModel::cellsPerParticle() const
{ {

View File

@ -124,7 +124,7 @@ public:
void resetVoidFractions() const; void resetVoidFractions() const;
void undoVoidFractions(double**const&) const; //void undoVoidFractions(double**const&) const;
double** const& cellsPerParticle() const; double** const& cellsPerParticle() const;