Buildings.Fluid.FMI.BaseClasses

Package with base classes for Buildings.Fluid.FMI

Information

This package contains base classes that are used to construct the models in Buildings.Fluid.FMI.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Fluid.FMI.BaseClasses.X_w_toX X_w_toX Conversion from Xi to X
Buildings.Fluid.FMI.BaseClasses.hOut_toT hOut_toT Conversion from h to T

Buildings.Fluid.FMI.BaseClasses.X_w_toX Buildings.Fluid.FMI.BaseClasses.X_w_toX

Conversion from Xi to X

Buildings.Fluid.FMI.BaseClasses.X_w_toX

Information

Block that converts a scalar input for the water mass fraction Xi to a vector output X. This is needed for models in which a scalar input signal Xi that may be conditionally removed is to be connected to a model with a vector input X, because the conversion from scalar to vector needs to access the conditional connector, but conditional connectors can only be used in connect statements.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model within the source

Connectors

TypeNameDescription
replaceable package MediumMedium model within the source
input RealInputX_wWater mass fraction per total air mass [kg/kg]
output RealOutputX[Medium.nX]Prescribed fluid composition [kg/kg]

Modelica definition

block X_w_toX "Conversion from Xi to X" extends Modelica.Blocks.Icons.Block; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium model within the source"; Modelica.Blocks.Interfaces.RealInput X_w(final unit="kg/kg") if Medium.nXi > 0 "Water mass fraction per total air mass"; Modelica.Blocks.Interfaces.RealOutput X[Medium.nX](each final unit="kg/kg", final quantity=Medium.substanceNames) "Prescribed fluid composition"; protected Modelica.Blocks.Interfaces.RealInput X_w_internal(final unit="kg/kg") "Internal connector for water mass fraction per total air mass"; equation // Conditional connector connect(X_w_internal, X_w); if Medium.nXi == 0 then X_w_internal = 0; end if; // Assign vector to output connector X = if Medium.nX == 1 then ones(Medium.nX) else cat( 1, {X_w_internal}, {1 - X_w_internal}); end X_w_toX;

Buildings.Fluid.FMI.BaseClasses.hOut_toT Buildings.Fluid.FMI.BaseClasses.hOut_toT

Conversion from h to T

Buildings.Fluid.FMI.BaseClasses.hOut_toT

Information

Block that converts enthalpy to temperature.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model within the source

Connectors

TypeNameDescription
replaceable package MediumMedium model within the source
input RealInputhSpecific enthalpy [J/kg]
input RealInputXi[Medium.nXi]Water vapor concentration in kg/kg total air [kg/kg]
output RealOutputTTemperature [K]

Modelica definition

block hOut_toT "Conversion from h to T" extends Modelica.Blocks.Icons.Block; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium model within the source"; Modelica.Blocks.Interfaces.RealInput h(final unit="J/kg") "Specific enthalpy"; Modelica.Blocks.Interfaces.RealInput Xi[Medium.nXi](each final unit="kg/kg") if Medium.nXi > 0 "Water vapor concentration in kg/kg total air"; Modelica.Blocks.Interfaces.RealOutput T(final unit="K", displayUnit="degC") "Temperature"; protected Modelica.Blocks.Interfaces.RealInput Xi_internal[Medium.nXi](each final unit="kg/kg") "Internal connector for water vapor concentration in kg/kg total air"; equation // Conditional connectors connect(Xi_internal, Xi); if Medium.nXi == 0 then Xi_internal = zeros(Medium.nXi); end if; T = Medium.temperature_phX( p=Medium.p_default, h=h, X=Xi_internal); end hOut_toT;