-
-
March 12, 2020 at 2:49 pmJeroenSubscriber
Hello
I am new to ANSYS and UDF's and am trying to simulate a reacting particle. Now I've written my UDF but I get the following error when compiling in ANSYS:
   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 path specified.
Â
   C:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSrz_model_filesdp0FFFFluentlibudfwin643d_hostlibudf.dll
Â
Â
My UDF is located in the following directory:
   C:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSMass_balance_UDF.c
Â
Â
How do I solve this issue?
Â
-
March 12, 2020 at 3:10 pmKarthik RemellaAdministrator
Hello,
Have you checked the UDF for a serial run? Instead of opening a parallel Fluent session, could you please try to run your UDF in a serial session?
Thank you.
Best,
Karthik
-
March 12, 2020 at 3:14 pmJeroenSubscriber
Starting fluent with serial processing enabled does not solve the issue unfortunately. I have also tried using the interpreted option though this gives a parse error in line 1.Â
-
March 12, 2020 at 3:20 pmKarthik RemellaAdministrator
Could you please post the entire error message?
-
March 12, 2020 at 3:27 pmJeroenSubscriber
For the compiled option I get the following error:
s151272: Opening library "C:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSrz_model_filesdp0FFFFluentlibudf"...
RPC RCX_SC_SET_ERR_MSG failed: RPC: Can't encode arguments
Â
Â
Error at host: 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 path specified.
Â
C:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSrz_model_filesdp0FFFFluentlibudfwin643d_hostlibudf.dll
Error at Node 0: 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 path specified.
Â
C:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSrz_model_filesdp0FFFFluentlibudfwin643d_nodelibudf.dll
Â
===============Message from the Cortex Process================================
Â
Compute processes interrupted. Processing can be resumed.
Â
==============================================================================
Â
Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).nnThe system cannot find the path specified.
nnC:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSrz_model_filesdp0FFFFluentlibudfwin643d_hostlibudf.dll
Â
Error Object: #f
Â
-
March 12, 2020 at 7:12 pmKarthik RemellaAdministrator
Hello,
Are you able to compile any UDF on your system at all? Or it the issue very specific to the code you are trying to compile?
Could you please take a simple test code from the Fluent UDF manual and try to compile it to see if that compiles? This might help us narrow down the issue. Right now, it could either be your code or that your compiler has not been installed properly on your machine.
Best,
Karthik
-
March 13, 2020 at 9:28 amJeroenSubscriber
I get the same issue with several UDF's in the Manual, both for interpreted and compiled codes.
So the issue is not in the UDF code.
Â
What other steps can I take to fix this error?
-
March 13, 2020 at 9:40 amJeroenSubscriber
nnC:Userss151272Documents...............rz_model_filesdp0FFFFluentlibudfwin643d_hostlibudf.dll
Â
I think the problem is in loading the libudf.dll file, which is not being generated by Fluent. Any ideas why it is not there or how it must be generated?
-
March 13, 2020 at 11:46 amRobForum Moderator
If you interpret the code what's the full error? Parse errors tend to mean there's a rogue/missing character on the line. Copy+Paste straight from the manual usually means you've got some white space characters that you don't want too.
-
March 13, 2020 at 11:52 amJeroenSubscriber
****************************************************************************
****************************************************************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
****************************************************************************
****************************************************************************
cpp -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/main" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/addon-wrapper" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/io" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/species" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/pbns" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/numerics" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/sphysics" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/storage" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/mphase" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/bc" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/models" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/material" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/amg" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/util" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/mesh" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/udf" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/ht" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/dx" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/turbulence" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/acoustics" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/parallel" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/etc" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/ue" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/dpm" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/dbns" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/tgrid/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/PRIME/tgrid/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/cortex/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/client/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/multiport/src" -I. -DUSE_UDF_HOST_DUMMY -DUDFCONFIG_H="
" "CUsers/s151272/Documents/Master/Afstudeer_opdracht/ANSYS/Mass_balance_UDF.c"
Error: CUsers/s151272/Documents/Master/Afstudeer_opdracht/ANSYS/Mass_balance_UDF.c: line 1: parse error.
Â
cpp -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/main" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/addon-wrapper" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/io" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/species" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/pbns" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/numerics" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/sphysics" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/storage" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/mphase" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/bc" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/models" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/material" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/amg" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/util" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/mesh" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/udf" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/ht" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/dx" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/turbulence" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/acoustics" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/parallel" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/etc" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/ue" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/dpm" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/src/dbns" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/tgrid/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/PRIME/tgrid/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/cortex/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/client/src" -I"C:PROGRA~1ANSYSI~1v195fluentfluent19.5.0/multiport/src" -I. -DUDFCONFIG_H="
Users/s151272/AppData/Local/Temp/udfconfig-14880-node0.h>" "CUsers/s151272/AppData/Local/Temp/Mass_balance_UDF.c.14880.0.c"
Â
Error: CUsers/s151272/AppData/Local/Temp/Mass_balance_UDF.c.14880.0.c: line 1: parse error.
-
March 13, 2020 at 5:19 pmKarthik RemellaAdministrator
Hello,
Could you please run the UDF with a -t0 flag? When you open the Fluent session, please set the number of processers to 0 and try running a UDF from the UDF manual first? This should force Fluent to open in legacy serial.
Also, could you also share the UDF you are using in one of your posts so we can take a look at it?
Thank you.
Best Regards,
Karthik
-
March 13, 2020 at 6:38 pmJeroenSubscriber
Starting with a -t0 flag also has no effect. My UDF code is below:
Â
/***********************************************************************
  UDF for defining the heat and mass transport of single step reduction
 ***********************************************************************/
 #include "udf.h"
 #include "dpm.h"
 #include "pdf_props.h"
