-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsteamToLiquid.m
More file actions
24 lines (23 loc) · 907 Bytes
/
steamToLiquid.m
File metadata and controls
24 lines (23 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function res = steamToLiquid(~, lazyParams) %DEPRECIATED, params no longer aligned, needs to be updated
params = lazyParams.';
specificHeatLiquid = params(5);
specificHeatSteam = params(6);
steamSA = params(11);
steamLiquidCoefficient = params(12);
steamEnergy = params(17);
liquidEnergy = params(18);
steamMass = params(16);
liquidMass = params(19);
deltaTemp = energyToTemperature(steamEnergy, steamMass, specificHeatSteam) - energyToTemperature(liquidEnergy, liquidMass, specificHeatLiquid);
flow = steamLiquidCoefficient * steamSA * deltaTemp;
newParams = zeros(1, length(params));
newParams(18) = flow;
newParams(17) = -flow;
res = newParams.';
end
function res = energyToTemperature(U, m, c)
res = U / heatCapacity(m,c);
end
function res = heatCapacity(mass, specificHeat)
res = mass * specificHeat;
end