Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » mschuh
  • » Profile

Posts

Posts

May-03-21 23:58:21
Having problems starting a simulation so I want to view the initial values to debug the problem

Thank you Carlos!  I was looking at the wrong file.  As you said, the .log file has the initial values and that it is a text file and can be viewed with a text editor.

Apr-22-21 00:17:54
Having problems starting a simulation so I want to view the initial values to debug the problem

Thank you CGT for explaining how to use the LOG_INIT_V simulation flag to save the initial data and where to find it.  I found the initial conditions .intdata file in the output path as you said.  It appears that the .intdata file is a data file of some sorts.  Is there a tool for viewing this file?  I tried to figure out if the OMEdit plotting tool could open it, but I could not figure out how to do this.


Code:


michael@jenkins:/tmp/OpenModelica_michael/OMEdit/Cdep.CDepSystem_reference_for_first_tryV2$ ls -ltr
total 287332
drwxr-xr-x 7 michael michael      4096 Apr 21 07:54 ..
-rw-r--r-- 1 michael michael   1252947 Apr 21 16:57 CDepSystem_reference_for_first_tryV2_init.xml
-rw-r--r-- 1 michael michael   1924067 Apr 21 16:57 CDepSystem_reference_for_first_tryV2_info.json
-rwxr-xr-x 1 michael michael   1788528 Apr 21 16:57 CDepSystem_reference_for_first_tryV2
-rw-r--r-- 1 michael michael  20283380 Apr 21 16:57 CDepSystem_reference_for_first_tryV2_prof.intdata
-rw-r--r-- 1 michael michael  40806800 Apr 21 16:57 CDepSystem_reference_for_first_tryV2_prof.realdata
-rw-r--r-- 1 michael michael 228016014 Apr 21 16:57 CDepSystem_reference_for_first_tryV2_res.mat
-rw-r--r-- 1 michael michael    139615 Apr 21 16:57 CDepSystem_reference_for_first_tryV2.log

Apr-13-21 20:38:45
Having problems starting a simulation so I want to view the initial values to debug the problem

I am working with a fluid system model and having trouble with initialization.  I suspect that the initial values assigned to the variables are not close enough to a valid solution for the simulation to be able to start.

Is there a way to look at the initial values that are set when the simulation begins for the pressure and flow variables?

If so, I suspect that I could look at them and figure out what initial equations I need to add to aid the initialization process.

Is there a good way to debug these problems?  I have looked for one but have not found anything helpful.  I would appreciate guidance on how to work through these problems.

Here is the output I see when trying to run the simulation:

Code:

  1 /tmp/OpenModelica_michael/OMEdit/CDepWithDeposition.CDepSystemV2/CDepSystemV2 -port=38453 -logFormat=xmltcp -override=startTime=0,stopTime=60000,stepSize=100,tolerance=1e-06,solver=dass    l,outputFormat=mat,variableFilter=.* -r=/tmp/OpenModelica_michael/OMEdit/CDepWithDeposition.CDepSystemV2/CDepSystemV2_res.mat -iim=symbolic -cpu -w -lv=LOG_INIT,LOG_STATS -inputPath=/tm    p/OpenModelica_michael/OMEdit/CDepWithDeposition.CDepSystemV2 -outputPath=/tmp/OpenModelica_michael/OMEdit/CDepWithDeposition.CDepSystemV2

  2 ### START INITIALIZATION ###
  3 updating min-values
  4 updating max-values
  5 updating nominal-values
  6 updating primary start-values
  7 initialization method: symbolic        [solves the initialization problem symbolically - default]
  8 Model contains homotopy operator: Use adaptive homotopy method to solve initialization problem. To disable initialization with homotopy operator use "-noHomotopyOnFirstTry".
  9 The initialization problem is inconsistent due to the following equation: 0 != 0.008 = 100120.0 - PreCoolerHeatExchanger.chamber_flow.mediums[1].p
10 ### END INITIALIZATION ###
11 Error in initialization. Storing results and exiting.
12 Use -lv=LOG_INIT -w for more information.

Thanks,
    Michael

Oct-27-20 16:56:58
Want to create simple model of ice formation in a counter-flow heat exchanger

I have written a simple distributed volume counter-flow heat exchanger model.  I would like to add a simple model of ice deposition to it.  My approach is to somehow divide the flow out of a segment into a moist air flow and an ice flow and account for the ice flow as an accumulation of ice.  The frost layer will be thin so there is no need to model the impact of the ice on the heat transfer so there is no need to model this.  I have been trying to figure out how to use the Modelica.Media.Air.MositAir.Xsaturation library call to specify how much of the flow will be ice and how much will be moist air.

Can someone point me to a relevant example or paper that describes how to do this?

Jul-25-20 01:49:32
How do I remove a text string from an inherited icon?

I am trying to extend the Modelica.Thermal.HeatTransfer.Components.HeatCapacitor class so that the mass and specific heat are specified as parameters and are displayed in the Icon.  I tried

Code:

model SolidHeatCapacitor

  extends Modelica.Thermal.HeatTransfer.Components.HeatCapacitor(C = mass*specific_heat_capacity);
  parameter Modelica.SIunits.Mass mass(start = 1.0) "Mass of the lumped capacitance";
  parameter Modelica.SIunits.SpecificHeatCapacity specific_heat_capacity(start = 502.0) "Specific Heat Capacity of the mass";
equation

annotation(
    Icon(graphics = {
    Text(origin = {1, 39}, extent = {{-81, 11}, {81, -11}}, textString = "Mass %mass"),
    Text(origin = {13, -46}, extent = {{-97, 8}, {97, -8}}, textString = "Cp %specific_heat_capacity")}));
end SolidHeatCapacitor;

When I do this, the “%C” text in the annotation icon shows “mass*specific_heat_capacity” instead of the product of the two.  The icon on the left is from the Modelica.Thermal library and the one on the right is from the above code.

http://boardsailor.com/pictures/20200724_Modelica_Icon.png

The "%C" text is filled with "5.5 J/K" in the left icon and "mass*specific_heat_capacity" in the right icon.  How do I modify the Modelica.Thermal.HeatTransfer.Components.HeatCapacitor class icon text to remove the “%C” text?  Alternatively, how can the "%C" text be filled with the value rather than the "mass*specific_heat_capacity" text?

I spent hours trying to find documentation on how to do these things without success.  Where can I find documentation that talks about this?

Thanks,
   Michael

  • Index
  • » Users
  • » mschuh
  • » Profile
You are here: