Buildings.Fluids.Sources

Package with source models for species

Information


This package contains source models for species.

Package Content

NameDescription
Buildings.Fluids.Sources.Examples Examples Collection of models that illustrate model use and test models
Buildings.Fluids.Sources.PrescribedExtraPropertyFlowRate PrescribedExtraPropertyFlowRate Source with mass flow that does not take part in medium mass balance (such as CO2)


Buildings.Fluids.Sources.PrescribedExtraPropertyFlowRate Buildings.Fluids.Sources.PrescribedExtraPropertyFlowRate

Source with mass flow that does not take part in medium mass balance (such as CO2)

Buildings.Fluids.Sources.PrescribedExtraPropertyFlowRate

Information


This model adds a mass flow rate to the port for an auxiliary
medium that does not take part in the mass balance of the medium
model. Instead, this mass transfer is tracked separately. A typical
use of this source is to add carbon dioxide to a room, since the 
carbon dioxide concentration is typically so small that it need not be added to the
room mass balance.

Extends from Modelica_Fluid.Sources.BaseClasses.PartialSource (Partial component source with one fluid connector).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model within the source
StringsubstanceName"CO2"Name of trace substance
Booleanuse_m_flow_infalseGet the trace substance mass flow rate from the input connector
MassFlowRatem_flow0Fixed mass flow rate going out of the fluid port [kg/s]

Connectors

TypeNameDescription
FluidPorts_bports[nPorts] 
input RealInputm_flow_inPrescribed mass flow rate for extra property

Modelica definition

model PrescribedExtraPropertyFlowRate 
  "Source with mass flow that does not take part in medium mass balance (such as CO2)"
  extends Modelica_Fluid.Sources.BaseClasses.PartialSource(nPorts=1);


  parameter String substanceName = "CO2" "Name of trace substance";
  parameter Boolean use_m_flow_in = false 
    "Get the trace substance mass flow rate from the input connector";

  parameter Medium.MassFlowRate m_flow = 0 
    "Fixed mass flow rate going out of the fluid port";
  Modelica.Blocks.Interfaces.RealInput m_flow_in if 
       use_m_flow_in "Prescribed mass flow rate for extra property";

protected 
  Modelica.Blocks.Interfaces.RealInput m_flow_in_internal 
    "Needed to connect to conditional connector";
  parameter Medium.ExtraProperty C_in_internal[Medium.nC](
       fixed=false,
       quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
    "Boundary trace substances";
initial algorithm 
  for i in 1:Medium.nC loop
    if ( Modelica.Utilities.Strings.isEqual(Medium.extraPropertiesNames[i], substanceName)) then
      C_in_internal[i] := 1;
    else
      C_in_internal[i] := 0;
    end if;
  end for;
  assert(sum(C_in_internal) > 0, "Trace substance '" + substanceName + "' is not present in medium '"
         + Medium.mediumName + "'.\n"
         + "Check source parameter and medium model.");
equation 
  connect(m_flow_in, m_flow_in_internal);
  if not use_m_flow_in then
    m_flow_in_internal = m_flow;
  end if;

  assert(sum(m_flow_in_internal) >= 0, "Reverse flow for species source is not yet implemented.");
  sum(ports.m_flow) = -m_flow_in_internal;
  medium.T = Medium.T_default;
  medium.Xi = Medium.X_default[1:Medium.nXi];
  ports.C_outflow = fill(C_in_internal, nPorts);
end PrescribedExtraPropertyFlowRate;

HTML-documentation generated by Dymola Fri May 15 10:15:23 2009.