# bndCondIsPressure

Asked by Guilherme das Neves Seguro on 2020-05-18

Hello everyone;

greetings from Brazil.

I got a question about setting some boundary conditions on DFNFlow Engine.

I am simulating a flow through a cube that represents a rock matrix and when I'm setting stress forces and initial conditions (like rock properties, joint fractures and so on...) I use the following:

bottom = 0
[later on code]
,bndCondIsPressure = [0,0,bottom,0,0,0]

[later after all pre-set conditions and to start the flow]

bottom = 1 (to simulate a flow through the y axis)

My question is: should I set bndCondIsPressure as [0,0,0,0,0,0] when there is no flux? And as [0,0,1,0,0,0] when there is flux along the y axis? Or [0,0,1,1,0,0]?

Best regards and thanks in advance!

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Luc Scholtès
Solved:
2020-05-29
Last query:
2020-05-29
2020-05-23
 Bruno Chareyre (bruno-chareyre) said on 2020-05-18: #1

Hi,

> should I set bndCondIsPressure as [0,0,0,0,0,0] when there is no flux?

Yes.

> And as [0,0,1,0,0,0] when there is flux along the y axis? Or [0,0,1,1,0,0]?

For a permeameter you would surely impose pressure with [0,0,1,1,0,0], but not everything is permeameter, so...
I don't know. "there is flux" is not a boundary condition. :)
If you want to impose pressure on one boundary then you turn that one as "isPressure".
Regards
Bruno

 Luc Scholtès (luc) said on 2020-05-19: #2

Hi Guillermo,

As for your other question [1], could you please provide a minimal working version of your script (something that everyone could run on their computer without any changes)?

Cheers

Luc

 Guilherme das Neves Seguro (guilhermeseguro) said on 2020-05-22: #3

Hello mr Chareyre,

> If you want to impose pressure on one boundary then you turn that one as "isPressure".

The flux I want to simulate is imposed on one facet on the y axis so I guess this solved my doubt on this part of the code.

 Guilherme das Neves Seguro (guilhermeseguro) said on 2020-05-22: #4

Hello mr Scholtès;

it is the same code I've shared in [1]. I'm having trouble in measuring the permeability and I was concerned that it might be because of a wrong setting the Pressure Condition.

The main code is shared in [2] (by now I corrected my mistake of making it open to everyone!) and this current question is on this part of the code:

PRESS=0.0
[...]
bottom=0

[then the code calls a secondary script and comes to]

### Flow Engine ###
flow=DFNFlowEngine(
isActivated=False
,useSolver=3 # (0: Gauss Seidel, 1: Taucs, 2: Pardiso, 3: CHOLMOD)
#,boundaryUseMaxMin=[0,0,0,0,0,0] # [left, right, bottom, top, back, front]: False means boundary made with walls
,bndCondIsPressure = [0,0,bottom,0,0,0] # bndCondIsPressure(=vector<bool>(6, false))
# bndCondIsPressure=[left, right, bottom, top, back, front]
# ,bndCondValue=[0,0,0,0,PRESS,0]
,bndCondValue=[0,0,PRESS,0,0,0] # bndCondValue(=vector<double>(6,0))
,permeabilityFactor=pFactor
,viscosity=visc
,fluidBulkModulus=KFluid
### DFN related
,clampKValues=False
,jointsResidualAperture=slotAperture
)

[fluid injection occurs and after that I need to impose the pressure on y axis as I asked. So I change the parameters to]

bottom = 1
PRESS = 3e6

O.run(1,True)
# getBoundaryFlux get the total discharge [m3/s]
Qin = flow.getBoundaryFlux(2)
Qout = flow.getBoundaryFlux(3)
# if Qout is the total discharge, we can compute k=Q*nu*Length/(Area*(Pout-Pin))
# if Qout is the flux, we can compute k=Q*nu*Length/(Pout-Pin) -> getFlux gives total discharge -> Qout (m3/s)!
permeability = abs(Qout)*flow.viscosity*Y/(X*Z) # !!! if Pout=1, Pin=0
permeability2 = flow.averageVelocity()*flow.viscosity*Y # !!! if Pout=1, Pin=0
conductivity = permeability*DENS_FLUID*9.82/flow.viscosity # K=rho*g*k/nu
print "\n\nQin=",Qin,"\nQout=",Qout,"\nOBS: ARE THEY EQUAL? IF NOT => NO FLOW!\n"
print "\n\nPermeability [m2]=",permeability,"\nHydraulic conductivity [m/s]=",conductivity, '\n\nTHE END!\n'

Thank you very much for all your support, guys!

 Luc Scholtès (luc) said on 2020-05-23: #5

Hi Guilherme,

If you want to impose a unidimensional flow in your sample along a given direction by imposing a pressure difference, you need to set condIsPressure=1 for both in and out coordinates along this direction and to define the in and out pressures.

For instance, in your case, it seems that you want to impose a pressure difference P2-P1 in the y direction so you need to set

bndCondIsPressure = [0,0,1,1,0,0]
bndCondValue = [0,0,P1,P2 0,0]

Like this, you should be able to compute the permeability following Darcy's law (or a derivative of it) by relating the computed flux and the imposed pressure difference.

Luc

 Guilherme das Neves Seguro (guilhermeseguro) said on 2020-05-29: #6

Thanks Luc Scholtès, that solved my question.