.Buildings.Fluid.MixingVolumes.BaseClasses.PartialMixingVolume

Information

This is a partial model of an instantaneously mixed volume. It is used as the base class for all fluid volumes of the package Buildings.Fluid.MixingVolumes.

Typical use and important parameters

Set the constant sensibleOnly=true if the model that extends or instantiates this model sets mWat_flow = 0.

Set the constant simplify_mWat_flow = true to simplify the equation

  port_a.m_flow + port_b.m_flow = - mWat_flow;

to

  port_a.m_flow + port_b.m_flow = 0;

This causes an error in the mass balance of about 0.5%, but generally leads to simpler equations because the pressure drop equations are then decoupled from the mass exchange in this component.

To increase the numerical robustness of the model, the constant prescribedHeatFlowRate can be set by the user. This constant only has an effect if the model has exactly two fluid ports connected, and if it is used as a steady-state model. Use the following settings:

Set the parameter use_C_flow = true to enable an input connector for the trace substance flow rate.

Implementation

If the model is (i) operated in steady-state, (ii) has two fluid ports connected, and (iii) prescribedHeatFlowRate=true or allowFlowReversal=false, then the model uses Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation in order to use the same energy and mass balance implementation as is used as in steady-state component models. In this situation, the functions inStream are used for the two flow directions rather than the function actualStream, which is less efficient. However, the use of inStream has the disadvantage that hOut has to be computed, in Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation, using

if allowFlowReversal then
  hOut = Buildings.Utilities.Math.Functions.regStep(y1=port_b.h_outflow,
                                                    y2=port_a.h_outflow,
                                                    x=port_a.m_flow,
                                                    x_small=m_flow_small/1E3);
else
  hOut = port_b.h_outflow;
end if;

Hence, for allowFlowReversal=true, if hOut were to be used to compute the temperature that drives heat transfer such as by conduction, then the heat transfer would depend on upstream and the downstream temperatures for small mass flow rates. This can give wrong results. Consider for example a mass flow rate that is positive but very close to zero. Suppose the upstream temperature is 20°C, the downstream temperature is 10°C, and the heat port is connected through a heat conductor to a boundary condition of 20°C. Then, hOut = (port_b.h_outflow + port_a.h_outflow)/2 and hence the temperature heatPort.T is 15°C. Therefore, heat is added to the component. As the mass flow rate is by assumption very small, the fluid that leaves the component will have a very high temperature, violating the 2nd law. To avoid this situation, if prescribedHeatFlowRate=false, then the model Buildings.Fluid.Interfaces.ConservationEquation is used instead of Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation.

For simple models that uses this model, see Buildings.Fluid.MixingVolumes.

Revisions


Generated at 2024-12-27T19:26:12Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos