How to check for the existence of a RP-variable from within a UDF in FLUENT ?

To do the check, you can use the following routine, e.g. checking for 'pressure/relax' and 'pressure/relay':

#include "udf.h"

DEFINE_ON_DEMAND(testrp)
{
CX_Message("RP Variable "pressure/relax" does %sexist!n",
S_false == assq(intern("pressure/relax"),
eval(intern("rp-variables"),
eval(intern("user-initial-environment"),
NIL))) ? "NOT " : "");

CX_Message("RP Variable "pressure/relay" does %sexist!n",
S_false == assq(intern("pressure/relay"),
eval(intern("rp-variables"),
eval(intern("user-initial-environment"),
NIL))) ? "NOT " : "");

if (S_false != assq(intern("testrp"),
eval(intern("rp-variables"),
eval(intern("user-initial-environment"),
NIL))))
{
Message("testrp is definedn");
}
else
{
Message("testrp is not definedn");
}
}





Show Form
No comments yet. Be the first to add a comment!