# CFX5.5 User Subroutine defining velocity B.C.

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

 February 28, 2003, 10:33 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.

 February 28, 2003, 13:57 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

 February 28, 2003, 21:38 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.

 March 2, 2003, 20:06 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

 March 2, 2003, 22:21 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.

 March 3, 2003, 16:28 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

 March 4, 2003, 04:25 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.

 March 4, 2003, 20:02 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

 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 mohsen zendehbad FLUENT 0 July 28, 2010 05:51 kk FLUENT 1 April 12, 2007 10:55 Kali Sanjay Phoenics 0 November 6, 2006 07:10 Particle Siemens 21 May 19, 2006 09:30 Anicorl CFX 6 August 25, 2003 17:01

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