필터 지우기
필터 지우기

.SSC Error: A.viscocity_kin not recognized

조회 수: 1 (최근 30일)
Christos Patrinos
Christos Patrinos 2020년 12월 2일
Hello,
I am trying to replicate a tutorial from Steven Miller regarding the development of a custom orifice.
I copied his code from the video since I could not find it.
However, I get an error that A.viscocity_kin cannot be recognized.
Could you please help me?
The code is the following:
component custom_orifice
nodes
A = foundation.hydraulic.hydraulic; %A:left
B = foundation.hydraulic.hydraulic; %B:right
end
variables
q = { 1 , 'm^3/s'}; %Volumetric flow rate
p = { 0 , 'Pa'}; %Pressure
Re = { 1 , 'l'}; %Reynolds number
end
parameters
area = {1e-5, 'm^2'}; % Orifice area
Cd = {0.7, '1' }; % Flow discharge coefficient
Recr = {12, '1' }; % Critical Reynolds number
end
% parameters (Access=private)
% density = {850, 'kg/m^3'};
% viscocity_kin = {9.8866e-6, 'm^2/s'};
% Dh = { 1, 'm'};
% end
function setup %#simple
if area <= 0
error('Orifice area must be greater than zero')
end
Dh = sqrt(4*area/pi);
density = A.density; %use domain parameter from node A
viscocity_kin = A.viscocity_kin; %use domain parameter from node A
end
branches
q: A.q -> B.q;
end
equations
p == A.p - B.p;
Re == q/(area*viscocity_kin)*Dh;
if(abs(Re)>=Recr) %Turbulent flow
q == Cd*area*sqrt(2/density*abs(p))*sign(p);
else %Laminar flow
q == 2*(Cd/sqrt(Recr))^2*area*Dh*p/(viscocity_kin*density);
end
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Foundation and Custom Domains에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by