mixing two different types of materials in a same pack

Asked by Pouyan

Hi,
I want to model two sets of particles with different diameters and different rigidity. But I could not find any packing approach which mix particles from two different types of materials. I wonder if someone could help me.
Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hello,
I guess you have seen makeCloud() (else you would ask how to generate one set?)
So, calling makeCloud() repeateadly with the same "pack" object will insert more and more particles in the same.
That is:
sp.makeCloud(someParameters)
sp.makeCloud(differentParameters)

Does it help?

Revision history for this message
Jan Stránský (honzik) said :
#2

Hi Amir,

could you please be more specific about your goal? For example:
- do you need regular or random packing?
- do you want to simulate actual mixing, or you want the packing and do
some other simulation on it?

do your materials differ in diameters "exclusively" (from diameter you can
say what material it is)? Just to complete Bruno's answer, as I understand
the question, the easiest way is to generate packing with one material and
then change material of some particles.

cheers
Jan

2015-04-21 21:46 GMT+02:00 Bruno Chareyre <
<email address hidden>>:

> Question #265598 on Yade changed:
> https://answers.launchpad.net/yade/+question/265598
>
> Status: Open => Answered
>
> Bruno Chareyre proposed the following answer:
> Hello,
> I guess you have seen makeCloud() (else you would ask how to generate one
> set?)
> So, calling makeCloud() repeateadly with the same "pack" object will
> insert more and more particles in the same.
> That is:
> sp.makeCloud(someParameters)
> sp.makeCloud(differentParameters)
>
> Does it help?
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Pouyan (ppouyan) said :
#3

Hi guys,
Thanks a lot for your prompt answers. I have done it before but the question is that how introduce material and color to two different sp. there is not material option in makecloud.
I want to try random packing, first, I need to create mixed sample, then do some simulation on it.
yes, my materials are completely different, one of them is sand and the another one plastic grains.

Revision history for this message
Best Jan Stránský (honzik) said :
#4

>
>
> yes, my materials are completely different, one of them is sand and the
> another one plastic grains.
>
>
ok, then you can create just one sp (with two makeCloud calls) and do
material assignment afterwards, something like:

from yade import pack
O.materials.append((FrictMat(young=1e9),FrictMat(young=3e9)))
mat1,mat2 = [O.materials[i] for i in (0,1)]
r1,r2 = 1.0,2.0
sp = pack.SpherePack()
maxCorner = (20,20,20)
sp.makeCloud(maxCorner=maxCorner,rMean=r1,num=20)
sp.makeCloud(maxCorner=maxCorner,rMean=r2,num=10)
sp.toSimulation()
bodies1 = [b for b in O.bodies if b.shape.radius==r1]
bodies2 = [b for b in O.bodies if b.shape.radius==r2]
for b in bodies1:
b.mat = mat1
b.shape.color = (1,0,0)
for b in bodies2:
b.mat = mat2
b.shape.color = (0,0,1)

cheers
Jan

Revision history for this message
Pouyan (ppouyan) said :
#5

Thanks Jan Stránský, that solved my question.

Revision history for this message
Pouyan (ppouyan) said :
#6

Hi,
I am doing a Java interface for connecting another software to YADE. Now, I just trying to control the YADE by a socket. My socket works but problem is that it is not multi trade because after running a simulation, the server is still busy with it and it needs that I enter a quit command.
 My question is how can I quit the YADE automatically since the simulation is done?
Thanks in advanced

Revision history for this message
Jérôme Duriez (jduriez) said :
#7

With
quit() or exit()
functions, as from other python prompt. In fact, it seems to work within Yade without parenthesis too.

But, next time, please open another Launchpad question when you have another question.

Revision history for this message
Anton Gladky (gladky-anton) said :
#8

Hi,

you should start yade with -x option:

yade -x yourscript.py

2015-04-28 20:01 GMT+02:00 amir <email address hidden>:
> I am doing a Java interface for connecting another software to YADE.

Very interesting! If you have something to share e.g. experience,
example files, source code would be good to see it.

Cheers

Anton