CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   User Subroutine (https://www.cfd-online.com/Forums/cfx/25399-user-subroutine.html)

A. Said March 6, 2008 11:21

User Subroutine
 
Hallo All,

I want to write a user subroutine to set the outlet temperature to be equal to the inlet temperature plus some constant. I am working with periodic boundary conditions for the velocity and there I can't set these in the GUI.

I have never worked with user subroutine in CFX and I think it will take long time until I get it. Any help or hint is welcome.

Regards

A. Said.

opaque March 6, 2008 12:31

Re: User Subroutine
 
Dear A. Said,

Please contact ANSYS CFX help desk, and discuss your problem. Your setup has been tried previously and they can provide you with specific information.

Opaque.


CycLone March 6, 2008 12:48

Re: User Subroutine
 
You can't set a temperature at an outlet. Do you mean that you want to set the inlet temperature to the outlet plus a constant? Or are you looking to add a source term in your domain to influence the outlet temperature?

A. Said March 6, 2008 16:36

Re: User Subroutine
 
Thank you for your reply.

Actually, I am simulating thermal flow in a periodic domain, so the temperature at the outlet has the same distribution as that at the inlet but with a higher value [Tout=Tinlet+ qflux/(m.cp)]

Thanks a lot again

A. Said

A. Said March 6, 2008 17:58

Re: User Subroutine
 
Thank you for your reply.

Actually, I am simulating thermal flow in a periodic domain, so the temperature at the outlet has the same distribution as that at the inlet but with a higher value [Tout=Tinlet+ qflux/(m.cp)]

Thanks a lot again

A. Said

CycLone March 7, 2008 10:34

Re: User Subroutine
 
You would set this up as a periodic domain, rather than including an inlet and outlet. When you create the periodic interface, Pre will create corresponding boundary conditions. Edit one of the boundary conditions (either the upstream or downstream one, it doesn't matter which) and add an appropriate energy source term.

-CycLone

CycLone March 7, 2008 10:35

Re: User Subroutine
 
I should add that such a calculation is only valid if the material properties are not temperature dependant. Otherwise you cannot make the assumption of linear periodicity.

To drive the flow, you can specify a pressure drop or mass flow rate on the periodic interface.

-CycLone

A. Said March 7, 2008 13:37

Re: User Subroutine
 
Dear CycLone,

Thanks a lot for your answer. That is right, the problem is periodic. For the velocity it is straight forward but for the temperature (in the case of constant heat flux boundary or constant temperature boundary) is not so direct. If one specify a heat source at the periodic boundary, the temperature will increase without any limit for the case of constant heat flux.

Regards

A. Said


CycLone March 7, 2008 15:23

Re: User Subroutine
 
You can make your heat source a function of other sources within the domain or a function of the local or average temperature at the boundary. If you add sources in a case like this, it's up to you to ensure they balance.

-CycLone

A. Said March 7, 2008 16:49

Re: User Subroutine
 
Can you plz explain in a more detail.

Regards


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