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 Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

NameDescription
Buildings.Fluid.Sources.Examples.PrescribedExtraPropertyFlow PrescribedExtraPropertyFlow  
Buildings.Fluid.Sources.Examples.Outside Outside Test model for source and sink with outside weather data


Buildings.Fluid.Sources.Examples.PrescribedExtraPropertyFlow Buildings.Fluid.Sources.Examples.PrescribedExtraPropertyFlow

Buildings.Fluid.Sources.Examples.PrescribedExtraPropertyFlow

Information

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

Modelica definition

model PrescribedExtraPropertyFlow
  extends Modelica.Icons.Example;
  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;

Buildings.Fluid.Sources.Examples.Outside Buildings.Fluid.Sources.Examples.Outside

Test model for source and sink with outside weather data

Buildings.Fluid.Sources.Examples.Outside

Information

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

Modelica definition

model Outside 
  "Test model for source and sink with outside weather data"
  extends Modelica.Icons.Example;
  package Medium = Buildings.Media.GasesConstantDensity.MoistAirUnsaturated 
    "Medium model for air";
  Buildings.Fluid.Sources.Outside bou(redeclare package Medium = Medium, nPorts=
       1) "Model with outside conditions";
  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos");
  MassFlowSource_T sin(redeclare package Medium = Medium, m_flow=-1,
    nPorts=1) "Sink";
  Sensors.TemperatureTwoPort senTem(redeclare package Medium = Medium,
      m_flow_nominal=1) "Temperature sensor";
  Sensors.RelativeHumidityTwoPort senRelHum(redeclare package Medium = Medium,
      m_flow_nominal=1);
  Sensors.MassFractionTwoPort senMasFra(redeclare package Medium = Medium,
      m_flow_nominal=1) "Sensor for mass fraction of water";
equation 
  connect(weaDat.weaBus, bou.weaBus);
  connect(senTem.port_b, sin.ports[1]);
  connect(senRelHum.port_a, bou.ports[1]);
  connect(senRelHum.port_b, senMasFra.port_a);
  connect(senMasFra.port_b, senTem.port_a);
end Outside;

Automatically generated Fri May 06 14:12:51 2011.