CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > CFX

Global variables storage in CFX.

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

LinkBack Thread Tools Display Modes
Old   October 5, 2000, 14:04
Default Global variables storage in CFX.
Fabio Kasper
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.
  Reply With Quote

Old   October 6, 2000, 08:21
Default Re: Global variables storage in CFX.
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
  Reply With Quote


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
How to set environmental variables of Intel Fortran +CFX? Christine MO CFX 0 September 23, 2011 11:11
Storage alloction failed in cfx mesh Mario Tremblay CFX 2 March 6, 2009 11:35
Importing solutions in CFX. Alphonso CFX 1 August 1, 2008 14:01
CFX 4.4 installation problem Pandu Sattvika CFX 1 December 1, 2001 05:07
PHI file structure Eugene Phoenics 9 November 2, 2001 23:00

All times are GMT -4. The time now is 08:40.