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]

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...?!

Thanks in advance!

[1] https://answers.launchpad.net/yade/+question/691351/+index

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
2021-01-20
Last query:
2021-01-20
Last reply:
2020-12-27
Robert Caulk (rcaulk) said : #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 [1].

>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 [1] to get the velocity magnitude and [2] 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[0],coords[1],coords[2])))
  velMag = np.linalg.norm(velocityVector)
  cellVol = flow.getCellVolume((coords[0],coords[1],coords[2]))
  v = v + cellVol*velocityVector
  totalVolume += cellVol

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

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.getCellVelocity
[2]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.getCellVolume

Hello mr Caulk;

Thanks for the suggestions, but I've tried both of them, but YADE returned "AttributeError: 'DFNFlowEngine' object has no attribute 'getCellVelocity' " and "AttributeError: 'DFNFlowEngine' object has no attribute 'getCellVolume' ".

Do I need to find the ID of the cells on the fracture and then measure their Velocity and Volume? If so, how do I get access to their ID? I've read [1] but I couldn't understand well.

If I type flow.nCells() my answer is 58550, what does this number represent exactly? My simulation works only with 10K cells.

> You would need to add some logic to decide which cells you want to use in your particular fracture region.

That corroborates my previous questions. My main struggle now is identifying the cells located along the fracture to get their velocity and then measure Q and k.

Thanks in advance

[1] https://answers.launchpad.net/yade/+question/686131

Launchpad Janitor (janitor) said : #3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Robert Caulk (rcaulk) said : #4

Changed status to avoid janitor cleanup

Robert Caulk (rcaulk) said : #5

>YADE returned "AttributeError: 'DFNFlowEngine' object has no attribute 'getCellVelocity' " and "AttributeError: 'DFNFlowEngine' object has no attribute 'getCellVolume' ".

Please review [1] and provide the missing information.

>If I type flow.nCells() my answer is 58550, what does this number represent exactly? My simulation works only with 10K cells.

58550 is the number of cells in your triangulation.

>My main struggle now is identifying the cells located along the fracture to get their velocity and then measure Q and k.

Why not use the coordinates of the fracture?

[1]https://www.yade-dem.org/wiki/Howtoask

Hello again, mr Caulk.

First of all thanks for answering my questions.

> Following your previous suggestions from answer #1, I've tried the following:

totalVolume = 0
velocityVector = [0.0, 0.0, 0.0]
v = np.array([0,0,0])
cellVol = 0.0

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

And the output error message on the terminal is:

File "/home/guilherme/yade/install/bin/yade-2019-02-13.git-2b0d17e", line 288, in runScript
    execfile(script,globals())
  File "hydraulicInjection_plane2.py", line 350, in <module>
    velocityVector = np.array(flow.getCellVelocity(coords[0],coords[1],coords[2]))
AttributeError: 'DFNFlowEngine' object has no attribute 'getCellVelocity'

Thanks in advance!

Robert Caulk (rcaulk) said : #7

Hello,

It doesn't make sense. Any flow engine derivative like DFNFlow has the method "getCellVelocity."

We need a full MWE to help you.

Cheers,

Robert

Launchpad Janitor (janitor) said : #8

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Hello mr Caulk;

is there anywhere I can try to look and check if my DFNFlow has the "getCellVelocity" method?

Cheers,

Guilherme

Robert Caulk (rcaulk) said : #10

You can check by interactively typing "flow." and then pushing "tab" key. This should open up a dialog which lets you see all the available methods.

You should see if you have any of the "get" methods from flow engine [1]. E.g. getCell(), getFlux(), getCellCenter etc.

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine

Hello mr Caulk;

when I type "flow.getCell" the following methods show up:

flow.getCell
flow.getCellBarycenter
flow.getCelllCenter
flow.getCelllFlux
flow.getCelllPImposed
flow.getCelllPressure
flow.getCelllTemperature
flow.getCelllTImposed

is that why the method "getCellVelocity" isn't running? How can update this to get it right? Is it a problem of an old version of yadedaily that I'm running?

Best regards!

Guilherme

Robert Caulk (rcaulk) said : #12

Probably, go ahead and update your yade version.

shen se (sehsnias4) said : #13

Input documents with particle coordinates or input mesh are not wished, in most cases. They may be changed by way of writing coordinates immediately within the script or using makeCloud or comparable functions. Most problems aren't because of a selected wide variety of particles or the specific form of an imported geometry. Instead, they can be reproduced with only a few facets and some spheres (or clumps or whatever is in a selected situation) https://apkship.com/
Although disposing of external hyperlinks may additionally want a bit extra work earlier than sending the question, this more time spent by means of the character asking way less time misplaced by the character answering. This is simply honest. Moreover, by doing so that you can also nicely understand the problem by using yourself in lots of instances."

Hello mr Caulk;

I've updated my YADE version following the instructions in [1], but I still have the same error. I even asked for a friend do the same in his PC and he faced the same. Is the function "getCellVelocity()" really defined on the latests versions?

Also, is there any difference between yade and yadedaily versions?

[1] https://yade-dem.org/doc/installation.html

Best Robert Caulk (rcaulk) said : #15

>I've updated my YADE version following the instructions in [1].

Ok which version did you install? Which part of [1] did you follow? Please provide your yade version, or else we are shooting into the dark here. Also waiting on that MWE...[1]

yadedaily -v

>Is the function "getCellVelocity()" really defined on the latests versions?

.... yes?

>Also, is there any difference between yade and yadedaily versions?

These are “daily” versions of the packages which are being updated regularly and, hence, include all the newly added features. The "stable" version yade is only updated once per year. So install yadedaily.

Cheers,

Robert

[1]https://www.yade-dem.org/wiki/Howtoask

Thanks Robert Caulk, that solved my question.