Code covered by the BSD License  

Highlights from
Co-Blade: Software for Analysis and Design of Composite Blades

image thumbnail

Co-Blade: Software for Analysis and Design of Composite Blades

by

 

18 Sep 2012 (Updated )

Analysis and design of composite blades for wind and hydrokinetic turbines

writeOupFileLoads(iSIM, SIM, BLADE, AppLoads, ResLoads, Disp, OUT)
function writeOupFileLoads(iSIM, SIM, BLADE, AppLoads, ResLoads, Disp, OUT)

date = datestr(now, 'mmmm dd, yyyy HH:MM AM');
 
fid = fopen([SIM.rootDir filesep SIM.case{iSIM} '_LoadsDisp.out'], 'w');

fprintf(fid,'=====  Loads and Displacement Output File  =====================================\r\n');
fprintf(fid,'Generated on %s by Co-Blade v%s \r\n', date, SIM.version);
fprintf(fid,'This line is for user comments. \r\n');
fprintf(fid,'\r\n');
fprintf(fid,'tipDeflect (m)\r\n');
fprintf(fid,'%6.4f\r\n', Disp.tipDeflect);
fprintf(fid,'\r\n');

if OUT.TAB_DEL
    dlm = '\t';
    fmtHeadr = [ '%s', repmat( [ dlm, '%s' ], 1, 20 ), '\r\n' ];  
else
    dlm = '  ';
    fmtHeadr = [ '%-6.4s', repmat( [ dlm, '%12.12s' ], 1, 20 ), '\r\n' ];  
end

fmtNumbr = [ '%-6.0f', ...
             dlm, '%12.4f', ...
             repmat( [ dlm, '%12.4e' ], 1, 15 ), ...
             repmat( [ dlm, '%12.4f' ], 1, 4 ), ...
             '\r\n' ];

header = {'sec',  '(-)'; ...
          'zSec', '(m)'; ...
          'px_a', '(N/m)'; ...  
          'py_a', '(N/m)'; ... 
          'qz_a', '(N)'; ... 
          'px_w', '(N/m)'; ... 
          'py_w', '(N/m)'; ... 
          'pz_w', '(N/m)'; ... 
          'px_c', '(N/m)'; ... 
          'py_c', '(N/m)'; ... 
          'pz_c', '(N/m)'; ... 
          'Vx',   '(N)'; ... 
          'Vy',   '(N)'; ... 
          'Vz',   '(N)'; ... 
          'Mx',   '(N-m)'; ... 
          'My',   '(N-m)'; ... 
          'Mz',   '(N-m)'; ... 
          'uo',   '(m)'; ... 
          'vo',   '(m)'; ... 
          'wo',   '(m)'; ... 
          'tz',   '(deg)'};
     
fprintf(fid, fmtHeadr, header{:,1});
fprintf(fid, fmtHeadr, header{:,2});
for i = 1:BLADE.NUM_SEC
    fprintf(fid, fmtNumbr, i, ...
                           BLADE.zSec(i), ...
                           AppLoads.px_a(i), ...    
                           AppLoads.py_a(i), ...    
                           AppLoads.qz_a(i), ...	
                           AppLoads.px_w(i), ...	
                           AppLoads.py_w(i), ...	
                           AppLoads.pz_w(i), ...	
                           AppLoads.px_c(i), ...	
                           AppLoads.py_c(i), ...	
                           AppLoads.pz_c(i), ...	
                           ResLoads.Vx(i), ...	
                           ResLoads.Vy(i), ...	
                           ResLoads.Vz(i), ...	
                           ResLoads.Mx(i), ...	
                           ResLoads.My(i), ...	
                           ResLoads.Mz(i), ...	
                           Disp.uo(i), ...	
                           Disp.vo(i), ...	
                           Disp.wo(i), ...	
                           Disp.tz(i)*180/pi);
end

fclose(fid);

end % function writeOupFileLoads

Contact us