Skip to content

Commit

Permalink
* Remove the detailed geothermal field model, #33
Browse files Browse the repository at this point in the history
  • Loading branch information
MBaranskiEBC committed May 21, 2019
1 parent 5d61997 commit c041736
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,14 @@ model SimpleModelGeo "extends Modelica.Icons.Example;extends ModelicaModels.Base
extent={{10,-10},{-10,10}},
rotation=-90,
origin={64,-50})));
AixLib.Fluid.MixingVolumes.MixingVolume vol(redeclare package Medium =
Water,
m_flow_nominal=100,
m_flow_small=50,
V=900000,
nPorts=3,
p_start=150000,
T_start=285.15) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={-78,-6})));
AixLib.Fluid.MixingVolumes.MixingVolume vol1(redeclare package Medium =
Water,
m_flow_nominal=100,
V=200,
energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
m_flow_small=50,
nPorts=3,
p_start=100000,
nPorts=4) annotation (
m_flow_nominal=16,
V=2) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
Expand All @@ -47,16 +35,6 @@ model SimpleModelGeo "extends Modelica.Icons.Example;extends ModelicaModels.Base
annotation (Placement(transformation(extent={{-6,-6},{6,6}},
rotation=-90,
origin={54,20})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature(T=283.15)
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=90,
origin={-88,-86})));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor thermalResistor(R=0.5)
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=90,
origin={-88,-42})));
AixLib.Fluid.Movers.FlowControlled_m_flow fan(redeclare package Medium =
Water,
m_flow_small=1,
Expand Down Expand Up @@ -185,13 +163,42 @@ model SimpleModelGeo "extends Modelica.Icons.Example;extends ModelicaModels.Base
origin={-58,-82})));
Modelica.Blocks.Sources.Constant m_flow(k=16)
annotation (Placement(transformation(extent={{-68,20},{-58,30}})));
AixLib.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium = Water,
m_flow_small=50,
V=9000,
p_start=150000,
T_start=285.15,
m_flow_nominal=16,
nPorts=3) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={-88,-14})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature(T=285.15)
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=90,
origin={-88,-76})));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalConductor(G=50)
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=90,
origin={-88,-48})));
Modelica.Blocks.Math.Gain maxHeatFlowRate(k=0.02) "Convert from percent"
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=270,
origin={-14,84})));
Modelica.Blocks.Sources.Constant const2(k=-10000)
annotation (Placement(transformation(extent={{-5,-5},{5,5}},
rotation=180,
origin={1,49})));
equation
connect(pulse1.y, Q_flow_need_cold.u1) annotation (Line(points={{-87.6,76},{
-66,76},{-66,72.4},{-62.8,72.4}}, color={0,0,127}));
connect(const.y, Q_flow_need_cold.u2) annotation (Line(points={{-87.6,60},{
-76,60},{-76,66},{-62.8,66},{-62.8,67.6}}, color={0,0,127}));
connect(thermalResistor.port_b, vol.heatPort) annotation (Line(points={{-88,-36},
{-88,-24},{-78,-24},{-78,-16}}, color={191,0,0}));
connect(Q_flow_need_heat.y, Q_flow_need.u[1]) annotation (Line(points={{-87.6,
92},{-46,92},{-46,63.6},{-36.8,63.6}},
color={0,0,127}));
Expand All @@ -207,26 +214,22 @@ equation
annotation (Line(points={{8,-34},{24,-34}}, color={0,127,255}));
connect(product.y, prescribedHeatFlow.Q_flow) annotation (Line(points={{-1.5,67},
{16,67},{16,52},{54,52},{54,26}}, color={0,0,127}));
connect(Q_flow_need.y, product.u2)
annotation (Line(points={{-27.6,64},{-13,64}},
color={0,0,127}));
connect(buildingNeed, Q_flow_need.y) annotation (Line(points={{-24,100},{-24,
64},{-27.6,64}}, color={0,0,127}));
connect(hydraulicResistance.port_b, senMasFlo2.port_a)
annotation (Line(points={{-2,2},{22,2}}, color={0,127,255}));
connect(senMasFlo2.port_b, vol1.ports[1])
annotation (Line(points={{34,2},{44,2},{44,-3}}, color={0,127,255}));
annotation (Line(points={{34,2},{44,2},{44,-3.33333}},
color={0,127,255}));
connect(senMasFlo1.port_a, vol1.ports[2]) annotation (Line(points={{36,-34},{
44,-34},{44,-5}}, color={0,127,255}));
connect(bou.ports[1], vol1.ports[3]) annotation (Line(points={{64,-40},{64,
-34},{44,-34},{44,-7}}, color={0,127,255}));
connect(senTem1.port, vol1.ports[4]) annotation (Line(points={{75,-26},{66,
-26},{66,-18},{44,-18},{44,-9}},
44,-34},{44,-6}}, color={0,127,255}));
connect(bou.ports[1], vol1.ports[2]) annotation (Line(points={{64,-40},{64,
-34},{44,-34},{44,-6}}, color={0,127,255}));
connect(senTem1.port, vol1.ports[3]) annotation (Line(points={{75,-26},{66,
-26},{66,-18},{44,-18},{44,-8.66667}},
color={0,127,255}));
connect(senMasFlo3.port_a, fan.port_b)
annotation (Line(points={{-26,-34},{-12,-34}}, color={0,127,255}));
connect(vol.ports[1], senMasFlo3.port_b) annotation (Line(points={{-68,
-8.66667},{-68,-34},{-38,-34}},color={0,127,255}));
connect(senTem2.port, fan.port_b) annotation (Line(points={{-15,-70},{-20,-70},
{-20,-34},{-12,-34}}, color={0,127,255}));
connect(senMasFlo3.m_flow, fieldMassflow_in)
Expand All @@ -235,20 +238,10 @@ equation
annotation (Line(points={{28,8.6},{28,100}}, color={0,0,127}));
connect(senTem3.port, senMasFlo2.port_a)
annotation (Line(points={{7,24},{7,2},{22,2}}, color={0,127,255}));
connect(vol.ports[2], senTem.port) annotation (Line(points={{-68,-6},{-68,-72},
{-63,-72}}, color={0,127,255}));
connect(Q_flow_need_cold.y, Q_flow_need.u[2]) annotation (Line(points={{-53.6,
70},{-48,70},{-48,56},{-36.8,56},{-36.8,64.4}}, color={0,0,127}));
connect(valveQflow, product.u1) annotation (Line(points={{-14,100},{-14,86},{
-14,70},{-13,70}}, color={0,0,127}));
connect(greaterEqual.u1, product.u2)
annotation (Line(points={{-23,49},{-23,64},{-13,64}}, color={0,0,127}));
connect(const1.y, greaterEqual.u2) annotation (Line(points={{-57.5,47},{
-42.75,47},{-42.75,49},{-27,49}}, color={0,0,127}));
connect(senMasFlo.port_a, vol.ports[3]) annotation (Line(points={{-50,2},{-68,
2},{-68,-3.33333}}, color={0,127,255}));
connect(fixedTemperature.port, thermalResistor.port_a)
annotation (Line(points={{-88,-80},{-88,-48}}, color={191,0,0}));
connect(senTem3.T, hRCTemperatureC.Kelvin)
annotation (Line(points={{10.5,29},{12,29},{12,77.2}}, color={0,0,127}));
connect(hRCTemperatureC.Celsius, buildingTemperature_in)
Expand All @@ -267,6 +260,24 @@ equation
annotation (Line(points={{-58,-86.4},{-58,-100}}, color={0,0,127}));
connect(m_flow.y, fan.m_flow_in) annotation (Line(points={{-57.5,25},{-30,25},
{-30,-14},{-2,-14},{-2,-22}}, color={0,0,127}));
connect(thermalConductor.port_b, vol.heatPort)
annotation (Line(points={{-88,-42},{-88,-24}}, color={191,0,0}));
connect(senMasFlo3.port_b, vol.ports[1]) annotation (Line(points={{-38,-34},{
-78,-34},{-78,-16.6667}}, color={0,127,255}));
connect(vol.ports[2], senMasFlo.port_a)
annotation (Line(points={{-78,-14},{-78,2},{-50,2}}, color={0,127,255}));
connect(fixedTemperature.port, thermalConductor.port_a)
annotation (Line(points={{-88,-70},{-88,-54}}, color={191,0,0}));
connect(vol.ports[3], senTem.port) annotation (Line(points={{-78,-11.3333},{
-70,-11.3333},{-70,-76},{-63,-76},{-63,-72}}, color={0,127,255}));
connect(valveQflow, maxHeatFlowRate.u)
annotation (Line(points={{-14,100},{-14,91.2}}, color={0,0,127}));
connect(maxHeatFlowRate.y, product.u1) annotation (Line(points={{-14,77.4},{
-14,74},{-14,70},{-13,70}}, color={0,0,127}));
connect(Q_flow_need.y, greaterEqual.u1)
annotation (Line(points={{-27.6,64},{-23,64},{-23,49}}, color={0,0,127}));
connect(const2.y, product.u2) annotation (Line(points={{-4.5,49},{-16,49},{
-16,64},{-13,64}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{120,100}})), Diagram(
coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ model Building "Simplified building model"
replaceable package Water = AixLib.Media.Water;
AixLib.Fluid.MixingVolumes.MixingVolume vol1(redeclare package Medium =
Water,
m_flow_nominal=100,
V=200,
energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
m_flow_small=50,
nPorts=3,
p_start=100000,
nPorts=3) annotation (
m_flow_nominal=16,
V=2) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
Expand All @@ -19,22 +19,31 @@ model Building "Simplified building model"
annotation (Placement(transformation(extent={{-12,-12},{12,12}},
rotation=0,
origin={-52,-58})));
Modelica.Blocks.Math.Gain maxHeatFlowRate(k=10) "Convert from percent"
Modelica.Blocks.Math.Gain maxHeatFlowRate(k=0.02) "Convert from percent"
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=0,
origin={-80,-58})));
origin={-84,-110})));
Modelica.Blocks.Math.Product product1
annotation (Placement(transformation(extent={{-62,-114},{-42,-94}})));
Modelica.Blocks.Sources.Constant const(k=-10000)
annotation (Placement(transformation(extent={{-120,-80},{-100,-60}})));
equation
connect(prescribedHeatFlow.port, vol1.heatPort) annotation (Line(points={{-40,
-58},{-26,-58},{-26,42},{-16,42}}, color={191,0,0}));
connect(prescribedHeatFlow.Q_flow, maxHeatFlowRate.y)
annotation (Line(points={{-64,-58},{-73.4,-58}}, color={0,0,127}));
connect(decisionVariables.y[1], maxHeatFlowRate.u) annotation (Line(points={{
-99,-110},{-92,-110},{-92,-58},{-87.2,-58}}, color={0,0,127}));
connect(decisionVariables.y[1], maxHeatFlowRate.u) annotation (Line(points={{-99,
-110},{-91.2,-110}}, color={0,0,127}));
connect(IntakeAirSource.ports[1], vol1.ports[1]) annotation (Line(points={{-100,12},
{-74,12},{-74,32},{-8.66667,32}}, color={0,127,255}));
connect(vol1.ports[2], massFlow.port_a) annotation (Line(points={{-6,32},{56,
32},{56,12},{116,12}}, color={0,127,255}));
connect(vol1.ports[3], supplyTemperature.port) annotation (Line(points={{
-3.33333,32},{104,32},{104,38}}, color={0,127,255}));
connect(maxHeatFlowRate.y, product1.u2)
annotation (Line(points={{-77.4,-110},{-64,-110}}, color={0,0,127}));
connect(product1.y, prescribedHeatFlow.Q_flow) annotation (Line(points={{-41,
-104},{-36,-104},{-36,-80},{-84,-80},{-84,-58},{-64,-58}}, color={0,0,
127}));
connect(const.y, product1.u1) annotation (Line(points={{-99,-70},{-92,-70},{
-92,-98},{-64,-98}}, color={0,0,127}));
end Building;
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,6 @@ model Field_new "Simplified model of geothermal field"

