I'm trying to solve the transient behaviour of a compressible flow through a porous medium (porosity is $\epsilon$) where the fraction of B in A ($ \phi$) changes with time. The equations that I found are the following:
- continuity: $\frac{\partial \rho} {\partial t}+\frac{1}{\epsilon}\frac{\partial \rho u} {\partial x}=0 $
- fraction of component B $\frac{\partial \rho \phi} {\partial t}+\frac{1}{\epsilon}\frac{\partial \rho u \phi} {\partial x}=0 $
- equation of state: $P = \rho \cdot R \cdot T \cdot Z(P,\phi)$
- Darcy: $u = -\frac{k}{\mu} \frac{\partial P} {\partial x}$
The imposed boundary conditions are: $\phi=\phi(t) $, $P(x=L)=P_{back}$ and
$P(x=0)=P_{inlet}$ or $u(x=0)=u_{inlet}$
How should I proceed with this problem using a finite differences approach? Filling the third equation in the fourth yields an expression of $u$ as function of $\rho$ which can be used in the first two equations. So one would get:
- continuity: $\frac{\partial \rho} {\partial t}+K\frac{\partial \rho \frac{\partial \rho \cdot Z} {\partial x}} {\partial x}=0 $
- fraction of component B: $\frac{\partial \rho \phi} {\partial t}+K\frac{\partial \rho \phi \frac{\partial \rho \cdot Z}{\partial x}} {\partial x}=0 $
Is this a good way in solving the problem? I would proceed with using a discretization scheme for the spatial derivative and using Runge-Kutta to find the time derivative. Then I would get $\rho$ and $\rho \cdot \phi$. But can I do this, because $\rho = f(\phi)$ so there is also a coupling.
A last question is, how should I impose the boundary condition for $u$? Because $u$ is not in these last two equations anymore.
Thanks