Interaction of FrictMat and a new class of material
Hi guys,
I created a new class of material to present viscoelasticity by Burgers model. This class of material has been derived from CohFrictMat and it's called CohBurgersMat. I verified the response of CohBurgersMat-
However, I need to have FrictMat-
However, the model fails to create the required interaction physics. Can you please have a look on my script? Thanks.
======== CohBurgers.cpp =======
// 2014 © Behzad Majidi <email address hidden>
// 2014 © Ricardo Pieralisi <email address hidden>
#include"
#include<
#include<
#include<
#include<
#include<
#include<
#include<
#include<
#include<
YADE_PLUGIN(
//*****
void Ip2_FrictMat_
{
// if(interaction-
shared_
Calculate_
interaction->phys = phys;
phys-
phys-
cohesionDefin
setCohesionNow = true;
}
//*****
void Ip2_CohBurgersM
{
if(interactio
shared_
Calculate_
interaction->phys = phys;
phys-
phys-
cohesionDefin
setCohesionNow = true;
}
//*****
bool Law2_ScGeom_
{
Vector3r force = Vector3r::Zero();
Vector3r torque1 = Vector3r::Zero();
Vector3r torque2 = Vector3r::Zero();
CohBurgersPhys& phys=*static_
if (computeForceTo
const int id1 = I->getId1();
const int id2 = I->getId2();
addForce (id1,-force,scene);
addForce (id2, force,scene);
addTorque(id1, torque1,scene);
addTorque(id2, torque2,scene);
return true;
} else return false;
}
/*!Calculate_
void Ip2_CohBurgersM
if(interactio
CohBurgersMat* mat1 = static_
CohBurgersMat* mat2 = static_
Real mass1 = 1.0;
Real mass2 = 1.0;
mass1=
mass2=
//Load the rheological parameters
Real kmn1 = (mat1->kmn)*2; Real kkn1 = (mat1->kkn)*2;
Real cmn1 = (mat1->cmn)*2; Real ckn1 = (mat1->ckn)*2;
Real kms1 = (mat1->kms)*2; Real kks1 = (mat1->kks)*2;
Real cms1 = (mat1->cms)*2; Real cks1 = (mat1->cks)*2;
Real kmn2 = (mat2->kmn)*2; Real kkn2 = (mat2->kkn)*2;
Real cmn2 = (mat2->cmn)*2; Real ckn2 = (mat2->ckn)*2;
Real kms2 = (mat2->kms)*2; Real kks2 = (mat2->kks)*2;
Real cms2 = (mat2->cms)*2; Real cks2 = (mat2->cks)*2;
phys->kmn = contactParamete
phys->kms = contactParamete
phys->cmn = contactParamete
phys->cms = contactParamete
phys->kkn = contactParamete
phys->kks = contactParamete
phys->ckn = contactParamete
phys->cks = contactParamete
phys-
interaction->phys = shared_
}
/*!Calculate_
void Ip2_FrictMat_
if(interactio
const shared_
const shared_
Real mass1 = 1.0;
Real mass2 = 1.0;
mass1=
mass2=
//Load the rheological parameters
Real kn1 = (mat1->young); Real ks1 = (mat1->
Real kmn2 = (mat2->kmn); Real kkn2 = (mat2->kkn);
Real cmn2 = (mat2->cmn); Real ckn2 = (mat2->ckn);
Real kms2 = (mat2->kms); Real kks2 = (mat2->kks);
Real cms2 = (mat2->cms); Real cks2 = (mat2->cks);
phys->kmn = contactParamete
phys->kms = contactParamete
phys->cmn = cmn2;
phys->cms = cms2;
phys->kkn = kkn2;
phys->kks = kks2;
phys->ckn = ckn2;
phys->cks = cks2;
phys-
interaction->phys = shared_
}
/*! computeForceTor
bool computeForceTor
const ScGeom& geom=*static_
CohBurgersPhys& phys=*static_
Scene* scene=Omega:
const int id1 = I->getId1();
const int id2 = I->getId2();
const BodyContainer& bodies = *scene->bodies;
const State& de1 = *static_
const State& de2 = *static_
const Real& dt = scene->dt;
if (phys.normalFor
return false;
}
if (I->isFresh(scene)) {
phys.ukn = Vector3r(0,0,0);
phys.uks = Vector3r(0,0,0);
phys.
phys.
} else {
Real An = 1.0 + phys.kkn * dt / (2.0 * phys.ckn);
Real Bn = 1.0 - phys.kkn * dt / (2.0 * phys.ckn);
Real Cn = dt / (2.0 * phys.ckn * An) + 1.0 / phys.kmn + dt / (2.0 * phys.cmn);
Real Dn = dt / (2.0 * phys.ckn * An) - 1.0 / phys.kmn + dt / (2.0 * phys.cmn);
Real As = 1.0 + phys.kks * dt / (2.0 * phys.cks);
Real Bs = 1.0 - phys.kks * dt / (2.0 * phys.cks);
Real Cs = dt / (2.0 * phys.cks * As) + 1.0 / phys.kms + dt / (2.0 * phys.cms);
Real Ds = dt / (2.0 * phys.cks * As) - 1.0 / phys.kms + dt / (2.0 * phys.cms);
const Vector3r shift2 = scene->isPeriodic ? scene->
const Vector3r shiftVel = scene->isPeriodic ? scene->
const Vector3r c1x = (geom.contactPoint - de1.pos);
const Vector3r c2x = (geom.contactPoint - de2.pos - shift2);
const Vector3r relativeVelocity = (de1.vel+
const Vector3r normalVelocity = geom.normal.
const Vector3r shearVelocity = relativeVelocit
const Vector3r normalForceT = (normalVelocity * dt + phys.ukn * (1.0 - Bn / An) - phys.normalForce * Dn) / Cn;
phys.ukn = (phys.ukn * Bn + (normalForceT + phys.normalForce) * dt / (2.0 * phys.ckn)) / An;
phys.
const Vector3r shearForceT = -1 * (shearVelocity * dt + phys.uks * (1.0 - Bs / As) - phys.shearForce * Ds) / Cs;
phys.uks = (phys.uks * Bs + (shearForceT + phys.shearForce) * dt / (2.0 * phys.cks)) / As;
phys.
const Real maxFs = phys.normalForc
if( phys.shearForce
const Real ratio = sqrt(maxFs) / phys.shearForce
}
force = phys.normalForce + phys.shearForce;
torque1 = -c1x.cross(force);
torque2 = c2x.cross(force);
return true;
}
}
=======
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask behzad for more information if necessary.