$$ \partial_t(\epsilon_g\rho_g)+\partial_x\cdot(\epsilon_g\rho_g\mathbf{v}_g)=\Pi $$

I want to program normal continuity equation and Darcy's law to calculate velocity. $$ \mathbf{v}_g=-\frac{1}{\epsilon_g \mu}\mathbf{\bar{\bar{K}}}\cdot\partial_x p $$

I approach it like this:

I am using upward differencing to discretize the equation and initially guessing the value of velocity in each cell. Now, having calculated the density, I find pressure field using ideal gas law and use Darcy's law to update velocity. (I am not modelling the time variable term in the continuity equation)

Now, I iterate this process by calculating density again via the updated velocity and repeat the procedure. But my solution doesn't converge. In fact, after 5 iterations I begin to get negative density values. (Values of density and velocity are known at the boundary, and it is a 1-D case)

So please guide me on how should I approach the problem, what am I wrong about, and what am I missing?

  • $\begingroup$ Why not just solve the coupled problem for velocity and pressure at once, rather than trying to iterate things out? $\endgroup$ – Wolfgang Bangerth Dec 28 '18 at 18:24
  • $\begingroup$ Also, it would probably be useful to add the equations you are trying to solve. $\endgroup$ – Wolfgang Bangerth Dec 28 '18 at 18:24
  • $\begingroup$ @Wolfgang Bangerth I am writing as a separate answer to ur query since I can't add a comment right now due to low reputation. As I mentioned, to calculate velocity I need pressure in the domain, and for that I would need density in the domain, which also I need to calculate. So I am starting with an initial approximation for velocity, to calculate a density which is not correct(since I calculated it as per the initial approximation for u). Then I use this density to calculate pressure(using ideal gas law), which in turn I am using to update velocity using darcy's law. And then I calculate dens $\endgroup$ – anshul suri Dec 28 '18 at 19:43
  • $\begingroup$ Whatcis $\epsilon_g$? Are you solving compressible flow in porous media? $\endgroup$ – Paul Dec 29 '18 at 16:23
  • 1
    $\begingroup$ What is the relationship between $\rho$ and $p$ in your equations? $\endgroup$ – Wolfgang Bangerth Dec 30 '18 at 17:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.