CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Phoenics (https://www.cfd-online.com/Forums/phoenics/)
-   -   How to difine variable in PIL? (https://www.cfd-online.com/Forums/phoenics/51836-how-difine-variable-pil.html)

luckyluke December 13, 2004 20:43

How to difine variable in PIL?
 
Hi, this is another question from a stupid newbie.

1.It seems that I can define variable in Group 1 or Group 7. What is the difference between them?

2.If I want to use global variable, what should I do? Whether the variable defined in Group 1 or Group 7 can be used along the whole computing process?

3.How to open and write data from a file stored in disk?

Thanks in advance.

A User December 14, 2004 10:00

Re: How to difine variable in PIL?
 
There is no difference between Group 1 and Group 7, it just defines a framework for entering data in an organised fashion. PIL variables can be declared and used anywhere in the Q1 file.

If by global variable you mean declaring 3d storage for a variable that will be stored over the whole field and then written to the RESULT and PHI files, then by way of an example, you can simply put STORE(EPOT) in Group 7 of the Q1 file, where here EPOT could be the electrical potential. If you want to solve a transport equation for this variable, then you would put SOLVE(EPOT) rather than STORE(EPOT). Use of the latter presumes that the user is going to take responsibility for computing this variable from an auxiliary relationship, say via INFORM, PLANT or by the direct use of FORTRAN in GROUND.

Data files can be opened and written to in GROUND by using FORTRAN.



All times are GMT -4. The time now is 01:33.