CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF 3D Rotation for Fluid in concentric sphere

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 21, 2019, 01:18
Default UDF 3D Rotation for Fluid in concentric sphere
  #1
New Member
 
AndyHor
Join Date: Dec 2019
Location: Melaka Malaysia
Posts: 5
Rep Power: 6
andyhor is on a distinguished road
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;

}
Attached Images
File Type: jpg Overall Surface.jpg (109.1 KB, 7 views)
File Type: jpg Inner Surface.jpg (135.9 KB, 7 views)
andyhor is offline   Reply With Quote

Old   December 22, 2019, 19:40
Default
  #2
New Member
 
AndyHor
Join Date: Dec 2019
Location: Melaka Malaysia
Posts: 5
Rep Power: 6
andyhor is on a distinguished road
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
andyhor is offline   Reply With Quote

Old   December 22, 2019, 23:05
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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 was helpful
AlexanderZ is offline   Reply With Quote

Old   December 23, 2019, 04:11
Default
  #4
New Member
 
AndyHor
Join Date: Dec 2019
Location: Melaka Malaysia
Posts: 5
Rep Power: 6
andyhor is on a distinguished road
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
andyhor is offline   Reply With Quote

Old   December 23, 2019, 04:27
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
there should be no problem, if you run fluent from visual studio console
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 23, 2019, 06:46
Default
  #6
New Member
 
AndyHor
Join Date: Dec 2019
Location: Melaka Malaysia
Posts: 5
Rep Power: 6
andyhor is on a distinguished road
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.
andyhor is offline   Reply With Quote

Old   December 24, 2019, 01:21
Default
  #7
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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 was helpful
AlexanderZ is offline   Reply With Quote

Old   January 2, 2020, 00:43
Default
  #8
New Member
 
AndyHor
Join Date: Dec 2019
Location: Melaka Malaysia
Posts: 5
Rep Power: 6
andyhor is on a distinguished road
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
andyhor is offline   Reply With Quote

Reply

Tags
fluent, udf code

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF Rotation lepetitmort Fluent UDF and Scheme Programming 38 October 15, 2020 06:29
sinusoidal rotation UDF denis Kim Fluent UDF and Scheme Programming 9 May 22, 2020 17:39
UDF Dynamic Meshing for Rotation and Translation Aidan100 Fluent UDF and Scheme Programming 2 August 16, 2015 23:39
Simulating a rotating sphere, with axis of rotation normal to flow direction gamer_lester FLUENT 2 December 19, 2014 14:47
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


All times are GMT -4. The time now is 19:05.