0

I am trying to model water pumping with Fipy in a domain where I want to simulate diffusion and advection. Water is extracted from one point, and is discharged in another point. However, I am having issues with regard to the definition of the boundary conditions.

enter image description here

where q is the flow (constant), h is the depth (constant), C is the concentration (transient), and Lx and dx are longitudes (constant).

First, I define the equations (2D Navier-Stokes) to compute the velocity fields. In particular, I impose pressure = zero at the surface, a vertical velocity at the suction/discharge zone (related to the pump nominal flow), and velocity = zero at the bottom.

enter image description here

With regard to the "mass" transport in the domain, I introduce mass fluxes as boundary conditions (however, one problem I have is that I cannot introduce water fluxes, and therefore I cannot take the dillution into account).

enter image description here

I have some questions:

  • Can the coefficient (q/Lx) be greater than one when defining the fixed-flux boundary condition? I think that FiPy takes the "mass" from the cells next to the boundary, and thus, if greater than one, it can lead to negative concentrations (which is not possible, in my case).
  • Is it possible to move the cells in order to displace water volumes?
  • Is it possible to consider the "volume" of the cells to apply the dillution at the top boundary?

This is my code:

coeff_in = (q / Lx_in)
coeff_out = (q / Lx_out)

eqC = (TransientTerm(var = C) == # Transient term
        DiffusionTerm(coeff = D, var = C) # Diffusion term
        - ConvectionTerm(coeff = Vf, var = C) # Convection term
        + (coeff_out * face_out * (C.faceValue)).divergence # Bottom Boundary Condition (fixed-flux); flow
        + (coeff_in * face_in * Cinput).divergence # Top Boundary Condition (fixed-flux); flow
        )

But this produces (obviously!) a concentration of mass at the top, and an extraction at the bottom. Intuitively, if the concentration is the same in all the mesh, the bottom shouldn't have to change (because the volume is extracted and then the mass displaced) and the top should reduce its concentration (because water with lower concentration is introduced and is mixed with the top concentration).

Toni P
  • 47
  • 5
  • You pump in (pure?) water in from the top and discharge water with stuff in it from the bottom? Are the flows balanced or can the depth h change? – jeguyer Mar 30 '21 at 21:16
  • I pump water from the bottom and I discharge it (cleaner) on the surface. The flows are balanced and the depth 'h' is constant. – Toni P Mar 31 '21 at 06:20

1 Answers1

0

Q: Can the coefficient (q/Lx) be greater than one when defining the fixed-flux boundary condition? I think that FiPy takes the "mass" from the cells next to the boundary, and thus, if greater than one, it can lead to negative concentrations (which is not possible, in my case).

You need adjust your time steps to ensure that the CFL condition remains less than 1 (better, keep CFL < 0.1).

Q: Is it possible to move the cells in order to displace water volumes?

I think you're asking if you can use a Lagrangian (moving mesh) approach? No, not readily. FiPy is an Eulerian code.

Q: Is it possible to consider the "volume" of the cells to apply the dillution at the top boundary?

You shouldn't get a concentration of mass at the discharge; that's what the flux denotes. I'm less certain of how to deal with the flow in of pure water. That seems equivalent to zero flux of solute at that boundary. It seems like you need a model for the concentration of water, even if you don't end up explicitly solving for it. It could be as simple as . In that case, a flux of pure water in at the bottom should be equivalent to a flux of out of the bottom.

jeguyer
  • 2,379
  • 1
  • 11
  • 15
  • Thanks for your help. Do you mean to include a cell variable that is water mass to also consider water fluxes? (However, doesn't that clash with water incompressibility?). Another option I am considering is to impose the extraction of mass (fixed flux of C) at the top, as it was the dillution in cleaner water (but I would need to define this variable flux every time step, as a function of the current concentration at the top and the input concentration. – Toni P Mar 31 '21 at 16:12
  • I think you probably don't need to solve an additional `CellVariable` for water, but it could be helpful to think mathematically about what you want to happen. w + C = const should satisfy incompressibility? Alternatively, since you impose a velocity at the inlet, that should carry C away from the inlet, which should have the effect of diluting C near the inlet, but I gather that isn't happing. If you're not going to have an explicit governing equation for water, you need to figure out what adding or removing water means in your context. I don't think I have enough to go on. – jeguyer Mar 31 '21 at 17:27