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).Name | Description |
---|---|
PowerLaw | Test model for power law function |
PowerLawFixedM | Test model for power law function |
WindPressureLowRise | Test model for wind pressure function |
This examples demonstrates the Buildings.Airflow.Multizone.BaseClasses.powerLaw function.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Type | Name | Default | Description |
---|---|---|---|
Real | k | 2/10^m | Flow coefficient, k = V_flow/ dp^m |
Real | m | 0.5 | Flow exponent, m=0.5 for turbulent, m=1 for laminar |
Pressure | dp_turbulent | 5 | Pressure difference where regularization starts [Pa] |
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;
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.
Type | Name | Default | Description |
---|---|---|---|
Real | k | 2/10^m | Flow coefficient, k = V_flow/ dp^m |
Pressure | dp_turbulent | 5 | Pressure difference where regularization starts [Pa] |
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;
This examples demonstrates the Buildings.Airflow.Multizone.BaseClasses.windPressureLowRise function.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Type | Name | Default | Description |
---|---|---|---|
Real | Cp0 | 0.6 | Wind pressure coefficient for normal wind incidence angle |
Real | G | Modelica.Math.log(0.5) | Natural logarithm of side ratio |
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;