When I cook spaghetti with a sauce that includes meatballs or chopped
vegetables, those stay in chunks and won't get uniformly mixed in the
pasta. Is there a simple reason for that?
I do not know if anyone ever studied spaghetti, if that is what you mean (see below). The reason is very simple: spaghetti are thin and meatballs are big.
How could they ever mix? If you pour the sauce and meatballs on top of spaghetti, even if you stir, they will not mix as they cannot mix: when spaghetti happens to be on the top of a meatball it will slip down along its sides, and the meatball will emerge.
If the meatballs are about the size of spaghetti like here (polpettine)
(recipe ) then, with a little stir, they will perfectly mix.
The bigger is pasta and the better they'll mix here you have bucatini,
here you have rigatoni
The same applies to vegetables: if they are finely chopped like here: recipe
As you can see in the recipe there are also mushrooms here, but they mix perfectly well.
In a nutshell: what is relevant here is the ratio pasta /meatball
Has it ever been studied?...some people study piles of sand with various grain sizes?
The physical phenomenon involved here is: granular convection "a phenomenon where granular material subjected to shaking or vibration will exhibit circulation patterns similar to types of fluid convection. It is sometimes also described as the Brazil nut effect when the largest particles end up on the surface of a granular material containing a mixture of variously sized objects; this derives from the example of a typical container of mixed nuts, where the largest will be Brazil nuts. The phenomenon is also known as the muesli effect since it is seen in packets of breakfast cereal containing particles of different sizes but similar density, such as muesli mix." [wiki]
Smaller grains, because of gravity, fall into the gaps between other grains created by the shakes, which are to small to be filled by bigger grains. The latter rise when the KE from the shake is greater than the PE needed to scale the diameter of one grain
Experiments made in reduced gravity show that this phenomenon is dependent on gravity