lbl-srg / modelica-buildings

Modelica Buildings library
255 stars 158 forks source link

NaturalConvectionWithControl: Simulation fails for Stop time values > 1 hr #962

Closed billstav closed 6 years ago

billstav commented 7 years ago

Hello everyone,

I have run several tests during the past few days using the Natural Convection With Control model. My conclusion is that the simulation usually fails for Stop Time values > 3600 s = 1h. My intention is to couple this model with some other power generation models from the library (e.g. wind, etc.) to get results for a time horizon of at least 1 year. However, having tested the Natural Convection With Control model for different sets of parameters (i.e. PI gain, Ti, sample period, number of intervals, tolerance) it seems impossible to gο past the 2hrs.

I also get the following errors:

  1. The initial conditions are not fully specified. Dymola has selected default initial conditions. Assuming fixed start value for the continuous states: conPID.I.y(start = 0.0)
  2. WARNINGS have been issued.
  3. Process Simulating: Initialization stopped without any error indication. 4.ERRORS have been issued.

while simulation fails with the following message:

"Log-file of program ./dymosim (generated: Fri Sep 22 22:30:44 2017)

dymosim started Model: Buildings.ThermalZones.Detailed.Examples.FFD.NaturalConvectionWithControl1 ... "dsin.txt" loading (dymosim input file) ... loading "tab1" from "C:/Users/..../Desktop/Buildings 4.0.0/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos" Start cosimulation ... "NaturalConvectionWithControl1.mat" creating (simulation result file) Integration started at T = 0 using integration method DASSL (DAE multi-step solver (dassl/dasslrt of Petzold modified by Dynasim))"

Any ideas?

Thank you in advance for your time.

mwetter commented 7 years ago

The model works for me, using the version from the master on Linux Ubuntu:

simulateModel("Buildings.ThermalZones.Detailed.Examples.FFD.NaturalConvectionWithControl", stopTime=7200, method="radau", tolerance=1e-06, resultFile="NaturalConvectionWithControl");
 = true
simulateModel("Buildings.ThermalZones.Detailed.Examples.FFD.NaturalConvectionWithControl", stopTime=7200, tolerance=1e-06, resultFile="NaturalConvectionWithControl");
 = true

Can you please send your simulate command so we can try to reproduce it on a Windows computer. I assume the model that won't work is the one from the library rather than one that you changed. Best is to first test the original model as distributed with the library.

billstav commented 7 years ago

@mwetter: Yes the model i ve been testing is the one from the library - no changes there. However, i have some different parameters from the default:

roo( nPorts=0, massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, AFlo=3*3, hRoo=3, useCFD=true, intConMod=Buildings.HeatTransfer.Types.InteriorConvection.Temperature, extConMod=Buildings.HeatTransfer.Types.ExteriorConvection.TemperatureWind, cfdFilNam= "modelica://Buildings/Resources/Data/Rooms/FFD/NaturalConvectionWithControl.ffd", linearizeRadiation=true, samplePeriod=30), qRadGai_flow(k=1), qConGai_flow(k=1), qLatGai_flow(k=1), TWesWal(T(displayUnit="K") = 277.15), weaDat(filNam= "C:/Users/.../Desktop/Buildings 4.0.0/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"), TEasWal(T(displayUnit="K")));

conPID( yMin=0, reset=Buildings.Types.Reset.Disabled, yMax=250, y_start=0, initType=Modelica.Blocks.Types.InitPID.NoInit, reverseAction=false, controllerType=Modelica.Blocks.Types.SimpleController.PI, k=2, Ti=1080)

TSet(k=298.15)


The fixed parameters for my study is Tset, yMax, Vroom and TWesWall while i ve been testing different values for PI gain, Ti, sample period, number of intervals to find the right combination in order for the simulation to not fail.

mwetter commented 7 years ago

@billstav : I cannot reproduce a failure. I run the following model:

model Test
  extends 
    Buildings.ThermalZones.Detailed.Examples.FFD.NaturalConvectionWithControl(
    roo(
      nPorts=0,
      massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
      AFlo=3*3,
      hRoo=3,
      useCFD=true,
      intConMod=Buildings.HeatTransfer.Types.InteriorConvection.Temperature,
      extConMod=Buildings.HeatTransfer.Types.ExteriorConvection.TemperatureWind,

      cfdFilNam="modelica://Buildings/Resources/Data/Rooms/FFD/NaturalConvectionWithControl.ffd",

      linearizeRadiation=true,
      samplePeriod=30),
    qRadGai_flow(k=1),
    qConGai_flow(k=1),
    qLatGai_flow(k=1),
    TWesWal(T(displayUnit="K") = 277.15),
    TEasWal(T(displayUnit="K")),
    conPID(
      yMin=0,
      reset=Buildings.Types.Reset.Disabled,
      yMax=250,
      y_start=0,
      initType=Modelica.Blocks.Types.InitPID.NoInit,
      reverseAction=false,
      controllerType=Modelica.Blocks.Types.SimpleController.PI,
      k=2,
      Ti=1080),
    TSet(k=298.15),
    weaDat(filNam="modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"));

  annotation (uses(Buildings(version="5.0.0")));
end Test;

with the command

simulateModel("Test", stopTime=7200, tolerance=1e-06, resultFile="Test");
 = true

I used Ubuntu Linux, but this should not matter.

mwetter commented 6 years ago

Closed as it cannot be reproduced.