K-Value Calculator
K-Value Calculator
m 1 of 2
% clear workspace variables, clear command window and close all figures at the start
clear all
clc
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Measured values from experiment %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
--------------------------------------------------------------------------------------
--
% below are some mock values (not real experimental values)that you can try plotting
with
% Angle = [0 10 20 30 40 50 60 70];
% Q_L_per_min = [20 19.5 19 18.5 18 17.5 17 16.5];
% DP_mbar = [10 20 30 50 70 100 150 220];
%
--------------------------------------------------------------------------------------
--
%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calculations %
%%%%%%%%%%%%%%%%%%%%%%%%%%
% specify constants
rho = 998 % in kg/m3
D = 0.021 % pipe diameter in m
clc
disp('Q in m^3/s is')
disp(Q_m3_per_s)
disp('DeltaP is')
disp(DP_Pa)
disp('Fractional Opening is')
disp(F_opening)
disp('Velocity is')
disp(v)
disp('K value is')
disp(K)
%%%%%%%%%%%%%%
% Plotting %
%%%%%%%%%%%%%%
semilogy(F_opening,K, "rs-")
xlabel('Fractional Opening')
ylabel('K Value')
title('K Value Against Fractional Opening')
% plot loss curve using semilog scale, use the 'semilogy' function instead
13/05/22 8:27 PM /Users/kodersale.../K_ValueCalculator.m 2 of 2