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

UDF For my 2D - Axisymmetric CHT rotating model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2020, 05:03
Default UDF For my 2D - Axisymmetric CHT rotating model
  #1
New Member
 
James Adams
Join Date: Feb 2020
Posts: 3
Rep Power: 6
hugzmeister is on a distinguished road
Hi,

First time posting. ANSYS rookie.

Ive set up a CHT 2D axisymmetric model.

I need to set up a UDF to simulate an engine slam acceleration.

My UDF does not seem to be working and I have no idea, why. I suspect I'm either calling the wrong type of macro or my syntax is wrong (never used C in my life).

I have interpreted this macro and I have called it in the cell zone conditions for my rotor and in the interface boundary conditions.
Attached Images
File Type: png forum.PNG (66.9 KB, 12 views)
File Type: png forum2.PNG (26.0 KB, 20 views)
hugzmeister is offline   Reply With Quote

Old   February 21, 2020, 06:37
Default Required motion
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Omega is not a scalar. So, its value cannot be set the way you have in the UDF.

In a 2D case, rotation is allowed only about z-axis. If that's what you need, you do not require a UDF. Just open the cell zone conditions panel and apply the rotational speed. Ensure that the center of cell zone is given correctly. If you want to give a speed that depends on time, then you can use a profile. Profile is much simpler and easier than a UDF.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 24, 2020, 10:24
Default Solved
  #3
New Member
 
James Adams
Join Date: Feb 2020
Posts: 3
Rep Power: 6
hugzmeister is on a distinguished road
Hi,

Thanks for your suggestion. Because I need to create much more complicated rotational profiles dependednt on time, I was insistent in using a macro.

After a few hours of trial and error I managed to write a UDF that worked.
Attached Files
File Type: txt SLAM_ACC_DEC_15.txt (1.0 KB, 17 views)
hugzmeister is offline   Reply With Quote

Old   February 24, 2020, 10:36
Default Profile for zone motion
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
This is a profile UDF and not meant for making a zone move. Furthermore, zones are cell zones if you are using moving mesh or MRF. If you are modeling a moving wall, then this will work. Otherwise, use DEFINE_ZONE_MOTION, just like you had in your original code. You need to modify that as follows

DEFINE_ZONE_MOTION(...)
{
if(time > 200)
*omega = 2000;
else if (time <=200 && time > 100)
*omega = 9000;
else
*omega = 2000;
}
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm 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
UDF problem for Population balance model Amir.11 Fluent UDF and Scheme Programming 6 May 30, 2022 04:36
Modified k-e turbulence model UDF Travis Fluent UDF and Scheme Programming 7 November 11, 2018 20:21
Using UDF for shaking / rotating mesh MandatoryMadness FLUENT 0 October 11, 2018 12:13
generate the 3D model from this 2D axisymmetric model mlooti FLUENT 2 June 11, 2018 08:26
Axisymmetric model Satish Perivilli FLUENT 2 May 9, 2006 10:02


All times are GMT -4. The time now is 18:43.