# discuss user subroutine in CFX

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

 August 18, 2003, 22:49 discuss user subroutine in CFX #1 Anicorl Guest   Posts: n/a Hello everyone, Could anybody explain how to implement user subroutine in CFX please? I am going to use¡¡Fortran subroutines in CFX4.4, but what is about CFX5.5? I am simulating the flow in a duct, which need to add electrical and magnetic effects as user subroutine to implemented in CFX. Firstly the Lorentz force as a momentum source need to be added. In addition to this force, the scalar electrical potential and relative electrical boundary conditions must be added. But I can¡¯t know how to arrange them. Could you tell me some your experiences about it? Any help greatly appreciated. I am looking forward to hear the kindly help soon. Thank you in advance. Anicorl

 August 19, 2003, 08:02 Re: discuss user subroutine in CFX #2 Miko Guest   Posts: n/a Hi, I am also doing soemthing on MHD with CFX5.5.1. I know how to add Lorentz force item to the N-S equation without using subroutine. But it's hard for the CFX to converge to obtain a good result! Now I also want to use Subroutine to achieve it, but it seems that it's difficult. Maybe we can discuss it together. Miko

 August 19, 2003, 16:58 Re: discuss user subroutine in CFX #3 Pascale Fonteijn Guest   Posts: n/a Contact Mr. Bartsch from CFX Berlin. I think he can help you on this topic. Pascale

 August 19, 2003, 18:24 Re: discuss user subroutine in CFX #4 Glenn Horrocks Guest   Posts: n/a Hi Anicorl, You can probably do this using the cel in CFX5. Then you don't need fortran at all. Glenn

 August 20, 2003, 03:02 Re: discuss user subroutine in CFX #5 Anicorl Guest   Posts: n/a Hi, Miko, Lorentz force dependent to not only the flow velocity but also the electrical potential is rather complicated. Moreover, the electrical boundary conditions need be considered. So it is necessary to use subroutine to achieve it. Lorentz force can be added as a source item to the momentum equation in CFX with using subroutine. The diffusion transport equation of electrical current can be derived as the temperature equation, and the electrical boundary conditions maybe be added to the equation to solve it. But I cannot confirm whether the original codes of CFX need to be rewritten. To this idea, what should you do? By the way, can you confirm these subroutines about electrical and magnetic problem can be added in CFX5.5? I look forwards to discuss it together. Anicorl

 August 20, 2003, 08:49 Re: discuss user subroutine in CFX #6 Miko Guest   Posts: n/a Hi Anicorl! You are right. But in my case, I needn't consider the electrical effect, for the external magnetic field is the only factor which influences the behaviour of the duct flow in MHD issues. I think you can achieve it stey by stey--that is, firstly consider Lorentz force, then electrical force. In CFX5.5.1, besides subroutine, we can use ccl to add Lorentz force to the N-S equation. In CFX4.4, subroutine is the only way to achieve so. I have asked local CFX office, they said that it's quite different between CFX4 and CFX5 in subroutine, and it's a common problem for CFX5.5 not to converge when we use ccl to add Lorentz force to the euqation. However, I think CFX can deal with such probelms, for I saw some CFX articles published online concerned duct flow, and the result is good. You can email to me directly at this mail box, and I also look forwards to discussing with me on this issue. Best regards! Miko

 August 25, 2003, 17:01 Re: discuss user subroutine in CFX #7 Robin Guest   Posts: n/a Hi Miko, You should contact your CFX support rep for help. Work has been done specifically for MHD which they may be able to supply you with. On another note, if your momentum source term is non-linear, you will likely have convergence problems. To help convergence, include a momentum source linearization (in Pre, right under the momentum source boxes) equal to first derivative of your momentum source wrt speed. If the source term is different in all three directions, use the largest value for the linearization. Regards, Robin

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post amanda-pei CFX 0 May 13, 2010 06:54 CFDUSER CFX 2 December 9, 2006 07:31 Andre CFX 14 August 8, 2006 23:03 raymond CD-adapco 4 December 6, 2001 06:44 David Creech Main CFD Forum 0 March 17, 1999 13:41

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