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

Can I change flow direction using UDF?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2016, 05:53
Default Can I change flow direction using UDF?
  #1
New Member
 
Tzung
Join Date: Apr 2016
Posts: 3
Rep Power: 10
newcfdone is on a distinguished road
Hi,

I want to use mass flow inlet boundary condition to create unsteady inflow and outflow. The mass flow rate can't be negative. Can I use UDF to define flow direction in Mass Flow Inlet Boundary Conditions Panel?

Thank you advance

Tzung
newcfdone is offline   Reply With Quote

Old   April 1, 2016, 06:24
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 12
Bruno Machado is on a distinguished road
Quote:
Originally Posted by newcfdone View Post
Hi,

I want to use mass flow inlet boundary condition to create unsteady inflow and outflow. The mass flow rate can't be negative. Can I use UDF to define flow direction in Mass Flow Inlet Boundary Conditions Panel?

Thank you advance

Tzung
Just change the flow direction in this panel.
Attached Images
File Type: png Untitled.png (8.5 KB, 44 views)
Bruno Machado is offline   Reply With Quote

Old   April 1, 2016, 13:05
Default
  #3
New Member
 
Tzung
Join Date: Apr 2016
Posts: 3
Rep Power: 10
newcfdone is on a distinguished road
Hi Bruno,

The mass flow inlet just accepts the positive mass flow rate. If I want to create outflow or inflow, as you mention, I have to specify the flow direction. I want to simulate an unsteady problem, however, it needs to dynamically change the flow direction. Can I do so through the Mass Flow Inlet Panel? or I have to do so using UDF, can I?

Best Regards,

Tzung
newcfdone is offline   Reply With Quote

Old   April 4, 2016, 05:19
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 12
Bruno Machado is on a distinguished road
Quote:
Originally Posted by newcfdone View Post
Hi Bruno,

The mass flow inlet just accepts the positive mass flow rate. If I want to create outflow or inflow, as you mention, I have to specify the flow direction. I want to simulate an unsteady problem, however, it needs to dynamically change the flow direction. Can I do so through the Mass Flow Inlet Panel? or I have to do so using UDF, can I?

Best Regards,

Tzung
But that is precisely what I've said. You can change the flow direction using a negative value (you can use -1 instead 1). The value of the mass flow rate, as you said, should be positive.

You can either do it manually by changing it whenever you want or by using a UDF with dependence on time.
Bruno Machado is offline   Reply With Quote

Old   April 6, 2016, 22:49
Default
  #5
New Member
 
Tzung
Join Date: Apr 2016
Posts: 3
Rep Power: 10
newcfdone is on a distinguished road
Hi Bruno,

I can successfully change the flow direction.
Thanks for your help a lot!

Can I ask you some questions?

How can I read experiment data to specify the flow rate at Mass Flow Inlet BC using UDF?
I use "fscanf", but it does work correctly.

1. Should I fopen data file outside or inside DEFINE_PROFILE?
2. Should I fscanf data file outside or inside DEFINE_PROFILE?
3. Should I fclose data file at Exit?

I am not sure whether if I miss something else.

Or you can provide a UDF example?

Sincerely,
Tzung
newcfdone 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
ERROR: Flow direction on the boundaries must not be tangential to the boundary. turbomax CFX 2 August 6, 2015 11:05
UDF problems with porous flow Nicolastheterminator Fluent UDF and Scheme Programming 0 April 8, 2014 09:12
UDF for perpertual velocity step change romanpicisan Fluent UDF and Scheme Programming 0 February 17, 2014 04:55
Do Pressure Inlet Flow Direction Components Need to Be Normalized? ScottN FLUENT 0 September 21, 2010 09:18
Help please UDF flow direction val17lr FLUENT 2 September 4, 2010 05:30


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