calculate Cp history (from Fluent) using Matlab


input data : unscaled time history of moment/thrust from ANSYS fluent

example of input data, "moment.out"

# iteration     moment
4283 6.983 -0.1910873139538953
4284 6.984 -0.191019809738711
4285 6.985 -0.1909838904131738
4286 6.986 -0.190943968230172
4287 6.987 -0.1908886443401208
4288 6.988 -0.1908541205872921

1. To load input data:
> load moment.out

2.  extract *time* and *unscaled moment* and assign it to a variable named "m"
> m=moment(:, 3);    # assign the 3rd column data of "moment.out" to variable "m"
> time = moment(:,2);

3. calculating power coefficient, Cp
cp=coeff(m);  # "coeff " is a function to calculate the Cp of 3 rotor  based on input moment (one rotor )

function cp=coeff(m)
% v : velocity
% m : unscaled moment of one blade
% rho : density
% cp : power coefficient of 3 blades
% omega: angular velocity, rad/s
v = 0.6;
A = 0.166;
omega = 11.087;
rho = 998.2;
cp=(3*m*omega)/(0.5*rho*v*v*v*A)

 


4. assign "time" and "cp" variables to a new variable "cp_his"
> cp_his = [time cp];

5. save the workspace variable, "cp_his", to a txt file
> save -ascii cp_his.txt cp_his
## syntax: save ; file format; export file name; variable

6. plotting the time history of Cp
> plot (time, cp);

posted @ 2019-03-01 16:59  kaiming_ai  阅读(309)  评论(0编辑  收藏  举报