.Annex60.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 Annex60.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 Annex60.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 Annex60.Fluid.Interfaces.StaticTwoPortConservationEquation, using

if allowFlowReversal then
  hOut = Annex60.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 Annex60.Fluid.Interfaces.ConservationEquation is used instead of Annex60.Fluid.Interfaces.StaticTwoPortConservationEquation.

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

Revisions


Generated at 2024-12-22T19:25:51Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos