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

UDF checks

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2018, 03:39
Default UDF checks
  #1
New Member
 
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8
denis Kim is on a distinguished road
hope all is well.
I am a new to the Fluent.
Now i am trying to analysis for sloshing.
But problem happened to me. Tho cylinder motion is quite difficult for me.
the motion for the cylinder is sinusoidal motion towards only one way (x-dir only)with +-40mm, 4hz.
Below is the UDF that i written.
Thank you much in advance.

#include "udf.h"

DEFINE_CG_MOTION(tank_mov, dt, vel, omega, time, dtime)
{
real a, w, pi;

pi = 3.1415;

/* define motion variables */

a = 0.04; /* 0.04m movement amplitude */
w = 2 * pi * 4; /* 4Hz frequency */

/* define object movement law */
vel[0] = a * w * sin(w*time);
vel[1] = 0;
vel[2] = 0;
}
denis Kim is offline   Reply With Quote

Old   October 30, 2018, 09:02
Default
  #2
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 12
obscureed is on a distinguished road
Hi Denis,


This looks almost correct to me, except that "vel[0] = a * w * sin(w*time);" will give an amplitude "a * w". I think you intended to write "vel[0] = a * sin(w*time);".


Apart from that, it should be OK. Remember to save .cas and .dat files before you start any Moving/Deforming Mesh case. Use an appropriately small timestep. For a long time, there was a bug in Fluent that crashed when MDM cases with UDFs were closed and reopened -- so use a recent version of Fluent, where it has been fixed.


Good luck!
Ed
obscureed is offline   Reply With Quote

Old   October 30, 2018, 09:29
Default
  #3
New Member
 
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8
denis Kim is on a distinguished road
Quote:
Originally Posted by obscureed View Post
Hi Denis,


This looks almost correct to me, except that "vel[0] = a * w * sin(w*time);" will give an amplitude "a * w". I think you intended to write "vel[0] = a * sin(w*time);".


Apart from that, it should be OK. Remember to save .cas and .dat files before you start any Moving/Deforming Mesh case. Use an appropriately small timestep. For a long time, there was a bug in Fluent that crashed when MDM cases with UDFs were closed and reopened -- so use a recent version of Fluent, where it has been fixed.


Good luck!
Ed
Many thanks to obscureed,
I tried once again, below message poped up.
Is there any problem this UDF?
Please help me..
===============================================
test2.c
# Generating udf_names.c because of makefile test2.obj
udf_names.c
# Linking libudf.dll because of user_nt.udf udf_names.obj test2.obj
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.

LINK : fatal error LNK1104: cannot open file 'libudf.dll'

Done.
denis Kim is offline   Reply With Quote

Old   October 30, 2018, 09:33
Smile
  #4
New Member
 
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8
denis Kim is on a distinguished road
Also, what is meaning of "Remember to save .cas and .dat files before you start any Moving/Deforming Mesh case."
denis Kim is offline   Reply With Quote

Old   October 30, 2018, 20:37
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
this error means that you are trying to modify library, which is in use (you have loaded your UDF library in fluent) So you should unload first, than compile.

Best regards
AlexanderZ is offline   Reply With Quote

Old   October 30, 2018, 20:38
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by denis Kim View Post
Also, what is meaning of "Remember to save .cas and .dat files before you start any Moving/Deforming Mesh case."
File -> write -> case & data

best regards
AlexanderZ is offline   Reply With Quote

Old   November 1, 2018, 00:04
Default
  #7
New Member
 
Ki Jong Kim
Join Date: Oct 2018
Posts: 12
Rep Power: 8
denis Kim is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
File -> write -> case & data

best regards
Many thanks!!!alexanderZ

best wishes,
Kim
denis Kim is offline   Reply With Quote

Reply


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
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 13:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
Help! Delete the UDM codes in the UDF Messi Fluent UDF and Scheme Programming 2 January 28, 2014 10:01
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 14:07.