replaceable package Water = AixLib.Media.Water;

AixLib.Fluid.Geothermal.Borefields.TwoUTubes borFie(redeclare package Medium =
Water,
borFieDat(
filDat=AixLib.Fluid.Geothermal.Borefields.Data.Filling.Bentonite(),
soiDat=AixLib.Fluid.Geothermal.Borefields.Data.Soil.SandStone(),
conDat=AixLib.Fluid.Geothermal.Borefields.Data.Configuration.Example(
borCon=AixLib.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel,
cooBor=[0,0; 0,6; 6,0; 6,6; 0,12; 12,0; 12,12; 0,18; 18,0; 18,18; 6,
12; 6,18; 12,6; 18,6; 18,12; 12,18; 24,0; 0,24; 6,24; 12,24; 18,24;
24,24; 24,18; 24,12; 24,6; 0,30; 6,30; 12,30; 18,30; 24,30; 30,30; 30,
24; 30,18; 30,12; 30,6; 30,0; 0,36; 6,36; 12,36; 18,36; 24,36; 30,36;
36,36; 36,30; 36,24; 36,18; 36,12; 36,6; 36,0])),
show_T=false,
TExt0_start=285.15)
annotation (Placement(
transformation(
extent={{-27,-26},{27,26}},
rotation=0,
origin={5,0})));

