Buildings.Fluid.Storage.Ice.BaseClasses.Examples

Examples that test models in the base classes

Information

This package contains examples that test the models in Buildings.Fluid.Storage.Ice.BaseClasses.

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

Package Content

Name Description
Buildings.Fluid.Storage.Ice.BaseClasses.Examples.LMTDStar LMTDStar Example that tests the LMTDStar model
Buildings.Fluid.Storage.Ice.BaseClasses.Examples.NormalizedHeatFlowRate NormalizedHeatFlowRate Example to calculate qStar
Buildings.Fluid.Storage.Ice.BaseClasses.Examples.QStar QStar Example to calculate QStar
Buildings.Fluid.Storage.Ice.BaseClasses.Examples.StateOfCharge StateOfCharge Example that tests the ice mass calculation

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.LMTDStar Buildings.Fluid.Storage.Ice.BaseClasses.Examples.LMTDStar

Example that tests the LMTDStar model

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.LMTDStar

Information

This example is to validate the LMTDStar.

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

Modelica definition

model LMTDStar "Example that tests the LMTDStar model" extends Modelica.Icons.Example; Buildings.Fluid.Storage.Ice.BaseClasses.LMTDStar lmtdSta "LMTD star"; Modelica.Blocks.Sources.Cosine TIn( amplitude=4, f=1/3600, offset=273.15 + 2) "Inlet temperature"; Modelica.Blocks.Sources.Cosine TOut( amplitude=4, f=1/3600, offset=273.15 + 2, phase=3.1415926535898) "Outlet temperature"; equation connect(TIn.y, lmtdSta.TIn); connect(TOut.y, lmtdSta.TOut); end LMTDStar;

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.NormalizedHeatFlowRate Buildings.Fluid.Storage.Ice.BaseClasses.Examples.NormalizedHeatFlowRate

Example to calculate qStar

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.NormalizedHeatFlowRate

Information

This example is to validate the Buildings.Fluid.Storage.Ice.BaseClasses.NormalizedHeatFlowRate.

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

Parameters

TypeNameDefaultDescription
RealcoeCha[6]{0,0.09,-0.15,0.612,-0.324,-...Coefficient for charging curve
RealcoeDisCha[6]{0,0.09,-0.15,0.612,-0.324,-...Coefficient for discharging curve
Realdt3600Time step used in the samples for curve fitting

Modelica definition

model NormalizedHeatFlowRate "Example to calculate qStar" extends Modelica.Icons.Example; parameter Real coeCha[6] = {0, 0.09, -0.15, 0.612, -0.324, -0.216} "Coefficient for charging curve"; parameter Real coeDisCha[6] = {0, 0.09, -0.15, 0.612, -0.324, -0.216} "Coefficient for discharging curve"; parameter Real dt = 3600 "Time step used in the samples for curve fitting"; Modelica.Blocks.Sources.Cosine fra( amplitude=0.5, offset=0.5, f=1/7200) "Fraction of charge"; Buildings.Fluid.Storage.Ice.BaseClasses.NormalizedHeatFlowRate norQSta( coeCha=coeCha, dtCha=dt, coeDisCha=coeDisCha, dtDisCha=dt) "Storage heat transfer rate"; Modelica.Blocks.Sources.Step lmtd( startTime=3600, offset=1, height=-0.5) "lmtd start"; Controls.OBC.CDL.Continuous.GreaterThreshold greThr(t=0.75) "Switch the change between charging and discharging mode"; Controls.OBC.CDL.Logical.Not not1; equation connect(fra.y, norQSta.SOC); connect(lmtd.y, norQSta.lmtdSta); connect(lmtd.y, greThr.u); connect(norQSta.canMelt, greThr.y); connect(greThr.y, not1.u); connect(not1.y, norQSta.canFreeze); end NormalizedHeatFlowRate;

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.QStar Buildings.Fluid.Storage.Ice.BaseClasses.Examples.QStar

Example to calculate QStar

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.QStar

Information

This example is to validate the Buildings.Fluid.Storage.Ice.BaseClasses.QStar.

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

Parameters

TypeNameDefaultDescription
RealcoeCha[6]{0,0.09,-0.15,0.612,-0.324,-...Coefficient for charging curve
Realdt3600Time step used in the samples for curve fitting

Modelica definition

model QStar "Example to calculate QStar" extends Modelica.Icons.Example; parameter Real coeCha[6] = {0, 0.09, -0.15, 0.612, -0.324, -0.216} "Coefficient for charging curve"; parameter Real dt = 3600 "Time step used in the samples for curve fitting"; Modelica.Blocks.Sources.Cosine fra( amplitude=0.5, f=1/86400, offset=0.5) "Fraction of charge"; Modelica.Blocks.Sources.Constant lmtd(k=1) "Log mean temperature difference"; Buildings.Fluid.Storage.Ice.BaseClasses.QStar qSta(coeff=coeCha, dt=dt); Controls.OBC.CDL.Logical.Sources.Constant active(k=true) "Outputs true to activate the component"; equation connect(fra.y, qSta.x); connect(lmtd.y, qSta.lmtdSta); connect(active.y, qSta.active); end QStar;

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.StateOfCharge Buildings.Fluid.Storage.Ice.BaseClasses.Examples.StateOfCharge

Example that tests the ice mass calculation

Buildings.Fluid.Storage.Ice.BaseClasses.Examples.StateOfCharge

Information

This example is to validate the model that calculates the ice mass.

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

Modelica definition

model StateOfCharge "Example that tests the ice mass calculation" extends Modelica.Icons.Example; Buildings.Fluid.Storage.Ice.BaseClasses.StateOfCharge soc(E_nominal=2846.35* 333550, SOC_start=1/2) "State of charge"; Modelica.Blocks.Sources.Cosine q( f=1/3600, amplitude=1, offset=0) "Heat transfer rate: postive for charging, negative for discharging"; Modelica.Blocks.Math.Gain hf(k=333550) "Fusion of heat of ice"; equation connect(q.y, hf.u); connect(hf.y, soc.Q_flow); end StateOfCharge;