communication between python and rp_varibles #3319
-
hi everyone, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hello Etienne, By the way -- from you description it sounds if you want to control the outlet static pressure boundary condition based on the outlet mass flow rate through that same outlet. |
Beta Was this translation helpful? Give feedback.
-
@etiennelame Would you also know how to create an rp-var within the pythonic/fluent side? I tried this which follows an example in the doc: I.e, something similar to (rp-var-define) but without using scheme_eval. best, |
Beta Was this translation helpful? Give feedback.
Hello Etienne,
I understand that you try to modify an RP var. in a UDF and then want to query that value in Python.
For that, you need to make sure that...
-- the
RP_Set_...("...", ...);
in the UDF is done on the host process-- you fetch the value from the host process into the cortex process using e.g. the Scheme command
(%rpgetvar '...)
(where'...
is the name of the RP var. with a leading single quote).I don't know whether there is a Python equivalent for the latter.
If not, you should be able to use
solver.execute_tui(r'''(%rpgetvar '...)''')
.(Note that in this Scheme command the
%
prefix makes the difference -- it ensures that the value is fetched from the host process instead of …