CoupledBeamDemo.cpp File Reference

Functions

int main ()
 [CoupledBeamDemo] More...
 

Function Documentation

◆ main()

int main ( )

[CoupledBeamDemo]

31 {
33  //set name
34  problem.setName("CoupledBeamUnitTest");
35 
36  //setup mercury
37  problem.setDomain({0,0,0},{0.16,0.04,0.01});
38  // add species
40  species->setDensity(1000);
41  species->setStiffness(5.2);
42  // add particle
43  SphericalParticle p(species);
44  p.setRadius(5e-3);
45  p.setPosition({problem.getXCenter(),problem.getYCenter(),problem.getZMax()+p.getRadius()});
46  p.setVelocity({0,0,-0.05});
47  auto particle = problem.particleHandler.copyAndAddObject(p);
48  // set time step
49  double tc = species->getCollisionTime(species->getMassFromRadius(p.getRadius()));
50  problem.setTimeStep(0.02*tc);
51 
52  // setup oomph
53  problem.setElasticModulus(1e6);
54  problem.setDensity(2500);
55  problem.setSolidCubicMesh(7, 5, 5, 0, 0.16, 0, 0.04, 0, 0.01);
56  problem.pinBoundaries({problem.Boundary::X_MIN, problem.Boundary::X_MAX});
57  problem.setNewtonSolverTolerance(3e-8);
58  problem.prepareForSolve();
59  problem.coupleBoundary(problem.Boundary::Z_MAX);
60  // sync time steps
61  problem.setOomphTimeStep(problem.getTimeStep());
62 
63  // setup time
64  problem.setTimeMax(100*problem.getTimeStep());
65 
66  // Solve the problem and save mesh
67  problem.solveSurfaceCoupling();
68  problem.saveSolidMesh();
69  return 0;
70 }
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
void setName(std::string name)
Definition: BaseCoupling.h:59
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
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1098
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
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
Mdouble getXCenter() const
Definition: DPMBase.h:653
Mdouble getYCenter() const
Definition: DPMBase.h:656
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
Definition: SCoupledSolidProblem.h:31
void solveSurfaceCoupling()
Definition: SCoupling.h:72
void coupleBoundary(unsigned b)
Definition: SCoupling.h:681
void setElasticModulus(double elasticModulus)
set function for elasticModulus_
Definition: SolidProblem.h:153
void prepareForSolve()
Definition: SolidProblem.h:322
void saveSolidMesh()
Definition: SolidProblem.h:557
void setSolidCubicMesh(const unsigned &nx, const unsigned &ny, const unsigned &nz, const double &xMin, const double &xMax, const double &yMin, const double &yMax, const double &zMin, const double &zMax)
Definition: SolidProblem.h:546
void setOomphTimeStep(double dt)
set function for time step
Definition: SolidProblem.h:269
void setDensity(double density)
set function for density_
Definition: SolidProblem.h:192
void setNewtonSolverTolerance(double Newton_solver_tolerance)
set function for Newton_solver_tolerance
Definition: SolidProblem.h:257
void pinBoundaries(std::vector< unsigned > b)
Definition: SolidProblem.h:235
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37

References BaseHandler< T >::copyAndAddObject(), SCoupling< M, O >::coupleBoundary(), BaseParticle::getRadius(), DPMBase::getTimeStep(), DPMBase::getXCenter(), DPMBase::getYCenter(), DPMBase::getZMax(), DPMBase::particleHandler, SolidProblem< ELEMENT_TYPE >::pinBoundaries(), SolidProblem< ELEMENT_TYPE >::prepareForSolve(), SolidProblem< ELEMENT_TYPE >::saveSolidMesh(), SolidProblem< ELEMENT_TYPE >::setDensity(), DPMBase::setDomain(), SolidProblem< ELEMENT_TYPE >::setElasticModulus(), BaseCoupling< M, O >::setName(), SolidProblem< ELEMENT_TYPE >::setNewtonSolverTolerance(), SolidProblem< ELEMENT_TYPE >::setOomphTimeStep(), BaseInteractable::setPosition(), BaseParticle::setRadius(), SolidProblem< ELEMENT_TYPE >::setSolidCubicMesh(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), BaseInteractable::setVelocity(), SCoupling< M, O >::solveSurfaceCoupling(), and DPMBase::speciesHandler.