CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel u

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2024, 14:11
Default ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel u
  #1
New Member
 
Camila Solano
Join Date: Mar 2024
Posts: 3
Rep Power: 2
Camiwu is on a distinguished road
Hi, I got this full error when trying to run this execute_at_end code for write and calculate heat flux on a steel wall: "ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified"

this is the code:

#include "udf.h"
#include "stdio.h"

#define UDM_HEAT_FLUX 0

DEFINE_EXECUTE_AT_END(compute_and_write_heat_flux)
{

Domain* domain = Get_Domain(5);
Thread* t;
face_t f;
FILE* fp;

fp = fopen("Heat_flux_compute_data.csv", "w");

if (fp == NULL)
{
Message("Error opening file Heat_flux_compute_data.csv\n");
return;
}

fprintf(fp, "Face ID, Heat Flux\n");

/*check #if !RP_HOST and #if !NODE for parallelization*/

/* Iterate over all face threads */
thread_loop_f(t, domain)
{
/* Loop over all faces in the thread */
begin_f_loop(f, t)
{
if (PRINCIPAL_FACE_P(f, t)) /* Tests if the face is the principal face (compiled udf) */
{
real heat_flux = 0.0;
real k;
real grad_T[ND_ND];
real temp;
real A[ND_ND];

F_AREA(A, f, t);

/* If face lies at domain boundary, use face values; */
/* If face lies IN the domain, use average of adjacent cells. */
if (BOUNDARY_FACE_THREAD_P(t))
{
/* Get thermal conductivity */
k = F_K_L(f, t);

/* Depending on its BC, temperature may not be set on face thread */
if (NNULLP(THREAD_STORAGE(t, SV_TEMPERATURE)))
{
temp = F_T(f, t); /* Set temp to face value if available */
}
else
{
cell_t c0 = F_C0(f, t);
Thread* t0 = THREAD_T0(t);
temp = C_T(c0, t0); /* else, set temp to cell value */
}

F_T_G(f, t, grad_T); /* Get temperature gradient at the face */
heat_flux = -k * grad_T[1]; /* Calculate heat flux in y-direction with Fourier's law */
}
else
{
/* For internal faces, use average of adjacent cells */
cell_t c0 = F_C0(f, t);
cell_t c1 = F_C1(f, t);
Thread* t0 = THREAD_T0(t);
Thread* t1 = THREAD_T1(t);

real k0 = C_K_L(c0, t0);
real k1 = C_K_L(c1, t1);
real k_avg = 0.5 * (k0 + k1);

real grad_T0[ND_ND], grad_T1[ND_ND];
C_T_G(c0, t0, grad_T0);
C_T_G(c1, t1, grad_T1);

real grad_T_avg[ND_ND];
NV_VS(grad_T_avg, =, 0.5, *, grad_T0, +, 0.5, *, grad_T1);

heat_flux = -k_avg * grad_T_avg[1]; /* Calculate heat flux in y direction [1] */
}

C_UDMI(F_C0(f, t), t, UDM_HEAT_FLUX) = heat_flux; /* Store the heat flux in UDM */

fprintf(fp, "%d, %g\n", f, heat_flux); /* Write face ID and heat flux to file */
}
}
end_f_loop(f, t)
}

/*#endif*/

fclose(fp);
Message("Heat flux data written to Heat_flux_compute_data.csv\n");

}

I am opening Fluent via the VS command for windows x64.
Camiwu is offline   Reply With Quote

Reply

Tags
code, error, fluent, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF library you are trying to load (libudf)... ehsan105 Fluent UDF and Scheme Programming 6 March 8, 2018 00:57
problem when load UDF: "not compiled for 2d on the current platform (win64)" kostas13 Fluent UDF and Scheme Programming 2 November 23, 2015 16:06
Compile udf and load libudf library starlight FLUENT 5 February 19, 2015 09:49
UDF library load error smgeorge531 Fluent UDF and Scheme Programming 6 August 26, 2013 04:06
setting up compiled UDF library in windows2000 sivakumar FLUENT 1 October 19, 2001 03:46


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