|
[Sponsors] |
October 5, 2000, 15:04 |
Global variables storage in CFX.
|
#1 |
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, 09:21 |
Re: Global variables storage in CFX.
|
#2 |
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 |
|
|
|
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 12: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 15: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 |