testDrumRound1Serial.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[] 
)
507 {
508 
509  // Start measuring elapsed time
510  std::chrono::time_point<std::chrono::system_clock> startClock, endClock;
511  startClock = std::chrono::system_clock::now();
512 
513  RotatingDrum problem;
514 
515  //setting locally-available variables to define key
516  //parameters such that they can be automatically included in
517  //the name of the file
518  //*******************Excitation Properties*****************************************
519  //Drum rotation rate (rpm)
520  double rotRateBasal = 10.0;
521 
522  //vibration amplitude and frequency
523  double fVib = 0.0;
524  double aVib = 0.0;
525 
526  //*******************Frictional Properties*****************************************
527  //sliding friction for species 1, 2 and wall
528  double muSWall = 0.6;
529  double muS1 = 0.1;
530  double muS2 = 0.1;
531 
532  //rolling friction for species 1, 2 and wall
533  double muRWall = 0.06;
534  double muR1 = 0.01;
535  double muR2 = 0.01;
536 
537  //torsion friction for species 1, 2 and wall
538  double muTWall = 0.0;
539  double muT1 = 0.000;
540  double muT2 = 0.000;
541 
542  //the density ratio of particles
543  double rhoRatio = 2500.0/2500.0;
544  //the size ratio of particles
545  double dRatio = 1.5;
546 
547  //the fraction of species 1 particles
548  double specFrac = 0.5;
549 
550  double drumRad = 20*1.5*0.0015;
551 
552  double rotRate = 10.0;
553 
554  double froudeNumber = (rotRate * 2.0 * 3.1415926535 / 60.0) * (rotRate * 2.0 * 3.1415926535 / 60.0) * drumRad / 9.81;
555 
556  //the dimensionless drum length (L/d_l)
557  double dimDrumLength = 240.0;
558 
559 
560  double drumLength = dimDrumLength*0.003*1.5;
561 
562  //Set the number of domains for parallel decomposition
563  problem.setNumberOfDomains({2,1,1});
564 
565 
566  //*******************Setting Up Filename******************************************
567  //setting up a stringstream to use in order to create an instructive filename
568  std::stringstream nameStream;
569  //the generic 'root' of the name for the file that will be applied to all files
570  //irrespective of parameters
571  //std::string nameBase = "binary";
572  std::string nameBase = "binary";
573 
574  //Name stream for tests looking at size segregation and concentration
575  nameStream << nameBase << "-length" << dimDrumLength;
576 
577 
578  //Name stream for tests looking at effect of vibration
579  /*nameStream << nameBase << "-rotationRate" << rotRate
580  << "-frequency" << fVib << "-amplitude" << aVib;
581  */
582 
583  /*Name stream for tests looking for particle 'sinkage'
584  * nameStream << nameBase << "-mu_s" << muS1 << "," << muS2 << "," << muSWall << ","
585  << "-mu_r" << muR1 << "," << muR2 << "," << muRWall << ","
586  << "-mu_t" << muT1 << "," << muT2 << "," << muTWall
587  << "-velocity" << rotRate << "-densityRatio" << rhoRatio;
588  */
589  std::string fullName = nameStream.str();
590  problem.setName(fullName);
591  //problem.autoNumber();
592  problem.setDrumRadius(drumRad);// in meters
593 
594  problem.setXMin(0.0);
595  problem.setYMin(0.0);
596  problem.setZMin(0.0);
597 
598  problem.setXMax(2. * problem.getDrumRadius());
599  problem.setZMax(2. * problem.getDrumRadius());
600  problem.setYMax(drumLength);// in meters
601 
602  problem.setTimeMax(750.);
603  problem.setTimeStep(1.0/(800.0 * 50.0));
604 
605  problem.setGravity(Vec3D(0.,0.,-9.81));
606  problem.setCOR(0.97,0.97,0.97);//drumWall, species1, species2
607  problem.setSizeAndDensityRatio(dRatio,rhoRatio);//size ratio and density ratio
608  problem.setFractionalPolydispersity(0.05);//10% dispersity
609  problem.setDrumFillFraction(0.3);// At 0.5 the drum is 3/4 filled.
610  problem.setSpeciesVolumeFraction(specFrac);//Species1 volume fraction
611  //redundant
612  //problem.setFrictionCoeff(.6,.19);//(particle-wall-friction,part-part-friction)
613  problem.setSlidingFriction(muSWall,muS1,muS2); //wall, species1, species2
614  problem.setRollingFriction(muRWall,muR1,muR2); //wall, species1, species2
615  problem.setTorsionFriction(muTWall,muT1,muT2); //wall, species1, species2
616 
617  problem.setRevolutionSpeed(rotRate);//rpm
618 
619  //setting vibration parameters
620  problem.setVibrationAmplitude(aVib);
621  problem.setVibrationFrequency(fVib);
622 
623  problem.setSaveCount(20000);
624  problem.setXBallsAdditionalArguments("-cmode 8 -solidf -v0");
625  problem.readArguments(argc,argv);
626 
627  problem.solve();
628 
629  // Measure elapsed time
630  endClock = std::chrono::system_clock::now();
631  std::chrono::duration<double> elapsed_seconds = endClock - startClock;
632  logger(INFO, "Elapsed time for solving the PDE: % s", elapsed_seconds.count());
633 
634  return 0;
635 }
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.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
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 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(), and DPMBase::solve().