merge with CFDEMcoupling-PUBLIC 2.9.0

This commit is contained in:
dqueteschiner
2015-03-25 14:23:49 +01:00
parent 0f0ca849f6
commit a1d8c61241
46 changed files with 414 additions and 128 deletions

View File

@ -1,3 +1,5 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
@ -20,5 +22,7 @@ EXE_LIBS = \
-ldynamicFvMesh \
-ldynamicMesh \
-lfvOptions \
-l$(CFDEM_LIB_NAME)
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -1,3 +1,5 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
@ -12,4 +14,6 @@ EXE_LIBS = \
-lincompressibleLESModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-l$(CFDEM_LIB_NAME)
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -1,3 +1,5 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
@ -12,4 +14,6 @@ EXE_LIBS = \
-lincompressibleLESModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-l$(CFDEM_LIB_NAME)
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -1,3 +1,5 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
@ -14,4 +16,6 @@ EXE_LIBS = \
-lincompressibleTransportModels \
-lfiniteVolume \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -98,7 +98,7 @@ int main(int argc, char *argv[])
particleCloud.averagingM().resetWeightFields();
particleCloud.momCoupleM(0).resetMomSourceField();
particleCloud.dataExchangeM().couple();
particleCloud.dataExchangeM().couple(0);
particleCloud.dataExchangeM().getData("x","vector-atom",positions_,count);
particleCloud.dataExchangeM().getData("v","vector-atom",velocities_,count);

View File

@ -26,7 +26,7 @@
IOobject::NO_WRITE
),
mesh,
dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), vector::zero)
dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), Foam::vector::zero)
);
//========================
@ -62,7 +62,7 @@
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), vector::zero)
dimensionedVector("0", dimensionSet(0, 1, -1, 0, 0), Foam::vector::zero)
);
//========================

View File

@ -4,6 +4,7 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
PFLAGS+= -DGITVERSION=\"$(GIT_VERSION)\"
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
$(PFLAGS) \

View File

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright (C) 1991-2009 OpenCFD Ltd.
Copyright (C) 2009-2012 JKU, Linz
Copyright (C) 2012- DCS Computing GmbH,Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling. If not, see <http://www.gnu.org/licenses/>.
Global
continuityErrs
Description
Calculates and prints the continuity errors.
The code is an evolution of compressibleContinuityErrs.H in OpenFOAM(R) 2.3.x,
where additional functionality for CFD-DEM coupling is added.
\*---------------------------------------------------------------------------*/
{
dimensionedScalar totalMass = fvc::domainIntegrate(rho*voidfraction);
scalar sumLocalContErr =
(fvc::domainIntegrate(mag(rho - thermo.rho())*voidfraction)/totalMass).value();
scalar globalContErr =
(fvc::domainIntegrate((rho - thermo.rho())*voidfraction)/totalMass).value();
cumulativeContErr += globalContErr;
Info<< "time step continuity errors : sum local = " << sumLocalContErr
<< ", global = " << globalContErr
<< ", cumulative = " << cumulativeContErr
<< endl;
}
// ************************************************************************* //

View File

@ -33,8 +33,8 @@ Description
#ifndef versionInfo_H
#define versionInfo_H
word CFDEMversion="cfdem-2.8.2";
word compatibleLIGGGHTSversion="3.0.6";
word CFDEMversion="cfdem-2.9.0PFM";
word compatibleLIGGGHTSversion="3.0.6PFM";
word OFversion="2.3.x-commit-4d6f4a3115ff76ec4154c580eb041bc95ba4ec09";
Info << "\nCFDEMcoupling version: " << CFDEMversion << endl;

View File

@ -93,6 +93,7 @@ Foam::cfdemCloud::cfdemCloud
particleVolumes_(NULL),
particleV_(NULL),
numberOfParticles_(0),
d32_(-1),
numberOfParticlesChanged_(false),
arraysReallocated_(false),
forceModels_(couplingProperties_.lookup("forceModels")),
@ -456,12 +457,12 @@ label Foam::cfdemCloud::liggghtsCommandModelIndex(word name)
return index;
}
std::vector<double*>* Foam::cfdemCloud::getVprobe()
std::vector< std::vector<double*> >* Foam::cfdemCloud::getVprobe()
{
return probeModel_->getVprobe();
}
std::vector<double>* Foam::cfdemCloud::getSprobe()
std::vector< std::vector<double> >* Foam::cfdemCloud::getSprobe()
{
return probeModel_->getSprobe();
}
@ -480,13 +481,13 @@ bool Foam::cfdemCloud::evolve
numberOfParticlesChanged_ = false;
arraysReallocated_=false;
bool doCouple=false;
probeModel_->clearProbes();
if(!ignore())
{
if (dataExchangeM().couple())
if (dataExchangeM().doCoupleNow())
{
Info << "\n Coupling..." << endl;
dataExchangeM().couple(0);
doCouple=true;
// reset vol Fields
@ -591,6 +592,8 @@ bool Foam::cfdemCloud::evolve
clockM().start(23,"giveDEMdata");
giveDEMdata();
clockM().stop("giveDEMdata");
dataExchangeM().couple(1);
}//end dataExchangeM().couple()

View File

@ -127,6 +127,8 @@ protected:
int numberOfParticles_;
scalar d32_;
bool numberOfParticlesChanged_;
mutable bool arraysReallocated_;
@ -305,6 +307,7 @@ public:
virtual inline double d(int);
inline scalar d32(bool recalc=true);
virtual inline double dMin() {return -1;}
virtual inline double dMax() {return -1;}
virtual inline int minType() {return -1;}
@ -399,9 +402,9 @@ public:
void resetArray(double**&,int,int,double resetVal=0.);
std::vector<double*>* getVprobe();
std::vector< std::vector<double*> >* getVprobe();
std::vector<double>* getSprobe();
std::vector< std::vector<double> >* getSprobe();
};

View File

