CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF boundary condition (https://www.cfd-online.com/Forums/fluent/226769-udf-boundary-condition.html)

Tianxu May 7, 2020 08:22

UDF boundary condition
 
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!!!

berkmm May 7, 2020 08:50

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.

vinerm May 7, 2020 09:02

Pressure Inlet
 
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.

Tianxu May 7, 2020 19:54

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 May 7, 2020 19:58

Quote:

Originally Posted by berkmm (Post 769222)
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

berkmm May 8, 2020 01:34

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

Tianxu May 8, 2020 01:39

Quote:

Originally Posted by vinerm (Post 769223)
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

vinerm May 8, 2020 05:18

Ideal Gas
 
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.

Tianxu May 8, 2020 22:05

Quote:

Originally Posted by vinerm (Post 769385)
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

vinerm May 9, 2020 16:15

Pressure Inlet
 
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.

Tianxu May 9, 2020 21:45

Quote:

Originally Posted by vinerm (Post 769636)
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 May 26, 2020 07:48

Quote:

Originally Posted by vinerm (Post 769636)
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!

vinerm May 26, 2020 09:17

Prevent Reverse Flow
 
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.

Tianxu May 26, 2020 09:30

Quote:

Originally Posted by vinerm (Post 771961)
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

vinerm May 26, 2020 09:34

Beta
 
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.

Tianxu May 26, 2020 09:49

Quote:

Originally Posted by vinerm (Post 771971)
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!

vinerm May 26, 2020 09:54

Beta Feature
 
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.

Tianxu May 26, 2020 10:14

Quote:

Originally Posted by vinerm (Post 771982)
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!

vinerm May 26, 2020 10:17

Beta feature
 
You can use the same command to disable it. Just use no in place of yes.

Tianxu May 26, 2020 10:19

Quote:

Originally Posted by vinerm (Post 771990)
You can use the same command to disable it. Just use no in place of yes.

Thank you!


All times are GMT -4. The time now is 04:07.