yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #12661
[Branch ~yade-pkg/yade/git-trunk] Rev 3858: Add mathcmaker for normalCohesion and shearCohesion.
------------------------------------------------------------
revno: 3858
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2016-05-13 09:13:26 +0200
message:
Add mathcmaker for normalCohesion and shearCohesion.
modified:
pkg/dem/CohesiveFrictionalContactLaw.cpp
pkg/dem/CohesiveFrictionalContactLaw.hpp
--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/dem/CohesiveFrictionalContactLaw.cpp'
--- pkg/dem/CohesiveFrictionalContactLaw.cpp 2016-02-15 15:30:38 +0000
+++ pkg/dem/CohesiveFrictionalContactLaw.cpp 2016-05-13 07:13:26 +0000
@@ -248,6 +248,9 @@
setCohesionNow = 0;}
if (geom) {
+ const auto normalAdhPreCalculated = (normalCohesion) ? (*normalCohesion)(b1->id,b2->id) : std::min(sdec1->normalCohesion,sdec2->normalCohesion);
+ const auto shearAdhPreCalculated = (shearCohesion) ? (*shearCohesion)(b1->id,b2->id) : std::min(sdec1->shearCohesion,sdec2->shearCohesion);
+
if (!interaction->phys) {
interaction->phys = shared_ptr<CohFrictPhys>(new CohFrictPhys());
CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->phys.get());
@@ -279,8 +282,8 @@
if ((setCohesionOnNewContacts || setCohesionNow) && sdec1->isCohesive && sdec2->isCohesive)
{
contactPhysics->cohesionBroken = false;
- contactPhysics->normalAdhesion = std::min(sdec1->normalCohesion,sdec2->normalCohesion)*pow(std::min(Db, Da),2);
- contactPhysics->shearAdhesion = std::min(sdec1->shearCohesion,sdec2->shearCohesion)*pow(std::min(Db, Da),2);
+ contactPhysics->normalAdhesion = normalAdhPreCalculated*pow(std::min(Db, Da),2);
+ contactPhysics->shearAdhesion = shearAdhPreCalculated*pow(std::min(Db, Da),2);
geom->initRotations(*(Body::byId(interaction->getId1(),scene)->state),*(Body::byId(interaction->getId2(),scene)->state));
contactPhysics->fragile=(sdec1->fragile || sdec2->fragile);
}
@@ -290,14 +293,13 @@
contactPhysics->maxRollPl = min(sdec1->etaRoll*Da,sdec2->etaRoll*Db);
contactPhysics->maxTwistPl = min(sdec1->etaTwist*Da,sdec2->etaTwist*Db);
contactPhysics->momentRotationLaw=(sdec1->momentRotationLaw && sdec2->momentRotationLaw);
- }
- else {// !isNew, but if setCohesionNow, all contacts are initialized like if they were newly created
+ } else {// !isNew, but if setCohesionNow, all contacts are initialized like if they were newly created
CohFrictPhys* contactPhysics = YADE_CAST<CohFrictPhys*>(interaction->phys.get());
if ((setCohesionNow && sdec1->isCohesive && sdec2->isCohesive) || contactPhysics->initCohesion)
{
contactPhysics->cohesionBroken = false;
- contactPhysics->normalAdhesion = std::min(sdec1->normalCohesion,sdec2->normalCohesion)*pow(std::min(geom->radius2, geom->radius1),2);
- contactPhysics->shearAdhesion = std::min(sdec1->shearCohesion,sdec2->shearCohesion)*pow(std::min(geom->radius2, geom->radius1),2);
+ contactPhysics->normalAdhesion = normalAdhPreCalculated*pow(std::min(geom->radius2, geom->radius1),2);
+ contactPhysics->shearAdhesion = shearAdhPreCalculated*pow(std::min(geom->radius2, geom->radius1),2);
geom->initRotations(*(Body::byId(interaction->getId1(),scene)->state),*(Body::byId(interaction->getId2(),scene)->state));
contactPhysics->fragile=(sdec1->fragile || sdec2->fragile);
=== modified file 'pkg/dem/CohesiveFrictionalContactLaw.hpp'
--- pkg/dem/CohesiveFrictionalContactLaw.hpp 2016-02-15 15:30:38 +0000
+++ pkg/dem/CohesiveFrictionalContactLaw.hpp 2016-05-13 07:13:26 +0000
@@ -8,13 +8,14 @@
#pragma once
-#include<core/GlobalEngine.hpp>
-#include<pkg/common/Dispatching.hpp>
-#include<pkg/common/ElastMat.hpp>
-#include<pkg/dem/ScGeom.hpp>
-#include<boost/tuple/tuple.hpp>
-#include<pkg/common/NormShearPhys.hpp>
-#include<pkg/dem/FrictPhys.hpp>
+#include <core/GlobalEngine.hpp>
+#include <pkg/common/Dispatching.hpp>
+#include <pkg/common/ElastMat.hpp>
+#include <pkg/dem/ScGeom.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <pkg/common/NormShearPhys.hpp>
+#include <pkg/dem/FrictPhys.hpp>
+#include <pkg/common/MatchMaker.hpp>
// The following code was moved from CohFrictMat.hpp
@@ -146,6 +147,8 @@
"Generates cohesive-frictional interactions with moments, used in the contact law :yref:`Law2_ScGeom6D_CohFrictPhys_CohesionMoment`. The normal/shear stiffness and friction definitions are the same as in :yref:`Ip2_FrictMat_FrictMat_FrictPhys`, check the documentation there for details.\n\nAdhesions related to the normal and the shear components are calculated from :yref:`CohFrictMat::normalCohesion` ($C_n$) and :yref:`CohFrictMat::shearCohesion` ($C_s$). For particles of size $R_1$,$R_2$ the adhesion will be $a_i=C_i min(R_1,R_2)^2$, $i=n,s$.\n\nTwist and rolling stiffnesses are proportional to the shear stiffness through dimensionless factors alphaKtw and alphaKr, such that the rotational stiffnesses are defined by $k_s \\alpha_i R_1 R_2$, $i=tw\\,r$",
((bool,setCohesionNow,false,,"If true, assign cohesion to all existing contacts in current time-step. The flag is turned false automatically, so that assignment is done in the current timestep only."))
((bool,setCohesionOnNewContacts,false,,"If true, assign cohesion at all new contacts. If false, only existing contacts can be cohesive (also see :yref:`Ip2_CohFrictMat_CohFrictMat_CohFrictPhys::setCohesionNow`), and new contacts are only frictional."))
+ ((shared_ptr<MatchMaker>,normalCohesion,,,"Instance of :yref:`MatchMaker` determining tensile strength"))
+ ((shared_ptr<MatchMaker>,shearCohesion,,,"Instance of :yref:`MatchMaker` determining cohesive part of the shear strength (a frictional term might be added depending on :yref:`CohFrictPhys::cohesionDisablesFriction`)"))
,
cohesionDefinitionIteration = -1;
);