SquareDrumTest.cpp File Reference
#include <Mercury3D.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "Species/LinearViscoelasticFrictionSpecies.h"
#include "Walls/AxisymmetricIntersectionOfWalls.h"
#include "Walls/IntersectionOfWalls.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[] 
)
457 {
458  RotatingDrum problem;
459  /* Make sure to add an (unique) name here */
460  problem.setName("SquareDrumTest");
461 
462  //setting locally-available variables to define key
463  //parameters such that they can be automatically included in
464  //the name of the file
465  //*******************Excitation Properties*****************************************
466  //Drum rotation rate (rpm)
467  double rotRateBasal = 10.0;
468 
469  //vibration amplitude and frequency
470  double fVib = 0.0;
471  double aVib = 0.0;
472 
473  //*******************Frictional Properties*****************************************
474  //sliding friction for species 1, 2 and wall
475  double muSWall = 0.6;
476  double muS1 = 0.16;
477  double muS2 = 0.16;
478 
479  //rolling friction for species 1, 2 and wall
480  double muRWall = 0.06;
481  double muR1 = 0.016;
482  double muR2 = 0.016;
483 
484  //torsion friction for species 1, 2 and wall
485  double muTWall = 0.0;
486  double muT1 = 0.000;
487  double muT2 = 0.000;
488 
489  //the density ratio of particles
490  double rhoRatio = 5000.0/2500.0;
491  //the size ratio of particles
492  double dRatio = 1;
493 
494  // computes rpm based on froude number and drumRad
495  //the fraction of species 1 particles
496  double specFrac = 0.5;
497 
498  double drumRad = 0.150/2; //diameter is 0.0150 m so drumRad is halve of the width
499  double drumLength = 0.024; // depth of the drum is 0.024 m
500 
501  problem.setTimeMax(5.0);
502  problem.setTimeStep(1.0/(2000.0 * 50.0));
503  double froudeNumber = 0.22; //was 0.22
504  double rotRate = 20; //pow(froudeNumber*9.81/drumRad,0.5);
505  logger(INFO, "rotRate = %", rotRate);
506 
507  //*******************Setting Up Filename******************************************
508 
509  problem.setDrumRadius(drumRad);// in meters
510 
511  problem.setXMin(-(pow(2*pow(drumRad,2.0),0.5)));
512  problem.setYMin(-drumLength/2);
513  problem.setZMin(-(pow(2*pow(drumRad,2.0),0.5)));
514 
515  problem.setXMax((pow(2*pow(drumRad,2.0),0.5)));
516  problem.setYMax(drumLength/2);// in meters
517  problem.setZMax((pow(2*pow(drumRad,2.0),0.5)));
518 
519  problem.setGravity(Vec3D(0.,0.,-9.81));
520  problem.setCOR(0.97,0.97,0.97);//drumWall, species1, species2 was all 0.97
521  problem.setSizeAndDensityRatio(dRatio,rhoRatio);//size ratio and density ratio
522  problem.setFractionalPolydispersity(0.00);
523  problem.setDrumFillFraction(0.4);// At 0.5 the drum is 3/4 filled.
524  problem.setSpeciesVolumeFraction(specFrac);//Species1 volume fraction
525 
526  problem.setSlidingFriction(muSWall,muS1,muS2); //wall, species1, species2
527  problem.setRollingFriction(muRWall,muR1,muR2); //wall, species1, species2
528  problem.setTorsionFriction(muTWall,muT1,muT2); //wall, species1, species2
529 
530  problem.setRevolutionSpeed(rotRate);//rpm
531 
532  problem.setSaveCount(2000);
533  problem.readArguments(argc,argv);
534 
539  problem.wallHandler.setWriteVTK(true);
540  problem.setParticlesWriteVTK(true);
541  problem.solve();
542  return 0;
543 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
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
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
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
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4391
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
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
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
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 setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
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
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
Definition: testDrum.cpp:38
void setDrumRadius(double radius)
Definition: testDrum.cpp:411
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
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:467

References DPMBase::dataFile, DPMBase::eneFile, DPMBase::fStatFile, INFO, logger, ONE_FILE, DPMBase::readArguments(), DPMBase::restartFile, RotatingDrum::setCOR(), RotatingDrum::setDrumFillFraction(), RotatingDrum::setDrumRadius(), File::setFileType(), RotatingDrum::setFractionalPolydispersity(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setParticlesWriteVTK(), RotatingDrum::setRevolutionSpeed(), RotatingDrum::setRollingFriction(), DPMBase::setSaveCount(), RotatingDrum::setSizeAndDensityRatio(), RotatingDrum::setSlidingFriction(), RotatingDrum::setSpeciesVolumeFraction(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), RotatingDrum::setTorsionFriction(), WallHandler::setWriteVTK(), DPMBase::setXMax(), DPMBase::setXMin(), DPMBase::setYMax(), DPMBase::setYMin(), DPMBase::setZMax(), DPMBase::setZMin(), DPMBase::solve(), and DPMBase::wallHandler.