|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
MEKSEM HOCINE
Join Date: Mar 2017
Posts: 5
Rep Power: 9 ![]() |
hy all, i'am traying to compile a UDF who give me the average pressure and temperature of air in compressible tow-phase flow (air-water) liquid piston.
but when i compile my udf, it given to me this error that i never seen before error LNK2019 : Unresolved external symbol __imp__RP_Get_Float Referenced in the Pressure function error LNK2019 : Unresolved external symbo __imp__Get_Domain Referenced in the Pressure function ![]() ![]() I implore you to help me ![]() ![]() i attached my UDF : |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9 ![]() |
Can you just copy+paste the code to this page?
I don't want to download any unknown files. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9 ![]() |
are you using functions such as sin()?
Have you included the #math? |
|
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
MEKSEM HOCINE
Join Date: Mar 2017
Posts: 5
Rep Power: 9 ![]() |
hy, KaLium
Here is my udf ________________________________ #include "udf.h" DEFINE_EXECUTE_AT_END(Pression) { Domain *subdomain; Domain *mixture_domain; int phase_domain_index; cell_t c; Thread *t; real sum_p = 0., sum_T = 0., P_moy, T_moy, vol_tot = 0; FILE* fichier = NULL; fichier = fopen("data_air.txt", "a"); mixture_domain = Get_Domain(2); subdomain = Get_Domain(2); sub_domain_loop(subdomain, mixture_domain, phase_domain_index) { thread_loop_c(t,subdomain) { begin_c_loop_all(c, t) { vol_tot += C_VOLUME(c, t); sum_p += C_P(c, t); sum_T += C_T(c, t); end_c_loop(c, t) } } P_moy = sum_p / vol_tot; T_moy = sum_T / vol_tot; C_UDMI(c, t, 0) = P_moy; C_UDMI(c, t, 1) = T_moy; printf("P_moy_air: %g\n", P_moy); printf("P_moy_air: %g\n", T_moy); if (fichier != NULL) { fprintf(fichier, "%g %g\n", CURRENT_TIME, P_moy, T_moy); fclose(fichier); } fflush(stdout); } } |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9 ![]() |
Are you sure that you can use
C_UDMI(c, t, 0) = P_moy; C_UDMI(c, t, 1) = T_moy; outside of the cell-loop? Does you code even need them? |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9 ![]() |
in fprintf(fichier, "%g %g\n", CURRENT_TIME, P_moy, T_moy); you are defining only 2 variables, but trying to use 3.
|
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
MEKSEM HOCINE
Join Date: Mar 2017
Posts: 5
Rep Power: 9 ![]() |
thanks for your raplay , i'll tray to remind this.
but i already code the UDMI outside and it's run so good. for the fprint, the Current_time doesn't need to be defined i think that the problem Is due to compilation with Visual Studio but i can't see him |
|
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
tyehuo
Join Date: Nov 2019
Posts: 5
Rep Power: 6 ![]() |
kalium does not know what he is talking about.
That's not the point at all. I have also encountered the same problem, not solved yet. |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 ![]() |
Kalium gave useful feedback. They identified two problems in the code.
There might be more problems remaining, but it's not nice to say such a bad thing about somebody who is helping.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Member
Vivek MJ
Join Date: Oct 2020
Location: India
Posts: 53
Rep Power: 5 ![]() |
The code below is my udf for simulating a gear pump:
for second gear, #include "udf.h" DEFINE_CG_MOTION(gear_2_new,dt,vel,omega,time,dtim e) { real t = CURRENT_TIME; NV_S (vel, = , 0.0); NV_S (omega, = , 0.0); omega[2] = -60.0; } for first gear, #include "udf.h" DEFINE_CG_MOTION(gear_1_new,dt,vel,omega,time,dtim e) { real t = CURRENT_TIME; NV_S (vel, = , 0.0); NV_S (omega, = , 0.0); omega[2] = 60.0; } This is the error message i recieve: gearone.obj : error LNK2019: unresolved external symbol __imp__RP_Get_Float referenced in function _gear_1_new geartwo.obj : error LNK2001: unresolved external symbol __imp__RP_Get_Float C:\PROGRA~1\ANSYSI~1\v192\fluent\fluent19.2.0\mult iport\win64\mpi\shared\mport.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86' C:\PROGRA~1\ANSYSI~1\v192\fluent\fluent19.2.0\win6 4\2d_node\fl_mpi1920.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86' libudf.dll : fatal error LNK1120: 1 unresolved externals The weird thing about this is that this udf executed perfectly the previous day and today its throwing me this error. i use fluent 19.2 and Visual studio 2017 . Need suggestions |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
most likely you are using x64 fluent version, but run x86 compiler
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CGNS Compiling | Diego | Main CFD Forum | 17 | December 21, 2014 01:40 |
using METIS functions in fortran | dokeun | Main CFD Forum | 7 | January 29, 2013 04:06 |
OpenFOAM install on Ubuntu Natty 11.04 | bkubicek | OpenFOAM | 13 | May 26, 2011 05:48 |
POSDAT problem | piotka | STAR-CD | 4 | June 12, 2009 08:43 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 20:30 |