% function HP = HPermFromResults(results filename - use [] for prompt,Pressure in PSI,thickness in nm) function HP = HPermFromResults(results,PPSI,thickness) PPSI = 3; thickness = 15; % load results from file if not specified if nargin<1 || isempty(results) %Load results from file [fname,pname] = uigetfile('*_r.mat','Load Results File'); r = load([pname fname],'results'); results = r.results; end radiusNM = [results.pores.EquivDiameter]/(2*results.pixpernm); porPER = [results.nmstats.porosity]*100; Flowsum = 0; for j = 1:length([results.pores.EquivDiameter]); Flow(j) = TongEq(radiusNM(j), porPER, PPSI,thickness); NSFlow(j) = pi*((radiusNM(j)*1e-9)^4)/(8*1e-3)*PPSI*6895/(thickness*1e-9); %Flow prediction of NS Flowsum = Flowsum + Flow(j); end %Flow is calculated in m3/s HPPore = Flow./[results.nmstats.processed_area]*10^14/PPSI*10^9*60; %Hydraulic perm [ul/cm^2/min/PSI] contribution per pore in image %Calculations for output Flowsum = Flowsum*10^9*60; %Flow is calculated in m3/s convert to ul per min NSFlow = sum(NSFlow)*10^9*60;%NS prediction HP = Flowsum./[results.nmstats.processed_area]*10^14/PPSI; %convert to a hydraulic permeability ul/min-PSI-cm2 %Figures used to understand contibutions of individual pores to overall %permeability Uncomment to generate figures in the post of Jan. 1, 2007 dia = sort(radiusNM.*2); figure; subplot(2,1,1) hist(dia,20); xlabel('Flow [m^3/s]','FontSize',20); ylabel('Number of pores','FontSize',20); % title(['Water Flow for ' fname(1:length(fname)-6)], 'Interpreter', 'none','FontSize',14); set(gca,'FontSize',20,'LineWidth',3); subplot(2,1,2) plot(dia,sort(Flow),'x','MarkerSize', 18, 'LineWidth', 3); ylabel('Flow [m^3/s]','FontSize',20); xlabel('Pore Diameter (nm)','FontSize',20); set(gca,'FontSize',20,'LineWidth',3); figure; subplot(2,1,1) hist(dia,20); ylabel('# pores','FontSize',20); % title(['Hydraulic Permeability for ' fname(1:length(fname)-6)], 'Interpreter', 'none','FontSize',14); set(gca,'FontSize',20,'LineWidth',3); title(['Total Permeability is ' num2str(HP) ' uL/min/PSI/cm^2'],'FontSize',20); subplot(2,1,2) plot(dia,sort(HPPore),'x','MarkerSize', 18, 'LineWidth', 3); ylabel('Perm. (uL/min/PSI/cm^2)','FontSize',20); xlabel('Pore Diameter (nm)','FontSize',20); set(gca,'FontSize',20,'LineWidth',3);