Buildings.Obsolete.Fluid.Sources

Package with boundary condition models

Information

Package Sources contains generic sources for fluid connectors to define fixed or prescribed ambient conditions.

Extends from Modelica.Icons.SourcesPackage (Icon for packages containing sources).

Package Content

Name Description
Buildings.Obsolete.Fluid.Sources.FixedBoundary FixedBoundary Boundary source component

Buildings.Obsolete.Fluid.Sources.FixedBoundary Buildings.Obsolete.Fluid.Sources.FixedBoundary

Boundary source component

Buildings.Obsolete.Fluid.Sources.FixedBoundary

Information

This model defines constant values for boundary conditions:

Note, that boundary temperature, density, specific enthalpy, mass fractions and trace substances have only an effect if the mass flow is from the Boundary into the port. If mass is flowing from the port into the boundary, the boundary definitions, with exception of boundary pressure, do not have an effect.

Extends from Buildings.Obsolete.BaseClasses.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions), Buildings.Fluid.Sources.BaseClasses.PartialSource (Partial component source with one fluid connector).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Boundary pressure or Boundary density
Booleanuse_ptrueselect p or d
AbsolutePressurepMedium.p_defaultBoundary pressure [Pa]
DensitydMedium.density_pTX(p=Medium....Boundary density [kg/m3]
Boundary temperature or Boundary specific enthalpy
Booleanuse_Ttrueselect T or h
TemperatureTMedium.T_defaultBoundary temperature [K]
SpecificEnthalpyhMedium.h_defaultBoundary specific enthalpy [J/kg]
Only for multi-substance flow
MassFractionX[Medium.nX]Medium.X_defaultBoundary mass fractions m_i/m [kg/kg]
Only for trace-substance flow
ExtraPropertyC[Medium.nC]fill(0, Medium.nC)Boundary trace substances
Advanced
BooleanverifyInputstrueSet to true to stop the simulation with an error if the medium temperature is outside its allowable range

Connectors

TypeNameDescription
FluidPorts_bports[nPorts]Fluid ports

Modelica definition

model FixedBoundary "Boundary source component" extends Buildings.Obsolete.BaseClasses.ObsoleteModel; extends Buildings.Fluid.Sources.BaseClasses.PartialSource(final verifyInputs=true); parameter Boolean use_p=true "select p or d"; parameter Medium.AbsolutePressure p=Medium.p_default "Boundary pressure"; parameter Medium.Density d=Medium.density_pTX( p = Medium.p_default, T = Medium.T_default, X = Medium.X_default) "Boundary density"; parameter Boolean use_T=true "select T or h"; parameter Medium.Temperature T=Medium.T_default "Boundary temperature"; parameter Medium.SpecificEnthalpy h=Medium.h_default "Boundary specific enthalpy"; parameter Medium.MassFraction X[Medium.nX]( final quantity=Medium.substanceNames) = Medium.X_default "Boundary mass fractions m_i/m"; parameter Medium.ExtraProperty C[Medium.nC]( final quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) "Boundary trace substances"; protected Modelica.Blocks.Interfaces.RealInput T_in_internal(final unit="K", displayUnit="degC") "Needed to connect to conditional connector"; Modelica.Blocks.Interfaces.RealInput p_in_internal(final unit="Pa") "Needed to connect to conditional connector"; Modelica.Blocks.Interfaces.RealInput h_in(final unit="J/kg") "Needed to connect to conditional connector"; Modelica.Blocks.Interfaces.RealInput h_in_internal= Medium.specificEnthalpy(Medium.setState_pTX(p_in_internal, T_in_internal, X_in_internal)); // Modelica.Blocks.Interfaces.RealInput d_in_internal = Medium.density(Medium.setState_pTX(p_in_internal, T_in_internal, X_in_internal)); initial equation Modelica.Fluid.Utilities.checkBoundary(Medium.mediumName, Medium.substanceNames, Medium.singleState, use_p, X, "FixedBoundary"); equation h_in = h; if use_p or Medium.singleState then p_in_internal = p; connect(medium.p, p_in_internal); else p_in_internal = Medium.p_default; connect(medium.p, p_in_internal); end if; if use_T then T_in_internal = T; connect(medium.h, h_in_internal); else T_in_internal = Medium.T_default; connect(medium.h, h_in); end if; X_in_internal = X; connect(X_in_internal[1:Medium.nXi], Xi_in_internal); connect(medium.Xi, Xi_in_internal); ports.C_outflow = fill(C, nPorts); C_in_internal = C; if not verifyInputs then h_in_internal = Medium.h_default; p_in_internal = Medium.p_default; X_in_internal = Medium.X_default; T_in_internal = Medium.T_default; end if; for i in 1:nPorts loop ports[i].p = p_in_internal; ports[i].h_outflow = h_in_internal; ports[i].Xi_outflow = Xi_in_internal; end for; end FixedBoundary;