Buildings.Fluids.Storage.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.Fluids.Storage.

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

Package Content

NameDescription
Stratified Test model for stratified tank


Buildings.Fluids.Storage.Examples.Stratified

Test model for stratified tank

Buildings.Fluids.Storage.Examples.Stratified

Information


This test model compares two tank models. The only difference between
the two tank models is that one uses the model from Stefan Wischhusen
that reduces the numerical diffusion that is induced by the upwind
discretization scheme.


Modelica definition

model Stratified "Test model for stratified tank"

 package Medium = Buildings.Media.ConstantPropertyLiquidWater "Medium model";

  Buildings.Fluids.Storage.Stratified tanSim(
    redeclare package Medium = Medium,
    nSeg=10,
    hTan=3,
    dIns=0.3,
    VTan=5,
    m0_flow=10) "Tank";
    Modelica.Blocks.Sources.TimeTable TWat(table=[0,273.15 + 40; 3600,273.15 +
        40; 3600,273.15 + 20; 7200,273.15 + 20]) "Water temperature";
  Modelica_Fluid.Sources.Boundary_pT sou_1(
    p=300000 + 5000,
    T=273.15 + 50,
    redeclare package Medium = Medium,
    use_T_in=true,
    nPorts=2);
  Modelica_Fluid.Sources.Boundary_pT sin_1(
    redeclare package Medium = Medium,
    T=273.15 + 20,
    use_p_in=true,
    p=300000,
    nPorts=2);
    FixedResistances.FixedResistanceDpM res_1(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5000,
    m0_flow=10);
  Buildings.Fluids.Storage.StratifiedEnhanced tanEnh(
    redeclare package Medium = Medium,
    nSeg=10,
    a=1E-4,
    hTan=3,
    dIns=0.3,
    VTan=5,
    m0_flow=10) "Tank";
    FixedResistances.FixedResistanceDpM res_2(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5000,
    m0_flow=10);
  Buildings.Fluids.Sensors.EnthalpyFlowRate HOut_flow(redeclare package Medium
      = Medium) "Enthalpy flow rate";
  Buildings.Fluids.Sensors.EnthalpyFlowRate HOut_flow1(redeclare package Medium
      = Medium) "Enthalpy flow rate";
  Modelica.Blocks.Continuous.Integrator dH 
    "Differenz in enthalpy (should be zero at steady-state)";
  Modelica.Blocks.Math.Add add(k2=-1);
    Modelica.Blocks.Sources.TimeTable P(table=[0,300000; 4200,300000; 4200,
        305000; 7200,305000; 7200,310000; 10800,310000; 10800,305000]) 
    "Pressure boundary condition";
  Modelica.Blocks.Sources.Sine sine(
    freqHz=1/86400,
    amplitude=10,
    offset=273.15 + 20);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TBCSid2 
    "Boundary condition for tank";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TBCSid1 
    "Boundary condition for tank";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TBCTop1 
    "Boundary condition for tank";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TBCTop2 
    "Boundary condition for tank";
  inner Modelica_Fluid.System system;
equation 
  connect(TWat.y, sou_1.T_in);
  connect(tanSim.port_b, HOut_flow.port_a);
  connect(HOut_flow.port_b, res_1.port_a);
  connect(tanEnh.port_b, HOut_flow1.port_a);
  connect(HOut_flow1.port_b, res_2.port_a);
  connect(add.y, dH.u);
  connect(HOut_flow.H_flow, add.u1);
  connect(HOut_flow1.H_flow, add.u2);
  connect(P.y, sin_1.p_in);
  connect(sine.y, TBCSid1.T);
  connect(sine.y, TBCTop1.T);
  connect(sine.y, TBCSid2.T);
  connect(sine.y, TBCTop2.T);
  connect(TBCSid2.port, tanEnh.heaPorSid);
  connect(TBCTop2.port, tanEnh.heaPorTop);
  connect(sin_1.ports[1], res_1.port_b);
  connect(sin_1.ports[2], res_2.port_b);
  connect(sou_1.ports[1], tanSim.port_a);
  connect(sou_1.ports[2], tanEnh.port_a);
end Stratified;

HTML-documentation generated by Dymola Thu Feb 19 16:52:59 2009.