A mug filled with coffee sits in the sink. You turn on the faucet and a column of water enters the coffee mug. The mug is already full ($V_0$) at a known concentration of coffee ($C_0$). I want to figure out how much coffee remains after $X$ amount of water has poured into the mug.
Assume:
The coffee isn’t sticking to the sides like crazy.
We use metric to make life easier.
Every mL of water going into the mug is equal to the number of mL flowing out of the mug.
As water is added to the mug, it is instantaneously diluted throughout the mug.
If this were a serial dilution or something similar, this would be straightforward. It is not. Here, the coffee is being diluted as it flows out, so there is a geometric loss of the coffee.
There is no time factor, so no need to worry about flow rate, because we assume instantaneous dilution so that the concentration at any time is just a factor of the water going in and diluted coffee going out.
Now, I've managed to work out how to calculate this. But that isn't a generalized formula, which is what I want.
To calculate after 1 mL is added would be:
$$ C_0-(1/V_0)(C_0) $$
Subsequent mL would expand the function. For example, the second mL would be
$$ \left(C_0- \frac{C_0}{V_0}\right) - \frac{1}{V_0}\left(C_0- \frac{C_0}{V_0}\right) $$
And so on and so on. I recognize that it’s not actually $1/V_0$ but $V_{\rm input}/V0$, but that isn’t quite right because it would be a linear dilution then, whereas I’m looking for the moment by moment addition.
It works, but is klunky and awkward and I don’t know how to describe it in a generalized form. I’ve been wracking my brains over this for a week, and I’m either otherthinking something obvious (probably) or am delving into a system more complex than I have the math for (also a distinct possibility). Please help!
Bonus question: What happens when we no longer assume the water dilutes instantaneously but spreads outward in a circle/column?
For a constant flow rate $\varrho$ and an instant dilution, the infinitesimal variation of $C$ is ruled by $$C(t+dt)\approx\frac{V_0}{V_0+\varrho dt} C(t)$$ hence $$C'(t)=-\frac{\varrho}{V_0} C(t)$$ which is solved by $$C(t)=C_0e^{-\varrho t/V_0}$$ The time $t_V$ at which the total volume added is $V$ solves $$\varrho t_V=V$$ and then $$C(t_V)=C_0e^{-V/V_0}$$ If the dilution is not instantaneous, more information is needed about the filling and dilution mechanisms.