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
  • » jesper.renz
  • » Profile

Posts

Posts

Oct-13-17 13:58:06
Problems with Simulation of external Media packages

Hello,

i would like to use Methane (CH4) for my fluid model. But not the Ideal Gas from NASA Glenn coefficient because i need to simulate temperatures below 200K.

When i open Dymola (Version 2017 with Modelica Version 3.2.2) first i load the following packages:
ExternalMedia, CoolProp2Modelica, MediaTwoPhaseMixture and ThermCycle.

I´m now using a simple fluid model. The "System" and the "closed Volume" from SML and select the "Methane - CoolProp - TC" Medium.

When i run the Model "Check" everything is fine. But when i try to start the Simulation i get following failures:

Translation of Tankh1:

The DAE has 70 scalar unknowns and 70 scalar equations.
The initial conditions for variables of type Real are not fully specified.
Dymola has selected default initial conditions.
Assuming fixed start value for the continuous states:
volume.medium.h(start = volume.h_start)
volume.medium.p(start = volume.p_start)
Statistics
Selected continuous time states
Compilation of Tankh1 failed. See Simulation tab for more information.
Note: There were translation errors that might explain the problem.
Failed
ERROR: 1 error was found
WARNING: 1 warning was issued



I have choosed the "ThermoStates" "Modelica.Media.Interfaces.Choices.IndependentVariables.T" in the Medium.

Could you please help me or give me a hint. Here is the code for my Modell:

model Tankh1
  inner Modelica.Fluid.System system
    annotation (Placement(transformation(extent={{-78,-88},{-58,-68}})));
  Modelica.Fluid.Vessels.ClosedVolume volume(
    redeclare package Medium = ThermoCycle.Media.Methane (ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.T),

    portsData={Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter=0.1)},
    V=50) annotation (Placement(transformation(extent={{-18,14},{2,34}})));
equation

  annotation (uses(Modelica(version="3.2.2")));
end Tankh1;



Thank you very much current/smile

Attached are two screenshots and the code of all used classes.

Failure.pdf

Sep-06-17 16:02:46
Problem with gas phases in Dymola

Hello Rene,

thank you for your informative reply.

I found out that RefProp is an commercial product from NIST https://www.nist.gov/srd/refprop   and could deliver the needed informations, but it is not for free.
Whereas CoolProf is the open-source alternative for RefProf https://sourceforge.net/projects/coolpr … directory

While installing the CoolProf Libary, with the wrapper, i got some further problems. I will try first to figure everything out and check the help on http://www.coolprop.org/v4/

I will post my results later on.
Regards, Jesper


Aug-20-17 08:37:41
Problem with gas phases in Dymola

Hello,

i started to build up a simple model in Dymola with two tanks and one pipe in between. When i choose "simple natural gas" as a medium i can run the simulation and everythink works fine.
But for my whole project i need also to run the natural gas in a liquified phase, which means that the temperature is about -162°celsius. If the ambient temperature is like this, an error occurs in the simulation mode:


... "dsin.txt" loading (dymosim input file)
tank.medium.T >= 200 and tank.medium.T <= 6000
The following error was detected at time: 0

Temperature T (=173.15 K = 200 K) is not in the allowed range
200 K <= T <= 6000 K
required from medium model "SimpleNaturalGas".
Error: Failed to start model.

- Does anyone know how to handle the natural gas within an temperature range from -162°C to +40°C?
- are there any other opportunities? e.g. using Look-Up-tables with pV-,ph- and T,s- diagrams?
- Is it possible to do such simulation (vaporizing gas) in Dymola or is it recommended to use another software for it?

When i use another medium, e.g. CH4 (methane) the same problem appears.

Thanks a lot for any hints and comments!
Regards, Jesper Renz

  • Index
  • » Users
  • » jesper.renz
  • » Profile
You are here: