|
[Sponsors] |
UDF for transient rpm(angular velocity) of boundary |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 16, 2018, 09:42 |
UDF for transient rpm(angular velocity) of boundary
|
#1 |
New Member
Neil
Join Date: Apr 2017
Posts: 2
Rep Power: 0 |
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 |
|
January 16, 2018, 10:39 |
|
#2 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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:
Code:
Message("time %f: angular velocity %f\n",t,600 + 60 * t); |
||
January 17, 2018, 01:40 |
|
#3 |
New Member
Neil
Join Date: Apr 2017
Posts: 2
Rep Power: 0 |
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 |
|
January 17, 2018, 06:00 |
|
#4 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
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); } |
|
Tags |
tansient rpm, taylor couette flow |
|
|
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 |