Equations for Simscape component Pipe (2P)
4 views (last 30 days)
Show older comments
Lukas Mårtensson on 31 Mar 2022
Commented: Lukas Mårtensson on 18 Jul 2022
Currently, I'm using the Simscape component Pipe (2P) as part of a larger system, and I want to understand the equations governing the behaviour of the pipe. There are however a few equations that confuse me, for example the calculation of the Nusselt number. The documentation says
But after studying the code, I can't see any so called "blending" of the Nusselt numbers in laminar and turbulent flow. Instead, it seems as if the Nusselt number in subcooled or superheated fluid is calculated as
, where is the Nusselt number in turbulent flow, and is the Nusselt number in laminar flow. Likewise, in the two-phase region, with a mixture of gas and liquid, the Nusselt number is given by
, where is the Nusselt number in the two phase region in the turbulent flow regime. As far as I can see when looking through the code, there is no blending here. Am I missing something, or is there a discrepancy between the documentation and the actual code?
Yifeng Tang on 15 Jul 2022
The blending happens in lines 324-327 (R2022a):
% Smooth transition for heat transfer coefficient between liquid, mixture, and vapor
heat_transfer_coeff = simscape.function.blend( ...
simscape.function.blend(Nu_I*k_I/Dh, Nu_mix_I*k_sat_liq_I/Dh, 0, A.transition_range, alpha_I), ...
Nu_I*k_I/Dh, (1 - A.transition_range), 1, unorm_I);
The simscape.function.blend applies a 3rd order polynomial inside. You can select it and right click to open its code (or Ctrl+D).
function y = blend(y1,y2,x1,x2,x)
% y = blend(y1,y2,x1,x2,x)
% Blend between two values y1 and y2 as x varies between x1 and x2. The
% blending function ensures y is continuous and differentiable in the
% range x1 <= x <= x2.
% Copyright 2017-2018 The MathWorks, Inc.
u = (x-x1)/(x2-x1);
transition = 3*u^2 - 2*u^3;
y = if le(x,x1)
(1-transition)*y1 + transition*y2;
Find more on Two-Phase Fluid Library in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!