CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   static variable (

Nico July 17, 2004 05:23

static variable
How can i have a static variable in Cfx (in CCL), this is model an iterative process of forces equilibrium. Therefore the last iteration values will be used to change the values of the next iteration. How can i do that? I have looked at CCL and fortran but apparently there are just function. Any help?


Jeff July 18, 2004 11:38

Re: static variable
1. Create an Additional Variable as a non-transport variable 2. Create a CCL Function which assigns whatever your trying to save to the AV and which gets called at the end of each iteration (Time Step) 3. Use this variable in CEL to set your equilibrium source. 4. Make sure the AV gets initialized to something sensible.


Nico July 20, 2004 04:26

Re: static variable
Actually, this is a free surface with a buoyancy problem. At the end of the first iteration, a difference between object_weight and force_z (buoyancy) will exist, therefore the free surface height will need to be adjusted for the next iteration. To converge, a value which i can use as a cumulative variable is required. At the end of the iteration, i ll find the error in buoyancy/weight, with it i ll change height_SF (free surface height) in a form similar to the following height_SF=height_SF + error, i dont see how to do that in CCL.

All times are GMT -4. The time now is 10:31.