# How can I measure a flux?

Asked by Guilherme das Neves Seguro on 2020-09-15

Hello fellows;

I'm trying to calculate the permeability through a fracture inside a cubic rock sample and, for that, I need to relate the flux inside the fracture to the pressure difference along its extension.

I do the following steps along my code as provided in 

1 - Set up a cubic rock matrix
2 - Position a fracture plane along the Y direction
3 - I assume the flow only to occurs only in the fracture cells (other cells are assumed impermeable)
4 - Apply a pressure difference at the bottom of the sample (on the ymin boundary) to generate flow along the fracture
5 - Measure the flux at ymin and ymax, Qin and Qout respectively, with the getBoundaryFlux() function.

I also followed (almost all) tips provided there.

The problem with getBoundaryFlux() function is that it will calculate the flow along the facet and I need it only in the fracture cells. So I got some questions:

1. How can I measure the flux through a fracture? Is there a more suitable function or any restriction to be applied than the getBoundaryFlux() function?

2. How can I measure the velocity of the flow in a particular point of this fracture? Maybe if I can do that at the beggining of the fracture or at the end I would not need the first question answered.

3. Is there any relation between flow velocity and the flux through the fracture? Physical equation or so...?!

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2020-09-15
2020-09-25
 Robert Caulk (rcaulk) said on 2020-09-25: #1

> How can I measure the velocity of the flow in a particular point of this fracture?

You can extract the velocity of an individual cell using getCellVelocity .

>Is there any relation between flow velocity and the flux through the fracture? Physical equation or so...?!

You can integrate the velocity within a region of interest to get the flux passing the boundary of that particular region. If you know which cells comprise your region, you use  to get the velocity magnitude and  to get the cell volume. Here is a loop on all cells in the triangulation. You would need to add some logic to decide which cells you want to use in your particular fracture region.

for i in range(0,flow.nCells()):
coords = flow.getCellCenter(i)
velocityVector = np.array(flow.getCellVelocity((coords,coords,coords)))
velMag = np.linalg.norm(velocityVector)
cellVol = flow.getCellVolume((coords,coords,coords))
v = v + cellVol*velocityVector
totalVolume += cellVol

q = np.linalg.norm(v)/totalVolume
kv = q*flow.viscosity/(delP*size_reduce)