I have asked this question in physics, math and chemistry (see my other sites). I have gotten some good advice but no definitive way to determine this. I am surprised there’s not already a program to determine questions like this. I thought I would reach out to you guys and see what you thought. Anyway if I knew anything about programming or the capabilities of engines like Blender I would imagine Each sphere having a repulsion to each other at close range but overall a strong attraction to each other so that overall an accumulated symmetrical and spherical shape forms. Then once the accumulation forms could there be a way to count the surface spheres and the interior spheres?
According to your image you can use Rigid Body physics.
- Add sphere as Particle in Physics properties add Rigid Body > type Active > Collision Shape Sphere
- Add sphere as Emitter, enable Particles System > source Volume > Render as Object
- Go to modifier properties and press Convert
- Add sphere as Collider object, go to physics properties and enable Rigid Body > Passive > shape Mesh
When you finish with a spheres shaped into a ball (state in blend file) you can select spheres on a surface with Dynamic Paint.
In general - go to last frame of animation. Select all "particle" spheres and Join ⎈ Ctrl+J them into a single object. Disable Rigid Body and enable Dynamic Paint > Canvas > from Paint to aWeight. At the bottom you can see a red field of vertex group, click plus icon so group is created. Go to Data properties and unsure this data block is unique for this object and is not used for other object. If next the data name is some number (like 2 or higher) click on that. Then select "collider" sphere, scale it down so half of particle spheres on surface is out of collider sphere. Again disable Rigid Body and enable Dynamic Paint but now as a Brush type. Play once animation. Like that collider "paints" on all vertecies of particles inside collider. Now with particle object selected go to modifiers and Apply Dynamic Paint here. Now when you switch to edit mode and from data properties click on Select under Vertex Group all vertices inside a collider sphere are selected now. Invert selection Crtl+I and select Linked cmd+L. Now all vertices of spheres on surface are selected. Separate by Selection P. Now you have spheres on surface as separate object. To count them, simply Separate by Loose Parts P. Now you can see (in 2.91 text next to Tool shelf, left top corner of 3D view editor) how many spheres takes to cover surface.
- For 180 spheres - 121 out / 59 in
- For 100 spheres - 74 out / 26 in
Since any work with forces is a bit random (also thanks to more ways how to store spheres in the same shape as seen in lemon's link) you can try to use Icosphere as a base mesh for quite even distribution of vertices on a surface.
Spheres are distributed via Instancing - parent small Sphere to Icosphere ⎇ Alt+P and enable in Properties Editor > Object > Instancing > Verts
coming to your question, your self proposed answer should work by using an emmiter particle system and 2 cahrge force fields + a drag force field:
But judging from your quistion you just want a sphere filled with spheres and seperate the outer layer?: