RP_Set_Integer does not work in parallel
Hello everyone.
I have some code where I need to change a RP variable from an UDF ON_DEMAND. I need the macro RP_Set_Integer. Well, it does not work in parallel, even protecting it with the #if !RP directives. I have tried it on Fluent 14.5.0, both in Windows and in Linux. What I say can be tried without a mesh or case files. Just start Fluent, compile and load the following UDF: Code:
#include "udf.h" Code:
(rp-var-define 'myrpvar -10 'integer #f) Code:
[Output in serial] In other thread similar problem has been reported:http://www.cfd-online.com/Forums/flu...able-name.html; but I think that this does not help me because I am struggling just with the host, the nodes do not play at all. The ultimate target of this is that I need to perform time-step iterations until the flow reaches a certain condition. For that, I have an scheme do-loop in which: -iterate 25 more time steps -execute an on_demand function, which will check if the condition I need is met: if so, it will set variable rp_end_loop to 1 -if rp_end_loop is 1, end loop; else, repeat steps. My on_demand function evaluates properly the conditions to be met (with function Message, information is displayed in console and it is stated when the loop should end), but this loop will never end because it fails to actualize the rp variable!!! I comment this in case someone can think of any other way of passing information from an UDF to scheme console (in any form which could be evaluated as a boolean, rp variable, scheme variable, whatever). If someone does not know how to make this RP_Set_Integer work, but knows some another workaround for my problem, I'd be extremely grateful. Help please!!! I really need this, I can't continue my work until I solve this... and serial calculation is not affordable. Thanks in advance |
Hello Manuel,
welcome into the strange world of Fluent's scheme environment. Don't ask me why, but using (%rpgetvar 'myrpvar) will do the trick. cheers |
Enormous thanks, coglione.
I could continue. That trick solved the issue in the UDF I have posted. However, I realized that in my code it wasn't working. I then realize that apparently, every fluent/scheme command in a "do loop" should be introduced as (ti-load-menu-string "command"). Sounds ridiculous. I really find lisp/scheme so unfriendly and tedious... But, I repeat again, thanks a lot! I could continue thanks to you :D |
All times are GMT -4. The time now is 00:16. |