# Global variables storage in CFX.

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

 October 5, 2000, 14:04 Global variables storage in CFX. #1 Fabio Kasper Guest   Posts: n/a Hi everyone. I'm a chemical engineering student and I have a simple question, but I don't know how to proceed with it. Is there a way to store global variables in the User Fortran supplied with CFX? When an user variable is stored, this one is only stored when the subroutine is called. In the next call, this variable is stored again, and looses its previous information. So, if I want to do a summation of a variable along the time, I won't be able to do it, because my variable is a local variable kind. Hence this happens because the variable is not specified at the main program code. Whenever I need something like this, I use to work with files, so I store the variable into a file and in the next iteration I read it for calculations. I keep storing it until simulations ends, but sometimes this strategy gives me several problems. So, anyone could give some more alternatives to proceed with this fact ? Thanks in advance. Fabio Kasper.

 October 6, 2000, 08:21 Re: Global variables storage in CFX. #2 Fabian Guest   Posts: n/a Hi Fabio, yes, there is a way how you can retain all values of every single variable from any subroutine. First, you have to understand that all values are stored in three huge arrays, WORK, IWORK, CWORK, (Real, Integer and Character, respectively). Only thing you have to do to get the value of a specific variable is to obtain the pointer of that variable in the field. This is achieved by the routine "CALL GETADD". To get the pointer to the variable stack, you use this funcion as follows: ('Calling routine','VAR ','VAR ',ILEVEL,JVAR). The pointer to the variables in the WORK stack then is JVAR. To obtain the value of say the V-velocity, you have to add NNODE, because V veocity has the variable number 2. So the v-velocity of the first node is stored in WORK(JVAR-1+NNODE). This is all explained in the solver manual in Chapter 11.5 Hope this helps Fabian

 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 Christine MO CFX 0 September 23, 2011 11:11 Mario Tremblay CFX 2 March 6, 2009 11:35 Alphonso CFX 1 August 1, 2008 14:01 Pandu Sattvika CFX 1 December 1, 2001 05:07 Eugene Phoenics 9 November 2, 2001 23:00

All times are GMT -4. The time now is 23:43.