DensitySizeSeg_Belt_WarreJan_25_75.cpp File Reference
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "Chute.h"
#include "Boundaries/PeriodicBoundary.h"
#include "Walls/InfiniteWall.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <Species/LinearViscoelasticFrictionSpecies.h>

Classes

class  SegregationPeriodic
 This class does segregation problems in a periodic chute. More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
Todo:
TW:should be lightest particle, but computeMass has to be automated first
358 {
360  //problem.setParticlesWriteVTK(true);
361 
362  if (argc < 5)
363  {
364  logger(ERROR,"Wrong amount of command line inputs; Use ./fileName -sr ... -dr ...");
365  }
366 
367  Mdouble sizeRatio = helpers::readFromCommandLine(argc,argv,"-sr",1.0);
368  Mdouble densityRatio = helpers::readFromCommandLine(argc,argv,"-dr",1.0);
369  problem.setSizeRatio(sizeRatio);
370  problem.setDensityRatio(densityRatio);
371 
372  std::stringstream dirNameBase;
373  std::string directoryName = "Segregation_";
374  dirNameBase << directoryName << "sizeRatio_" << problem.getSizeRatio() << "_densityRatio_" << problem.getDensityRatio();
375 
376  std::stringstream fileNameStream;
377  std::string nameBase = "Segregation_";
378  fileNameStream << nameBase << "sizeRatio_" << problem.getSizeRatio() << "_densityRatio_" << problem.getDensityRatio();
379  std::stringstream saveTo;
380  saveTo << dirNameBase.str() << "/" << fileNameStream.str();
381 
382  std::stringstream com;
383  com << "mkdir " << dirNameBase.str();
384  int status = system(com.str().c_str());
385 
386  problem.setName(saveTo.str());
387 
388  // Problem parameters, name tmax and two types of particles
389  //This should be set to 100 for full problems.
390  problem.setTimeMax(1);
391  //problem.speciesHandler.copyAndAddObject(problem.speciesHandler.getObject(0));
392  //problem.speciesHandler.copyAndAddObject(problem.speciesHandler.getObject(0));
393 
394 
395 
396  // Chute properties
397  problem.setFixedParticleRadius(0.5);
398  problem.setRoughBottomType(MULTILAYER);
399  problem.setChuteAngleAndMagnitudeOfGravity(26.0, 1.0);
400  problem.setChuteLength(20);
401  problem.setChuteWidth(10);
402  problem.setZMax(70);
403  problem.setMaxFailed(6);
404  problem.makeChutePeriodic();
405 
406  //solve
408  //std::cout << "Maximum allowed speed of particles: " << problem.particleHandler.getSmallestParticle()->calculateMaximumVelocity() << std::endl; // speed allowed before particles move through each other!
409  problem.setTimeStep(5.e-3 / 50.0);//initially it was auto-set
410  //This is based on the fact in general you get too much data, so prob at worst you want to turn it into a 20 at 60fps (which is its self overkill)
411  problem.setSaveCount(helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(20*60, problem.getTimeMax(), problem.getTimeStep()));
412  //problem.setSaveCount(helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(20*60,getTimeMax(),getTimeStep()));
413  //problem.setSaveCount(1);
414  logger(INFO, "dt=%", problem.getTimeStep());
415 
416  //problem.autoNumber();
417 
418 
419  //This set to colouring based of size and small vectors
420  problem.setXBallsColourMode(7);
421  problem.setXBallsVectorScale(1);
422  problem.setXBallsAdditionalArguments("-v0 -solidf");
423 
424 
425  //solves the problems
426  problem.solve();
427 
428  //Make sure the restart data is upto date at the end
429  problem.writeRestartFile();
430 }
@ MULTILAYER
Definition: Chute.h:32
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:32
This class does segregation problems in a periodic chute.
Definition: Chute/segregation.cpp:18
#define INFO(i)
Definition: mumps_solver.h:54
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: FormulaHelpers.cc:75
bool readFromCommandLine(int argc, char *argv[], const std::string &varName)
Returns true if command line arguments contain varName, false else.
Definition: CommandLineHelpers.cc:99
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References ERROR, helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(), INFO, logger, MULTILAYER, problem, helpers::readFromCommandLine(), and oomph::Global_string_for_annotation::string().