@ -197,6 +197,25 @@ inline double cfdemCloud::d(int index)
return 2*radii_[index][0];
}
inline double cfdemCloud::d32(bool recalc)
{
if(d32_<0 || recalc)
{
scalar Ntot(0);
scalar Dtot(0);
scalar r(0);
for(int index = 0;index < numberOfParticles(); ++index)
{
r=radii_[index][0];
Ntot+=2*r*r*r;
Dtot+=r*r;
}
d32_=Ntot/Dtot;
}
return d32_;
}
inline int cfdemCloud::numberOfParticles() const
{
return numberOfParticles_;

View File

@ -101,9 +101,10 @@ bool Foam::cfdemCloudIB::evolve()
arraysReallocated_=false;
bool doCouple=false;
if (dataExchangeM().couple())
if (dataExchangeM().doCoupleNow())
{
Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl;
dataExchangeM().couple(0);
doCouple=true;
// Info << "skipLagrangeToEulerMapping_: " << skipLagrangeToEulerMapping_
@ -141,6 +142,8 @@ bool Foam::cfdemCloudIB::evolve()
if(verbose_) Info << " -giveDEMdata()" << endl;
giveDEMdata();
dataExchangeM().couple(1);
haveEvolvedOnce_=true;
}
Info << "evolve done." << endl;

View File

@ -1,5 +1,5 @@
#define version23 // currently being tested
//#define version22 // currently being used
#define version23 // currently being used
//#define version22
//#define version21
//#define version16ext
//#define version15

View File

@ -0,0 +1,8 @@
# paths for additional libraries
CFDEM_ADD_LIB_PATHS = \
# additional libraries to be linked to solvers
CFDEM_ADD_LIBS = \
# additional static libraries to be linked to lagrangian library
CFDEM_ADD_STATICLIBS = \

View File

@ -42,7 +42,7 @@
if [[ $CFDEM_LAMMPS_LIB_DIR == "" ]]; then
export CFDEM_LAMMPS_LIB_DIR=$CFDEM_LIGGGHTS_SRC_DIR/../lib/
else
echo "using already defined CFDEM_LAMMPS_LIB_DIR=$CFDEM_LAMMPS_LIB_DIR ."
echo "using CFDEM_LAMMPS_LIB_DIR=$CFDEM_LAMMPS_LIB_DIR defined by user."
fi
#- LIGGGHTS lib name
@ -54,6 +54,13 @@ 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
#check if additional libraries should be compiled together with solvers
if [[ $CFDEM_ADD_LIBS_DIR == "" ]]; then
export CFDEM_ADD_LIBS_DIR=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc
else
echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user."
fi
#-----------------------------------------------------
# additional libraries

View File

@ -11,10 +11,15 @@ source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh
#- show gcc settings
checkGPP="true"
#- sys check for add on
checkAddOn="true"
#- system settings
echo "*******************"
echo "system settings:"
echo "*******************"
printHeader
echo "*********************************"
echo "CFDEM(R)coupling system settings:"
echo "*********************************"
echo "CFDEM_VERSION=$CFDEM_VERSION"
echo "couple to OF_VERSION=$WM_PROJECT_VERSION"
@ -29,8 +34,10 @@ checkDirComment "$CFDEM_SOLVER_DIR" '$CFDEM_SOLVER_DIR' "yes"
checkDirComment "$CFDEM_TUT_DIR" '$CFDEM_TUT_DIR' "yes"
checkDirComment "$CFDEM_LIGGGHTS_SRC_DIR" '$CFDEM_LIGGGHTS_SRC_DIR' "yes"
checkDirComment "$CFDEM_LPP_DIR" '$CFDEM_LPP_DIR' "yes"
checkDirComment "$CFDEM_ADD_LIBS_DIR" '$CFDEM_ADD_LIBS_DIR' "yes"
checkDirComment "$CFDEM_PIZZA_DIR" '$CFDEM_PIZZA_DIR' "no"
checkDirComment "$CFDEM_TEST_HARNESS_PATH" '$CFDEM_TEST_HARNESS_PATH' "no"
checkDirComment "$C3PO_SRC_DIR" '$C3PO_SRC_DIR' "no"
echo ""
echo "library names"
@ -61,3 +68,16 @@ if [ $checkGPP == "true" ]
mpirun --version
fi
echo "**********************"
echo "additional packages..."
if [ $checkAddOn == "true" ]
then
packageName=c3po
filePath=$CFDEM_SRC_DIR/$packageName
if [ $(checkDir $filePath) == "true" ]; then
source $filePath/etc/$packageName"SystemTest.sh"
else
echo "$packageName does not exist."
fi
fi

View File

@ -37,6 +37,13 @@
#- export environment variables (adapt to your paths)
#------------------------------------------------------------------------------
#check if default lammps lib path should be used
if ( ! ($?CFDEM_LAMMPS_LIB_DIR) ) then
setenv CFDEM_LAMMPS_LIB_DIR $CFDEM_LIGGGHTS_SRC_DIR"/../lib/"
else
echo "using CFDEM_LAMMPS_LIB_DIR=$CFDEM_LAMMPS_LIB_DIR defined by user."
endif
#- LIGGGHTS lib name
setenv CFDEM_LIGGGHTS_LIB_NAME lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME
@ -46,6 +53,16 @@ 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
#check if additional libraries should be compiled together with solvers
if ( ! ($?CFDEM_ADD_LIBS_DIR) ) then
setenv CFDEM_ADD_LIBS_DIR $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc
else
echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user."
endif
#-----------------------------------------------------
# additional libraries
#- 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

@ -930,6 +930,52 @@ checkDirComment()
fi
}
#========================================#
#- function to check if a variable exits
checkEnv()
{
#--------------------------------------------------------------------------------#
#- define variables
var="$1"
#--------------------------------------------------------------------------------#
if [[ $var == "" ]]; then
echo "false"
else
echo "true"
fi
}
#========================================#
#- function to check if a variable exits
checkEnvComment()
{
#--------------------------------------------------------------------------------#
#- define variables
var="$1"
varName="$2"
critical="$3"
#--------------------------------------------------------------------------------#
if [ $(checkEnv $var) == "true" ]; then
echo "valid:yes critical:$critical - $varName = $var"
else
echo "valid:NO critical:$critical - $varName = $var variable not set!"
fi
}
#========================================#
#- function to print a header to terminal
printHeader()
{
echo ""
echo "*********************************************"
echo "* C F D E M (R) c o u p l i n g *"
echo "* *"
echo "* by DCS Computing GmbH *"
echo "* www.dcs-computing.com *"
echo "*********************************************"
echo ""
}
#========================================#
#- track memory usage
trackMem()

View File

