Simulink - Simscape HTC input using model parameters

4 views (last 30 days)

Hi,
I'm trying to define a variable convective heat transfer coefficient using model parameters (i.e. temperature) in the simulink model shown below. Is there a way to define this?

I get this error when I run the simulation ' ...or the model referenced by it contains a block that updates persistent or state variables while computing outputs and is not supported in an algebraic loop. It is in an algebraic loop with the following blocks.'
So does that mean we can't define the conv_HTC as a function of temperature or is there a way to do it?

Many thanks

  4 Comments
Youssef Noureddine
Youssef Noureddine on 10 Nov 2022
Edited: Youssef Noureddine on 10 Nov 2022
Hi Delika,
Can you provide the contents of the "variable convective heat transfer" block? I would recommend continuing with this for now as it seems you are not encountering any errors. I would however suggest simplifying the model (blocks like temperature 1 and temperature 2 seem identical and may cause additional confusion).
Since I do not know what the contents of your custom block are, I cannot tell for certain if you will run into an error, but if you do, feel free to attach it here so we can understand what the exact issue simscape is running into is.
Delika Weragoda
Delika Weragoda on 10 Nov 2022
Hi Youssef,
Thanks, yeah I figured there is an extra temp sensor when I uploaded. Did change it afterwards. Please see the content for the variable convective HT block below.
-----------------------------------------------------------------------------------------------
inputs
T_diff = {1, 'K'}; % S:bottom
end
parameters
k = {0.598, 'W/(m*K)'}; %Thermal conductivity of water (W/mK)
C_p = {4200, 'J/(kg*K)'}; %specific heat capacity of the liquid (J/kgK)
beta = {210e-6, '1/K'}; %Volumetric thermal expansion coefficient
mu = {8.9e-4, 'kg/(m*s)'}; %Dynamic viscosity of water (Pa.s)
rho = {998.2, 'kg/m^3'}; %Density of water
g = {9.81, 'm/s^2'}; %acceleration due to gravity
%Battery dimensions
Bat_width = {160e-3, 'm'}; %Width of the battery (m)
Bat_height = {227e-3, 'm'}; %Height of the battery (m)
Bat_thickness = {7.25e-3, 'm'}; %Thicknesss of the battery (m)
end
parameters (Access=private)
nu = mu/rho; %Kinematic viscosity
alpha = k/(rho*C_p); %Thermal diffusivity
Vol_of_cell = Bat_height*Bat_width*Bat_thickness; %Volume of the pouch cell
Surf_area_cell = 2*Bat_height*Bat_width; %Surface of cooling of the cell (only one surface considered)
L = Vol_of_cell/Surf_area_cell %Lenght scale of the cell
end
nodes
A = foundation.thermal.thermal; % A:bottom
B = foundation.thermal.thermal; % B:top
end
variables (Access=private, Conversion=relative)
T = {0, 'K'}; % Temperature difference
end
variables (Access=private)
Q = {0, 'W'}; % Heat flow rate
end
branches
Q : A.Q -> B.Q;
end
equations
T == A.T - B.T;
%Equation for heat transfer coefficient is embedded in the following equation
Q == Surf_area_cell *((k/L)*(0.68 + ((0.67*((g*beta*T_diff*L^3)/(nu*alpha))^(1/4))/(1 + ((0.492*k)/(C_p*mu))^(9/16))^(4/9))))* T;
end
end
---------------------------------------------------
Cheers
Delika

Sign in to comment.

Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!