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/)
-   -   UDF 3D Rotation for Fluid in concentric sphere (https://www.cfd-online.com/Forums/fluent-udf/223075-udf-3d-rotation-fluid-concentric-sphere.html)

andyhor December 21, 2019 01:18

UDF 3D Rotation for Fluid in concentric sphere
 
2 Attachment(s)
Hi everyone,

I am first time user to UDF, and using ansys 2016. I need UDF for the lower momentum boundary condition.

I am trying to put expressions for a 3D , 1/8 concentric sphere, and the fluid is driven by lower surface to oscillate with respect to z-axis.

I have attached the 2 diagrams below of the fluid surfaces.

In 2019 version, i can put the boundary conditions as expression as sin(t/1[s])*1[rad/s] for the lower oscillating surface.

If I want to write in UDF, can I write in this way ? Please help.

[CODE]
/************************************************** ********************
oscillatingwall.c
UDF for specifying a transient simple harmonic motion
************************************************** *********************/

#include "udf.h"
#define angular_freq 1
DEFINE_GRID_MOTION(inneroscillatingwall, dt, cg_vel, cg_omega, time, dtime)

{
Thread*t; /*is the pointer to the structure that store*/
real omega;

/* reset velocities */
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);

t=DT_THREAD(dt); /*Get the tread pointer for which this motion is defined*/

omega = sin(angular_freq*time); /*rotional speed about axis*/

cg_vel[0] = 0.0; /*x y z translation*/
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0]=0.0; /* x y z rotational axis*/
cg_omega[1]=0.0;
cg_omega[2]=omega;

}

andyhor December 22, 2019 19:40

I have tried several methods, and amending the code, this is what I currently face, could anyone please help ?

#include "udf.h"
#define angular_freq 1.0
DEFINE_CG_MOTION(inneroscillatingwall, dt, cg_vel, cg_omega, time, dtime)

{
real omega;

omega = sin(angular_freq*time); /*rotional speed about axis*/

cg_vel[0] = 0.0; /*x y z translation*/
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0]=0.0; /* x y z rotational axis*/
cg_omega[1]=0.0;
cg_omega[2]=omega;

}



/*When I press build button, it gives */

Setting Post Processing and Surfaces information ... Done.
Copied C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent/C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\UDF oscillating.c to libudf\src
Creating user_nt.udf file for 3ddp ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v170\fluent"\fluent17.0.0\sr c\udf\makefile_nt.udf "libudf\win64\3ddp\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp")'nmake' is not recognized as an internal or external command,
operable program or batch file.

Done.





/*When I press load button, it gives*/

Opening library "C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\libudf"...RPC RCX_SC_SET_ERR_MSG failed: RPC: Can't encode arguments


Error: The UDF library you are trying to load (C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\libudf) is not compiled for 3ddp on the current platform (win64).

The system cannot find the file specified.

C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\libudf\win64\3ddp\libudf. dll

Error: The UDF library you are trying to load (C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\libudf) is not compiled for 3ddp on the current platform (win64).\n\nThe system cannot find the file specified.
\n\nC:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\C:\Users\Dell T7600\Desktop\Chee Hao Ansys\Hip Gap_files\dp0\FFF\Fluent\libudf\win64\3ddp\libudf. dll
Error Object: #f





/*And then I restart Ansys, it somehow have the UDF file, when I load to the boundary, and press ok, it gives */

Error: received a fatal signal (Segmentation fault).

Error: received a fatal signal (Segmentation fault).
Error Object: #f

AlexanderZ December 22, 2019 23:05

you didn't compile the code: nmake error in log

solution:
run Visual Studio console, run fluent from console, compile udf, load udf, hook udf function

andyhor December 23, 2019 04:11

Dear AlexanderZ,

Thanks for your comment, anyway, I did follow your advise, and follow steps as in this video, using visual studio to launch fluent, but I still face the same problem, nmake error, could you please advise ? I need your help . Hope to hear from you very soon.

https://www.youtube.com/watch?v=xt2hnE9_LdM

AlexanderZ December 23, 2019 04:27

there should be no problem, if you run fluent from visual studio console

andyhor December 23, 2019 06:46

Dear AlexanderZ,

There are 3 types of VS,
1. Community 2019
2. Professional 2019
3. Enterprise 2019

Which one should I actually select to install ? I had selected the Community 2019, but inside, there are a lot of tick to choose, which consume a lot of space, if all are selected, like 30GB++, but I have limited harddisk space. To install VS alone is only 600MB++, any part I should specifically to tick to include during the installation process ? Thank you.

AlexanderZ December 24, 2019 01:21

you may try to use other approach

download microsoft windows sdk 7.1, if your system is x64 -> downlaod x64 version
https://www.microsoft.com/en-us/down...s.aspx?id=8279
download:
https://www.microsoft.com/en-gb/down...s.aspx?id=4422


delete from your machine:
Microsoft Visual C++ 2010 x64 Redistributable 10.0.30319 (numbers could be different)
Microsoft Visual C++ 2010 x86 Redistributable 10.0.30319 (numbers could be different)

install:
SDK
Install VS compiler

andyhor January 2, 2020 00:43

Dear AlexandarZ,

Happy New Year, I had followed ur step, the UDF can build in an original version, but not cracked version.

Step one is done. I am trying to solve the load problem first. Will ask again if i could not solve the load problem.


All times are GMT -4. The time now is 12:40.