Buildings.Fluid.Sources.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.Sources.

Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).

Package Content

NameDescription
PrescribedExtraPropertyFlow  


Buildings.Fluid.Sources.Examples.PrescribedExtraPropertyFlow

Buildings.Fluid.Sources.Examples.PrescribedExtraPropertyFlow

Modelica definition

model PrescribedExtraPropertyFlow
 package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir(extraPropertiesNames={"CO2"});
 // package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir;

  MixingVolumes.MixingVolume vol(
    redeclare package Medium = Medium,
    nPorts=1,
    V=100) "Mixing volume";
  PrescribedExtraPropertyFlowRate sou(redeclare package Medium = Medium,
      use_m_flow_in=true);
  Modelica.Blocks.Sources.Step step(          startTime=0.5,
    height=-2,
    offset=2);
  FixedResistances.FixedResistanceDpM res(
    redeclare package Medium = Medium,
    m_flow_nominal=1,
    dp_nominal=1) 
    "Resistance, used to check if species are transported between ports";
  MixingVolumes.MixingVolume vol1(
    redeclare package Medium = Medium,
    nPorts=1,
    V=100) "Mixing volume";
  PrescribedExtraPropertyFlowRate sou1(
                                      redeclare package Medium = Medium,
      use_m_flow_in=true);
  Buildings.Utilities.Diagnostics.AssertEquality assEqu(threShold=1E-4) 
    "Assert that both volumes have the same concentration";
  Modelica.Blocks.Sources.RealExpression reaExp(y=vol.mC[1]);
  Modelica.Blocks.Sources.RealExpression reaExp1(y=vol1.mC[1]);
  MixingVolumes.MixingVolume vol2(
    redeclare package Medium = Medium,
    nPorts=2,
    p_start=Medium.p_default,
    V=100) "Mixing volume";
  MixingVolumes.MixingVolume vol3(
    redeclare package Medium = Medium,
    nPorts=2,
    p_start=Medium.p_default,
    V=100) "Mixing volume";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM spl(
    redeclare package Medium = Medium,
    m_flow_nominal={1,1,1},
    dp_nominal={1,1,1},
    from_dp=false);
  Buildings.Utilities.Diagnostics.AssertEquality assEqu1(
                                                     threShold=1E-4) 
    "Assert that both volumes have the same concentration";
  Modelica.Blocks.Sources.RealExpression reaExp2(y=vol2.mC[1]);
  Modelica.Blocks.Sources.RealExpression reaExp3(y=vol3.mC[1]);
  MixingVolumes.MixingVolume vol4(
    redeclare package Medium = Medium,
    nPorts=3,
    p_start=Medium.p_default,
    V=100) "Mixing volume";
  PrescribedExtraPropertyFlowRate sou2(
                                      redeclare package Medium = Medium,
      use_m_flow_in=true);
  Buildings.Fluid.Sources.Boundary_pT bou(
    redeclare package Medium = Medium,
    p=101325,
    nPorts=1,
    T=293.15);
  Buildings.Fluid.Sources.Boundary_pT bou1(
    redeclare package Medium = Medium,
    nPorts=2,
    p=101320,
    T=293.15);
  FixedResistances.FixedResistanceDpM res1(
    redeclare package Medium = Medium,
    m_flow_nominal=1,
    dp_nominal=1) 
    "Resistance, used to check if species are transported between ports";
  FixedResistances.FixedResistanceDpM res2(
    redeclare package Medium = Medium,
    m_flow_nominal=1,
    dp_nominal=1) 
    "Resistance, used to check if species are transported between ports";
  FixedResistances.FixedResistanceDpM res3(
    redeclare package Medium = Medium,
    m_flow_nominal=1,
    dp_nominal=1) 
    "Resistance, used to check if species are transported between ports";
  inner Modelica.Fluid.System system;
equation 
  connect(reaExp.y, assEqu.u1);
  connect(reaExp1.y, assEqu.u2);
  connect(reaExp2.y, assEqu1.u1);
  connect(reaExp3.y, assEqu1.u2);
  connect(vol4.ports[2], spl.port_3);
  connect(spl.port_1, vol2.ports[1]);
  connect(spl.port_2, vol3.ports[1]);
  connect(res2.port_a, vol3.ports[2]);
  connect(res1.port_a, vol2.ports[2]);
  connect(res3.port_b, vol4.ports[3]);
  connect(res1.port_b, bou1.ports[1]);
  connect(res2.port_b, bou1.ports[2]);
  connect(bou.ports[1], res3.port_a);
  connect(sou.ports, vol.ports);
  connect(sou1.ports[1], res.port_a);
  connect(res.port_b, vol1.ports[1]);
  connect(sou2.ports[1], vol4.ports[1]);
  connect(step.y, sou.m_flow_in);
  connect(step.y, sou1.m_flow_in);
  connect(step.y, sou2.m_flow_in);
end PrescribedExtraPropertyFlow;

HTML-documentation generated by Dymola Thu Jun 24 16:55:09 2010.