Modelica.Blocks.Sources.CombiTimeTable decisionVariables(
table=[0.0,0.0,0.0; 0.0,0.0,0.0; 0.0,0.0,0.0; 0.0,0.0,0.0; 0.0,0.0,0.0; 0.0,
0.0,0.0],
Expand Down Expand Up @@ -58,20 +38,20 @@ model Field_new "Simplified model of geothermal field"
origin={-90,90})));
AixLib.Fluid.MixingVolumes.MixingVolume vol1(
redeclare package Medium = Water,
m_flow_nominal=100,
V=200,
energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
m_flow_small=50,
nPorts=3,
p_start=100000,
nPorts=3) annotation (
m_flow_nominal=16,
V=2) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={2,40})));
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow
annotation (Placement(transformation(extent={{-12,-12},{12,12}},
rotation=0,
origin={-36,40})));
origin={-24,40})));
Modelica.Blocks.Math.Gain percent(k=0.01) "Convert from percent" annotation (
Placement(transformation(
extent={{-6,-6},{6,6}},
Expand Down Expand Up @@ -110,23 +90,46 @@ model Field_new "Simplified model of geothermal field"
annotation (Placement(transformation(extent={{6,-6},{-6,6}},
rotation=270,
origin={80,12})));
Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold
Modelica.Blocks.Logical.LessEqualThreshold lessEqualThreshold
annotation (Placement(transformation(extent={{-60,70},{-40,90}})));
Modelica.Blocks.Logical.Switch switch1
annotation (Placement(transformation(extent={{-80,30},{-60,50}})));
AixLib.Fluid.Sensors.Temperature returnTemperature(redeclare package Medium
= Water, T(start=285.15)) "Temperature of supply water"
AixLib.Fluid.Sensors.Temperature returnTemperature(redeclare package Medium =
Water, T(start=285.15)) "Temperature of supply water"
annotation (Placement(transformation(extent={{74,-78},{94,-58}})));
AixLib.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium = Water,
m_flow_small=50,
nPorts=2,
V=9000,
p_start=150000,
T_start=285.15,
m_flow_nominal=16) annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-8,-2})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature(T=285.15)
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=90,
origin={-24,-62})));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalConductor(G=50)
annotation (Placement(transformation(
extent={{-6,-6},{6,6}},
rotation=90,
origin={-24,-34})));
Modelica.Blocks.Math.Gain negate(k=-1) "negate" annotation (Placement(
transformation(
extent={{-6,-6},{6,6}},
rotation=0,
origin={-48,40})));
equation
connect(prescribedHeatFlow.port, vol1.heatPort)
annotation (Line(points={{-24,40},{-8,40}}, color={191,0,0}));
connect(borFie.port_b, pump.port_a)
annotation (Line(points={{32,0},{48,0}}, color={0,127,255}));
annotation (Line(points={{-12,40},{-8,40}}, color={191,0,0}));
connect(res.port_b, vol1.ports[1])
annotation (Line(points={{38,30},{-0.666667,30}},
color={0,127,255}));
connect(vol1.ports[2], borFie.port_a) annotation (Line(points={{2,30},{-40,30},
{-40,0},{-22,0}}, color={0,127,255}));
connect(decisionVariables.y[1], percent.u)
annotation (Line(points={{-79,-50},{-71.2,-50}}, color={0,0,127}));
connect(percent.y, product1.u2) annotation (Line(points={{-57.4,-50},{-48,-50},
Expand All @@ -143,18 +146,28 @@ equation
annotation (Line(points={{80,18},{80,30},{58,30}}, color={0,127,255}));
connect(supplyTemperature.port, pump.port_b)
annotation (Line(points={{92,34},{92,0},{68,0}}, color={0,127,255}));
connect(variation.y[1], greaterEqualThreshold.u) annotation (Line(points={{
-79,90},{-66,90},{-66,80},{-62,80}}, color={0,0,127}));
connect(prescribedHeatFlow.Q_flow, switch1.y)
annotation (Line(points={{-48,40},{-59,40}}, color={0,0,127}));
connect(variation.y[1], lessEqualThreshold.u) annotation (Line(points={{-79,
90},{-66,90},{-66,80},{-62,80}}, color={0,0,127}));
connect(variation.y[1], switch1.u3) annotation (Line(points={{-79,90},{-72,90},
{-72,70},{-96,70},{-96,32},{-82,32}}, color={0,0,127}));
connect(product1.y, switch1.u1) annotation (Line(points={{-59,10},{-52,10},{
-52,26},{-90,26},{-90,48},{-82,48}}, color={0,0,127}));
connect(greaterEqualThreshold.y, switch1.u2) annotation (Line(points={{-39,80},
{-14,80},{-14,60},{-92,60},{-92,40},{-82,40}}, color={255,0,255}));
connect(lessEqualThreshold.y, switch1.u2) annotation (Line(points={{-39,80},{
-14,80},{-14,60},{-92,60},{-92,40},{-82,40}}, color={255,0,255}));
connect(thermalConductor.port_b, vol.heatPort)
annotation (Line(points={{-24,-28},{-24,-2},{-18,-2}}, color={191,0,0}));
connect(fixedTemperature.port, thermalConductor.port_a)
annotation (Line(points={{-24,-56},{-24,-40}}, color={191,0,0}));
connect(vol.ports[1], pump.port_a) annotation (Line(points={{-10,-12},{20,-12},
{20,0},{48,0}}, color={0,127,255}));
connect(vol1.ports[2], vol.ports[2]) annotation (Line(points={{2,30},{-40,30},
{-40,-12},{-6,-12}}, color={0,127,255}));
connect(vol1.ports[3], returnTemperature.port) annotation (Line(points={{
4.66667,30},{-40,30},{-40,-90},{84,-90},{84,-78}}, color={0,127,255}));
4.66667,30},{-40,30},{-40,-80},{84,-80},{84,-78}}, color={0,127,255}));
connect(prescribedHeatFlow.Q_flow, negate.y)
annotation (Line(points={{-36,40},{-41.4,40}}, color={0,0,127}));
connect(negate.u, switch1.y)
annotation (Line(points={{-55.2,40},{-59,40}}, color={0,0,127}));
annotation (experiment(StopTime=94608000, Interval=86400),
__Dymola_experimentSetupOutput);
end Field_new;

0 comments on commit c041736

Please sign in to comment.