Please wait...
×

Error

Posted Sun, 18 Oct 2015 02:26:58 GMT by S Heermann
I have had excellent luck using the new python capabilities.  However, I cannot figure out how to get flow budget information at selected nodes.
I understand that the standard ifm procedure is a two-step process of creating a budget and a pointer to that budget and then referencing the budget at a given node.  But I don't understand how this translates into python functions.
Posted Wed, 28 Oct 2015 15:54:59 GMT by Björn Kaiser
In following please find a tiny Python snippet addressing [b]doc.budgetFlowCreate()[/b]:
[color=blue]
def postTimeStep(doc):
    abs_sim_time =  doc.getAbsoluteSimulationTime()
    print "Time-step: " + str(abs_sim_time)
    budgetlist = doc.budgetFlowCreate()

    fnBUDGET_out.write(str(abs_sim_time)+ "\t")
    for index in Dirichlet:
        fnBUDGET_out.write(str(doc.budgetQueryFlowAtNode(budgetlist, index))+ "\t")
    fnBUDGET_out.write(str("\n"))
    doc.budgetClose(budgetlist)
[/color]

Please note that [b]doc.budgetFlowCreate()[/b] builds up the matrix for for the budget calculation on each node even if you are not interested on every node. Accordingly, this function could be computationally too demanding if you are interested in a few nodes only. For a small number of nodes I suggest to use doc.budgetCompute().

The budget created by [b]doc.budgetFlowCreate()[/b] runs in legacy mode where Storage/Capture is not discriminated from the Imbalance. In future a new API function will be provided which distinguishes between Storage/Capture and Imbalance.
Posted Fri, 21 Dec 2018 15:01:40 GMT by Christian Tomsu Germany
Hi Björn,

unfortunately, this script doesn't work.

What exactly means Dirichlet ?? Where is it defined.

Bests
Christian
Posted Fri, 21 Dec 2018 15:22:13 GMT by Christian Tomsu Germany
ok. got it for myself.
the second parameter is simply the node number.

But nevertheless, i am not sure, how this is to be interpreted in Python:

IfmBudgetComponents *pBudgetComp
Opaque pointer of budget flux components.

to retrieve other components than the boundary condition related flux.

Bests
Christian

You must be signed in to post in this forum.