CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

CFX5.5 User Subroutine defining velocity B.C.

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 28, 2003, 10:33
Default CFX5.5 User Subroutine defining velocity B.C.
  #1
David
Guest
 
Posts: n/a
Hi all,

I am using CFX5.5 User Subroutine to define the unsteady velocity inlet boundary condition. It is the function of the location of the cells and diverged time serial. Could the system variables ˇ°u,v,wˇ± be defined as the 2-D arrays? Where I can find some examples of this application. Thanks.
  Reply With Quote

Old   February 28, 2003, 13:57
Default Re: CFX5.5 User Subroutine defining velocity B.C.
  #2
Robin
Guest
 
Posts: n/a
Hi David,

First of all, what is the function? Does it require complicated logic?

Regards, Robin
  Reply With Quote

Old   February 28, 2003, 21:38
Default Re: CFX5.5 User Subroutine defining velocity B.C.
  #3
David
Guest
 
Posts: n/a
Hi Robin,

It is somewhat complicated. The Fortran source code is about 500 lines.Now I am facing the difficulty of translate my code into CFX User Subroutine. Regards, David.
  Reply With Quote

Old   March 2, 2003, 20:06
Default Re: CFX5.5 User Subroutine defining velocity B.C.
  #4
Robin
Guest
 
Posts: n/a
HI David,

What are you simulating at your inlet that requires 500 lines of Fortran?

Regards, Robin
  Reply With Quote

Old   March 2, 2003, 22:21
Default Re: CFX5.5 User Subroutine defining velocity B.C.
  #5
David
Guest
 
Posts: n/a
Hi Robin,

It simulates the stochastic velocity history of the inlet from the frequency domain to time domain, so the arithmetic is complicated. Now I have two questions: 1,How the system time is visited by external subroutine. There are no examples of this aspects in CFX helpfile. 2,It needs to define a kind of arrays in the subroutine.Their dimensions are the funtion of the number of the cell,such as "REAL UU(1:2*1024*NLOC,1:NLOC)".But the Fortan does not permit to do so. How to sovle it? Regards, David.

  Reply With Quote

Old   March 3, 2003, 16:28
Default Re: CFX5.5 User Subroutine defining velocity B.C.
  #6
Robin
Guest
 
Posts: n/a
Hi David,

By stochastic velocity history, I assume then that your functions are more complicated than a combination of trig functions then ( V = A*sin(wt) for instance)?

Solution time may be passed as a variable to your subroutine ( for example: U = myFunction(x,y,z,t) ) or accessed through the MMS(I assume this is what you mean by system time and not your system clock?) . Note that time is only available if you have a transient run.

I am not sure what you mean by your second statement. The arrays you appear to be referring to are available through the User Function Fortran interface. Have you reviewed the Fortran examples in the documentation?

Regards, Robin
  Reply With Quote

Old   March 4, 2003, 04:25
Default Re: CFX5.5 User Subroutine defining velocity B.C.
  #7
David
Guest
 
Posts: n/a
Hi,Robin

The array could be defined such way.I examined it and found that I made a little mistake.

About the first question, I want to get the physical "flow time" of the simulation to control the result obtained by the solver.But I am not sure how to access this system variable in CFX. Just access it as "t"? I post the main part (also I think this part may be something wrong) below:

#include "cfx5ext.h" dllexport(inlet_velocity)

SUBROUTINE INLET_VELOCITY ( NLOC, NRET, NARG, RET, ARGS, CRESLT, CZ,DZ,IZ,LZ,RZ )

....................... !------------------------------------------------------ ! U = RET(1:NLOC,1) ! Y = ARG(1:NLOC,1) ! Z = ARG(1:NLOC,2) !------------------------------------------------------ ........................

CALL USER_INLETV_SUB (NLOC,RET(1,1),ARG(1,1),ARG(1,2)) ........................ END

SUBROUTINE USER_INLETV_SUB (NLOC,U,Y,Z) ........................

CALL SPEEDSIMUIFFT(UU,NF,DF,DELTA,UN,Z, US,FS,OPT,NLOC) !subroutine return the velocity history stored in UU ........................ DO J=0,2*NF*NLOC-1

IF(T.GE.J*DT.AND.T.LT.(J+1)*DT) THEN

DO ILOC=1,NLOC

U(ILOC)=UU(J,ILOC) !J denotes the time serial

ENDDO

ENDIF ENDDO ........................

In the subroutine SPEEDSIMUIFFT() calculating velocity history,I avoid accessing flow time and store the velocity history in 2-D array UU(J,ILOC).J is the integer serial denoting the time sequence.Then I wish to evaluate it to 1-D array U(ILOC) using system varial "t" control(to do so because I don't know whether U could be defined as a 2D array). This is the first time I using CFX user subroutine. Many thanks for your kindly help.

Regards, David.

  Reply With Quote

Old   March 4, 2003, 20:02
Default Re: CFX5.5 User Subroutine defining velocity B.C.
  #8
Robin
Guest
 
Posts: n/a
Hi David,

To store the history, you will need to create a junction box routine and create the necessary user data in the CFX-5 MMS.

This is really too detailed to get into on a forum and I highly recommend getting in touch with your local support representative for help.

Best regards, Robin
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Defining normal velocity on walls mohsen zendehbad FLUENT 0 July 28, 2010 06:51
is there mass outflow or velocity outflow B.C. kk FLUENT 1 April 12, 2007 11:55
Velocity in Porous medium : HELP! HELP! HELP! Kali Sanjay Phoenics 0 November 6, 2006 07:10
How to deal with the user subroutine problem? Particle Siemens 21 May 19, 2006 10:30
discuss user subroutine in CFX Anicorl CFX 6 August 25, 2003 18:01


All times are GMT -4. The time now is 20:26.