Surface coupling with oomph-lib

Tutorial

Before we can do coupled simulations, see How to run oomph-lib codes in MercuryDPM to learn how to run oomph-lib simulations in the framework of MercuryDPM.

Now you can include oomph-lib source files into your Driver codes. A good example of this is SolidBeamDemo.cpp:

int main()
{
//set name
problem.setName("CoupledBeamUnitTest");
//setup mercury
problem.setDomain({0,0,0},{0.16,0.04,0.01});
// add species
species->setDensity(1000);
species->setStiffness(5.2);
// add particle
SphericalParticle p(species);
p.setRadius(5e-3);
p.setPosition({problem.getXCenter(),problem.getYCenter(),problem.getZMax()+p.getRadius()});
p.setVelocity({0,0,-0.05});
auto particle = problem.particleHandler.copyAndAddObject(p);
// set time step
double tc = species->getCollisionTime(species->getMassFromRadius(p.getRadius()));
problem.setTimeStep(0.02*tc);
// setup oomph
problem.setElasticModulus(1e6);
problem.setDensity(2500);
problem.setSolidCubicMesh(7, 5, 5, 0, 0.16, 0, 0.04, 0, 0.01);
problem.pinBoundaries({problem.Boundary::X_MIN, problem.Boundary::X_MAX});
problem.setNewtonSolverTolerance(3e-8);
problem.prepareForSolve();
problem.coupleBoundary(problem.Boundary::Z_MAX);
// sync time steps
problem.setOomphTimeStep(problem.getTimeStep());
// setup time
problem.setTimeMax(100*problem.getTimeStep());
// Solve the problem and save mesh
problem.saveSolidMesh();
return 0;
}
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
int main(int argc, char *argv[])
Definition: T_protectiveWall.cpp:215
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

This code includes the class SCoupledSolidProblem, which is derived from the SolidProblem class. This class is defined in the MercuryDPM kernel, and is specifically designed to solve problems with coupled elastic bodies. As you can see, the driver code defines a class of type SCoupledSolidProblem, with the element type RefineableQDPVDElement<3,2>, sets the properties of the elastic solid, then calls solveSteady to solve the linear algebra problem.

Further test cases

We have implemented the following test cases:

SolidOnParticleBed.cpp

Illustrates the surface coupling technique implemented in MercuryDPM and oomph-lib. A solid cube (10cm side length) rests on four particles (2cm diameter), which rests on a fixed bottom wall. Gravity acts on both particles and the solid cube. The particle stiffness is chosen very low such that the compression due to gravitational load can be seen: the equilibrium overlap of the particle-wall and particle-cube contacts is 1mm, and you can see in the simulation that the overlaps oscillate between 0 and 2 mm. Both solid cube and particle contacts are non-dissipative, so oscillations are not damped out.


CoupledBeam.cpp

This is the demo from the coupling paper by Hongyang: A 20m x 80cm x 80cm beam fixed on the left end, with two particles of 20 cm diameter rolling down the beam at 0.1 m/s velocity, under gravity. Both solid cube and particle contacts are non-dissipative, so oscillations are not damped out. (Does not fully work yet; the smooth wall implementation is not there)

CoupledBeamUnitTest.cpp

A short simulation showing the unsteady interaction of a particle impacting a beam that is fixed on both sides. Colors indicate the displacement of the beam, due to gravity and the particle-beam interaction.