# User Subroutine

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 6, 2008, 10:21 User Subroutine #1 A. Said Guest   Posts: n/a 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.

 March 6, 2008, 11:31 Re: User Subroutine #2 opaque Guest   Posts: n/a 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.

 March 6, 2008, 11:48 Re: User Subroutine #3 CycLone Guest   Posts: n/a 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?

 March 6, 2008, 15:36 Re: User Subroutine #4 A. Said Guest   Posts: n/a 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

 March 6, 2008, 16:58 Re: User Subroutine #5 A. Said Guest   Posts: n/a 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

 March 7, 2008, 09:34 Re: User Subroutine #6 CycLone Guest   Posts: n/a 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

 March 7, 2008, 09:35 Re: User Subroutine #7 CycLone Guest   Posts: n/a 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

 March 7, 2008, 12:37 Re: User Subroutine #8 A. Said Guest   Posts: n/a 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

 March 7, 2008, 14:23 Re: User Subroutine #9 CycLone Guest   Posts: n/a 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

 March 7, 2008, 15:49 Re: User Subroutine #10 A. Said Guest   Posts: n/a Can you plz explain in a more detail. Regards