testDrum.cpp File Reference
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "Mercury3D.h"
#include "Species/LinearViscoelasticFrictionSpecies.h"
#include "Walls/AxisymmetricIntersectionOfWalls.h"
#include "Walls/InfiniteWall.h"
#include "Boundaries/PeriodicBoundary.h"
#include <chrono>

Classes

class  RotatingDrum
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
534 {
535 
536  // Start measuring elapsed time
537  std::chrono::time_point<std::chrono::system_clock> startClock, endClock;
538  startClock = std::chrono::system_clock::now();
539 
540  RotatingDrum problem;
541 
542  //setting locally-available variables to define key
543  //parameters such that they can be automatically included in
544  //the name of the file
545  //*******************Excitation Properties*****************************************
546  //Drum rotation rate (rpm)
547  double rotRateBasal = 15.0;
548 
549  //vibration amplitude and frequency
550  double fVib = 0.0;
551  double aVib = 0.0;
552 
553  //*******************Frictional Properties*****************************************
554  //sliding friction for species 1, 2 and wall
555  double muSWall = 0.6;
556  double muS1 = 0.1;
557  double muS2 = 0.1;
558 
559  //rolling friction for species 1, 2 and wall
560  double muRWall = 0.06;
561  double muR1 = 0.01;
562  double muR2 = 0.01;
563 
564  //torsion friction for species 1, 2 and wall
565  double muTWall = 0.0;
566  double muT1 = 0.000;
567  double muT2 = 0.000;
568 
569  //the density ratio of particles
570  double rhoRatio = 2500.0/2500.0;
571  //the size ratio of particles
572  double dRatio = 1.5;
573 
574  //the fraction of species 1 particles
575  double specFrac = 0.5;
576 
577  double drumRad = 30*1.5*0.0015;
578 
579  double rotRate = 15.0;
580 
581  double froudeNumber = (rotRate * 2.0 * 3.1415926535 / 60.0) * (rotRate * 2.0 * 3.1415926535 / 60.0) * drumRad / 9.81;
582 
583  //the dimensionless drum length per core (L/(d_l*core))
584  double dimDrumLengthPerCore = 10.0;
585 
586  unsigned nDoms = 8; // The number of domains into which the system is divided
587 
588  double drumLength = dimDrumLengthPerCore*0.003*1.5*nDoms;
589 
590  //Set the number of domains for parallel decomposition
591  problem.setNumberOfDomains({1,nDoms,1});
592 
593 
594  //*******************Setting Up Filename******************************************
595  //setting up a stringstream to use in order to create an instructive filename
596  std::stringstream nameStream;
597  //the generic 'root' of the name for the file that will be applied to all files
598  //irrespective of parameters
599  //std::string nameBase = "binary";
600  std::string nameBase = "constLPerCore";
601 
602  //Name stream for tests looking at size segregation and concentration
603  nameStream << nameBase << "-length" << dimDrumLengthPerCore << "-nDomains" << nDoms << "-rpm" << rotRate;
604 
605 
606  //Name stream for tests looking at effect of vibration
607  /*nameStream << nameBase << "-rotationRate" << rotRate
608  << "-frequency" << fVib << "-amplitude" << aVib;
609  */
610 
611  /*Name stream for tests looking for particle 'sinkage'
612  * nameStream << nameBase << "-mu_s" << muS1 << "," << muS2 << "," << muSWall << ","
613  << "-mu_r" << muR1 << "," << muR2 << "," << muRWall << ","
614  << "-mu_t" << muT1 << "," << muT2 << "," << muTWall
615  << "-velocity" << rotRate << "-densityRatio" << rhoRatio;
616  */
617  std::string fullName = nameStream.str();
618  problem.setName(fullName);
619  //problem.autoNumber();
620  problem.setDrumRadius(drumRad);// in meters
621 
622  problem.setXMin(0.0);
623  problem.setYMin(0.0);
624  problem.setZMin(0.0);
625 
626  problem.setXMax(2. * problem.getDrumRadius());
627  problem.setZMax(2. * problem.getDrumRadius());
628  problem.setYMax(drumLength);// in meters
629 
630  problem.setTimeMax(30.); //600s - equal to 150 rotations @ 15 rpm
631  problem.setTimeStep(1.0/(800.0 * 50.0));
632 
633  problem.setGravity(Vec3D(0.,0.,-9.81));
634  problem.setCOR(0.97,0.97,0.97);//drumWall, species1, species2
635  problem.setSizeAndDensityRatio(dRatio,rhoRatio);//size ratio and density ratio
636  problem.setFractionalPolydispersity(0.05);//10% dispersity
637  problem.setDrumFillFraction(0.3);// At 0.5 the drum is 3/4 filled.
638  problem.setSpeciesVolumeFraction(specFrac);//Species1 volume fraction
639  //redundant
640  //problem.setFrictionCoeff(.6,.19);//(particle-wall-friction,part-part-friction)
641  problem.setSlidingFriction(muSWall,muS1,muS2); //wall, species1, species2
642  problem.setRollingFriction(muRWall,muR1,muR2); //wall, species1, species2
643  problem.setTorsionFriction(muTWall,muT1,muT2); //wall, species1, species2
644 
645  problem.setRevolutionSpeed(rotRate);//rpm
646 
647  //setting vibration parameters
648  problem.setVibrationAmplitude(aVib);
649  problem.setVibrationFrequency(fVib);
650 
651  //problem.setSaveCount(1);
652  problem.setSaveCount(20000);
653  problem.setXBallsAdditionalArguments("-cmode 8 -solidf -v0");
654  problem.readArguments(argc,argv);
655 
657 
658  problem.solve();
659 
660  // Measure elapsed time
661  endClock = std::chrono::system_clock::now();
662  std::chrono::duration<double> elapsed_seconds = endClock - startClock;
663  logger(INFO, "Elapsed time for solving the PDE: % s", elapsed_seconds.count());
664 
665  return 0;
666 }
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setNumberOfDomains(std::vector< unsigned > direction)
Sets the number of domains in x-,y- and z-direction. Required for parallel computations.
Definition: DPMBase.cc:5213
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4391
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1058
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
Definition: testDrum.cpp:38
void setDrumRadius(double radius)
Definition: testDrum.cpp:411
void setVibrationFrequency(double f)
Definition: testDrum.cpp:484
double getDrumRadius()
Definition: testDrum.cpp:477
void setVibrationAmplitude(double A)
Definition: testDrum.cpp:487
void setFractionalPolydispersity(double fpd)
Definition: testDrum.cpp:427
void setTorsionFriction(double drum, double f1, double f2)
Definition: testDrum.cpp:470
void setRollingFriction(double drum, double f1, double f2)
Definition: testDrum.cpp:463
void setDrumFillFraction(double dff)
Definition: testDrum.cpp:432
void setSpeciesVolumeFraction(double vf)
Definition: testDrum.cpp:437
void setCOR(double drumCOR, double COR1, double COR2)
Definition: testDrum.cpp:448
void setSizeAndDensityRatio(double sr, double dr)
Definition: testDrum.cpp:421
void setRevolutionSpeed(double rpm)
Definition: testDrum.cpp:416
void setSlidingFriction(double drum, double f1, double f2)
Definition: testDrum.cpp:456
Definition: Vector.h:51

References BaseHandler< T >::copyAndAddObject(), RotatingDrum::getDrumRadius(), INFO, logger, DPMBase::readArguments(), RotatingDrum::setCOR(), RotatingDrum::setDrumFillFraction(), RotatingDrum::setDrumRadius(), RotatingDrum::setFractionalPolydispersity(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setNumberOfDomains(), RotatingDrum::setRevolutionSpeed(), RotatingDrum::setRollingFriction(), DPMBase::setSaveCount(), RotatingDrum::setSizeAndDensityRatio(), RotatingDrum::setSlidingFriction(), RotatingDrum::setSpeciesVolumeFraction(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), RotatingDrum::setTorsionFriction(), RotatingDrum::setVibrationAmplitude(), RotatingDrum::setVibrationFrequency(), DPMBase::setXBallsAdditionalArguments(), DPMBase::setXMax(), DPMBase::setXMin(), DPMBase::setYMax(), DPMBase::setYMin(), DPMBase::setZMax(), DPMBase::setZMin(), DPMBase::solve(), and DPMBase::speciesHandler.