# UDF 3D Rotation for Fluid in concentric sphere

 Register Blogs Members List Search Today's Posts Mark Forums Read

December 21, 2019, 01:18
UDF 3D Rotation for Fluid in concentric sphere
#1
New Member

AndyHor
Join Date: Dec 2019
Location: Melaka Malaysia
Posts: 5
Rep Power: 2
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.

[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);

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;

}
Attached Images
 Overall Surface.jpg (109.1 KB, 4 views) Inner Surface.jpg (135.9 KB, 4 views)

 December 22, 2019, 19:40 #2 New Member   AndyHor Join Date: Dec 2019 Location: Melaka Malaysia Posts: 5 Rep Power: 2 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

 December 22, 2019, 23:05 #3 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,419 Rep Power: 21 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 __________________ best regards ****************************** press LIKE if this message helped you How to ask questions: https://www.cfd-online.com/Forums/si...tml#post612025

 December 23, 2019, 04:11 #4 New Member   AndyHor Join Date: Dec 2019 Location: Melaka Malaysia Posts: 5 Rep Power: 2 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

 December 23, 2019, 04:27 #5 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,419 Rep Power: 21 there should be no problem, if you run fluent from visual studio console __________________ best regards ****************************** press LIKE if this message helped you How to ask questions: https://www.cfd-online.com/Forums/si...tml#post612025

 December 23, 2019, 06:46 #6 New Member   AndyHor Join Date: Dec 2019 Location: Melaka Malaysia Posts: 5 Rep Power: 2 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.

 December 24, 2019, 01:21 #7 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,419 Rep Power: 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 __________________ best regards ****************************** press LIKE if this message helped you How to ask questions: https://www.cfd-online.com/Forums/si...tml#post612025

 January 2, 2020, 00:43 #8 New Member   AndyHor Join Date: Dec 2019 Location: Melaka Malaysia Posts: 5 Rep Power: 2 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. Last edited by andyhor; January 2, 2020 at 00:51. Reason: Error in message, need go retry

 Tags fluent, udf code