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.

antoniosantoyo July 12, 2022 09:12

Udf
 
Someone have the UDF uv_dosage::libudf?

AlexanderZ July 14, 2022 03:49

Quote:

Originally Posted by antoniosantoyo (Post 831529)
Someone have the UDF uv_dosage::libudf?

the person, who made case you are using has that UDF, ask him better

BlueLumos March 5, 2024 13:08

Dear André,

I trust this message finds you well. While perusing the forums, I noticed your post regarding a particular issue with Ansys Fluent, and I couldn't help but reach out.

I am currently facing a similar challenge with the same code you discussed in your previous post. Despite my efforts to resolve the issue, I find myself at an impasse. It seems you encountered a similar situation some time ago, and I'm curious to know if you were able to find a solution.

In my pursuit of answers, I reached out to the code's original creator, but their guidance was limited to suggesting an update to the UDF code, leaving me with little direction. Given your prior experience, I am hopeful that you may have discovered a more comprehensive solution.

Your insights on how you resolved the issue, if indeed you did, would be immensely valuable to me. I understand that time has passed since your initial post, but any assistance you can provide would be sincerely appreciated.

Thank you very much for considering my request, and I look forward to any insights or guidance you may have to offer.

Warm regards,

Niall


All times are GMT -4. The time now is 10:02.