Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 procede 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 procede 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.


share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.