[Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-14 Thread Yor1
New question #295301 on Yade: https://answers.launchpad.net/yade/+question/295301 Hello Yade users ! I try to calculate the external work on a sample in tensile test. In fact, i calculate the external work with this simple formulate "Wext_incremental=AppliedForce*displacement_incremental". I want

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-14 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: Hi Jabrane, you came to c++ variables and scopes [2]. to get correct behavior, one option is to change the declaration of dAX [1]. Currently (Real dAX=) it create

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-14 Thread Jérôme Duriez
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Status: Open => Answered Jérôme Duriez proposed the following answer: Hello, You tried to modify the source code, that's it ? Did you also modify UniaxialStrainer.cpp in order to update this new variable "d

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-14 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: Hello Jerome and Jan Thank you of your response. Jerome, I simulate the tensile test with TriaxialStressController using a positive strainRate but i doesn't work. I get sigma=sigma2=

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-14 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: Hi Jabrane, But i have a question how do you know that dAX is a local variable ? it just comes from how C++ works / is defined, nothing else. "Real dAX" in cpp file

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-14 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: Hello Jan, The behavior of dAX is related to the line in which i put "this->dAX = dAX" In fact i put "this->dAX = dAX" just after https://github.com/yade/trunk/blob/master/pkg/dem/Un

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-14 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: Hi Jabrane, you should put "this->dAX = dAX" to a place such that dAX is not changed afterwards. e.g. it is changed at https://github.com/yade/trunk/blob/master/pkg/dem

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-15 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: Hi Jan, Thank you for the answer. Your alternative work but it doesn't resolve my problem because the external work obtained is underestimated (i compare it with the elastic energy).

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-15 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: > > > Your alternative work but it doesn't resolve my problem because the > external work obtained is underestimated (i compare it with the elastic > energy). > Do you

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: Hi Jan, This is the script which i use: from yade import ymport, utils , plot import math PACKING='X1Y2Z1_2k' OUT=PACKING+'_tensionTest_r0002_energy' DAMP=0.4 s saveData=100 iterMa

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: Hi Jabrane, thanks for the script. However, I was mainly interested in how you compute the elastic energy and the work :-) Jan 2016-06-16 9:28 GMT+02:00 Yor1 : > Que

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: Hi Jan, I compute the elastic energy in the recorder (in the script) with these lines: for i in O.interactions: if not i.isReal : continue E+=0.5*(i.phys.normalForce.squar

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: Hi Jabrane, dAX*=.5; > displacement=2*dAX; > externalWork += displacement(sumPosForces+sumNegForces)/2; > externalWork += externalWork; a few points: 1) displacement

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: Hi Jan, I calculate the displacement and the external work with these lines: if(asymmetry==0){ dAX*=.5;displacement=2*max(negIds.size(),posIds.size())*dAX;} externalWork += displaceme

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: > > displacement=2*max(negIds.size(),posIds.size())*dAX; I don't like that the work depends on number of particles, it should not.. Jan 2016-06-16 18:37 GMT+02:00 Y

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: I change the manner that i calculate the displacement if(asymmetry==0){ dAX*=.5; for(size_t i=0; idt; // update current position

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-16 Thread Jan Stránský
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Jan Stránský proposed the following answer: > > > > if(asymmetry!=1){ > for(size_t i=0; i negCoords[i]-=dAX; > axisVel(negIds[i]) = -dAX/scene->dt;

Re: [Yade-users] [Question #295301]: calculate external work in Uniaxial Strainer

2016-06-17 Thread Yor1
Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301 Yor1 posted a new comment: Hello Jan ! I modified the computation of the displacement and the external work by these formula: displacement += strainRate*originalLength*scene->dt; externalWork += displacement*(