CFD Online URL
[Sponsors]
Home > Forums > CFX

discuss user subroutine in CFX

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 18, 2003, 23:49
Default 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
  Reply With Quote

Old   August 19, 2003, 09:02
Default 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
  Reply With Quote

Old   August 19, 2003, 17:58
Default 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
  Reply With Quote

Old   August 19, 2003, 19:24
Default 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
  Reply With Quote

Old   August 20, 2003, 04:02
Default 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
  Reply With Quote

Old   August 20, 2003, 09:49
Default 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
  Reply With Quote

Old   August 25, 2003, 18:01
Default 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
  Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUBROUTINE INPSOL in cfx 4.4 amanda-pei CFX 0 May 13, 2010 07:54
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31
CFX 10 User Routine NOT in Fortran Andre CFX 14 August 9, 2006 00:03
user subroutine of inlet boundary raymond CD-adapco 4 December 6, 2001 06:44
CFX User Subroutine Archive David Creech Main CFD Forum 0 March 17, 1999 13:41


All times are GMT -4. The time now is 16:42.