From a technical standpoint, your simulation is possible, if highly impractical. The operating system uses virtual memory to abstract resource allocation away from calling processes, but the good thing about that is that your 4Gb of RAM can seem infinite to your simulation program because the operating system will simply use disk space for all the RAM memory requests that don't fit in the active page table. If you're using linux, you can probably see your current system limits configuration using
cat /proc/self/limits. Some systems set a default maximum, in which case calling
malloc will fail with
ENOMEM, but you can configure this on your own computer to whatever you want, including removing the limit altogether.
That being said, disk access is millions of times slower than reading from RAM, even if we assume the unrealistic, best-case scenario where you're mostly doing large sequential reads, which is not the point of random access memory at all.
I think the first thing you should figure out is what exactly you're trying to model about these particles. If you're trying to explore the physics of their interaction with the environment, do you really need to model all of them at once? The biggest hurdle in these kinds of simulations is the inter-dependence of state variables. After all, you're trying to model interactions, otherwise you could simply parallelize this on a supercomputer. If you were to reduce the number of particles being simulated at any one time, you could use put those resources towards the computation of the simulation data. Modeling viscosity, flow rate, etc., takes a ton of computational resources, and the more resources you have at your disposal, the more realistically you can model the interactions between the particles themselves.
I interned in a computational physics lab doing solid-state simulations, and the biggest hurdle in those projects was the amount of interaction between each molecule. The computational complexity of the computations involved could reach n!, so if you're plan is to start out by modeling every blood cell in the human body from the beginning, my advice would be to either design the model first, prototype the necessary algorithms, run small simulations with a low iteration count, repeat as necessary while you fine-tune the model, and then gradually increase either the scope or the depth (but not both) of the investigation, or cryogenically freeze yourself until a Kardashev tier 2 civilization shows up with the tech you need.