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

UDF boundary condition

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By vinerm
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 7, 2020, 08:22
Default UDF boundary condition
  #1
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Hi everyone,

I am doing 2D rotating detonation engine (RDE) simulation in ANSYS Fluent.

For inlet boundary condition, there are three possible cases:

1. Pi > Po, where Pi is the pressure inside the domain immediately at the inlet and Po is the total inflow pressure. In this case the pressure inside the RDE at this point is very high and blocks inflow of new mixture through the inlet face. The inlet boundary acts as a wall.

2. Pcr < Pi < Po, where Pcr is the critical pressure. In this case the inlet is not chocked and new mixture flows into the RDE according to: mass flow rate = the integral of (rho*u*dA).

3. Pi < Pcr, in this case the pressure inside the domain is low. The inlet at this point is choked, so maximum flow rate of fuel is flowing into the domain. Pcr is calculated from isentropic relation.

It is quite challenge for me to construct UDF for this inlet condition. It would be very appreciate if someone could help me out!!!
Tianxu is offline   Reply With Quote

Old   May 7, 2020, 08:50
Default
  #2
New Member
 
Join Date: Oct 2019
Posts: 20
Rep Power: 6
berkmm is on a distinguished road
As I understand it is a transient simulation so you can calculate at which time step these pressure values are occuring and use Transient Table Data boundary condition for specific time step at your inlet.
Also you can use named expression for this boundary condition to like this IF(t=2s, 1 mPa, 0mPa) You can find its tutorial here too (https://www.youtube.com/watch?v=XKmcISqR9Q4&t=417s) hope these helps.
berkmm is offline   Reply With Quote

Old   May 7, 2020, 09:02
Default Pressure Inlet
  #3
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
You don't need a UDF for that. Just use Pressure Inlet. It allows flow only if the pressure inside is lower than that at the boundary. Do note that it allows flow-out but you can block that.
berkmm likes this.
__________________
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   May 7, 2020, 19:54
Default
  #4
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Thank you for the reply!

Is the pressure inside compares with critical pressure, which calculated from gauge total pressure (stagnation pressure) and the supersonic gauge pressure (static pressure) on the inlet pressure boundary?

Regards,
Tianxu
Tianxu is offline   Reply With Quote

Old   May 7, 2020, 19:58
Default
  #5
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by berkmm View Post
As I understand it is a transient simulation so you can calculate at which time step these pressure values are occuring and use Transient Table Data boundary condition for specific time step at your inlet.
Also you can use named expression for this boundary condition to like this IF(t=2s, 1 mPa, 0mPa) You can find its tutorial here too (https://www.youtube.com/watch?v=XKmcISqR9Q4&t=417s) hope these helps.
Thank you for the reply!

Yes, it is a transient simulation. I'll go through that!

Regards,
Tianxu
Tianxu is offline   Reply With Quote

Old   May 8, 2020, 01:34
Default
  #6
New Member
 
Join Date: Oct 2019
Posts: 20
Rep Power: 6
berkmm is on a distinguished road
Sorry but I forgot to add this, really sorrry
Here is transient table data boundary condition tutorial: https://www.youtube.com/watch?v=6iiHqOGkPCE&t=291s
berkmm is offline   Reply With Quote

Old   May 8, 2020, 01:39
Default
  #7
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
You don't need a UDF for that. Just use Pressure Inlet. It allows flow only if the pressure inside is lower than that at the boundary. Do note that it allows flow-out but you can block that.
Thank you for the reply!

Is the pressure inside compares with critical pressure, which calculated from gauge total pressure (stagnation pressure) and the supersonic gauge pressure (static pressure) on the inlet pressure boundary?

Regards,
Tianxu
Tianxu is offline   Reply With Quote

Old   May 8, 2020, 05:18
Default Ideal Gas
  #8
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
Critical pressures have no significance for ideal gases. In other words, it does not make sense to talk of critical pressure while assuming that the gas is ideal. If you want to study the flow around the critical pressure, you have to use real-gas models. Otherwise, just the pressure inlet will work. If you are worried about choking, ideal gas will do that if Mach number approaches unity.
berkmm likes this.
__________________
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   May 8, 2020, 22:05
Default
  #9
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
Critical pressures have no significance for ideal gases. In other words, it does not make sense to talk of critical pressure while assuming that the gas is ideal. If you want to study the flow around the critical pressure, you have to use real-gas models. Otherwise, just the pressure inlet will work. If you are worried about choking, ideal gas will do that if Mach number approaches unity.
I apologize if my description leads to some misunderstanding.

For the critical pressure, I mean that is the critical pressure of the inflow which is calculated from isentropic relation.

So basically, if pressure inside is higher than total pressure at inlet boundary, the Pressure Inlet will block the inflow?

Regards,
Tianxu
Tianxu is offline   Reply With Quote

Old   May 9, 2020, 16:15
Default Pressure Inlet
  #10
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
If the pressure inside the chamber is higher than the total pressure applied at the boundary, then the flow will begin to come out. However, Fluent has option where you can opt not to allow the fluid to reverse at the inlet. As far as choking condition is concerned, Pressure Inlet takes care of it.
__________________
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   May 9, 2020, 21:45
Thumbs up
  #11
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
If the pressure inside the chamber is higher than the total pressure applied at the boundary, then the flow will begin to come out. However, Fluent has option where you can opt not to allow the fluid to reverse at the inlet. As far as choking condition is concerned, Pressure Inlet takes care of it.
Thank you so much! That's pretty helpful!
Tianxu is offline   Reply With Quote

Old   May 26, 2020, 07:48
Default
  #12
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
If the pressure inside the chamber is higher than the total pressure applied at the boundary, then the flow will begin to come out. However, Fluent has option where you can opt not to allow the fluid to reverse at the inlet. As far as choking condition is concerned, Pressure Inlet takes care of it.
Hi,

I actually didn't find an option for blocking back flow for pressure inlet.
Do i need to use some text command to activate that?

Thanks!
Tianxu is offline   Reply With Quote

Old   May 26, 2020, 09:17
Default Prevent Reverse Flow
  #13
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
The option to prevent reverse flow at pressure inlet is not available in older versions, only in newer ones, most likely after 19.2 or 19.3.
__________________
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   May 26, 2020, 09:30
Default
  #14
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
The option to prevent reverse flow at pressure inlet is not available in older versions, only in newer ones, most likely after 19.2 or 19.3.
Hi,

I'm using 19.2, unfortunately I didn't find that...

So in this case, the only way to achieve that is to write UDF?

Regards,
Tianxu
Tianxu is offline   Reply With Quote

Old   May 26, 2020, 09:34
Default Beta
  #15
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
I don't have 19.2, but you can try to enable beta features. It is possible that the option is available as beta feature in 19.2. If it is not available, then, UDF would be required to block the flow.
__________________
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   May 26, 2020, 09:49
Default
  #16
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
I don't have 19.2, but you can try to enable beta features. It is possible that the option is available as beta feature in 19.2. If it is not available, then, UDF would be required to block the flow.
Hi,

I don't have experiences with beta feature. Do you mind explaining on it? How does it help for blocking the reverse inlet flow.

Thank you very much!
Tianxu is offline   Reply With Quote

Old   May 26, 2020, 09:54
Default Beta Feature
  #17
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
Issue the following command in Fluent

def bfa yes ok

Then, go to pressure inlet and see if it shows the option to prevent reverse flow or not. If it is available as beta feature, it will show the option otherwise not.
__________________
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   May 26, 2020, 10:14
Default
  #18
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
Issue the following command in Fluent

def bfa yes ok

Then, go to pressure inlet and see if it shows the option to prevent reverse flow or not. If it is available as beta feature, it will show the option otherwise not.
I've tried that, option for preventing reverse flow doesn't appear.. I think i need to do UDF for that.
How can I disable beta feature btw?

Thanks!
Tianxu is offline   Reply With Quote

Old   May 26, 2020, 10:17
Default Beta feature
  #19
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
You can use the same command to disable it. Just use no in place of yes.
__________________
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   May 26, 2020, 10:19
Default
  #20
New Member
 
Tianxu Yin
Join Date: May 2020
Posts: 24
Rep Power: 6
Tianxu is on a distinguished road
Quote:
Originally Posted by vinerm View Post
You can use the same command to disable it. Just use no in place of yes.
Thank you!
Tianxu 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
Cyclic boundary condition in foam-extend 4.0 rellumeister OpenFOAM Pre-Processing 2 March 3, 2020 08:03
Fluent Boundary Condition with UDF amitjoshi FLUENT 0 November 16, 2018 02:21
How do you use heat flux as a boundary condition in a non-wall area in UDF? JuBong Fluent UDF and Scheme Programming 2 July 2, 2018 21:15
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 10:20
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44


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