Skip to content

Commit

Permalink
Merge pull request #115 from ParticulateFlow/release
Browse files Browse the repository at this point in the history
Release 21.03
  • Loading branch information
danielque authored Mar 22, 2021
2 parents 71a78be + 4ebd073 commit 6fe6137
Show file tree
Hide file tree
Showing 93 changed files with 934 additions and 758 deletions.
3 changes: 2 additions & 1 deletion applications/solvers/cfdemSolverIB/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
-I$(LIB_SRC)/fvOptions/lnInclude \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/cfdemSolverMultiphase/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-Wno-deprecated-copy

LIB_LIBS = \
-linterfaceProperties \
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/cfdemSolverPiso/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/cfdemSolverPisoMS/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/cfdemSolverPisoScalar/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ EXE_INC = \
-I../cfdemSolverPiso \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/cfdemSolverRhoPimple/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
3 changes: 1 addition & 2 deletions applications/solvers/cfdemSolverRhoPimpleChem/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ EXE_INC = \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam \


-Wno-deprecated-copy


EXE_LIBS = \
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/rStatAnalysis/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ EXE_INC = \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/rcfdemSolverBase/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ EXE_INC = \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ EXE_INC = \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EXE_INC = \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
1 change: 1 addition & 0 deletions applications/solvers/rtfmSolverSpecies/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ EXE_INC = \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
1 change: 1 addition & 0 deletions applications/utilities/cfdemPostproc/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-Wno-deprecated-copy


EXE_LIBS = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
-I$(LIB_SRC)/fvOptions/lnInclude \
-Wno-deprecated-copy

EXE_LIBS = \
-lfiniteVolume \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
-I$(LIB_SRC)/fvOptions/lnInclude \
-Wno-deprecated-copy

EXE_LIBS = \
-lfiniteVolume \
Expand Down
1 change: 1 addition & 0 deletions applications/utilities/rSmoother/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-Wno-deprecated-copy

EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
Expand Down
2 changes: 1 addition & 1 deletion etc/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#------------------------------------------------------------------------------

export CFDEM_PROJECT=CFDEM
export CFDEM_VERSION=20.09
export CFDEM_VERSION=21.03

################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
Expand Down
2 changes: 1 addition & 1 deletion etc/cshrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#------------------------------------------------------------------------------

setenv CFDEM_PROJECT CFDEM
setenv CFDEM_VERSION 20.09
setenv CFDEM_VERSION 21.03

################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
Expand Down
3 changes: 2 additions & 1 deletion src/finiteVolume/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-Wno-old-style-cast \
-Wno-unused-result \
-Wno-literal-suffix
-Wno-literal-suffix \
-Wno-deprecated-copy

LIB_LIBS = \
-lOpenFOAM \
Expand Down
1 change: 1 addition & 0 deletions src/lagrangian/cfdemParticle/Make/files
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ $(forceModels)/pdCorrelation/pdCorrelation.C
$(forceModels)/surfaceTensionForce/surfaceTensionForce.C
$(forceModels)/gradPForceSmooth/gradPForceSmooth.C
$(forceModels)/particleDeformation/particleDeformation.C
$(forceModels)/turbulentDispersion/turbulentDispersion.C

$(forceModelsMS)/forceModelMS/forceModelMS.C
$(forceModelsMS)/forceModelMS/newForceModelMS.C
Expand Down
3 changes: 2 additions & 1 deletion src/lagrangian/cfdemParticle/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ EXE_INC = \
-I$(CFDEM_SRC_DIR)/cfdTools \
-Wno-old-style-cast \
-Wno-unused-result \
-Wno-literal-suffix
-Wno-literal-suffix \
-Wno-deprecated-copy


LIB_LIBS = \
Expand Down
4 changes: 2 additions & 2 deletions src/lagrangian/cfdemParticle/cfdTools/versionInfo.H
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Description
#ifndef versionInfo_H
#define versionInfo_H

word CFDEMversion="PFM 20.09";
word compatibleLIGGGHTSversion="PFM 20.09";
word CFDEMversion="PFM 21.03";
word compatibleLIGGGHTSversion="PFM 21.03";
word OFversion="6";

Info << "\nCFDEMcoupling version: " << CFDEMversion << endl;
Expand Down
68 changes: 68 additions & 0 deletions src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ cfdemCloud::cfdemCloud
turbulenceModelType_
)
),
particlePropertyTable(32),
dataExchangeModel_
(
dataExchangeModel::New
Expand Down Expand Up @@ -402,6 +403,22 @@ cfdemCloud::~cfdemCloud()
if(getParticleDensities_) dataExchangeM().destroy(particleDensities_,1);
if(getParticleEffVolFactors_) dataExchangeM().destroy(particleEffVolFactors_,1);
if(getParticleTypes_) dataExchangeM().destroy(particleTypes_,1);

for
(
HashTable<particleProperty>::iterator iter = particlePropertyTable.begin();
iter != particlePropertyTable.end();
++iter
)
{
if ((*(iter().ti)) == typeid(int**)) {
dataExchangeM().destroy(iter().ref<int**>(),-1);
} else if ((*(iter().ti)) == typeid(double**)) {
dataExchangeM().destroy(iter().ref<double**>(),-1);
} else {
FatalError << "Trying to destroy property of type " << iter().ti->name() << endl;
}
}
}

// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
Expand Down Expand Up @@ -780,9 +797,60 @@ bool cfdemCloud::reAllocArrays()
if(getParticleDensities_) dataExchangeM().allocateArray(particleDensities_,0.,1);
if(getParticleEffVolFactors_) dataExchangeM().allocateArray(particleEffVolFactors_,0.,1);
if(getParticleTypes_) dataExchangeM().allocateArray(particleTypes_,0,1);

for
(
HashTable<particleProperty>::iterator iter = particlePropertyTable.begin();
iter != particlePropertyTable.end();
++iter
)
{
if (iter().size > 0) {
///Info << "!! about to realloc property of type " << iter().ti->name() << endl;
if ((*(iter().ti)) == typeid(int**)) {
dataExchangeM().allocateArray(iter().ref<int**>(),iter().initVal,iter().size);
} else if ((*(iter().ti)) == typeid(double**)) {
dataExchangeM().allocateArray(iter().ref<double**>(),iter().initVal,iter().size);
} else {
FatalError << "Trying to realloc property of type " << iter().ti->name() << endl;
}
}
}

arraysReallocated_ = true;
return true;
}
else
{
for
(
HashTable<particleProperty>::iterator iter = particlePropertyTable.begin();
iter != particlePropertyTable.end();
++iter
)
{
if (iter().size > 0 && iter().reset) {
if ((*(iter().ti)) == typeid(int**)) {
int**& property = iter().ref<int**>();
for (int index=0; index<numberOfParticles(); ++index) {
for (int icomponent=0; icomponent<iter().size; ++icomponent) {
property[index][icomponent] = iter().initVal;
}
}
} else if ((*(iter().ti)) == typeid(double**)) {
double**& property = iter().ref<double**>();
for (int index=0; index<numberOfParticles(); ++index) {
for (int icomponent=0; icomponent<iter().size; ++icomponent) {
property[index][icomponent] = iter().initVal;
}
}
} else {
FatalError << "Trying to reset property of type " << iter().ti->name() << endl;
}
}
}
}

return false;
}

Expand Down
24 changes: 24 additions & 0 deletions src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SourceFiles
// choose version
#include "OFversion.H"
#include <vector>
#include <typeinfo>

#include "fvCFD.H"
#include "IFstream.H"
Expand Down Expand Up @@ -188,6 +189,21 @@ protected:

const turbulenceModel& turbulence_;

struct particleProperty {
void** property; // pointer to per-particle data; memory deallocation by cfdemCloud
const std::type_info* ti; // type of particle data (int**, double**)
int size; // size of single particle data; memory allocation by cfdemCloud if size > 0
double initVal; // initial property value
bool reset; // if true, data is reset to initial value every coupling step
template<typename T>
T& ref() {
if (*ti == typeid(T)) return *reinterpret_cast<T*>(&property);
else throw std::bad_cast();
}
};

HashTable<particleProperty> particlePropertyTable; // table of registered per-particle properties

autoPtr<dataExchangeModel> dataExchangeModel_;

PtrList<forceModel> forceModel_;
Expand Down Expand Up @@ -443,6 +459,14 @@ public:
void otherForces(volVectorField&);

bool checkPeriodicCells() const { return checkPeriodicCells_; }

template<typename T>
void registerParticleProperty(const word& property, int size=0, double initVal=0.0, bool reset=true);
template<typename T>
T& getParticlePropertyRef(const word& property);
protected:
virtual int**& getParticlePropertyImpl(const word& property, int**);
virtual double**& getParticlePropertyImpl(const word& property, double**);
};


Expand Down
23 changes: 23 additions & 0 deletions src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,28 @@ inline const turbulenceModel& cfdemCloud::turbulence() const
return turbulence_;
}


template<typename T>
void cfdemCloud::registerParticleProperty(const word& property, int size, double initVal, bool reset)
{
particlePropertyTable.insert(property,{NULL,&typeid(T),size,initVal,reset});
}

template<typename T>
T& cfdemCloud::getParticlePropertyRef(const word& property)
{
return getParticlePropertyImpl(property, static_cast<T>(0));
}

inline int**& cfdemCloud::getParticlePropertyImpl(const word& property, int**)
{
return particlePropertyTable[property].ref<int**>();
}

inline double**& cfdemCloud::getParticlePropertyImpl(const word& property, double**)
{
return particlePropertyTable[property].ref<double**>();
}

}
// ************************************************************************* //
Loading

0 comments on commit 6fe6137

Please sign in to comment.