CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   cfd compilation error - LNK2019 (https://www.cfd-online.com/Forums/main/238258-cfd-compilation-error-lnk2019.html)

vivjk94 September 1, 2021 23:52

cfd compilation error - LNK2019
 
The code below is my udf for simulating a gear pump which was taken from a youtube video:

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 .

vivjk94 September 2, 2021 08:08

fixed it
 
The issue is fixed. i reinstalled visual basic studio 2017 and got the x86 version of the visual basic studio community 2017 instead of the x64 version. Hope it helps others.

Guvennergiz September 2, 2021 08:27

Why did you need a UDF code?

vivjk94 September 2, 2021 09:20

Quote:

Originally Posted by Guvennergiz (Post 811509)
Why did you need a UDF code?

i was trying to do a dynamic mesh with 2d gear pump setup.

Guvennergiz September 2, 2021 09:31

2 Attachment(s)
Quote:

Originally Posted by vivjk94 (Post 811511)
i was trying to do a dynamic mesh with 2d gear pump setup.

I dont know which software you use for this analysis but I think its better to use discontinuous mesh instead of adaptive mesh with such a moving part analysis.

Attachment 86130
Attachment 86131

Ps: Thanks to Ahmet Kozanoglu for images

vivjk94 September 2, 2021 10:02

Quote:

Originally Posted by Guvennergiz (Post 811512)
I dont know which software you use for this analysis but I think its better to use discontinuous mesh instead of adaptive mesh with such a moving part analysis.

Attachment 86130
Attachment 86131

Ps: Thanks to Ahmet Kozanoglu for images

i am currently using Ansys Fluent. discontinuous mesh sounds interesting. which software do you recommend for doing the analysis using discontinuous mesh?

Guvennergiz September 2, 2021 10:10

I prefer Cradle CFD especially moving part analysis. You can download student version of it. There is many tutorials inside to better understand how CFD analysis can perform.

https://www.mscsoftware.com/node/10211

Note: Cradle is 3D CFD software, 2D analysis may not allowed. But you can define symmetrical or periodic boundaries.

vivjk94 September 2, 2021 10:17

Quote:

Originally Posted by Guvennergiz (Post 811517)
I prefer Cradle CFD especially moving part analysis. You can download student version of it. There is many tutorials inside to better understand how CFD analysis can perform.

https://www.mscsoftware.com/node/10211

Note: Cradle is 3D CFD software, 2D analysis may not allowed. But you can define symmetrical or periodic boundaries.

wow, thanks. i will try it using cradle.


All times are GMT -4. The time now is 06:44.