update BC in flowEngine

Asked by Luc Scholtès

Hello guys,

I am currently using flowEngine to compute permeability of samples subjected to compressive loading.

I would like to compute permeabilities along the 3 directions at different stages of the loading. The problem is that when I change the flow boundary conditions to change the direction of the flow, it seems that there is some sort of influence of the previous calculation on the pressure field and the permeability measurements are thus wrong (the inlet and outlet fluxes are not equal in the second calculation).

This is how I do it:

print 'Flow along X!'
flow.bndCondIsPressure = [1,1,0,0,0,0]
flow.bndCondValue = [1,0,0,0,0,0]
O.step()
Qin = flow.getBoundaryFlux(0)
Qout = flow.getBoundaryFlux(1)
permeability = abs(Qout)*flow.viscosity*X/(Y*Z) # k=Q*nu*Length/(Area*(Pout-Pin))
print "Qin=",Qin," Qout=",Qout," ARE THEY EQUAL? IF NOT-> NO FLOW!"
print "Permeability [m2]=",permeability

print 'Flow along Y!'
flow.bndCondIsPressure = [0,0,1,1,0,0]
flow.bndCondValue = [0,0,1,0,0,0]
flow.updateBCs()
O.step()
Qout = flow.getBoundaryFlux(3)
permeability = abs(Qout)*flow.viscosity*Y/(X*Z) # k=Q*nu*Length/(Area*(Pout-Pin))
print "Qin=",Qin," Qout=",Qout," ARE THEY EQUAL? IF NOT-> NO FLOW!"
print "Permeability [m2]=",permeability

What do I need to add in order to update the flow boundary conditions correctly?

Thanks

Luc

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#1

Hi Luc,
You made me go back to class documentation and improve it. Would the following doc answer your question?

.def("updateBCs",...,"Update the boundary condition to reflect changes of boundary pressure (needed typically after changing :yref:`FlowEngine::bndCondValue`). It is not sufficient to reflect changes of the type of boundary condition (:yref:`FlowEngine::bndCondIsPressure`), in such case re-triangulation is needed (see :yref:`FlowEngine::updateTriangulation`). Conversely, the update is not necessary for point-wise imposed pressure (:yref:`FlowEngine::imposePressure`)")

((bool, updateTriangulation, 0,,"If true the medium is retriangulated. Can be switched on to force retriangulation after some events (else it will be true periodicaly based on :yref:`FlowEngine::defTolerance` and :yref:`FlowEngine::meshUpdateInterval`. Of course, it costs CPU time. Note that the new triangulation will start to be effectively used only after next iteration (i.e. O.run(2) gives a result with the new one, O.run(1) does not)."))

Note that you can replace O.step() by flow.emulateAction().
And in fact the simplest way to not worry about updating BCs is to use it with a fresh engine each time:

for k in boundaryConditions:
    flow=FlowEngine()
    flow.bndCondIsPressure=k.bndCondIsPressure
    flow.bndCondValue= k.bndCondValue
    flow.emulateAction()
    Q=flow.getBoundaryFlux(...)

Revision history for this message
Luc Scholtès (luc) said :
#2

Many thanks Bruno.

Revision history for this message
Luc Scholtès (luc) said :
#3

Thanks Bruno Chareyre, that solved my question.