Giter VIP home page Giter VIP logo

Comments (3)

casella avatar casella commented on August 29, 2024

Regarding the first problem, PEleMin is computed from tabular data. First, an external object parameter is created by means of an internal CombiTable2D function call

  parameter Modelica.Blocks.Types.ExternalCombiTable2D tabIdePEle=
      Modelica.Blocks.Types.ExternalCombiTable2D(
      "NoName",
      "NoName",
      tabPEle.table,
      smoothness,
      extrapolation,
      false) "External table object for nominal electrical power consumption";

then, the flat model contains

final parameter Real heaPum.refCyc.refCycHeaPumHea.PEle_nominal(quantity = "Power", unit = "W") =
  Modelica.Blocks.Tables.Internal.getTable2DValueNoDer2(
    heaPum.refCyc.refCycHeaPumHea.tabIdePEle, 
    heaPum.refCyc.refCycHeaPumHea.TCon_nominal,
    heaPum.refCyc.refCycHeaPumHea.TEva_nominal) *
  heaPum.refCyc.refCycHeaPumHea.scaFac "Nominal electrical power consumption";

which looks good.

However, in the debugger we see:

(assign) heaPum.refCyc.refCycHeaPumHea.PEle_nominal := 
  Modelica.Blocks.Tables.Internal.getTable2DValueNoDer2(
    heaPum.refCyc.refCycHeaPumHea.tabIdePEle, 
    false,
    Modelica.Fluid.Types.Dynamics.FixedInitial) *
 heaPum.refCyc.refCycHeaPumHea.scaFac

So, during code generation, at some point the two Real inputs TCon_nominal and TEva_nominal were replaced by a Boolean and an enumeration value.

Running the model with -d=optdaedump crashes OMEdit, probably because there is something fishy going on.

from openmodelica.

casella avatar casella commented on August 29, 2024

Got it, by running -d=optdaedump from the command line. The issue is in the pre-optimization module evaluateParameters (simulation). Before that module runs, we see

3168: heaPum.refCyc.refCycHeaPumHea.PEle_nominal:PARAM(unit = "W" final = true )  = 
  Modelica.Blocks.Tables.Internal.getTable2DValueNoDer2(heaPum.refCyc.refCycHeaPumHea.tabIdePEle, 
  heaPum.refCyc.refCycHeaPumHea.TCon_nominal,
  heaPum.refCyc.refCycHeaPumHea.TEva_nominal) *
heaPum.refCyc.refCycHeaPumHea.scaFac  "Nominal electrical power consumption" type: Real

which is fine. After that module runs, we see

3168: heaPum.refCyc.refCycHeaPumHea.PEle_nominal:PARAM(unit = "W" final = true )  = 
Modelica.Blocks.Tables.Internal.getTable2DValueNoDer2(
  heaPum.refCyc.refCycHeaPumHea.tabIdePEle, 
  false, 
  Modelica.Fluid.Types.Dynamics.FixedInitial) * 
heaPum.refCyc.refCycHeaPumHea.scaFac  "Nominal electrical power consumption" type: Real

which is obviously nonsense.

@phannebohm, @kabdelhak can you please check what is going wrong in that module and fix it?

Thanks

from openmodelica.

phannebohm avatar phannebohm commented on August 29, 2024

Is this new or old backend? You link to the old one.

I'm having trouble reproducing the issue. When I use this script (old backend):

loadModel(Buildings, priorityVersion = {"12.0.0-master"}); getErrorString();
simulate(Buildings.Fluid.HeatPumps.ModularReversible.Examples.LargeScaleWaterToWater_OneRoomRadiator); getErrorString();

I get the following result:

true
""
record SimulationResult
    resultFile = "/home/ph/ws/models/test/Buildings.Fluid.HeatPumps.ModularReversible.Examples.LargeScaleWaterToWater_OneRoomRadiator_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 86400.0, numberOfIntervals = 500, tolerance = 1e-8, method = 'dassl', fileNamePrefix = 'Buildings.Fluid.HeatPumps.ModularReversible.Examples.LargeScaleWaterToWater_OneRoomRadiator', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "LOG_ASSERT        | warning | [/home/ph/.openmodelica/libraries/Buildings 12.0.0-master/Fluid/HeatPumps/ModularReversible/TableData2D.mo:78:3-83:28:writable]
|                 | |       | The following assertion has been violated during initialization at time 0.000000
|                 | |       | ((abs(heaPum.scaFacHea - heaPum.scaFacCoo) / heaPum.scaFacHea < heaPum.limWarSca)) --> \"In LargeScaleWaterToWater_OneRoomRadiator.heaPum: Scaling factors for heating and cooling
|                 | |       |     operation differ by 95.9592 %. The simulated nominal heating and cooling
|                 | |       |     capacities may not be realistic for a single device\"
LOG_SUCCESS       | info    | The initialization finished successfully with 3 homotopy steps.
LOG_SUCCESS       | info    | The simulation finished successfully.
",
    timeFrontend = 1.107622303,
    timeBackend = 1.06267989,
    timeSimCode = 0.137295308,
    timeTemplates = 0.178590055,
    timeCompile = 1.298441242,
    timeSimulation = 0.281521631,
    timeTotal = 4.06624667
end SimulationResult;
"Warning: The model contains alias variables with redundant start and/or conflicting nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts.
"

The new backend doesn't come this far:

true
""
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 86400.0, numberOfIntervals = 500, tolerance = 1e-8, method = 'dassl', fileNamePrefix = 'Buildings.Fluid.HeatPumps.ModularReversible.Examples.LargeScaleWaterToWater_OneRoomRadiator', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "Failed to build model: Buildings.Fluid.HeatPumps.ModularReversible.Examples.LargeScaleWaterToWater_OneRoomRadiator",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;
"[/home/ph/ws/OpenModelica/OMCompiler/Compiler/NFFrontEnd/NFComponentRef.mo:595:7-598:102:writable] Error: Internal error NFComponentRef.mergeSubscripts failed because the subscripts {$i1} could not be fully merged onto rad.vol.dynBal.Medium.nC.
Result: rad.vol.dynBal.Medium.nC with leftover: {$i1}.
"

from openmodelica.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.