Buildings.Fluid.Sensors.Conversions.Examples

Collection of models that illustrate model use and test models

Information

This package contains examples for the use of models that can be found in Buildings.Fluid.Sensors.Conversions.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

NameDescription
Buildings.Fluid.Sensors.Conversions.Examples.To_VolumeFraction To_VolumeFraction Example problem for conversion model


Buildings.Fluid.Sensors.Conversions.Examples.To_VolumeFraction Buildings.Fluid.Sensors.Conversions.Examples.To_VolumeFraction

Example problem for conversion model

Buildings.Fluid.Sensors.Conversions.Examples.To_VolumeFraction

Information

This example demonstrates the modeling of a room with one person and CO2 control. The room has a volume of 4*4*2.7 m3, and the CO2 inflow is from one person. A control system regulates the outside air to maintain a CO2 concentration of 1000 PPM in the room. The outside air has a CO2 concentration of 300 PPM. Note that for simplicity, we allow zero outside air flow rate if the CO2 concentration is below the setpoint, which does not comply with ASHRAE regulations.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model To_VolumeFraction "Example problem for conversion model"
  extends Modelica.Icons.Example;
  import Buildings;
  package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir(extraPropertiesNames={"CO2"});

  Buildings.Fluid.Sensors.Conversions.To_VolumeFraction conMasVolFra(MMMea=
        Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM) 
    "Conversion from mass fraction CO2 to volume fraction CO2";
  Modelica.Blocks.Sources.Constant volFra(k=1000E-6) 
    "Set point for volume fraction of 700PPM CO2";
  Buildings.Controls.Continuous.LimPID limPID(
    controllerType=Modelica.Blocks.Types.SimpleController.PI,
    reverseAction=true,
    Ti=600,
    k=2,
    Td=1);
  Buildings.Fluid.Sensors.TraceSubstances senCO2(redeclare package Medium =
        Medium, substanceName="CO2") "CO2 sensor";
  Buildings.Fluid.MixingVolumes.MixingVolume vol(
    nPorts=4,
    redeclare package Medium = Medium,
    energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
    massDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
    V=4*4*2.7,
    C_start={300E-6}*44.009544/28.9651159,
    m_flow_nominal=0.1) "Volume of air";
  Buildings.Fluid.Sources.PrescribedExtraPropertyFlowRate souCO2(
    use_m_flow_in=true,
    redeclare package Medium = Medium,
    nPorts=1) "CO2 source";
  Modelica.Blocks.Math.Gain CO2Per(k=15/1000/3600*1.977) 
    "CO2 emission per person";
  Buildings.Fluid.Sources.MassFlowSource_T sou(
    use_m_flow_in=true,
    redeclare package Medium = Medium,
    C={300E-6}*44.009544/28.9651159,
    nPorts=1) "Source of fresh air with 300 PPM CO2";
  Buildings.Fluid.Sources.FixedBoundary sin(
    redeclare package Medium = Medium,
    p=100000,
    C={300E-6}*44.009544/28.9651159,
    nPorts=1) "Sink for exhaust air";
  Modelica.Blocks.Math.Gain gai(k=50/3600) "Gain for mass flow rate";
  Modelica.Blocks.Sources.Constant nPeo(k=1) "Number of people";
  Buildings.Fluid.Sensors.VolumeFlowRate senVolFlo(redeclare package Medium =
        Medium, m_flow_nominal=0.1);
  Modelica.Blocks.Math.Gain norSet(k=1/1000E-6) 
    "Normalization for set point (to scale control input)";
  Modelica.Blocks.Math.Gain norMea(k=1/1000E-6) 
    "Normalization for measured concentration (to scale control input)";
  Modelica.Blocks.Math.Gain conVolFlo(k=3600, y(unit="m3/h")) 
    "Conversion from m3/s to m3/h";
  Buildings.Fluid.Sensors.TraceSubstancesTwoPort senTraSubPeo(m_flow_nominal=0.1,
      redeclare package Medium = Medium,
    C_start=0) "CO2 concentration in absorptance from people";
  Buildings.Fluid.Sensors.TraceSubstancesTwoPort senTraSubFre(m_flow_nominal=0.1,
      redeclare package Medium = Medium,
    C_start=0) "CO2 concentration in fresh air supply";
equation 

  connect(souCO2.m_flow_in, CO2Per.y);
  connect(gai.y, sou.m_flow_in);
  connect(limPID.y, gai.u);
  connect(nPeo.y, CO2Per.u);
  connect(sou.ports[1], senVolFlo.port_a);
  connect(senCO2.C, conMasVolFra.m);
  connect(conMasVolFra.V, norMea.u);
  connect(norMea.y, limPID.u_m);
  connect(volFra.y, norSet.u);
  connect(norSet.y, limPID.u_s);
  connect(conVolFlo.u, senVolFlo.V_flow);
  connect(souCO2.ports[1], senTraSubPeo.port_a);
  connect(senTraSubPeo.port_b, vol.ports[1]);
  connect(senVolFlo.port_b, senTraSubFre.port_a);
  connect(senTraSubFre.port_b, vol.ports[2]);
  connect(vol.ports[3], senCO2.port);
  connect(vol.ports[4], sin.ports[1]);
end To_VolumeFraction;

Automatically generated Thu Dec 8 16:34:45 2011.