CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Could not find "libudf" (https://www.cfd-online.com/Forums/fluent-udf/228282-could-not-find-libudf.html)

acalado June 25, 2020 13:02

Could not find "libudf"
 
Hi!

I was trying to load a case file that was sent over which has a custom UDF (.c), however I am getting this error which seems to relate to the default libudf.

Any ideas on how to solve this? Thanks in advance!



Checking the existence of compiled "libudf" UDF library for current platform.
If needed will attempt auto-compilation...

Error: Auto-compilation skipped. Could not find "libudf" or input files for creating "libudf" library
Error Object: #f

Warning: the rp-structure-time? option is not available in this solver

Warning: this is a double-precision solver.

AlexanderZ June 26, 2020 03:07

libudf is a default name for UDF library (could be different)
to run UDF you should put source file into working directory and interpret it from FLUENT GUI
or you should put pre compiled UDF library in working directory (for your case it probably has name libudf). You always can recompile your UDF (user-defined -> compiled -> build )

acalado June 26, 2020 08:23

I have the UDF file in the same directory, and when I interpret it get the following error:

20: TP_USER_REAL: undeclared variable

The UDF is the following - would appreciate any help interpreting this. Maybe it has something to do with missing header files?

Quote:

/************************************************** *********************/
/* UDF for computing the UV dosage along a particle trajectory */
/************************************************** *********************/

#include "udf.h"
#include "dpm.h"
#include "sg_disco.h"
#include "models.h"

#define C_DO(c,t,i)C_STORAGE_R_XV(c,t,SV_DO_IRRAD,i)
#define nb 1

DEFINE_DPM_SCALAR_UPDATE(uv_dosage, cell, thread, initialize, tp)
{
int i=0;
if (initialize)
{
for(i=0;i<nb;i++)
{
TP_USER_REAL(tp,i) = 0.0;
TP_USER_REAL(tp,nb+i) = C_DO(cell,thread,i);
}
}

else
{
for(i=0;i<nb;i++)
{
TP_USER_REAL(tp,i) += TP_DT(tp) * .5 * (TP_USER_REAL(tp,nb+i) + C_DO(cell,thread,i));
TP_USER_REAL(tp,nb+i) = C_DO(cell,thread,i);
C_UDMI(cell,thread,0) += TP_USER_REAL(tp,i);
}
}
}

DEFINE_DPM_OUTPUT(uv_output, header, fp, tp, thread, plane)
{

char name[100];
int i=0;


if (header)
{
if (NNULLP(thread))
par_fprintf_head(fp,"(%s %d)\n",THREAD_HEAD(thread)->dpm_summary.sort_file_name,14);
else
par_fprintf_head(fp,"(%s %d)\n",plane->sort_file_name,14);

par_fprintf_head(fp,"(%4s %12s %12s %12s %12s %12s"
"%12s %12s %12s %12s %12s %12s %12s %12s)\n",
"X0","Y0","Z0","X","Y","Z",
"U","V","W","dia","temp","mass-flow","time","uvdose");

/*for(i=0;i<nb;i++)
{
par_fprintf_head(fp,"%12s %d","UV-Dosage-band-",i);
}

par_fprintf_head(fp,"%20s\n","name"); */
}

if(NULLP(tp))
return;

/*sprintf(name,"%s:%" int64_fmt,tp->injection->name,tp->part_id);*/

par_fprintf(fp,"%d %" int64_fmt " (("
"%12.4e %12.4e %12.4e"
"%12.4e %12.4e %12.4e"
"%12.4e %12.4e %12.4e"
"%12.4e %12.4e %12.4e"
"%12.4e %12.4e))\n",
P_INJ_ID(TP_INJECTION(tp)), tp->part_id,
TP_INIT_POS(tp)[0],TP_INIT_POS(tp)[1],TP_INIT_POS(tp)[2],
TP_POS(tp)[0],TP_POS(tp)[1],TP_POS(tp)[2],
TP_VEL(tp)[0], TP_VEL(tp)[1], TP_VEL(tp)[2],
TP_DIAM(tp), TP_T(tp), TP_FLOW_RATE(tp),
TP_TIME(tp),TP_USER_REAL(tp,0));

/*par_fprintf(fp,"%d %" int64_fmt " (("
"%12.4e %12.4e %12.4e"
"%12.4e %12.4e))\n",
P_INJ_ID(TP_INJECTION(tp)), tp->part_id,
TP_POS(tp)[0],TP_POS(tp)[1],TP_POS(tp)[2],
TP_USER_REAL(tp,0),TP_TIME(tp));*/

/*par_fprintf(fp,"%20.6g",TP_USER_REAL(tp,0));*/

/*par_fprintf(fp,"%20s\n",name); */


}

DEFINE_DPM_OUTPUT(sample_cphase_vel, header, fp, tp, t, plane)
{
int id;
real time;
real vel_x, vel_y, vel_z;



#if 0
if (header)
par_fprintf_head(fp,"ID Time[s] x-velocity[m/s] y-velocity[m/s] z-velocity[m/s] \n");
#endif



if (NULLP(tp))
return;

id = tp->part_id;
time = tp->state.time;
vel_x = tp->cphase->V[0];
vel_y = tp->cphase->V[1];
vel_z = tp->cphase->V[2];



if ( NULLP(tp->user) )
Message("ERROR: Please allocate one DPM User Scalar\n");
else
{
int interp = (int)(tp->user[0]);
par_fprintf(fp, "%d %d %2d %3d %7.5f %14.5e %14.5e %14.5e \n", id, interp,
id, interp, time, vel_x, vel_y, vel_z);
}
}

kuloek June 21, 2021 08:02

DEFINE_INIT(init_charge, domain)
{
if (NULLP(user_particle_vars))
Init_User_Particle_Vars();
strcpy(user_particle_vars[0].name,"Particle Сharge");
strcpy(user_particle_vars[0].label,"Particle Сharge");
strcpy(user_particle_vars[1].name,"Cell Index");
strcpy(user_particle_vars[1].label,"Сell Index");
}

pakk June 21, 2021 12:33

Compile, don't interpret.


All times are GMT -4. The time now is 18:54.