SimScape dynamic compressor / fan modelling with characteristic curve of Pressure Difference to Volumeflow

8 views (last 30 days)
Hi Community,
I am currently working on my masterthesis and want to start with physical modelling using Simscape. Therefore I try to model my air-ventilation test bench as a simscape model with the one restriction that I dont have the SimHydraulic Toolbox.
My Problem consists of the fact that I want to model a realistic Fan-Unit which "feels" the counterpressure of the control path behind it (like CAVs, Ducts, etc.) and calibrates the volumeflow similar to the characteristic V_flow/Pressure Difference-Curve I got from the Fan-Producer.
Therefore I made a small example to find out, how I can solve the Problem and find stable numerical Solutions for it. The characteristic curves for a fan and a duct look like this (Fan starts in Point (0,400) the colors can hardly been seen):
the System should end up in the crossingpoint somewhere around 9.54 m3/h where the fan produces the same pressure difference as the duct uses up.
so i wrote a "duct.ssc" model with the curve:
component Duct < foundation.pneumatic.vertical_branch
parameters
resistance = {1/10000, 'Pa*s^2/kg^2'};
end
parameters (Access = private)
gas_flow_reference_conv = {1, 'kg/s/Pa^2' }; % Mass flow rate unitconvert
gas_flow_unit= {1, 'kg/s'};
end
equations
gas_flow == sqrt(pressure_difference/resistance);
% Heat equation
temperature_difference == 0;
end
end
And the "Fan.ssc" Model based on a pipe model of mathworks:
component Fan_v2 < foundation.pneumatic.absolute_branch
parameters(Access = private)
p_min = { 0.01, 'Pa' }; % Minimum absolute pressure expected in simulation
T_min = { 0.01, 'K' }; % Minimum absolute temperature expected in simulation
p_gradient_min = { 100, '1/Pa' }; % 1/p_min
T_gradient_min = { 100, '1/K' }; % 1/T_min
p_offset_min = { log(0.01), '1' }; % log(p_min)
T_offset_min = { log(0.01), '1' }; % log(T_min)
T_unit = { 1, 'K'}; % Units of temperature
p_unit = { 1, 'Pa'}; % Units of pressure
gas_flow_reference_conv = {1, 'kg/s/Pa^2' }; % Mass flow rate unitconvert
gas_flow_unit= {1, 'kg/s'};
end
equations
let
% Use logs of absolute pressures and temperatures plus linear extrapolation for
% pressures and temperatures below T_min and p_min to prevent divide by zero
% in flow equations.
logP1 = if p1<p_min, p_offset_min + p_gradient_min*(p1 - p_min) else log(p1) end;
logP2 = if p2<p_min, p_offset_min + p_gradient_min*(p2 - p_min) else log(p2) end;
logT1 = if T1<T_min, T_offset_min + T_gradient_min*(T1 - T_min) else log(T1) end;
logT2 = if T2<T_min, T_offset_min + T_gradient_min*(T2 - T_min) else log(T2) end;
% Flow direction - "dir" is positive if flow is from port A to port B, otherwise negative
% should not happen, maybe create something like a lock valve
% A fan is a compressor it wants to compress the air therefore p2 must be larger than p1
dir = if p2>p1, 1 else -1 end;
% Upstream and downstream pressures and temperatures
[p_u, p_d, T_u, T_d] = if dir>0, ...
p_unit*exp(logP1); p_unit*exp(logP2); T_unit*exp(logT1); T_unit*exp(logT2) else ...
p_unit*exp(logP2); p_unit*exp(logP1); T_unit*exp(logT2); T_unit*exp(logT1) end;
in
if dir>0 %a->B
G==400*gas_flow_unit-(p_u-p_d)^2*gas_flow_reference_conv;
else %B->A
G==0;
end
Q1 == G*A.c_p*T1;
Q2 == -G*A.c_p*T1;
end
end
end
But this dont works, I always get something like:
steady state solve failed to converge.
...Nonlinear solver to advance time one step failed to converge due to Linear Algebra error. Failed to solve using iteration matrix.
......Equations of one or more components may be dependent or inconsistent. This can cause problems in transient initialization. Here is the set of components involved:
'Fan_Min_Example/ Pneumatic Atmospheric Reference '
Equation location is:
'C:/Program Files/MATLAB/R2014a/toolbox/physmod/simscape/library/m/+foundation/+pneumatic/+elements/atmospheric_reference.ssc' (line 26)
'Fan_Min_Example/Constant Volume Pneumatic Chamber'
Equation locations are:
'C:/Program Files/MATLAB/R2014a/toolbox/physmod/simscape/library/m/+foundation/+pneumatic/vertical_one_port.ssc' (line 29)
'C:/Program Files/MATLAB/R2014a/toolbox/physmod/simscape/library/m/+foundation/+pneumatic/+elements/chamber.ssc' (line 39)
'Fan_Min_Example/Duct'
Equation locations are:
'C:/Program Files/MATLAB/R2014a/toolbox/physmod/simscape/library/m/+foundation/+pneumatic/vertical_branch.ssc' (line 28)
'D:/Studium/Masterarbeit/Matlab/Simscape/Library/+MasterarbeitSimscape/+PneumaticElements/Duct.ssc' (line 19)
'Fan_Min_Example/Thermal Reference'
Equation location is:
'C:/Program Files/MATLAB/R2014a/toolbox/physmod/simscape/library/m/+foundation/+thermal/+elements/reference.ssc' (line 22)
Component: Simulink | Category: Block error
I hope I described my problem or the things I want to do well enough and look foreward to your answers. Just to let you know my system is built up like this:
atmosphere reference - Fan-Modell - Const. Vol. Pneu. Chamber - Duct - Atmo. reference

Answers (2)

ahmed abd alaziz
ahmed abd alaziz on 28 Aug 2016
i have the same error if you reach a suitable solution please help me ??

Tobias Hörberg
Tobias Hörberg on 13 Apr 2017
Hi, did you solve your problem? It would be great to have a working Ventilator!

Products

Community Treasure Hunt

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

Start Hunting!