Gas concentration in a room (simple model) Completed and further simplified version of the question: 
We have a cubic open room of volume $V,$ open in the sense that there's both a source and a sink of gas connected to the room. 
There's a constant influx (amount of substance per unit area per unit time) $I_f$ of a gas $x$ (source), similarly a constant outflux $O_f$ of $x$. So in short, the room is being both filled by the gas $x$, and from the other end a certain amount (not necessarily matching the amount that had entered) manages to leave the room.
Last detail, the room is initially uniformly filled with a fluid $y$ with concentration (amount of substance per unit volume) $\rho_0.$ The source and the sink are impermeable to $y$. If this last detail proves to over-complicate things too much, we can set $\rho_0=0$ and assume the room to be initially empty (i.e. vacuum). 
Initial conditions: $\rho_x (t=0)=0$ and $\rho_y (t=0) = \rho_0 \neq 0.$ (As mentioned before, for added simplicity one can assume $\rho_0 =0$ at first). Simple case: in-out flows are constant with $I_f \ge O_f$. Difficult case: the in-out flows are proportional to current average density of x in the room, i.e. $I_f\propto A_i \langle \rho_x(t) \rangle$ and $O_f \propto A_o \langle \rho_x(t)\rangle$.
If I understand correctly for the latter case the boundary conditions become time dependent as well? Would the problem still be tractable?
My question:


*

*Ultimately, I am trying to figure out how I can compute the concentration profile of the gas $x$ in the room as a function of time, given our initial conditions. More precisely, I gather we have to set things off using the diffusion equation $\frac{\partial \rho_x (\mathbf{r},t)}{\partial t}=D\nabla^2 \rho_x (\mathbf{r},t).$ But how do account for the source+sink on the lhs? (do they also perturb the boundary conditions)

*I understand it may be more practical to consider first the steady state scenario, namely, the concentration profile $\rho_x$ is no longer time dependent. Would it be possible to calculate this limiting concentration profile? At least for the simple case?

*In reality my question is really at a conceptual and methodological level, since I'm not sure where to start from in order to model the concentration.
I understand this may be just basic fluid dynamics at work, but I would really appreciate some hints or learning from similar solved examples. 
Please let me know if the question as it stands is too vague (e.g. if it is important that the gas is compressible or not.)
 A: A simple flow model would go like this:
The volume contains $x$ kg of gas, so the density $\rho$ is $x/V$ with units $\mathrm{kg/m^3}$. Now we ask of the rate of change of $x$, the amount of kg inside the box, per time. We write this as
$$\frac{dx}{dt} =\text{stuff coming in}-\text{stuff going out} ,$$
where the units on the right should be $\mathrm{kg/s}$.
When there is an influx then a certain amount "$I_f$" of kg per second enter the box. We can express this as 
$$\text{stuff coming in}=I_f\cdot~\mathrm{\frac{kg}{s}}= \rho_i ~\mathrm{\frac{kg}{m^3}}\cdot Q_i~\mathrm{\frac{m^3}{s}}, $$
where $\rho_i$ is the density of the incoming gas and $Q_i$ is the volumetric flow rate of the incoming gas. The units are $\mathrm{kg/s}$, just as we want.
Similarly the amount of stuff going out is the density of gas inside the box times the volumetric flow rate $Q_o$ out of the box: 
$$\text{stuff going out}= O_f\cdot~\mathrm{\frac{kg}{s}}=\rho ~\mathrm{\frac{kg}{m^3}}\cdot Q_o ~\mathrm{\frac{m^3}{s}}. $$
The density $\rho$ of the gas inside the box is, as said above, $x/V$, so we can finally write (omitting the units):
$$\frac{dx}{dt}= \rho_i \cdot Q_i -\frac{x}{V} \cdot Q_o .$$
The solution of this is
$$x(t)=\frac{ Q_i  }{Q_0}~\rho_i V+c_1e^{-\frac{Q_0}{V} \cdot t}, $$
where the constant $c_1$ has to determined from the condition that the box contains $x_0$ kg of gas at $t=0$. When the room is empty at the beginning then 
$$x(t)=\frac{ Q_i  }{Q_0}~\rho_i V~\left(1-e^{-\frac{Q_0}{V} \cdot t}\right), $$
which makes sense: if the flow rates for "going out" and "coming in" are equal then after long enough time the amount of gas in the box will just be the density of the incoming gas times the volume.
A: From your question it seems to me that flow of gas in the canal and through the holes is being created by some external agency like a pump. If this is the case, mass flow in the room, from canal to holes, does not require any concentration gradient to exist in the room. Flow is driven by a pressure gradient. Therefore knowledge of flow rates alone is insufficient to tell you anything about the concentration profile (or even if it exists at all; the best you can do is calculate average concentration of gas in the room using control-volume type analysis, as shown by @NoEigenvalue). If at all a concentration gradient is present, then it means that thermodynamic conditions are not uniform in the room. If pressure in the room may be assumed constant, then variation in concentration/density requires that temperature be non-uniform in the room. So you need to analyse energy equation too, but things will most likely become messy.
A: You do not need the diffusion equation since you are interested only on time variation regardless of spatial distribution. Especially because you  are fixing inflow and outflow irrespective of surface area, which probably means these areas are equal and then only the time rates matter. Since those time rates are constant, the is not clear if you are interested in the volumetric profile, in which case the solution is a linear or flat profile with time.
If you do want spatially resolved density, then you need to provide the areas of inflow and outflow because they matter. Also the speed of inflow/outflow will change the type of diffusion, which can range from molecular diffusion, if they are very small, to chaotic turbulence if they are really fast.   

Addition after comments below…

To solve the problem, it needs to be specified further. For the equation proposed to be applicable
$$\frac{\partial \rho_x(r, t)}{\partial t} = D \nabla^2 \rho_x(r,t)$$
we need thermodynamical equilibrium. This means that the gas y has to be present and it's temperature and pressure must match those of the incoming/outgoing gas in the fronteers. 
If this does not hold, the duffusion will also be driven by temperature/pressure gradients. Such effects would be expressed by dependences of the diffusion coefficient $D$ on spatial coordinates, and we would need to use the more general expression
$$\frac{\partial \rho_x(r, t)}{\partial t} = \nabla ( D(\rho,t)  \nabla \rho_x(r,t) )$$
Now, under the mentioned assumptions, you can have the following cases:


*

*Equal sized entry and exit boundaries...
Then the problem is basically unidimensional since the transversal profile has no differences and the equation looks like:
$$\frac{\partial \rho_x(z, t)}{\partial t} = D \frac{\partial^2 \rho_x(z,t)}{\partial z^2}$$


*

*Unequal sized entry and exit boundaries...
Then the problem can be 2D in space, if cyllindrical coordinates can be used because the system is rotationally symmetric where you can use 
$$\frac{\partial \rho_x(z, t)}{\partial t} = D (\frac{1}{r}\frac{\partial}{\partial r}(r\frac{\partial \rho}{\partial r} ) + \frac{1}{r^2}\frac{\partial^2 \rho}{\partial \phi ^2} + \frac{\partial^2 \rho_x(z,t)}{\partial z^2})$$
or if not, like in your case where V is a box, then a the coordinate system needs to be chosen according to the problem.
Al of these equations can be solved defining correctly the boundary conditions. For the first case they are simply $O_f$ and $I_f$, while for the second, it needs to account for the entry and exit boundaries shape.
