yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #07262
Re: [Question #224128]: How to learn and start a 2D simulation in YADE
Question #224128 on Yade changed:
https://answers.launchpad.net/yade/+question/224128
Status: Open => Answered
Jan Stránský proposed the following answer:
Hi,
> "# Simulation controller defination
> unb=unbalancedForce()
>
> meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2
> q=unb
> r=abs(meanS-triax.sigma_iso)/triax.sigma_iso
> ### functions defination ###
> def checkUnbalanced():
> if q<0.01 and r<1e-5:
> O.pause()".
>
>
Let me explain what is hapening in your script. Firstly, before the
simulation starts, you compute
unb=unbalancedForce()
meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1])/2
q=unb
r=abs(meanS-triax.sigma_iso)/triax.sigma_iso
after this, you define checkUnbalance function
def checkUnbalanced():
if q<0.01 and r<1e-5:
O.pause()
It runs each 200 iterations, but actually do nothing. Both "q" and "r"
variables are unchanged values computed in the beginning of the script.
Because they have original values (are not changed), your condition "if
q<0.01 and r<1e-5" is never fulfilled and O.pause() is never executed.
To make it work, you need to do the same as in the original version,
i.e.:
def checkUnbalanced():
unb=unbalancedForce()
meanS=(triax.stress(triax.wall_right_id)[0]+triax.
stress(triax.wall_top_id)[1])/2
q=unb
r=abs(meanS-triax.sigma_iso)/triax.sigma_iso
if q<0.01 and r<1e-5:
O.pause()
>
> (2).I have borrowed the method of particles generation Professor Bruno
> Chareyre last time gave me, which is that:
>
> "O.periodic=1
> O.cell.setBox(7,7,1)
> sp=pack.SpherePack()
> sp.makeCloud((0,0,.5),(7,7,.5),rMean=-1,RelFuzz=0,num=300,periodic=True)
> O.bodies.append([utils.sphere(s[0],s[1]) for s in sp])"
>
>
The problem is exactly what the error says: some of your bodies has
dimension larger than period of your periodic cell. You can get the maximum
dimension of bodies with:
print max([b.shape.radius for b in O.bodies]) # [ ] pais might be omitted,
but just now I can't try it, so use version with braces.
Probably it will be > 1.0, so it is larger than the least dimension of
periodic cell (1.0 in your case). Fortunately, this dimension dos not play
any role in your simulaion, so you can enlarge it as you want to solve you
problem, just set the dimension as cube:
O.cell.setBox(7,7,7)
Please try these suggestions and let us know what are the results :-)
cheers
Jan
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.