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.

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.

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium model

Connectors

TypeNameDescription
replaceable package MediumMedium model

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) "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";
  Sources.PrescribedBoundary_pTX sou_1(
    p=300000 + 5000,
    T=273.15 + 50,
    redeclare package Medium = Medium);
  Sources.PrescribedBoundary_pTX sin_1(
    p=300000,
    redeclare package Medium = Medium,
    T=273.15 + 20);
    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) "Tank";
  Sources.PrescribedBoundary_pTX sou_2(
    p=300000 + 5000,
    T=273.15 + 50,
    redeclare package Medium = Medium);
  Sources.PrescribedBoundary_pTX sin_2(
    p=300000,
    redeclare package Medium = Medium,
    T=273.15 + 20);
    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.PrescribedTemperature TBCSid2 
    "Boundary condition for tank";
  Modelica.Thermal.HeatTransfer.PrescribedTemperature TBCSid1 
    "Boundary condition for tank";
  Modelica.Thermal.HeatTransfer.PrescribedTemperature TBCTop1 
    "Boundary condition for tank";
  Modelica.Thermal.HeatTransfer.PrescribedTemperature TBCTop2 
    "Boundary condition for tank";
equation 
  connect(TWat.y, sou_1.T_in);
  connect(res_1.port_b, sin_1.port);
  connect(sou_1.port, tanSim.port_a);
  connect(res_2.port_b,sin_2. port);
  connect(sou_2.port, tanEnh.port_a);
  connect(TWat.y, sou_2.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(P.y, sin_2.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);
end Stratified;

HTML-documentation generated by Dymola Fri Oct 31 16:23:54 2008.