← Back to team overview

yade-users team mailing list archive

Re: [Question #464303]: update BC in flowEngine

 

Question #464303 on Yade changed:
https://answers.launchpad.net/yade/+question/464303

    Status: Open => Answered

Bruno Chareyre proposed the following answer:
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(...)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.