March 9, 2023 at 1:53 pm
Subscriber
When I tried it, I had problems with the input of the auxilar parameter un the UDF. Could you help with the code line to fix it? I do not have a lot of experience in this. I tried with “real” declarison of var_aux but I had same results that with double. When I initialize the program, I get the text I put for wrong input value of var_aux (“Error: var_aux must be a integer value between 1-3" in spanish).
#include “udf.h”
DEFINE_PROPERTY(density, cell, thread)
{
double var_aux = RP_Get_Double(“var_aux”);
real rho;
if (var_aux == 1)
{
rho = 1.055 – 0.660 * C_T(cell, thread);
}
else if (var_aux == 2)
{
rho = 1108 – 0.666 * C_T(cell, thread);
}
else if (var_aux == 3)
{
rho = 1185000 – 0.7333 * C_T(cell, thread);
}
else
{
Message(“Error: var_aux debe ser un valor entero entre 1 y 3.\n”);
rho = 0.0;
}
return rho;
}