Skip to content
Thermodynamic property models for use with Modia and other Julia packages
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dict Packages used in tests added via ModiaMedia Feb 25, 2019
docs Formatting error in documentation corrected Feb 3, 2019
src New function getMedium(state) to inquire Medium from state Feb 28, 2019
test Removed Medium from connectors (since in states) Feb 28, 2019
LICENSE.md Initial version Nov 4, 2018
Manifest.toml Packages used in tests added via ModiaMedia Feb 25, 2019
Project.toml Project.toml and manifest.toml file adapted Nov 18, 2018
README.md
REQUIRE

README.md

ModiaMedia

Latest

This package provides thermodynamic property models for use with Modia and other Julia packages. The initial goal is to achieve a similar functionality as Modelica.Media, the standard media library for Modelica models, but with improvements based on Julia features such as multiple dispatch.

This package is under development and it is planned to provide all thermodynamic property models from Modelica.Media in this package.

Installation

This package is currently under development and is not yet registered in METADATA. Julia 1.0 is required. Installation is performed via:

julia> ]add https://github.com/ModiaSim/ModiaMedia.jl

ModiaMedia uses PyPlot for plotting (via ModiaMath.plot). If PyPlot is not available in your current Julia environment an information message is printed and all plot(..) calls are ignored.

In order that plot windows are displayed, you need to add PyPlot to your current environment via ]add PyPlot. Often this automatic installation fails and it is recommended to follow the instructions Installing PyPlot in a robust way.

Use

  using ModiaMedia

  # Define thermodynamic property model to be used
  Medium = getMedium("N2");

  # Define the operating point where the medium shall be evaluated.
  p = 1e5    # in [Pa]
  T = 300.0  # in [K]

  # Set the medium-specific thermodynamic state from p and T
  # (could be also set from p,h, or p,s, or d,T, or
  # p,T,X, or p,h,X, or p,s,X, or d,T,X)
  state = setState_pT(Medium, p, T)

  # Update a state object with new values
  setState_pT!(state, p, T)

  # Call media functions (here to compute density and specific enthalpy)
  d = density(state)
  h = specificEnthalpy(state)

  # Print computed values
  println("data for p=$p, T=$T:")
  println("density          = ", d)
  println("specificEnthalpy = ", h)

  # List the available media
  listMedia()

  # Plot the most important characteristics of the medium
  standardPlot(Medium)

The last command results in the following plot:

standardPlot

Status

The ModiaMedia package development has just started and a lot has to be improved.

Main Developers

License: MIT (expat)

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.