
[Sponsors] 
April 15, 2004, 15:13 
Angle variable under CEL.

#1 
Guest
Posts: n/a

I'm working on a multiphase rotating frame of reference test case. As long as I apply the rotation (which is not constant) I have to correct the gravity components (i.e. a function of the domain rotation). This issue is explained on the manual but I could not find which is the name of the angle variable which is printed in the out file as the simulation runs. An example of the output is given below:
================================================== ==================== TIME STEP = 544 SIMULATION TIME = 2.85E+01 CPU SECONDS = 3.34E+05 (THIS RUN: 7 7.90E01 2.71E+02)  Domain: Rotor rotated 1.67E+02 degrees ( 0.464 pitches)  Domain interface: Slide Interface Nonoverlap area fraction on side 1 = 0.0 % Nonoverlap area fraction on side 2 = 0.0 % Pitch ratio: (area side 1)/(area side 2) = 1.000  I want to capture this angle (1.67E+02 degrees) to apply a CEL expression of the gravity components like this: GravX = 9.81 [m s^2] * sin(alpha) GravY = 9.81 [m s^2] * cos(alpha) I look at the CFX5RULES and CFX5VAR files but it didn't help at all. The manual suggests that I should build the gravity expression as a function of the angular velocity (which, by the way, is function of time). However, the angular velocity is not constant and is hard to figure out what is the exact angle to perform the CEL expression. Therefore I'm looking a way to get this angle to implement the expression. How is the internal solver name of this variable and how can I get it into CEL? Thanks in advance, G. G. 

April 15, 2004, 16:29 
Re: Angle variable under CEL.

#2 
Guest
Posts: n/a

Unfortunately, that variable is not available via CEL and you will require detailed explanation (developer help) of how to access it via User Fortran.
However, since you know the expression for angular velocity, you could integrate it analitically/numerically and create a local angle variable. Then, you match the gravity vector with your local angle variable.. Good luck, Juan Carlos 

November 17, 2012, 14:51 
Rotated degrees or pitches of rotating domain

#3 
Member
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 7 
Has this functionality changed in CFX since these posts? I have a rotating domain and a stationary domain and I would like to output to a monitor (or somewhere) how many degrees or pitches that my rotating domain has traveled. This value appears in the output file, but does not appear to be available as a variable or expression. Even the relative angle between the rotating and stationary domains would be enough.
Could the variable theta be used at all, applied to the rotating domain for example? Thanks, Shawn 

November 17, 2012, 20:06 

#4 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 13,535
Rep Power: 104 
Not sure, why not just try it and find out?


November 18, 2012, 15:07 

#5 
Member
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 7 
I looked through the help files but couldn't find any variables for "rotated degrees" or similar. I tried a couple names like "rotated" "rotateddegrees" etc. but all gave me errors.
I'm also not sure how to use "theta" in an expression. Tried theta@blade1 and theta()@blade1 but both gave errors. Apparently theta on its own is not single valued. I had considered using time and multiplying by the rotation speed, but since I may have used anoter different speed case as the IC's, the speed would not be have been constant. I wouldn't have a problem if rounding errors didn't very slowly cause the angular displacement to drift off the 1 degree increments I set. After maybe 4000 timesteps instead of 4000 degrees I'm at 4000.7, for example. The problem keeps getting worse if I use the results from one case as the IC's for another. 

November 18, 2012, 16:47 

#6 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 13,535
Rep Power: 104 
Try the variable "Rotation Velocity". Multiply that by time (and assuming it is constant) you have it. Theta is an available variable but I am not quite sure how to call it.
Also if you use a CEL expression to set the rotational velocity and then use that same expression to calculate theta you should not have the precision error. 

November 19, 2012, 00:00 

#7 
Member
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 7 
Hi Glenn,
I used the CEL expression "1 [s] * ( 60 / 158 ) / 360" to set my timesteps as 1 degree increments corresponding an angular speed of 158 RPM for my rotating domain. The rotating domain speed was simply set as 158 with the rev/min option chosen. Rotational velocity is constant within each case. I don't know how to calculate theta, or how to reference it to a single location or value. Error says that theta is a field variable. 

November 19, 2012, 06:09 

#8 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 13,535
Rep Power: 104 
You could convert theta to a single value with avg(theta)@domain_name.
Alternately: If you define some values with CEL, like: TimeStep=1[s] RotSpeed=158 [rpm] Then set your time step equal to TimeStep, the rotational velocity as RotSpeed and then theta will be TimeStep*RotSpeed. This might improve the accuracy of the calculation. 

November 20, 2012, 17:35 

#9 
Senior Member
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 278
Rep Power: 14 

November 20, 2012, 18:28 

#10 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 13,535
Rep Power: 104 
Yes, well spotted. Thanks for the correction.


November 25, 2012, 11:50 

#11 
Member
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 7 
I tried ave(theta)@Rotor and got the error that the "solver does not support the use of this variable in this context." Tried a couple other quantitative functions too like volume(), volumeAve() and areaAve() with the same result. Oh well...
I've defined my values a bit differently now with CEL so I'll see how that works out. Thanks for the help 

November 26, 2012, 07:29 

#12 
Senior Member
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 278
Rep Power: 14 
The solver won't let you calculate averages of some variables, but I think you can trick it into doing that by creating an algebraic additional variable that is equal to the variable you want to measure (theta, in your case) and then average this variable instead.
But what about just getting the theta value from time and rotational speed? That didn't work out? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Import netgen mesh to OpenFOAM  hsieh  Open Source Meshers: Gmsh, Netgen, CGNS, ...  32  September 13, 2011 05:50 
emag beta feature: charge density  charlotte  CFX  4  March 22, 2011 10:14 
error in COMSOL:'ERROR:6164 Duplicate Variable'  bhushas  Main CFD Forum  1  May 30, 2008 04:35 
Env variable not set  gruber2  OpenFOAM Installation  5  December 30, 2005 05:27 
Replace periodic by inletoutlet pair  lego  CFX  3  November 5, 2002 21:09 