Toni P
Toni P

Reputation: 47

FiPy Modelling water pumping with FiPy

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:

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

Upvotes: 0

Views: 266

Answers (1)

jeguyer
jeguyer

Reputation: 2484

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.

Upvotes: 0

Related Questions