@ -196,7 +196,7 @@ void Foam::dataExchangeModel::destroy(double* array) const
//====
bool Foam::dataExchangeModel::couple() const
bool Foam::dataExchangeModel::couple(int i) const
{
bool coupleNow = false;
if (doCoupleNow())

View File

@ -69,7 +69,6 @@ protected:
int couplingInterval_;
// Protected member functions
void setNumberOfParticles(int) const;
public:
@ -116,6 +115,8 @@ public:
// Member Function
void setNumberOfParticles(int) const;
inline const int& maxNumberOfParticles() const { return maxNumberOfParticles_; }
template <typename T>
@ -175,7 +176,7 @@ public:
virtual void destroy(double*) const;
//====
virtual bool couple() const;
virtual bool couple(int) const;
virtual scalar timeStepFraction() const;

View File

@ -108,7 +108,9 @@ twoWayMPI::twoWayMPI
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
twoWayMPI::~twoWayMPI()
{}
{
if (liggghts == 1) delete lmp;
}
// * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //
void twoWayMPI::getData
@ -239,10 +241,10 @@ void Foam::twoWayMPI::destroy(double* array) const
}
//============
bool Foam::twoWayMPI::couple() const
bool Foam::twoWayMPI::couple(int i) const
{
bool coupleNow = false;
if (doCoupleNow())
if (i==0)
{
couplingStep_++;
coupleNow = true;
@ -293,9 +295,9 @@ bool Foam::twoWayMPI::couple() const
DEMstepsToInterrupt[ind] -= DEMstepsToInterrupt[ind-1];
}
Info << "Foam::twoWayMPI::couple(): interruptTimes=" << interruptTimes << endl;
Info << "Foam::twoWayMPI::couple(): DEMstepsToInterrupt=" << DEMstepsToInterrupt << endl;
Info << "Foam::twoWayMPI::couple(): lcModel=" << lcModel << endl;
Info << "Foam::twoWayMPI::couple(i): interruptTimes=" << interruptTimes << endl;
Info << "Foam::twoWayMPI::couple(i): DEMstepsToInterrupt=" << DEMstepsToInterrupt << endl;
Info << "Foam::twoWayMPI::couple(i): lcModel=" << lcModel << endl;
}
if(particleCloud_.liggghtsCommand()[i]().type()=="runLiggghts")

View File

@ -91,10 +91,11 @@ private:
MPI_Comm comm_liggghts;
LAMMPS_NS::LAMMPS *lmp;
// private member functions
protected:
LAMMPS_NS::LAMMPS *lmp;
public:
//- Runtime type information
@ -158,7 +159,7 @@ public:
void destroy(int*) const;
//==============
bool couple() const;
bool couple(int) const;
int getNumberOfParticles() const;
int getNumberOfClumps() const;

View File

@ -388,11 +388,10 @@ void inline Foam::twoWayMany2Many::destroy(int* array) const
//==============
bool Foam::twoWayMany2Many::couple() const
bool Foam::twoWayMany2Many::couple(int i) const
{
bool coupleNow = false;
label commandLines(0);
if (doCoupleNow())
if (i==0)
{
couplingStep_++;
coupleNow = true;
@ -408,7 +407,7 @@ bool Foam::twoWayMany2Many::couple() const
if (particleCloud_.liggghtsCommand()[i]().runCommand(couplingStep()))
{
commandLines=particleCloud_.liggghtsCommand()[i]().commandLines();
label commandLines = particleCloud_.liggghtsCommand()[i]().commandLines();
for (int j=0; j<commandLines; j++)
{
const char* command = particleCloud_.liggghtsCommand()[i]().command(j);
@ -443,7 +442,7 @@ bool Foam::twoWayMany2Many::couple() const
setPositions(nlocal_foam_,pos_foam_);
setCellIDs(nlocal_foam_,cellID_foam_);
Info <<"Foam::twoWayMany2Many::couple() done." << endl;
Info <<"Foam::twoWayMany2Many::couple(i) done." << endl;
}
return coupleNow;
}

View File

@ -201,7 +201,7 @@ public:
void inline destroy(int*) const;
//==============
bool couple() const;
bool couple(int) const;
int getNumberOfParticles() const;
int getNumberOfClumps() const;

View File

@ -198,7 +198,7 @@ void DiFeliceDrag::setForce() const
drag = dragCoefficient*Ur; //total drag force!
forceSubM(0).explicitInterpCorr(dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose(),index);
forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose(),index);
}
if(forceSubM(0).verbose() && index >-1 && index <102)

View File

@ -223,8 +223,8 @@ void GidaspowDrag::setForce() const
drag = dragCoefficient * Ur;
// explicitInterpCorr
forceSubM(0).explicitInterpCorr(dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose());
// explicitCorr
forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose());
if(forceSubM(0).verbose() && index >=0 && index <2)
{

View File

@ -231,8 +231,8 @@ void KochHillDrag::setForce() const
{
drag = dragCoefficient * Ur;
// explicitInterpCorr
forceSubM(0).explicitInterpCorr(dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose());
// explicitCorr
forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose());
}
}

