Name | Description |
---|---|
BoreholeSegment | Model that tests a basic segment that is used to built a borehole |
Factorial | Test the function factorial |
HexInternalElement | Model that tests the basic element that is used to built borehole models |
SingleUTubeBoundaryCondition | Test model the temperature boundary condition of a single U tube heat exchanger |
ExchangeValues | Test problem for the function that exchanges values |
Extends from Modelica.Icons.Example (Icon for runnable examples).
model BoreholeSegment "Model that tests a basic segment that is used to built a borehole" import Buildings; extends Modelica.Icons.Example;inner Modelica.Fluid.System system; package Medium = Buildings.Media.ConstantPropertyLiquidWater; Buildings.HeatTransfer.Data.BoreholeFillings.Bentonite bento;Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.BoreholeSegment seg( redeclare package Medium = Medium, matFil=bento, m_flow_nominal=0.2, dp_nominal=5, rTub=0.02, eTub=0.002, rBor=0.1, rExt=3, B0=17.44, B1=-0.605, nSta=9, samplePeriod=604800, kTub=0.5, hSeg=10, xC=0.05, redeclare Buildings.HeatTransfer.Data.Soil.Concrete matSoi, TFil_start=283.15, TExt_start=283.15); Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium, nPorts=1, use_T_in=false, p=101340, T=303.15); Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium, use_p_in=false, use_T_in=false, nPorts=1, p=101330, T=283.15); equationconnect(sou_1.ports[1], seg.port_a1); connect(seg.port_b1, seg.port_a2); connect(seg.port_b2, sin_2.ports[1]); end BoreholeSegment;
This example tests the function Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.factorial.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Type | Name | Default | Description |
---|---|---|---|
Integer | x[:] | {1,2,3,4,5} |
model Factorial "Test the function factorial" extends Modelica.Icons.Example; parameter Integer x[:] = {1, 2, 3, 4, 5}; Integer y[5]; equation y = Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.factorial(x); assert(abs(120-y[5]) < 1E-10, "Error: Factorial function yields wrong result.");end Factorial;
Extends from Modelica.Icons.Example (Icon for runnable examples).
model HexInternalElement "Model that tests the basic element that is used to built borehole models" extends Modelica.Icons.Example;inner Modelica.Fluid.System system; import Buildings; package Medium = Buildings.Media.ConstantPropertyLiquidWater;Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.HexInternalElement hex( redeclare package Medium = Medium, m1_flow_nominal=0.3, m2_flow_nominal=0.3, rTub=0.02, kTub=0.5, rBor=0.1, xC=0.025, kSoi=3.1, B0=21.91, B1=-0.3796, dp1_nominal=5, dp2_nominal=5, hSeg=20, redeclare Buildings.HeatTransfer.Data.BoreholeFillings.Bentonite matFil, TFil_start=283.15); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium, nPorts=1, use_T_in=false, p=101340, T=303.15); Buildings.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium, nPorts=1, use_p_in=false, use_T_in=false, p=101330, T=283.15); equationconnect(sou_1.ports[1], hex.port_a1); connect(hex.port_b1, hex.port_a2); connect(hex.port_b2, sin_2.ports[1]); end HexInternalElement;
Extends from Modelica.Icons.Example (Icon for runnable examples).
Type | Name | Default | Description |
---|---|---|---|
HeatFlowRate | Q_flow | -50 | Heat flow rate extracted at center of cylinder [W] |
model SingleUTubeBoundaryCondition "Test model the temperature boundary condition of a single U tube heat exchanger" extends Modelica.Icons.Example; import Buildings; parameter Modelica.SIunits.HeatFlowRate Q_flow=-50 "Heat flow rate extracted at center of cylinder";Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.SingleUTubeBoundaryCondition TBouSte( final rExt=3, final samplePeriod=604800, hSeg=1, redeclare final Buildings.HeatTransfer.Data.Soil.Sandstone matSoi, TExt_start=293.15) "Boundary condition"; Modelica.Blocks.Sources.Step step( height=Q_flow, offset=0, startTime=0); Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.SingleUTubeBoundaryCondition TBouCon( final rExt=3, final samplePeriod=604800, hSeg=1, redeclare final Buildings.HeatTransfer.Data.Soil.Sandstone matSoi, TExt_start=293.15) "Boundary condition"; Modelica.Blocks.Sources.Constant con(k=Q_flow); Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.SingleUTubeBoundaryCondition TBouPul( final rExt=3, final samplePeriod=604800, hSeg=1, redeclare final Buildings.HeatTransfer.Data.Soil.Sandstone matSoi, TExt_start=293.15) "Boundary condition"; Modelica.Blocks.Sources.Pulse pulse( offset=0, startTime=0, amplitude=2*Q_flow, period=7200); equationconnect(con.y, TBouCon.Q_flow); connect(step.y, TBouSte.Q_flow); connect(pulse.y, TBouPul.Q_flow); end SingleUTubeBoundaryCondition;
This example tests the function Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.exchangeValues by assigning and reading different elements of the array. The assert statements check whether the returned values is correct.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Type | Name | Default | Description |
---|---|---|---|
Real | x | 3 |
model ExchangeValues "Test problem for the function that exchanges values" extends Modelica.Icons.Example; parameter Real x = 3; Real y; Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.ExtendableArray table= Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.ExtendableArray() "Extentable array, used to store history of rate of heat flows"; algorithm y := Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.exchangeValues( table=table, iX=1, x=x, iY=1); assert(abs(y-3) < 1E-10, "Error in implementation of exchangeVaules."); y := Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.exchangeValues( table=table, iX=2, x=4*x, iY=1); assert(abs(y-3) < 1E-10, "Error in implementation of exchangeVaules."); y := Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.exchangeValues( table=table, iX=2, x=4*x, iY=2); assert(abs(y-12) < 1E-10, "Error in implementation of exchangeVaules."); y := Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.exchangeValues( table=table, iX=200, x=5*x, iY=1); assert(abs(y-3) < 1E-10, "Error in implementation of exchangeVaules."); y := Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.exchangeValues( table=table, iX=10, x=6*x, iY=200); assert(abs(y-15) < 1E-10, "Error in implementation of exchangeVaules."); y := Buildings.Fluid.HeatExchangers.Boreholes.BaseClasses.exchangeValues( table=table, iX=10, x=6*x, iY=1); assert(abs(y-3) < 1E-10, "Error in implementation of exchangeVaules.");end ExchangeValues;