CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF For my 2D - Axisymmetric CHT rotating model (https://www.cfd-online.com/Forums/fluent/224479-udf-my-2d-axisymmetric-cht-rotating-model.html)

hugzmeister February 21, 2020 05:03

UDF For my 2D - Axisymmetric CHT rotating model
 
2 Attachment(s)
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.

vinerm February 21, 2020 06:37

Required motion
 
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.

hugzmeister February 24, 2020 10:24

Solved
 
1 Attachment(s)
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.

vinerm February 24, 2020 10:36

Profile for zone motion
 
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;
}


All times are GMT -4. The time now is 01:41.