clear ; addpath(genpath('.')) % Compression ratio & heat recovery efficiency r = 10 ; % [-] etaRecovery = 0.8 ; % [-] % Units kPa = 1e3 ; % [Pa] g = 1/1000 ; % [kg] kW = 1000 ; % [W] % Ideal gas, air gas.Rbar = 8.314 ; % [J/(mol*K)] gas.M = 28.97 * g ; % [kg/mol] gas.R = gas.Rbar / gas.M ; % [J/(kg*K)] % Constant cp and cv gas.k = 1.4 ; % [-] gas.cv = gas.R / ( gas.k - 1 ) ; gas.cp = gas.k * gas.cv ; % States state1.T = 300 ; % [K] state1.p = 100 * kPa ; % [Pa] state1.v = getVariableFromStateEquation("v", state1, gas) ; % 1-2 (isoentropic compression) state2.p = state1.p * r ; state2 = getStateAfterIsoentropicProcessConst(state1, state2, gas) ; % 2-3 (p=const) state3.T = 1400 ; % [K] state3 = getStateAfterIsobaricProcess(state2, state3, gas) ; % 3-4 (isoentropic expansion) state4.p = state1.p ; state4 = getStateAfterIsoentropicProcessConst(state3, state4, gas) ; % Determination of hx (after regenerative heat exchange) deltaH_24 = gas.cp * ( state4.T - state2.T ) ; deltaH_2x = etaRecovery * deltaH_24 ; stateX.h = gas.cp * state2.T + deltaH_2x ; % Supplied heat [J/kg] qIn = gas.cp * state3.T - stateX.h ; % Compression (1-2) & expansion (3-4, turbine) work per unit mass & rlr lc = gas.cp * ( state2.T - state1.T ) ; lt = gas.cp * ( state3.T - state4.T ) ; % Thermal efficiency & restitution ratio eta = (lt - lc) / qIn