# Calculating the number of molecules diffusing out of a volume [closed]

I have a system of reactions that are governed by differential equations.

They are reacting inside of a volume with known dimensions i.e lbh. I don't have any other information on their position inside that volume. I simply know there are 200 of A, 300 of B etc.

when molecules pass out of this volume they no longer react in the same way and move around in a Brownian fashion.

I want to know how often molecules leave this volume and I want to simulate this system.

I suppose I want a flux, or a probability distribution showing how likely an individual molecule leaves. I want to be able to "Count" the number of molecules left in V at the end of a timestep.

Ways I have thought about solving this:

Fick's first law: I get a flux with this, but I thought you couldn't apply it in systems where the concentration isn't constant.

Fick's second law: I don't really know how I would put it into my simulation

Smirnov density:

$$p(t)=\frac{x_0}{\sqrt{4\pi Dt^3}}\exp\left(-\frac{x_0^2}{4Dt}\right)$$

got this from https://physics.stackexchange.com/questions/93498/simulating-diffusion-from-bulk-to-individual-particles haven't really seen any other information on this. Maybe it's called something different?

With this equation there is a problem in that I don't know where the particles are in the volume.

The other approach I have thought of is using gibson-bruck next reaction and treating a transition as a reaction.