View File

@ -353,8 +353,8 @@ void KochHillRWDrag::setForce() const
drag = dragCoefficient * Ur;
// explicitInterpCorr
forceSubM(0).explicitInterpCorr(dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],verbose_);
// explicitCorr
forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],verbose_);
}
if(verbose_ && index >=0 && index <2)

View File

@ -179,8 +179,9 @@ void forceSubModel::partToArray
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void forceSubModel::explicitInterpCorr
void forceSubModel::explicitCorr
(
vector& dragImplicit,
vector& dragExplicit,
scalar& dragCoefficient,
vector& Ufluid,
@ -218,11 +219,15 @@ void forceSubModel::readSwitches() const
particleCloud_.impDEMdrag_=true;
// do sanity check
// This can work if the accumulator is used, but is explicitely applied on the CFD side
// Sanity check is therefore not necessary here
/*
if(switches_[0]) // treatExplicit=true
{
FatalError << "Please check your settings, treatExplicit together with implForceDEM does not work!."
<< abort(FatalError);
}
*/
}
if(switches_[7]) // implForceDEMaccumulated=true
@ -320,7 +325,7 @@ const volVectorField& forceSubModel::divTauField(const volVectorField& U) const
const volVectorField& forceSubModel::IBDragPerV(const volVectorField& U,const volScalarField& p) const
{
#ifdef compre
IBDragPerV_ = muField()*fvc::laplacian(U)-fvc::grad(p)
IBDragPerV_ = muField()*fvc::laplacian(U)-fvc::grad(p);
#else
IBDragPerV_ = rhoField()*(nuField()*fvc::laplacian(U)-fvc::grad(p));
#endif

View File

@ -132,7 +132,7 @@ public:
// Member Functions
void partToArray(label&, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const;
virtual void explicitInterpCorr(vector&, scalar&, vector&, const vector&, vector&, const vector&, bool,label index=100) const;
virtual void explicitCorr(vector&, vector&, scalar&, vector&, const vector&, vector&, const vector&, bool,label index=100) const;
// Access

View File

@ -30,6 +30,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
#include <sys/stat.h>
#include "liggghtsCommandModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -120,8 +121,8 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict)
timeInterval_ = -1;
// calculate coupling times
firstCouplingStep_ = floor(startTime_/DEMts/couplingInterval);
lastCouplingStep_ = floor(endTime_/DEMts/couplingInterval);
firstCouplingStep_ = floor((startTime_+SMALL)/DEMts/couplingInterval);
lastCouplingStep_ = floor((endTime_+SMALL)/DEMts/couplingInterval);
couplingStepInterval_ = -1;
}
else //runEveryCouplingStep of every n steps or every writeStep
@ -134,6 +135,7 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict)
timeInterval_ = readScalar(propsDict.lookup("timeInterval"));
// calculate coupling times
// if this makes troubles try floor((startTime_+SMALL)/.. as above
firstCouplingStep_ = floor(startTime_/DEMts/couplingInterval)+1;
lastCouplingStep_ = floor(endTime_/DEMts/couplingInterval)+1;
couplingStepInterval_ = floor(timeInterval_/DEMts/couplingInterval)+1;
@ -238,6 +240,13 @@ DynamicList<scalar> liggghtsCommandModel::executionsWithinPeriod(scalar TSstart,
return executions;
}
bool liggghtsCommandModel::checkPath(fileName path)
{
struct stat buffer;
return (stat (path.c_str(), &buffer) == 0);
}
void liggghtsCommandModel::parseCommandList(wordList& commandList,labelList& labelList,scalarList& scalarList,word& command, dictionary& propsDict, bool timeStamp)
{
bool addBlank = true; // std no blanks after each word

View File

@ -160,6 +160,8 @@ public:
DynamicList<scalar> executionsWithinPeriod(scalar,scalar);
bool checkPath(fileName);
// Access
int nextRun(){return nextRun_;};

View File

@ -81,6 +81,15 @@ writeLiggghts::writeLiggghts
writeLast_=Switch(propsDict_.lookup("writeLast"));
}
if (propsDict_.found("path"))
{
path_=fileName(propsDict_.lookup("path"));
if (!checkPath(path_))
FatalError<<"The path you provided in writeLiggghtsProps is incorrect: " << path_ << "\n" << abort(FatalError);
else
Info << "Using user defined path to write LIGGGHTS restart file: " << path_ << endl;
}
if(propsDict_.found("writeName"))
{
propsDict_.lookup("writeName") >> writeName_;

View File

@ -99,7 +99,9 @@ particleProbe::particleProbe
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
particleProbe::~particleProbe()
{}
{
clearProbes();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -112,6 +114,7 @@ void particleProbe::setOutputFile() const
else
currItemId_+=1;
sPtr = sPtrList_[currItemId_-1]; //set the pointer to the output file from list
probeIndex_=currItemId_-1;
}
@ -216,14 +219,79 @@ void particleProbe::writeHeader() const
void particleProbe::clearProbes() const
{
for (unsigned int i=0; i<vProbes_.size(); i++)
delete vProbes_[i];
vProbes_[i].clear();
for (unsigned int j=0; j<sProbes_.size(); j++)
sProbes_[j].clear();
sProbes_.clear();
vProbes_.clear();
}
void particleProbe::updateProbes(int index, Field<scalar> sValues, Field<vector> vValues) const
{
int vSize_=vProbes_.size();
int sSize_=sProbes_.size();
//check if the particle already has an allocated vector. If not, create it. It should be only called at the beginning.
while(index >= vSize_)
{
std::vector<double*> particleVector_;
vProbes_.push_back(particleVector_);
vSize_=vProbes_.size();
}
while(index >= sSize_)
{
std::vector<double> particleScalar_;
sProbes_.push_back(particleScalar_);
sSize_=sProbes_.size();
}
//register vector probes on the corresponding vector
forAll(vValues, iter)
{
int ProbeSize_=vProbes_[index].size();
if(probeIndex_<ProbeSize_) //The corresponding probe for this particle already exists, values are overwritten.
{
vProbes_[index][probeIndex_][0]=vValues[iter][0];
vProbes_[index][probeIndex_][1]=vValues[iter][1];
vProbes_[index][probeIndex_][2]=vValues[iter][2];
}
else //The corresponding probe for this particle has to be created
{
double * probe_= new double[3];
probe_[0]=vValues[iter][0];
probe_[1]=vValues[iter][1];
probe_[2]=vValues[iter][2];
vProbes_[index].push_back(probe_);
}
}
//register scalar probes on the corresponding vector
forAll(sValues, iter)
{
int ProbeSize_=sProbes_[index].size();
if(probeIndex_<ProbeSize_) //The corresponding probe for this particle already exists, values are overwritten.
{
sProbes_[index][probeIndex_]=sValues[iter];
}
else //The corresponding probe for this particle has to be created
{
sProbes_[index].push_back(sValues[iter]);
}
}
}
void particleProbe::writeProbe(int index, Field<scalar> sValues, Field<vector> vValues) const
{
updateProbes(index,sValues,vValues); //update probe vectors
if(printNow_ && checkIDForPrint(index) && verboseToFile_)
{
//index and time
@ -231,7 +299,6 @@ 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)
@ -241,21 +308,6 @@ void particleProbe::writeProbe(int index, Field<scalar> sValues, Field<vector> v
*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
@ -265,7 +317,6 @@ void particleProbe::writeProbe(int index, Field<scalar> sValues, Field<vector> v
forAll(sValues, iter)
{
*sPtr << sValues[iter] << " ";
sProbes_.push_back(sValues[iter]);
}
}

View File

@ -101,9 +101,13 @@ private:
mutable bool printNow_;
mutable std::vector<double> sProbes_;
mutable std::vector< std::vector<double> > sProbes_;
mutable std::vector<double*> vProbes_;
mutable std::vector< std::vector<double*> > vProbes_;
mutable std::vector<std::string> probeName_;
mutable int probeIndex_;
public:
@ -127,6 +131,7 @@ public:
~particleProbe();
// Member Functions
void updateProbes(int index, Field<scalar> sValues, Field<vector> vValues) const;
void initialize(word typeName, word logFileName) const;
void setOutputFile() const;
void writeHeader() const;
@ -134,8 +139,9 @@ public:
bool checkIDForPrint(int) const;
void setCounter() const;
void clearProbes() const;
std::vector<double*>* getVprobe() { return &vProbes_; }
std::vector<double>* getSprobe() { return &sProbes_; }
std::vector< std::vector<double*> >* getVprobe() { return &vProbes_; }
std::vector< std::vector<double> >* getSprobe() { return &sProbes_; }
};

View File

@ -140,8 +140,8 @@ 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 std::vector< std::vector<double*> >* getVprobe() { return NULL; }
virtual std::vector< std::vector<double> >* getSprobe() { return NULL; }
virtual void clearProbes() const {}
// Access

View File

@ -23,5 +23,5 @@ else
fi
gnome-terminal --title='cfdemSolverIB twoSpheresGlowinskiMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
#gnome-terminal --title='cfdemSolverIB twoSpheresGlowinskiMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
bash $casePath/parCFDDEMrun.sh

View File

@ -26,4 +26,5 @@ else
fi
#- run parallel CFD-DEM in new terminal
gnome-terminal --title='cfdemSolverPiso ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
bash $casePath/parCFDDEMrun.sh

View File

@ -26,6 +26,9 @@ FoamFile
//===========================================================================//
// sub-models & settings
syncMode false;
//verbose;
modelType "A"; // A or B
couplingInterval 100;
@ -171,7 +174,7 @@ KochHillDragProps
//);
implForceDEM true;
//implForceDEMaccumulated true;
//explicitInterpCorr true;
//explicitCorr true;
}
BeetstraDragProps

View File

@ -63,27 +63,27 @@ functions
name probes;
probeLocations
(
(0 0 0.0001)
(0 0 0.0026)
(0 0 0.0051)
(0 0 0.0076)
(0 0 0.0101)
(0 0 0.0126)
(0 0 0.0151)
(0 0 0.0176)
(0 0 0.0201)
(0 0 0.0226)
(0 0 0.0251)
(0 0 0.0276)
(0 0 0.0301)
(0 0 0.0326)
(0 0 0.0351)
(0 0 0.0375)
(0 0 0.0401)
(0 0 0.0426)
(0 0 0.0451)
(0 0 0.0476)
(0 0 0.0529)
(0.00003 0 0.0001)
(0.00003 0 0.0026)
(0.00003 0 0.0051)
(0.00003 0 0.0076)
(0.00003 0 0.0101)
(0.00003 0 0.0126)
(0.00003 0 0.0151)
(0.00003 0 0.0176)
(0.00003 0 0.0201)
(0.00003 0 0.0226)
(0.00003 0 0.0251)
(0.00003 0 0.0276)
(0.00003 0 0.0301)
(0.00003 0 0.0326)
(0.00003 0 0.0351)
(0.00003 0 0.0375)
(0.00003 0 0.0401)
(0.00003 0 0.0426)
(0.00003 0 0.0451)
(0.00003 0 0.0476)
(0.00003 0 0.0529)
);
// Fields to be probed

View File

@ -21,7 +21,7 @@ logfileName="log_$headerText"
solverName="cfdemSolverPiso"
nrProcs="4"
machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off| strict # on | off| strict
debugMode="off" # on | off| strict
testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
runOctave="true"
postproc="false"

View File

@ -26,5 +26,5 @@ else
fi
#- run parallel CFD-DEM in new terminal
gnome-terminal --title='cfdemSolverPiso ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh"
#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_cgs CFD' -e "bash $casePath/parCFDDEMrun.sh"
bash $casePath/parCFDDEMrun.sh

View File

@ -49,7 +49,8 @@ cp $casePath/CFD/constant/couplingProperties_restart $casePath/CFD/constant/coup
cp $casePath/CFD/system/controlDict_restart $casePath/CFD/system/controlDict
#- run parallel CFD-DEM in new terminal
gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh"
#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh"
bash $casePath/parCFDDEMrun.sh
#- wait until sim has finished then run octave

View File

@ -19,5 +19,5 @@ else
fi
#- run parallel CFD-DEM in new terminal
gnome-terminal --title='cfdemSolverPiso settlingTest CFD' -e "bash $casePath/parCFDDEMrun.sh"
#gnome-terminal --title='cfdemSolverPiso settlingTest CFD' -e "bash $casePath/parCFDDEMrun.sh"
bash $casePath/parCFDDEMrun.sh

View File

@ -26,5 +26,5 @@ else
fi
#- run parallel CFD-DEM in new terminal
gnome-terminal --title='cfdemSolverPisoScalar packedBedTemp CFD' -e "bash $casePath/parCFDDEMrun.sh"
#gnome-terminal --title='cfdemSolverPisoScalar packedBedTemp CFD' -e "bash $casePath/parCFDDEMrun.sh"
bash $casePath/parCFDDEMrun.sh