Name | Description |
---|---|
BaseClasses | Package with base classes for mixing volumes |
Examples | Collection of models that illustrate model use and test models |
MixingVolume | Mixing volume with inlet and outlet ports (flow reversal is allowed) |
MixingVolumeDryAir | Mixing volume with heat port for latent heat exchange, to be used with dry air |
MixingVolumeMoistAir | Mixing volume with heat port for latent heat exchange, to be used with media that conatin water |
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Volume | V | Volume [m3] | |
Ports | |||
Boolean | use_portsData | false | = false to neglect pressure loss and kinetic energy |
VesselPortsData | portsData[nPorts] | Data of inlet/outlet ports | |
Assumptions | |||
Dynamics | |||
Dynamics | energyDynamics | system.energyDynamics | Formulation of energy balance |
Dynamics | massDynamics | system.massDynamics | Formulation of mass balance |
Heat transfer | |||
Boolean | use_HeatTransfer | false | = true to use the HeatTransfer model |
replaceable model HeatTransfer | IdealHeatTransfer | Wall heat transfer | |
Initialization | |||
AbsolutePressure | p_start | system.p_start | Start value of pressure [Pa] |
Boolean | use_T_start | true | = true, use T_start, otherwise h_start |
Temperature | T_start | if use_T_start then system.T... | Start value of temperature [K] |
SpecificEnthalpy | h_start | if use_T_start then Medium.s... | Start value of specific enthalpy [J/kg] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
Advanced | |||
Port properties | |||
MassFlowRate | m_flow_small | system.m_flow_small | Regularization range at zero mass flow rate [kg/s] |
Type | Name | Description |
---|---|---|
VesselFluidPorts_b | ports[nPorts] | Fluid inlets and outlets |
HeatPort_a | heatPort |
model MixingVolume "Mixing volume with inlet and outlet ports (flow reversal is allowed)" extends Modelica_Fluid.Vessels.ClosedVolume(m(start=V*rho_nominal, fixed=false), use_portsData=false); protected parameter Medium.ThermodynamicState sta0 = Medium.setState_pTX(T=T_start, p=p_start, X=X_start[1:Medium.nXi]); parameter Modelica.SIunits.Density rho_nominal=Medium.density(sta0) "Density, used to compute fluid mass"; end MixingVolume;
This model represents the same physics as Buildings.Fluids.MixingVolumes.MixingVolume, but in addition, it allows adding (or subtracting) water in liquid phase, which causes a change in enthalpy and species concentration. The water flow rate is assumed to be added or extracted at the temperature of the input port TWat, or if this port is not connected at the medium default temperature as returned by Medium.T_default.
Note that this model can only be used with medium models that include water as a substance. In particular, the medium model need to provide the function enthalpyOfLiquid(T) and the integer variable Water that contains the index to the water substance. For medium that do not provide this functionality, use instead the model Buildings.Fluids.MixingVolumes.MixingVolumeDryAir.
Extends from BaseClasses.PartialMixingVolumeWaterPort (Partial mixing volume that allows adding or subtracting water vapor).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Volume | V | Volume [m3] | |
Assumptions | |||
Dynamics | |||
Dynamics | energyDynamics | system.energyDynamics | Formulation of energy balance |
Dynamics | massDynamics | system.massDynamics | Formulation of mass balance |
Heat transfer | |||
Boolean | use_HeatTransfer | false | = true to use the HeatTransfer model |
replaceable model HeatTransfer | Modelica_Fluid.Vessels.BaseC... | Wall heat transfer | |
Initialization | |||
AbsolutePressure | p_start | system.p_start | Start value of pressure [Pa] |
Boolean | use_T_start | true | = true, use T_start, otherwise h_start |
Temperature | T_start | if use_T_start then system.T... | Start value of temperature [K] |
SpecificEnthalpy | h_start | if use_T_start then Medium.s... | Start value of specific enthalpy [J/kg] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
Type | Name | Description |
---|---|---|
FluidPorts_b | ports[nPorts] | Fluid outlets |
HeatPort_a | heatPort | |
input RealInput | mWat_flow | Water flow rate added into the medium [kg/s] |
input RealInput | TWat | Temperature of liquid that is drained from or injected into volume [K] |
output RealOutput | XWat | Species composition of medium |
model MixingVolumeDryAir "Mixing volume with heat port for latent heat exchange, to be used with dry air" extends BaseClasses.PartialMixingVolumeWaterPort; equation if cardinality(mWat_flow) == 0 then mWat_flow = 0; end if; if cardinality(TWat) == 0 then TWat = Medium.T_default; end if; HWat_flow = 0; mXi_flow = zeros(Medium.nXi); // Assign output port XWat = 0; end MixingVolumeDryAir;
This model represents the same physics as Buildings.Fluids.MixingVolumes.MixingVolume, but in addition, it allows adding (or subtracting) water in liquid phase, which causes a change in enthalpy and species concentration. The water flow rate is assumed to be added or extracted at the temperature of the input port TWat, or if this port is not connected, at the medium default temperature as defined by Medium.T_default.
Note that this model can only be used with medium models that include water as a substance. In particular, the medium model need to provide the function enthalpyOfLiquid(T) and the integer variable Water that contains the index to the water substance. For medium that do not provide this functionality, use instead the model Buildings.Fluids.MixingVolumes.MixingVolumeDryAir.
Extends from BaseClasses.PartialMixingVolumeWaterPort (Partial mixing volume that allows adding or subtracting water vapor).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Volume | V | Volume [m3] | |
Assumptions | |||
Dynamics | |||
Dynamics | energyDynamics | system.energyDynamics | Formulation of energy balance |
Dynamics | massDynamics | system.massDynamics | Formulation of mass balance |
Heat transfer | |||
Boolean | use_HeatTransfer | false | = true to use the HeatTransfer model |
replaceable model HeatTransfer | Modelica_Fluid.Vessels.BaseC... | Wall heat transfer | |
Initialization | |||
AbsolutePressure | p_start | system.p_start | Start value of pressure [Pa] |
Boolean | use_T_start | true | = true, use T_start, otherwise h_start |
Temperature | T_start | if use_T_start then system.T... | Start value of temperature [K] |
SpecificEnthalpy | h_start | if use_T_start then Medium.s... | Start value of specific enthalpy [J/kg] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
Type | Name | Description |
---|---|---|
FluidPorts_b | ports[nPorts] | Fluid outlets |
HeatPort_a | heatPort | |
input RealInput | mWat_flow | Water flow rate added into the medium [kg/s] |
input RealInput | TWat | Temperature of liquid that is drained from or injected into volume [K] |
output RealOutput | XWat | Species composition of medium |
model MixingVolumeMoistAir "Mixing volume with heat port for latent heat exchange, to be used with media that conatin water" extends BaseClasses.PartialMixingVolumeWaterPort; // redeclare Medium with a more restricting base class. This improves the error // message if a user selects a medium that does not contain the function // enthalpyOfLiquid(.) replaceable package Medium = Modelica.Media.Interfaces.PartialCondensingGases; protected parameter Integer iWat(min=1, fixed=false) "Index for water substance"; initial algorithm iWat :=1; if cardinality(mWat_flow) > 0 then for i in 1:Medium.nXi loop if Modelica.Utilities.Strings.isEqual(Medium.substanceNames[i], "Water") then iWat :=i; end if; end for; end if; equation if cardinality(mWat_flow) == 0 then mWat_flow = 0; HWat_flow = 0; mXi_flow = zeros(Medium.nXi); else if cardinality(TWat) == 0 then HWat_flow = mWat_flow * Medium.enthalpyOfLiquid(Medium.T_default); else HWat_flow = mWat_flow * Medium.enthalpyOfLiquid(TWat); end if; for i in 1:Medium.nXi loop mXi_flow[i] = if ( i == iWat) then mWat_flow else 0; end for; end if; // Medium species concentration XWat = medium.X[iWat]; end MixingVolumeMoistAir;