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

UDF for transient rpm(angular velocity) of boundary

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 16, 2018, 09:42
Smile UDF for transient rpm(angular velocity) of boundary
  #1
New Member
 
Neil
Join Date: Apr 2017
Posts: 2
Rep Power: 0
swapbitra is on a distinguished road
Hi all,

I am doing a simple simulation of a Taylor Couette Flow. I want to vary the rpm of the inner cylinder wall as a function of the flow time. I have used a simple UDF

# include "udf.h"
DEFINE_PROFILE(unsteady_angularvelocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = 600 + 60 * t;
}
end_f_loop(f, thread)

}
The udf is interpreted but the results are erroneous and also I want to print the current rpm in the console window. Please anybody help me to properly formulate the udf and achieve desired results.....

Regards
swapbitra is offline   Reply With Quote

Old   January 16, 2018, 10:39
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by swapbitra View Post
The udf is interpreted but the results are erroneous
You probably mean that the UDF gives results, but these results are not what you expected. If that is the case, then you should tell us what you expected, and what you received. I can not change the UDF to your expectations, if I don't know what your expectations are.
Quote:
and also I want to print the current rpm in the console window.
Add
Code:
Message("time %f: angular velocity %f\n",t,600 + 60 * t);
at the end of your code.
pakk is offline   Reply With Quote

Old   January 17, 2018, 01:40
Default
  #3
New Member
 
Neil
Join Date: Apr 2017
Posts: 2
Rep Power: 0
swapbitra is on a distinguished road
Dear Pakk

At a flow time of 0.1 sec, as per udf
angular velocity should be 600 + 60 * 0.1 = 606 rpm, corresponding to this rpm

Wall velocity should be 2 * pi * 606/60 *radius of inner cylinder(in my case 0.0595 m) = 3.775 m s^-1

But the fluent with udf gives 3.61 e+01 m s^-1. Please see the picture attached

and also
Code : Message("time %f: angular velocity %f\n",t,600 + 60 * t); gives an error message of "Invalid : -1"

Without udf at individual 606 rpm, the results are correct.

Regards
Attached Images
File Type: jpg Picture1.JPG (31.3 KB, 12 views)
swapbitra is offline   Reply With Quote

Old   January 17, 2018, 06:00
Default
  #4
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 12
obscureed is on a distinguished road
Hi Swapbitra,

Fluent requires UDF to supply profile values in its default units -- in this case, [rad/s]. It does not matter whether you have changed the GUI panel to use [rpm]. This exactly explains the discrepancy.

I cannot see anything wrong with Pakk's Message code, unless there is some quirk of interpreted UDFs. (I would recommend using compiled UDFs unless you are forced to use interpreted.) For reasons of speed and maintainability, you should evaluate and type the formula only once, for example:

Code:
# include "udf.h"
DEFINE_PROFILE(unsteady_angularvelocity, thread, position)
{
  face_t f;
  real rate; /* in [rad/s] */
  rate = (600. + 60.*CURRENT_TIME) * M_PI / 30.;
  /* "*2*M_PI" to convert revs to rad, then "/60" to convert /min to /s */
  begin_f_loop(f, thread)
  {
    F_PROFILE(f, thread, position) = rate;
  }
  end_f_loop(f, thread)

  Message0("time %g s: angular velocity %g rad/s\n",CURRENT_TIME,rate);
}
obscureed is offline   Reply With Quote

Reply

Tags
tansient rpm, taylor couette flow


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
write a UDF to give a velocity boundary condition at an interior face Tharanga Fluent UDF and Scheme Programming 19 August 5, 2018 05:29
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 19:02
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 11:20
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 15:32
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00


All times are GMT -4. The time now is 17:32.