Â
 DEFINE_DPM_HEAT_MASS(Mass_bal_Hematite,p,Cp,hgas,hvap,cvap_surf,Z,dydt,dzdt)
 {
 Thread *t0 = P_CELL_THREAD(p);  /* thread where the particle is in*/
 cphase_state_t *c = &(p->cphase); /* cell information of particle location*/
Â
 int nFe = 2; /* indices for chemical formula oxide */
 int nO = 3;
Â
 float K = 1;     /* equilibrium constant */
 float E_act = 214000; /* activation energy [J/mol] */
 float k0 = 4.41e7;  /* pre-exponential factor */
 real H_Ox = 9.8509E5; /* oxide enthalpy */
Â
 real T_p = P_T(p);  /* particle temperature [K] */
 real mp = P_MASS(p); /* particle mass [kg] */
Â
 int atm = 101325;     /* atmospheric pressure [Pa] */
 real p_c = C_P(c,t0)/atm;  /* cell pressure [atm] */
 /*real Tc = P_T(c,t0);  /* cell temperature [K] */
Â
 real mf[0] = Pdf_Yi(c,t0,0); /* mass fraction hydrogen */
 real mf[1] = Pdf_Yi(c,t0,1); /* mass fraction steam */
Â
 float molMassFe = 55.845/1000;     /* mol mass iron [kg/mol] */
 float molMassO = 15.9994/1000;     /* mol mass oxide [kg/mol] */
 float molMassH2 = 2.01488/1000;     /* mol mass hydrogen [kg/mol] */
 real molMassH2O = molMassH2 + molMassO; /* mol mass water [kg/mol] */
Â
 real molf[0] = (mf[0]/molMassH2)/((mf[0]/molMassH2)+(mf[1]/molMassH2O)); /* mole fraction hydrogen */
 real molf[1] = (mf[1]/molMassH2O)/((mf[0]/molMassH2)+(mf[1]/molMassH2O)); /* mole fraction steam */
Â
 real p_H2 = p_c*molf[0]/(molf[0] + molf[1]);  /* partial pressure hydrogen [atm]*/
 real p_H2O = p_c*molf[1]/(molf[0] + molf[1]);  /* partial pressure steam [atm]*/
 Â
 real p_time = P_TIME(p);    /* particle time in reactor
*/
 real time = CURRENT_TIME;   /* current time
*/
 real dt  = CURRENT_TIMESTEP; /* time step
*/
Â
 float R = 8.3144598; /* Gas constant [J/mol*K] */
Â
 real X_t = 1-exp(-k0*exp(-E_act/(R*T_p))*(p_H2 - p_H2O/K)*p_time) ;   /* reduction rate at current time step */
 real X = 1-exp(-k0*exp(-E_act/(R*T_p))*(p_H2 - p_H2O/K)*(p_time+dt));  /* calculate reduction rate at end of time step [%] */
Â
 real molMass_FeOx = nFe*molMassFe + nO*molMassO; /* initial molar mass iron oxide */
 real nMol = mp/molMass_FeOx;           /* amount of moles iron oxide in the particle */
 real O_initial = (nO*molMassO)/molMass_FeOx;
Â
 real Fe_t = (1 - O_initial)/(1 - X_t*O_initial);       /* mass-% iron at time t */
 real x_t = (nFe*molMassFe/Fe_t - nO*molMassFe)/molMassO;   /* amount of oxygen left at time t */
 real Fe_end = (1 - O_initial)/(1 - X*O_initial);       /* mass-% iron at end of timestep */
 real x_end = (nFe*molMassFe/Fe_end - nO*molMassFe)/molMassO; /* amount of oxygen left at end of timestep */
Â
 real molMass_FeOx_t = nFe*molMassFe + x_t*molMassO;   /* molar mass at time t*/
 real molMass_FeOX_end = nFe*molMassFe + x_end*molMassO; /* molar mass at end of timestep */
Â
 real dmdt = -(molMass_FeOx_t - molMass_FeOx_end)*nMol/dt; /* dmdt iron oxide particle [kg/s] */
 dzdt->species[0] = -nMol*(x_t-x_end)*molMassH2/dt;     /* dmdt hydrogen flow [kg/s] */
 dzdt->species[1] = nMol*(x_t-x_end)*molMassH2O/dt;     /* dmdt steam formation [kg/s] */
 Â
 real H_Fe = 3.3864E5;     /* Enthalpies (temperature dependent) */
 real H_Ox = 9.8509E5;
 real H_h2 = 4.6595E4;Â
 real H_h2o = 9.7514e+04;
 real dH = H_Ox + nO*H_h2 - nO*H_h2o - nFe*H_Fe;  /* Enthalpy difference of reaction */
Â
 dzdt ->energy[1] += (dmdt * dH)/(mp * Cp); /* source term of the steam temperature [K/s] */
Â
 dydt[1] += dmdt;              /* source term of the particle mass [kg/s] */
Â
 dzdt->species[0] = 0; /*neglect formation of steam and dissipation of hydrogen */
 dzdt->species[1] = 0;
 dzdt ->energy[1] += 0; /*neglect temperature change due to reaction */
 dydt[1] += 0;     /*neglect change in particle mass due to reaction */
Â
 /* write output file to verify data */
 str = fopen ("UDF_output.txt","a");
 fprintf (str,"particle time: %f , time: %f, reduction degree: %f n", p_time, time, X);
 fclose (str);
 }
