NetDEM v1.0
Loading...
Searching...
No Matches
netdem::LinearSpring Class Reference

Contact model that uses linear spring elements to evaluate contact forces and moments. More...

#include <model_linear_spring.hpp>

Inheritance diagram for netdem::LinearSpring:
netdem::ContactModel

Public Member Functions

 LinearSpring ()
 Default constructor for LinearSpring.
 
 LinearSpring (double kn, double kt, double mu, double beta)
 Constructor for LinearSpring.
 
nlohmann::json PackJson () override
 Packs the contact model properties into a JSON object.
 
void InitFromJson (nlohmann::json const &js) override
 Initializes the contact model from a JSON object.
 
void SetProperty (nlohmann::json const &js) override
 Sets the contact model properties.
 
void SetProperty (std::string const &name, double value) override
 Sets a specific contact model property.
 
ContactModelClone () const override
 Creates a copy of this contact model.
 
void EvaluateForces (ContactForces *const cnt_forces, CollisionGeometries &cnt_geoms, ContactPP *const cnt, double dt) const override
 Evaluates the forces and moments between two particles using linear spring elements.
 
void EvaluateForces (ContactForces *const cnt_forces, CollisionGeometries &cnt_geoms, ContactPW *const cnt, double dt) const override
 Evaluates the forces and moments between a particle and a wall using linear spring elements.
 
void Print () const override
 Prints the contact model properties.
 
- Public Member Functions inherited from netdem::ContactModel
virtual void EvaluateForces (ContactForces *const cnt_forces, BondGeometries &cnt_geoms, ContactPP *const cnt, double dt) const
 Calculate the contact forces and moments due to this model.
 
virtual void EvaluateForces (ContactForces *const cnt_forces, BondGeometries &cnt_geoms, ContactPW *const cnt, double dt) const
 Calculate the contact forces and moments due to this model.
 
virtual ~ContactModel ()
 

Public Attributes

double kn {2e6}
 < Parameters used to calculate contact forces.
 
double kt {1e6}
 
double beta {0.7}
 
double mu {0.5}
 
- Public Attributes inherited from netdem::ContactModel
int id {0}
 
std::string label {"default"}
 
int model_type {0}
 
std::string model_name {"contact_model"}
 

Additional Inherited Members

- Public Types inherited from netdem::ContactModel
enum  Type {
  none , linear_spring , hertz_mindlin , volume_based ,
  parallel_bond
}
 

Detailed Description

Constructor & Destructor Documentation

◆ LinearSpring() [1/2]

netdem::LinearSpring::LinearSpring ( )

Default constructor for LinearSpring.

◆ LinearSpring() [2/2]

netdem::LinearSpring::LinearSpring ( double kn,
double kt,
double mu,
double beta )

Constructor for LinearSpring.

Parameters
knNormal stiffness parameter used to calculate contact forces.
ktTangential stiffness parameter used to calculate contact forces.
muCoefficient of friction used to calculate contact forces.
betaCoefficient of restitution used to calculate contact forces.

Member Function Documentation

◆ Clone()

ContactModel * netdem::LinearSpring::Clone ( ) const
overridevirtual

Creates a copy of this contact model.

Returns
A new instance of the contact model.

Reimplemented from netdem::ContactModel.

◆ EvaluateForces() [1/2]

void netdem::LinearSpring::EvaluateForces ( ContactForces *const cnt_forces,
CollisionGeometries & cnt_geoms,
ContactPP *const cnt,
double dt ) const
overridevirtual

Evaluates the forces and moments between two particles using linear spring elements.

Parameters
cnt_forcesThe contact forces data structure to store the results.
cnt_geomsThe collision geometries data structure containing the contact information.
cntThe contact point between the two particles.
dtThe simulation timestep.

Reimplemented from netdem::ContactModel.

◆ EvaluateForces() [2/2]

void netdem::LinearSpring::EvaluateForces ( ContactForces *const cnt_forces,
CollisionGeometries & cnt_geoms,
ContactPW *const cnt,
double dt ) const
overridevirtual

Evaluates the forces and moments between a particle and a wall using linear spring elements.

Parameters
cnt_forcesThe contact forces data structure to store the results.
cnt_geomsThe collision geometries data structure containing the contact information.
cntThe contact point between the particle and the wall.
dtThe simulation timestep.

Reimplemented from netdem::ContactModel.

◆ InitFromJson()

void netdem::LinearSpring::InitFromJson ( nlohmann::json const & js)
overridevirtual

Initializes the contact model from a JSON object.

Parameters
jsA JSON object containing the contact model properties.

Reimplemented from netdem::ContactModel.

◆ PackJson()

nlohmann::json netdem::LinearSpring::PackJson ( )
overridevirtual

Packs the contact model properties into a JSON object.

Returns
A JSON object containing the contact model properties.

Reimplemented from netdem::ContactModel.

◆ Print()

void netdem::LinearSpring::Print ( ) const
overridevirtual

Prints the contact model properties.

Reimplemented from netdem::ContactModel.

◆ SetProperty() [1/2]

void netdem::LinearSpring::SetProperty ( nlohmann::json const & js)
overridevirtual

Sets the contact model properties.

Parameters
jsA JSON object containing the contact model properties.

Reimplemented from netdem::ContactModel.

◆ SetProperty() [2/2]

void netdem::LinearSpring::SetProperty ( std::string const & name,
double value )
overridevirtual

Sets a specific contact model property.

Parameters
nameThe name of the property to set.
valueThe value to set the property to.

Reimplemented from netdem::ContactModel.

Member Data Documentation

◆ beta

double netdem::LinearSpring::beta {0.7}

◆ kn

double netdem::LinearSpring::kn {2e6}

< Parameters used to calculate contact forces.

◆ kt

double netdem::LinearSpring::kt {1e6}

◆ mu

double netdem::LinearSpring::mu {0.5}

The documentation for this class was generated from the following files: