modelicaopenmodelicadymola

Controlling the output Temperature of a Heatpump in the Modelica MoSDH Library


I am currently working with the MoSDH library (availiable here: https://github.com/MoSDH/MoSDH).

Within that library I am trying to control the thermal output of a HeatPump component by giving it a Tref. Unfortunately this seems to not have any influence on my model at all.

While regTmax is calculated correctly and around 30 to 35°C my regeneration Heatpump always has a TsupplyLoad of 80°C.

Has anyone ever worked with this library and experienced something similar?

I am having similar issues with pumps that don't react to any given volFlowRef, so I assume I am doing something horribly wrong.

I am currently using Dymola 2023.

 Modelica.Units.SI.Temperature regTmax "Boiler supply temperature";

Components.Sources.Electric.HeatPump regenerationHeatPump(
tau=3600,
setAbsoluteSourcePressure=false,
mediumLoad=boreholes.medium,
TminSource=243.15,
TminLoad=273.15,
MiminumShift=273.15,
enableReturnFlowMixing=false,
mode=MoSDH.Utilities.Types.ControlTypesHeatPump.SourcePower,
on=regenerationHeatPumpMode == modes.FullLoad,
setAbsoluteLoadPressure=false,
Pref=regHP_PthermalRef,
Tref=regTmax,
DeltaTref=0) annotation (Placement(transformation(extent={{-248,2},{-208,-38}})));

The hole model is this one:

            model Modell_pump_cooling_SoF "Geothermal supported heating and cooling system"
 import modes = MoSDH.Utilities.Types.OperationModes;
 import buoyancy = MoSDH.Components.Storage.StratifiedTank.BaseClasses.BuoyancyModels;
 parameter Modelica.Units.SI.Power BHE_PthermalSpec=30;
 parameter Modelica.Units.SI.Temperature TsupplyRef=323.15;
 parameter Modelica.Units.SI.Temperature TregenerationRef=278.15;
 parameter Modelica.Units.SI.Temperature TreturnRef=298.15;
 parameter Modelica.Units.SI.Temperature TboreholeMin=273.15 "Minimum allowed entrance temperature of boreholes";
 parameter Modelica.Units.SI.VolumeFlowRate BHE_volFlowSpec=0.0005 "Specific flow rate through BHEs";
 Boolean coolingMode "System is in cooling Mode";   //cooling Mode and heating Mode are redundant and just used for readability of the code.
 Boolean heatingMode "System is in heating Mode";
 modes heatPumpMode "Heat pump operation mode";
 modes boilerMode "Supply from buffer mode";
 modes regenerationHeatPumpMode "regeneration Heat Pump mode";
 Modelica.Units.SI.Power HP_PthermalRef(displayUnit="MW") "Reference thermal power of heat pump";
 Modelica.Units.SI.Power regHP_PthermalRef(displayUnit="MW") "Reference thermal power of regeneration heat pump";
 Modelica.Units.SI.VolumeFlowRate HP_volFlowRef "Heat Pump flow rate";
 Modelica.Units.SI.VolumeFlowRate EB_volFlowRef "Boiler flow rate";
 Modelica.Units.SI.VolumeFlowRate buffer_pump_volFlowRef "Buffer Pump flow rate";
 Modelica.Units.SI.VolumeFlowRate buffer_pump1_volFlowRef "Buffer Pump 1 flow rate";
 Modelica.Units.SI.VolumeFlowRate hx_load_volFlowRef "hx Load flow rate";
 Modelica.Units.SI.Temperature EB_Tref "Boiler supply temperature";
 Modelica.Units.SI.Temperature regTmax "Boiler supply temperature";
 // Storage Components
  MoSDH.Components.Storage.StratifiedTank.TTES buffer(
    storageVolume=0.01*boreholes.nBHEs*boreholes.BHElength,
    storageHeight=10,
    buoyancyMode=Components.Storage.StratifiedTank.BaseClasses.BuoyancyModels.buildings,
    nLayers=10,
    Tinitial=linspace(
        TreturnRef,
        TsupplyRef,
        buffer.nLayers),
    setAbsolutePressure=false)                               annotation(Placement(transformation(extent={{-15,-1},{15,59}})));
  MoSDH.Components.Storage.BoreholeStorage.BTES boreholes(
    redeclare replaceable parameter Modelica.Thermal.FluidHeatFlow.Media.Gylcol20_20degC medium,
    BHElength=100,
    BHEspacing=8,
    BHEstart=2,
    dZminMax(displayUnit=""),
    nAdditionalElementsR=5,nBHEs=100,
    nBHEsInSeries=2,
    relativeModelDepth=1.3,
    useAverageSurfaceTemperature=false,
    volFlowRef=min(-heatPump.volFlowSource,-regenerationHeatPump.volFlowLoad))  annotation(Placement(transformation(
  origin={-184,-61},
  extent={{-20,-20},{20,20}})));

// Weather Data
  MoSDH.Components.Weather.WeatherData weather(weatherData=Modelica.Utilities.Files.loadResource("modelica://MoSDH/Data/Weather/DWD/TRY2017_Darmstadt.txt")) annotation(Placement(transformation(extent={{-20,-72},{20,-32}})));

// Source Components
  MoSDH.Components.Sources.Electric.ElectricHeatingRod elBoiler(
    tau=3600,
    PelMax=2000000,
    mode=MoSDH.Utilities.Types.ControlTypes.RefFlowRefTemp,
    on=true,
    Tref(displayUnit="degC") = EB_Tref,
    volFlowRef=EB_volFlowRef) annotation (Placement(transformation(extent={{25,9},{65,49}})));
  MoSDH.Components.Sources.Electric.HeatPump heatPump(
    tau=3600,
    redeclare replaceable parameter Modelica.Thermal.FluidHeatFlow.Media.Gylcol20_20degC mediumSource,
    setAbsoluteSourcePressure=true,
    redeclare replaceable parameter Modelica.Thermal.FluidHeatFlow.Media.Water mediumLoad,
    setAbsoluteLoadPressure=true,
    TminLoad=323.15,
    MiminumShift=20,
    mode=MoSDH.Utilities.Types.ControlTypesHeatPump.SourceFlowRate,
    on=heatPumpMode == modes.FullLoad,
    Pref=HP_PthermalRef,
    Tref=TsupplyRef + 3,
    volFlowRef=HP_volFlowRef,
    DeltaTref=5)
               annotation(Placement(transformation(
  origin={-112,51},
  extent={{-20,-20},{20,20}})));
  MoSDH.Components.Sources.Electric.HeatPump regenerationHeatPump(
    tau=3600,
    setAbsoluteSourcePressure=false,
    mediumLoad=boreholes.medium,
    TminSource=243.15,
    TminLoad=273.15,
    MiminumShift=273.15,
    enableReturnFlowMixing=false,
    mode=MoSDH.Utilities.Types.ControlTypesHeatPump.SourcePower,
    on=regenerationHeatPumpMode == modes.FullLoad,
    setAbsoluteLoadPressure=false,
    Pref=regHP_PthermalRef,
    Tref=regTmax,
    DeltaTref=0) annotation (Placement(transformation(extent={{-248,2},{-208,-38}})));

// Distribution Components
  MoSDH.Components.Distribution.threeWayValveMix valve(tau=3600) annotation(Placement(transformation(extent={{70,29},{80,39}})));
  MoSDH.Components.Distribution.threeWayValveMix valve1(tau=3600) annotation(Placement(transformation(extent={{70,29},{80,19}})));
  MoSDH.Components.Distribution.threeWayValveMix valve2(tau=3600) annotation(Placement(transformation(extent={{20,9},{30,-1}})));
  MoSDH.Components.Distribution.threeWayValveMix valve3(tau=3600) annotation(Placement(transformation(extent={{20,49},{30,59}})));
  MoSDH.Components.Distribution.threeWayValveMix valve5(tau=3600) annotation(Placement(transformation(extent={{-30,49},{-20,59}})));
  MoSDH.Components.Distribution.threeWayValveMix valve6(tau=3600) annotation(Placement(transformation(extent={{-30,9},{-20,-1}})));
  MoSDH.Components.Distribution.threeWayValveMix valve4(medium=boreholes.medium) annotation (Placement(transformation(
        extent={{-5,-5},{5,5}},
        rotation=90,
        origin={-173,-11})));
  MoSDH.Components.Distribution.threeWayValveMix valve7(medium=boreholes.medium) annotation (Placement(transformation(
        extent={{-5,-5},{5,5}},
        rotation=90,
        origin={-173,-25})));
  MoSDH.Components.Distribution.threeWayValveMix valve8(medium=heatPump.mediumLoad) annotation (Placement(transformation(extent={{-66,60},{-56,50}})));
  MoSDH.Components.Distribution.threeWayValveMix valve9(medium=heatPump.mediumLoad) annotation (Placement(transformation(extent={{-70,0},{-60,10}})));
  MoSDH.Components.Distribution.threeWayValveMix valve10(medium=boreholes.medium) annotation (Placement(transformation(
        extent={{5,5},{-5,-5}},
        rotation=90,
        origin={-193,21})));
  MoSDH.Components.Distribution.threeWayValveMix valve11(medium=boreholes.medium) annotation (Placement(transformation(
        extent={{5,5},{-5,-5}},
        rotation=90,
        origin={-173,11})));
  MoSDH.Components.Distribution.Pump pump(volFlowRef=buffer_pump_volFlowRef) annotation (Placement(transformation(origin={0,66}, extent={{-5,-5},{5,5}})));
  MoSDH.Components.Distribution.Pump pump1(volFlowRef=buffer_pump1_volFlowRef) annotation (Placement(transformation(origin={0,-11}, extent={{5,-5},{-5,5}})));   //min(heatPump.volFlowLoad, (load.volFlow - elBoiler.volFlow))
  MoSDH.Components.Distribution.Pump hx_load_pump(volFlowRef=hx_load_volFlowRef) annotation (Placement(transformation(extent={{-82,18},{-72,28}})));
  MoSDH.Components.Distribution.HeatExchanger hx(
    tau=3600,
    mediumSource=boreholes.medium,
    mediumLoad=heatPump.mediumLoad,
    setAbsoluteLoadPressure=false,
    controlType=MoSDH.Utilities.Types.ControlTypesHX.Passive)
                                    annotation (Placement(transformation(extent={{-118,8},{-98,28}})));

// FluidFlow Components
  MoSDH.Components.Utilities.FluidHeatFlow.fluidSourceHot fluidSourceHot(Tsource=weather.Tambient) annotation (Placement(transformation(extent={{-254,-28},{-264,-18}})));
  MoSDH.Components.Utilities.FluidHeatFlow.fluidSourceCold fluidSourceCold(Tsource(displayUnit="K") = weather.Tambient)
                                                                                               annotation (Placement(transformation(extent={{-254,-18},{-264,-8}})));

// Load Components
  Components.Loads.HeatDemand            loadHeatingAndCooling(loadData=ModelicaServices.ExternalReferences.loadResource("modelica://MoSDH/Data/HeatDemand/Darmstadt_TRY2015_5GWh.txt"),
                                                                                                                                             powerUnitData=1000) annotation (Placement(transformation(extent={{90,8},{130,48}})));

initial algorithm 
// determine if system in in heating or cooling mode
  if loadHeatingAndCooling.Pload < 0 then
    coolingMode := true;
    heatingMode := false;
  else
    coolingMode := false;
    heatingMode := true;
  end if;
// determine the initial heat pump operation mode
  if max(buffer.Tlayers) < TsupplyRef and time > 1 and heatingMode then
    heatPumpMode := modes.FullLoad;
    HP_volFlowRef := boreholes.nBHEs * BHE_volFlowSpec / boreholes.nBHEsInSeries;
  elseif heatingMode then
    heatPumpMode := modes.Idle;
  else
    heatPumpMode := modes.Idle;
  end if;
//coolingMode
// determine the initial gas boiler operation mode
  if min(buffer.Tlayers[buffer.nLayers - 1:buffer.nLayers]) > TsupplyRef + 1 and heatingMode then
    boilerMode := modes.Idle;
  elseif min(buffer.Tlayers[buffer.nLayers - 1:buffer.nLayers]) > TsupplyRef - 8 and heatingMode then
    boilerMode := modes.PartLoad;
  elseif heatingMode then
    boilerMode := modes.FullLoad;
  else
    boilerMode := modes.Idle;
  end if;
//coolingMode
// determine the initial regeneration heat pump operation mode
  if weather.Tambient > TregenerationRef + 3 then
    regenerationHeatPumpMode := modes.FullLoad;
  elseif weather.Tambient > TregenerationRef then
    regenerationHeatPumpMode := modes.FullLoad;
  else
    regenerationHeatPumpMode := modes.Idle;
  end if;
// determine initital active regulation
  if heatingMode then
    hx_load_volFlowRef := 0;
    buffer_pump_volFlowRef := min(heatPump.volFlowLoad, loadHeatingAndCooling.volFlow - elBoiler.volFlow);
    buffer_pump1_volFlowRef := min(heatPump.volFlowLoad, loadHeatingAndCooling.volFlow - elBoiler.volFlow);
  else
    hx_load_volFlowRef := loadHeatingAndCooling.volFlow;
    buffer_pump_volFlowRef := loadHeatingAndCooling.volFlow;
    buffer_pump1_volFlowRef := loadHeatingAndCooling.volFlow;
  end if;
equation 
//Switch heat pump on/off
algorithm 

  when loadHeatingAndCooling.Pload <= 0 then
    coolingMode := true;
    heatingMode := false;
  elsewhen loadHeatingAndCooling.Pload > 0 then
    coolingMode := false;
    heatingMode := true;
  end when;
//Switch heat pump on/off
  when min(buffer.Tlayers) > TsupplyRef - 5 and heatingMode or min(boreholes.TboreholeWall) < TboreholeMin and heatingMode then
    heatPumpMode := modes.Idle;
  elsewhen max(buffer.Tlayers) < TsupplyRef and time > 1 and min(boreholes.TboreholeWall) > TboreholeMin + 2 and heatingMode then
    heatPumpMode := modes.FullLoad;
    HP_volFlowRef := boreholes.nBHEs * BHE_volFlowSpec / boreholes.nBHEsInSeries;
  elsewhen coolingMode then
    heatPumpMode := modes.Idle;
  end when;
//switch between boiler full load, part load and idle model
  when min(buffer.Tlayers[buffer.nLayers - 1:buffer.nLayers]) > TsupplyRef + 1 and heatingMode then
    boilerMode := modes.Idle;
  elsewhen min(buffer.Tlayers[buffer.nLayers - 1:buffer.nLayers]) < TsupplyRef - 3 and heatingMode then
    boilerMode := modes.PartLoad;
  elsewhen min(buffer.Tlayers[buffer.nLayers - 1:buffer.nLayers]) < TsupplyRef - 16 and heatingMode then
    boilerMode := modes.FullLoad;
  elsewhen min(buffer.Tlayers[buffer.nLayers - 1:buffer.nLayers]) > TsupplyRef - 8 and heatingMode then
    boilerMode := modes.PartLoad;
  elsewhen coolingMode then
    boilerMode := modes.Idle;
  end when;
//switch regeneration on/off
  when weather.Tambient > TregenerationRef + 3 and time > 3600 then
    regenerationHeatPumpMode := modes.FullLoad;
  elsewhen weather.Tambient > TregenerationRef then
    regenerationHeatPumpMode := modes.FullLoad;
  elsewhen weather.Tambient < TregenerationRef and time > 3600 then
    regenerationHeatPumpMode := modes.Idle;
  end when;
// determine initital active regulation
  when heatingMode then
    hx_load_volFlowRef := 0;
    buffer_pump_volFlowRef := min(heatPump.volFlowLoad, loadHeatingAndCooling.volFlow - elBoiler.volFlow);
    buffer_pump1_volFlowRef := min(heatPump.volFlowLoad, loadHeatingAndCooling.volFlow - elBoiler.volFlow);
  elsewhen coolingMode then
    hx_load_volFlowRef := loadHeatingAndCooling.volFlow;
    buffer_pump_volFlowRef := loadHeatingAndCooling.volFlow;
    buffer_pump1_volFlowRef := loadHeatingAndCooling.volFlow;
  end when;
equation 
// Component behaviour
  HP_PthermalRef = boreholes.nBHEs * boreholes.BHElength * BHE_PthermalSpec * min(1, max(0.25, (min(boreholes.TboreholeWall) - TboreholeMin) / 2));
  regHP_PthermalRef = boreholes.nBHEs * boreholes.BHElength * BHE_PthermalSpec * min(1, max(0.25, (min(boreholes.TboreholeWall) - TboreholeMin) / 2));
//2000000;// * regenerationHeatPump.COP * regenerationHeatPump.Pelectric;//
  regTmax = boreholes.Tstorage + 15.0;

  if boilerMode == modes.FullLoad then
    EB_volFlowRef =loadHeatingAndCooling.volFlow;
    EB_Tref = TsupplyRef;
  elseif boilerMode == modes.PartLoad then
    EB_volFlowRef =loadHeatingAndCooling.volFlow*(TsupplyRef - buffer.Tlayers[10])/(363.15 - TsupplyRef);
    EB_Tref = 363.15;
  else
    EB_volFlowRef = 0;
    EB_Tref = 363.15;
  end if;

  connect(elBoiler.supplyPort, valve.flowPort_b) annotation (Line(
      points={{64.67,34},{70,34}},
      color={255,0,0},
      thickness=1));
  connect(elBoiler.returnPort, valve1.flowPort_b) annotation (Line(
      points={{64.67,24},{70,24}},
      color={0,0,255},
      thickness=1));
  connect(loadHeatingAndCooling.supplyPort, valve.flowPort_a) annotation (Line(
      points={{90,33},{90,34},{79.67,34}},
      color={255,0,0},
      thickness=1));
  connect(loadHeatingAndCooling.returnPort, valve1.flowPort_a) annotation (Line(
      points={{90,23},{90,24},{79.67,24}},
      color={0,0,255},
      thickness=1));
  connect(loadHeatingAndCooling.weatherPort, weather.weatherPort) annotation (Line(points={{110,8.33},{110,-22},{0,-22},{0,-32}}, color={0,176,80}));
  connect(weather.weatherPort,buffer.weatherPort) annotation(Line(
   points={{0,-32},{0,-0.67}},
   color={0,176,80}));
  connect(pump1.flowPort_b,valve6.flowPort_c) annotation(Line(
   points={{-4.67,-11},{-25,-11},{-25,-1}},
   color={0,0,255},
   thickness=1));
  connect(pump.flowPort_a,valve5.flowPort_c) annotation(Line(
   points={{-5,66},{-25,66},{-25,59}},
   color={255,0,0},
   thickness=1));
  connect(pump.flowPort_b,valve3.flowPort_c) annotation(Line(
   points={{4.67,66},{25,66},{25,59}},
   color={255,0,0},
   thickness=1));
  connect(buffer.sourceIn,valve5.flowPort_a) annotation(Line(
   points={{-15,54},{-20.33,54}},
   color={255,0,0},
   thickness=1));
  connect(buffer.sourceOut,valve6.flowPort_a) annotation(Line(
   points={{-15,4},{-20.33,4}},
   color={0,0,255},
   thickness=1));
  connect(valve2.flowPort_a,valve1.flowPort_c) annotation(Line(
   points={{29.67,4},{75,4},{75,19}},
   color={0,0,255},
   thickness=1));
  connect(valve3.flowPort_a,valve.flowPort_c) annotation(Line(
   points={{29.67,54},{75,54},{75,39}},
   color={255,0,0},
   thickness=1));
  connect(pump1.flowPort_a,valve2.flowPort_c) annotation(Line(
   points={{5,-11},{25,-11},{25,-1}},
   color={0,0,255},
   thickness=1));
  connect(fluidSourceHot.fluidPort, regenerationHeatPump.supplyPortSource) annotation (Line(
      points={{-254,-23},{-248,-23}},
      color={255,0,0},
      thickness=1));
  connect(fluidSourceCold.fluidPort, regenerationHeatPump.returnPortSource) annotation (Line(
      points={{-254,-13},{-248,-13}},
      color={0,0,255},
      thickness=1));
  connect(weather.weatherPort, boreholes.weatherPort) annotation (Line(points={{0,-32},{0,-22},{-150,-22},{-150,-80.67},{-184,-80.67}},
                                                                                                                          color={0,176,80}));
  connect(valve4.flowPort_b, valve7.flowPort_a) annotation (Line(
      points={{-173,-16},{-173,-20.33}},
      color={0,0,0},
      thickness=1));
  connect(boreholes.returnPort, valve7.flowPort_b) annotation (Line(
      points={{-174,-41},{-174,-34},{-173,-34},{-173,-30}},
      color={0,0,255},
      thickness=1));
  connect(regenerationHeatPump.supplyPortLoad, valve7.flowPort_c) annotation (Line(
      points={{-208.33,-23},{-208.33,-24},{-180,-24},{-180,-25},{-178,-25}},
      color={255,0,0},
      thickness=1));
  connect(regenerationHeatPump.returnPortLoad, valve4.flowPort_c) annotation (Line(
      points={{-208.33,-13},{-208.33,-11},{-178,-11}},
      color={0,0,255},
      thickness=1));
  connect(valve6.flowPort_b, valve9.flowPort_a) annotation (Line(
      points={{-30,4},{-32,4},{-32,5},{-60.33,5}},
      color={0,0,0},
      thickness=1));
  connect(valve5.flowPort_b, valve8.flowPort_a) annotation (Line(
      points={{-30,54},{-32,54},{-32,55},{-56.33,55}},
      color={0,0,0},
      thickness=1));
  connect(heatPump.supplyPortLoad, valve8.flowPort_b) annotation (Line(
      points={{-92.33,56},{-79.165,56},{-79.165,55},{-66,55}},
      color={255,0,0},
      thickness=1));
  connect(boreholes.supplyPort, valve10.flowPort_a) annotation (Line(
      points={{-194,-41},{-194,-9.335},{-193,-9.335},{-193,16.33}},
      color={255,0,0},
      thickness=1));
  connect(valve11.flowPort_a, valve4.flowPort_a) annotation (Line(
      points={{-173,6.33},{-173,-6.33}},
      color={0,0,0},
      thickness=1));
  connect(valve11.flowPort_c, hx.returnPortSource) annotation (Line(
      points={{-168,11},{-168,10},{-124,10},{-124,13},{-118,13}},
      color={0,0,0},
      thickness=1));
  connect(heatPump.returnPortSource, valve11.flowPort_b) annotation (Line(
      points={{-132,46},{-174,46},{-174,16},{-173,16}},
      color={0,0,255},
      thickness=1));
  connect(heatPump.supplyPortSource, valve10.flowPort_b) annotation (Line(
      points={{-132,56},{-193,56},{-193,26}},
      color={255,0,0},
      thickness=1));
  connect(hx_load_pump.flowPort_b, valve8.flowPort_c) annotation (Line(
      points={{-72.33,23},{-61,23},{-61,50}},
      color={0,0,0},
      thickness=1));
  connect(hx.supplyPortSource, valve10.flowPort_c) annotation (Line(
      points={{-118,23},{-118,21},{-188,21}},
      color={255,0,0},
      thickness=1));
  connect(hx.supplyPortLoad, hx_load_pump.flowPort_a) annotation (Line(
      points={{-98.33,23},{-82,23}},
      color={255,0,0},
      thickness=1));
  connect(hx.returnPortLoad, valve9.flowPort_b) annotation (Line(
      points={{-98.33,13},{-98.33,12},{-76,12},{-76,5},{-70,5}},
      color={0,0,255},
      thickness=1));
  connect(heatPump.returnPortLoad, valve9.flowPort_c) annotation (Line(
      points={{-92.33,46},{-65,46},{-65,10}},
      color={0,0,255},
      thickness=1));
  connect(buffer.loadOut, valve3.flowPort_b) annotation (Line(
      points={{14.67,54},{20,54}},
      color={255,0,0},
      thickness=1));
  connect(buffer.loadIn, valve2.flowPort_b) annotation (Line(
      points={{14.67,4},{20,4}},
      color={0,0,255},
      thickness=1));
 annotation (
  __OpenModelica_commandLineOptions="--matchingAlgorithm=PFPlusExt --indexReductionMethod=dynamicStateSelection -d=initialization,evaluateAllParameters,NLSanalyticJacobian -d=nonewInst -d=nonewInst",
  __OpenModelica_simulationFlags(
   lv="LOG_STATS",
   s="cvode"),
  __esi_viewinfo={
     ModelInfo(
      defaultViewSettings=ViewSettings(showGrid=2))},
  Diagram(coordinateSystem(extent={{-280,-120},{150,100}})),
  Documentation(info= "<html><head></head><body><h3 style=\"font-family: 'MS Shell Dlg 2';\">Example model for a geothermal heating system:</h3><h2><ul><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">A&nbsp;<a href=\"modelica://MoSDH.Components.Storage.BoreholeStorage.BTES\">borehole heat exchanger array</a>&nbsp;supplies heat to the&nbsp;<a href=\"modelica://MoSDH.Components.Storage.StratifiedTank.TTES\">buffer storage</a>&nbsp;via a&nbsp;<a href=\"modelica://MoSDH.Components.Sources.Electric.HeatPump\">heat pump</a>.&nbsp;</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">A <a href=\"modelica://MoSDH.Components.Distribution.HydraulicShunt\">shunt</a> is used for hydraulic decoupling of the BHEs and the heat pumps, since both have a circulation pump integrated into the same hydraulic circuit.</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">The&nbsp;<a href=\"modelica://MoSDH.Components.Loads.HeatDemand\">heat load</a>&nbsp;is suplied from the buffer storage and a&nbsp;<a href=\"modelica://MoSDH.Components.Sources.Fossil,BasBoiler\">gas boiler</a>&nbsp;is used as additional heat source.&nbsp;</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">The&nbsp;<a href=\"modelica://MoSDH.Components.Weather.WeatherData\">weather</a>&nbsp;component is required to giv the ambient temperature for calculation of the buffer's thermal losses and the day of the year for the heat load table.</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">Pumps are used to bypass the buffer, if heat can be supplied directly from the heat pump to the load.</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">The system control strategy is defined on the top level of the model.</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">Parameters&nbsp;<b>TsupplyRef</b>&nbsp;and&nbsp;<b>TreturnRef</b>&nbsp;are used to define the operating temperatures of the system.</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">The gas boiler is operated in mode&nbsp;<b>RefTempFefFlow</b>, for which the supply temperture is deined by the control variable&nbsp;<b>boiler.Tref</b>&nbsp;and the volume flow rate by the variable&nbsp;<b>boiler.volFlowRef</b>.&nbsp;</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px; font-weight: normal;\">The variable&nbsp;<b>boilerMode</b>&nbsp;of type&nbsp;<a href=\"modelica://MoSDH.Utilities.Types.OperationModes\">OperationModes</a>&nbsp;is used &nbsp;to define the behavior of the gas boiler. Three modes are implemented:</li><ul style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\"><li><span style=\"font-weight: normal;\">Idle: If the buffer has the required temperature, the boiler is turned off (</span>boiler.<b>volFlowRef</b><span style=\"font-weight: normal;\">=0)</span></li><li style=\"font-weight: normal;\">PartLoad: If the buffer temperature falls below the required temperature, the gas boiler is used to shift the temperature of the stored heat by mixing.</li><li style=\"font-weight: normal;\">FullLoad: If the buffer temperature falls below the deinfed maximum, all of the heat demand is covered by the boiler.</li></ul><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\"><span style=\"font-weight: normal;\">The heat pump is operated in </span>mode<span style=\"font-weight: normal;\"> SourceFlowRate, fow which the source side volume flow rate (</span>heatPump.volFlowRef<span style=\"font-weight: normal;\">), the load side supply temperature (</span>heatPump.Tref<span style=\"font-weight: normal;\">) and the load thermal power (</span>heatPump.Tref<span style=\"font-weight: normal;\">) have to be defined.</span></li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\"><span style=\"font-weight: normal;\">The variable heatPumpMode is used to turn the heat pump off, if the buffer storage is filled or the borehole wall temperature falls below parameter </span>TboreholeMin.</li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\"><span style=\"font-weight: normal;\">The heating power of the heat pump is defined in relation to the total borehole length by parameter </span>BHE_PthermalSpec<span style=\"font-weight: normal;\">&nbsp;and modulated to a minimum of 25 % if the borehole temperatures gets close to </span>TboreholeMin<span style=\"font-weight: normal;\">.</span></li><li style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\"><span style=\"font-weight: normal;\">The borehole field volume flow rate </span>boreholes.volFlowRef<span style=\"font-weight: normal;\"> is set equal to the source side volume flow rate of the heat pump </span>hp.volFlowSource <span style=\"font-weight: normal;\">(negative -&gt; see pump on the icon of the borehole field).</span></li></ul>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
  <caption align=\"bottom\"><strong>Fig. 1: </strong>Thermal powers</caption>
  <tbody><tr>
    <td>
      <img src=\"modelica://MoSDH/Utilities/Images/ExampleGeothermalHeating.png\" width=\"700\">
    </td>
  </tr>
</tbody></table>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
  <caption align=\"bottom\"><strong>Fig. 2: </strong>BHE inlet and outlet temperatures </caption>
  <tbody><tr>
    <td>
      <img src=\"modelica://MoSDH/Utilities/Images/ExampleGeothermalHeatingB.png\" width=\"700\">
    </td>
  </tr>
</tbody></table>
</h2>

</body></html>"),
  experiment(
      StopTime=31536000,
      Interval=3600,
      Tolerance=0.1,
      __Dymola_Algorithm="Dassl"),
    Icon(coordinateSystem(extent={{-280,-120},{150,100}})));
end Modell_pump_cooling_SoF;

Solution

  • The mistake was so simple that I am almost embarresed to post the answer here:

    The reference temperature was compared to the input temperature + the minimum temperature shift. And the default unit for the shift was set to degree Celcius. Therefore my temperature shift was accidentaly set to 0°C or in other words 273.15 K. Which caused the Heatpump to always return the maximum possible Temperature.