-
March 16, 2020 at 5:06 pmKarthik RemellaAdministrator
Hello,
Since you said you were not able to compile any UDFs from the manual, I'm not sure if it is wise to debug the UDF you've posted here. It is perhaps that your compiler is not working the way it should and therefore, we are seeing the following issue. I'm posting a very simple piece of code here. If compiled properly, you should be able to prescribe a parabolic velocity profile at your inlet. Here is the code. Please copy this code you a text file, name the file - inlet.c and try to compile this. Please let us know your findings here. Depending on this, we should be able to help you better.
Thanks,
Best,
Karthik
Code:
/***********************************************************************
UDF for specifying steady-state parabolic pressure profile boundary
profile for a turbine vane
************************************************************************/
#include "udf.h"
DEFINE_PROFILE(pressure_profile,t,i)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y = x[1];
F_PROFILE(f,t,i) = 1.1e5 - y*y/(.0745*.0745)*0.1e5;
}
end_f_loop(f,t)
} -
March 16, 2020 at 5:29 pmAmine Ben Hadj AliAnsys EmployeeYou need a compiler. Interpreting UDFs is not always possible aNd the docu states that for several define macros a compiler is required. Moreover Ansys staff do not debug UDFs if ths is your intention later
-
March 16, 2020 at 5:33 pmJeroenSubscriber
The code supplied also does not work and gives the following error:
Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).nnThe system cannot find the file specified.
nnC:Userss151272DocumentsMasterAfstudeer_opdrachtANSYSlibudfwin643d_hostlibudf.dll
Â
Error Object: #f
Â
I currently have Windows Visual 2019 and Pelles C installed as compilers. However, I have never established a coupling between Fluent and one of these compilers. How should this be done?
Â
-
March 16, 2020 at 5:53 pmAmine Ben Hadj AliAnsys EmployeeCan you try compiling from x64 cross vs compiler prompt just start Fluent there.
-
March 16, 2020 at 6:03 pmJeroenSubscriber
I have tried starting it from the compiler prompt you mentioned, though that still doesn't work.
-
March 16, 2020 at 6:48 pmAmine Ben Hadj AliAnsys EmployeeCan you screenshot cl in this prompt? Type cl and insert the screenshot.
-
March 16, 2020 at 6:50 pm
-
March 16, 2020 at 7:03 pmAmine Ben Hadj AliAnsys EmployeeThe VS 2019 is supported with 2020R1. Fir 2019Rx a patch is required. Either you have access to customer portal or use another version like VS 2017. Always clean uninstall any Visusl Studio version and install as admin.
-
March 17, 2020 at 3:40 pmJeroenSubscriber
Alright with VS 2017 it indeed works. However I now get a syntax error whilst udf_names.c is being generated.
   # Generating udf_names.c because of React_Hematite.obj
   udf_names.c
   udf_names.c(7): error C2059: syntax error: '}'
Â
   udf_names.c(: warning C4034: sizeof returns 0
Â
Any idea why this happens and how I can solve this issue?
-
March 17, 2020 at 5:31 pmKarthik RemellaAdministrator
While compiling your code, the compiler found issues with the code. Please go to those lines and check the syntax you used in your code. The error messages will help you debug your code.
For example, please go to line no. 7 in your code to understand why there is a missing parenthesis.
Thanks.
-
March 17, 2020 at 7:08 pmAmine Ben Hadj AliAnsys EmployeeNice that now it seems working. Now stick to the documentation and what my colleague shared.
-
- The topic ‘Compiling UDF’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Script error Code: 800a000d
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.