Buildings.Airflow.Multizone.BaseClasses.Examples

Collection of models that illustrate model use and test models

Information

This package contains examples for the use of models that can be found in Buildings.Airflow.Multizone.BaseClasses.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

NameDescription
Buildings.Airflow.Multizone.BaseClasses.Examples.PowerLaw PowerLaw Test model for power law function
Buildings.Airflow.Multizone.BaseClasses.Examples.PowerLawFixedM PowerLawFixedM Test model for power law function
Buildings.Airflow.Multizone.BaseClasses.Examples.WindPressureLowRise WindPressureLowRise Test model for wind pressure function


Buildings.Airflow.Multizone.BaseClasses.Examples.PowerLaw Buildings.Airflow.Multizone.BaseClasses.Examples.PowerLaw

Test model for power law function

Information

This examples demonstrates the Buildings.Airflow.Multizone.BaseClasses.powerLaw function.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Realk2/10^mFlow coefficient, k = V_flow/ dp^m
Realm0.5Flow exponent, m=0.5 for turbulent, m=1 for laminar
Pressuredp_turbulent5Pressure difference where regularization starts [Pa]

Modelica definition

model PowerLaw "Test model for power law function"
  extends Modelica.Icons.Example;
  parameter Real k = 2/10^m "Flow coefficient, k = V_flow/ dp^m";

  parameter Real m(min=0.5, max=1) = 0.5 
    "Flow exponent, m=0.5 for turbulent, m=1 for laminar";
  parameter Modelica.SIunits.Pressure dp_turbulent(min=0)=5 
    "Pressure difference where regularization starts";

  Modelica.SIunits.Pressure dp "Pressure difference";
  Modelica.SIunits.VolumeFlowRate V_flow "Volume flow rate";
equation 
  dp = 10*(-1+2*time);
  V_flow = Buildings.Airflow.Multizone.BaseClasses.powerLaw(dp=dp, k=k, m=m, dp_turbulent=dp_turbulent);
end PowerLaw;

Buildings.Airflow.Multizone.BaseClasses.Examples.PowerLawFixedM Buildings.Airflow.Multizone.BaseClasses.Examples.PowerLawFixedM

Test model for power law function

Information

This examples demonstrates the Buildings.Airflow.Multizone.BaseClasses.powerLaw and Buildings.Airflow.Multizone.BaseClasses.powerLawFixedM functions. They need to return the same function value. This is verified by an assert statement.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Realk2/10^mFlow coefficient, k = V_flow/ dp^m
Pressuredp_turbulent5Pressure difference where regularization starts [Pa]

Modelica definition

model PowerLawFixedM "Test model for power law function"
  extends Modelica.Icons.Example;
  parameter Real k = 2/10^m "Flow coefficient, k = V_flow/ dp^m";

  constant Real m(min=0.5, max=1) = 0.5 
    "Flow exponent, m=0.5 for turbulent, m=1 for laminar";
  parameter Modelica.SIunits.Pressure dp_turbulent(min=0)=5 
    "Pressure difference where regularization starts";

  Modelica.SIunits.Pressure dp "Pressure difference";
  Modelica.SIunits.VolumeFlowRate V_flow 
    "Volume flow rate computed with model powerLaw";
  Modelica.SIunits.VolumeFlowRate VFixed_flow 
    "Volume flow rate computed with model powerLawFixed";

  constant Real gamma(min=1) = 1.5 
    "Normalized flow rate where dphi(0)/dpi intersects phi(1)";
  constant Real a = gamma 
    "Polynomial coefficient for regularized implementation of flow resistance";
  constant Real b = 1/8*m^2 - 3*gamma - 3/2*m + 35.0/8 
    "Polynomial coefficient for regularized implementation of flow resistance";
  constant Real c = -1/4*m^2 + 3*gamma + 5/2*m - 21.0/4 
    "Polynomial coefficient for regularized implementation of flow resistance";
  constant Real d = 1/8*m^2 - gamma - m + 15.0/8 
    "Polynomial coefficient for regularized implementation of flow resistance";

equation 
  dp = 10*(-1+2*time);
  V_flow = Buildings.Airflow.Multizone.BaseClasses.powerLaw(dp=dp, k=k, m=m, dp_turbulent=dp_turbulent);
  VFixed_flow = Buildings.Airflow.Multizone.BaseClasses.powerLawFixedM(
    k=k,
    dp=dp,
    m=m,
    a=a,
    b=b,
    c=c,
    d=d,
    dp_turbulent=dp_turbulent);
  assert(abs(V_flow-VFixed_flow) < 1E-10, "Error: The two implementations of the power law model need to give identical results");
end PowerLawFixedM;

Buildings.Airflow.Multizone.BaseClasses.Examples.WindPressureLowRise Buildings.Airflow.Multizone.BaseClasses.Examples.WindPressureLowRise

Test model for wind pressure function

Information

This examples demonstrates the Buildings.Airflow.Multizone.BaseClasses.windPressureLowRise function.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
RealCp00.6Wind pressure coefficient for normal wind incidence angle
RealGModelica.Math.log(0.5)Natural logarithm of side ratio

Modelica definition

model WindPressureLowRise "Test model for wind pressure function"
  extends Modelica.Icons.Example;
  parameter Real Cp0 = 0.6 
    "Wind pressure coefficient for normal wind incidence angle";
  Modelica.SIunits.Angle incAng "Wind incidence angle (0: normal to wall)";
  parameter Real G = Modelica.Math.log(0.5) "Natural logarithm of side ratio";
  Real Cp "Wind pressure coefficient";
equation 
  incAng=time*2*Modelica.Constants.pi;
  Cp = Buildings.Airflow.Multizone.BaseClasses.windPressureLowRise(Cp0=Cp0, G=G, incAng=incAng);
end WindPressureLowRise;

Automatically generated Thu Dec 8 16:33:18 2011.