CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Turbomachinery - change rotation every 30 timesteps (CEL) (https://www.cfd-online.com/Forums/cfx/92115-turbomachinery-change-rotation-every-30-timesteps-cel.html)

 lindner September 2, 2011 13:51

Turbomachinery - change rotation every 30 timesteps (CEL)

Hi,
The title gives a hint, i need to change the rotation of my machine every 30 timesteps, increasing in 10 rpm.
Example: Iteration 1 angular velocity = 120
Iteration 30 angular velocity = 120+10
Iteration 60 angular velocity = 120+10+10
I tought something like this
if(citern=30, AngVel=AngVel+10)
if(citern=60, AngVel=AngVel+10) ...

I never programmed in CEL, so i don't know all the options to script that.
Anyone have an ideia to make this as simple as possible?

 ghorrocks September 2, 2011 18:36

You could write this function using the mod function in CEL, or you could define a 1D interpolation function.

 lindner September 6, 2011 07:03

Thanks ghorrocks, i will try this mod function and post the results later.

 lindner September 6, 2011 08:27

ok, now my rotation speed increases every 30 iterations, see above.

rot = 120 [rev min^-1]
rotVar = rot + r1*yy+r2*yy+r3*yy
r1 = if(citern>=30,1,0)
r2 = if(citern>=60,1,0)
r3 = if(citern>=90,1,0)
yy = 10 [rev min^-1]

Is it possible to make the variable dependent on the RMS residuals instead of iterations? Like if (RMS<0.0001,1,0)
What should be in the place of RMS variable?

thanks

 ghorrocks September 6, 2011 18:56

I don't think the RMS residuals are a CEL variable, so I don't think you have access to it.

 All times are GMT -4. The time now is 14:49.