mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-01 03:00:13 -04:00
Merge branch 'master' into pgfplots
This commit is contained in:
@@ -46,10 +46,10 @@ To use the HAProps function, import it and do some calls, do something like this
|
||||
In [2]: h = HAPropsSI('H','T',298.15,'P',101325,'R',0.5); print h
|
||||
|
||||
# Temperature of saturated air at the previous enthalpy
|
||||
In [2]: T = HAPropsSI('T','P',101.325,'H',h,'R',1.0); print T
|
||||
In [2]: T = HAPropsSI('T','P',101325,'H',h,'R',1.0); print T
|
||||
|
||||
# Temperature of saturated air - order of inputs doesn't matter
|
||||
In [2]: T = HAPropsSI('T','H',h,'R',1.0,'P',101.325); print T
|
||||
In [2]: T = HAPropsSI('T','H',h,'R',1.0,'P',101325); print T
|
||||
|
||||
Or go to the :ref:`Humid-Air` documentation.
|
||||
|
||||
|
||||
@@ -6,13 +6,24 @@ C# Wrapper
|
||||
|
||||
Pre-compiled Binaries
|
||||
=====================
|
||||
Pre-compiled release binaries can be downloaded from :sfdownloads:`Csharp`. Development binaries coming from the buildbot server can be found at :sfnightly:`Csharp`.
|
||||
|
||||
To Use
|
||||
------
|
||||
|
||||
Copy all the platform-independent .cs files to a folder on your computer you want, here we call it ``platform-independent``. Copy the DLL for your system architecture to the same location. Copy the Example.cs file to the same location. You will need to have a copy of some version of C#.
|
||||
Pre-compiled binaries can be downloaded from :sfdownloads:`Csharp`. Development binaries coming from the buildbot server can be found at :sfnightly:`Csharp`.
|
||||
|
||||
Download the ``platform-independent.7z`` file and expand it to a folder called ``platform-independent`` using 7-zip. Download the special C# shared library for your system architecture to the same location from either :sfdownloads:`Csharp` (release) or :sfnightly:`Csharp` (development). Copy the Example.cs file to the same location. You will need to have a copy of some version of C#.
|
||||
|
||||
When you are finished, you should have a folder layout something like ::
|
||||
|
||||
main
|
||||
|- CoolProp.dll
|
||||
|- Example.cs
|
||||
|- platform-independent
|
||||
|- AbstractState.cs
|
||||
|- Configuration.cs
|
||||
|- ...
|
||||
|
||||
Windows
|
||||
^^^^^^^
|
||||
|
||||
@@ -24,7 +35,7 @@ At the command prompt, run::
|
||||
|
||||
where you might need to update the path to visual studio depending on your version installed. Use `-platform:x86` to tell C# that your DLL is 32-bit if you are on 32-bit, or `-platform:x64` if you are on 64-bit.
|
||||
|
||||
Alternatively, you can add all the .cs files to a visual studio project.
|
||||
Alternatively, you can add all the .cs files to a visual studio project. If you do that, add the DLL to the project as well, right-click on the DLL, and select the option to copy it to the output directory.
|
||||
|
||||
Linux/OSX
|
||||
^^^^^^^^^
|
||||
@@ -33,6 +44,8 @@ Same idea as windows, but command line is just a bit different::
|
||||
|
||||
mcs Example.cs platform-independent/*.cs -platform:x64
|
||||
./Example
|
||||
|
||||
Use `-platform:x86` to tell C# that your shared library is 32-bit if you are on 32-bit, or `-platform:x64` if you are on a 64-bit platform.
|
||||
|
||||
User-Compiled Binaries
|
||||
======================
|
||||
|
||||
@@ -6,7 +6,20 @@ Java Wrapper
|
||||
|
||||
Pre-compiled Binaries
|
||||
=====================
|
||||
Pre-compiled binaries can be downloaded from :sfdownloads:`Java`, which come from :sfnightly:`the nightly snapshots <Java>`.
|
||||
|
||||
Pre-compiled binaries can be downloaded from :sfdownloads:`Java`. Development binaries coming from the buildbot server can be found at :sfnightly:`Java`.
|
||||
|
||||
Download the ``platform-independent.7z`` file and expand it to a folder called ``platform-independent`` using 7-zip. Download the special Java shared library for your system architecture to the same location from either :sfdownloads:`Java` (release) or :sfnightly:`Java` (development). Copy the Example.java file to the same location. You will need to have a copy of some version of java.
|
||||
|
||||
When you are finished, you should have a folder layout something like ::
|
||||
|
||||
main
|
||||
|- CoolProp.dll
|
||||
|- Example.java
|
||||
|- platform-independent
|
||||
|- AbstractState.java
|
||||
|- Configuration.java
|
||||
|- ...
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
100
Web/coolprop/wrappers/Javascript/index.html
Normal file
100
Web/coolprop/wrappers/Javascript/index.html
Normal file
@@ -0,0 +1,100 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>CoolProp Javascript example</title>
|
||||
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css" />
|
||||
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
|
||||
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
|
||||
|
||||
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
|
||||
<script>
|
||||
//<link rel="stylesheet" href="/resources/demos/style.css" />
|
||||
</script>
|
||||
|
||||
<script src="http://www.coolprop.sourceforge.net/jscript/coolprop-latest.js"></script>
|
||||
<!-- <script src="coolprop.js"></script> -->
|
||||
<script>
|
||||
PropsSI = Module.cwrap('PropsSI','number',['string','string','number','string','number','string'])
|
||||
Props1 = Module.cwrap('Props1SI','number',['string','string'])
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="ui-widget">
|
||||
<label>FluidName: </label>
|
||||
<select id="FluidName">
|
||||
<option>Nitrogen</option>
|
||||
<option>R134a</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ui-widget">
|
||||
<label>Input #1: </label>
|
||||
<select id="Name1">
|
||||
<option value="">Select one...</option>
|
||||
<option value="Pressure">Pressure [Pa]</option>
|
||||
<option value="Temperature">Temperature [K]</option>
|
||||
<option value="Density">Density [kg/m³]</option>
|
||||
</select>
|
||||
<input id ='Value1'></input>
|
||||
</div>
|
||||
<div class="ui-widget">
|
||||
<label>Input #2: </label>
|
||||
<select id="Name2">
|
||||
<option value="">Select one...</option>
|
||||
<option value="Pressure">Pressure [Pa]</option>
|
||||
<option value="Temperature">Temperature [K]</option>
|
||||
<option value="Density">Density [kg/m³]</option>
|
||||
</select>
|
||||
<input id ='Value2'></input>
|
||||
</div>
|
||||
|
||||
<button id="calc">Calculate</button>
|
||||
<div class="ui-widget">
|
||||
<label>Output: </label>
|
||||
</div>
|
||||
<div class="ui-widget">
|
||||
<p id="output">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function text2key(text)
|
||||
{
|
||||
if (text == 'Pressure [Pa]')
|
||||
return 'P';
|
||||
else if (text == 'Temperature [K]')
|
||||
return 'T';
|
||||
else if (text == 'Density [kg/m³]')
|
||||
return 'D';
|
||||
}
|
||||
//using jQuery
|
||||
$('#calc').click( function() {
|
||||
var name = $('#FluidName :selected').text()
|
||||
var key1 = text2key($('#Name1 :selected').text())
|
||||
var key2 = text2key($('#Name2 :selected').text())
|
||||
var val1 = parseFloat($('#Value1').val())
|
||||
var val2 = parseFloat($('#Value2').val())
|
||||
|
||||
var T = PropsSI('T', key1, val1, key2, val2, name)
|
||||
var rho = PropsSI('D', key1, val1, key2, val2, name)
|
||||
var p = PropsSI('P', key1, val1, key2, val2, name)
|
||||
var s = PropsSI('S', key1, val1, key2, val2, name)
|
||||
var h = PropsSI('H', key1, val1, key2, val2, name)
|
||||
var cp = PropsSI('C', key1, val1, key2, val2, name)
|
||||
|
||||
text = ''
|
||||
text += 'T = ' + T + ' K\n' + '<br>'
|
||||
text += 'rho = ' + rho + ' kg/m³ <br>'
|
||||
text += 'p = ' + p + ' Pa<br>'
|
||||
text += 's = ' + s + ' J/kg/K<br>'
|
||||
text += 'h = ' + h + ' J/kg<br>'
|
||||
text += 'cp = ' + cp + ' J/kg/K<br>'
|
||||
|
||||
$( "#output" ).html( text);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -10,7 +10,9 @@ Pre-Compiled Binaries
|
||||
|
||||
* Download the precompiled binaries from :sfdownloads:`Javascript`, or the development versions from the buildbot server at :sfnightly:`Javascript`
|
||||
|
||||
* Load your js file into your website, following the structure of `the example here <https://github.com/CoolProp/CoolProp/blob/master/wrappers/Javascript/index.html>`_, which is also included at the above download link
|
||||
* Load your js file into your website, following the structure of `the example here <https://github.com/CoolProp/CoolProp/blob/master/Web/coolprop/wrappers/Javascript/index.html>`_, which is also included at the above download link
|
||||
|
||||
* You can also build your website and include our hosted Javascript repository. You will never ever have to update your library by linking directly to ``<script src="http://www.coolprop.sourceforge.net/jscript/coolprop-latest.js"></script>`` in your HTML header. Until now, this file does not get updated automatically, so please file an issue on
|
||||
|
||||
User-Compiled Binaries
|
||||
======================
|
||||
@@ -51,7 +53,7 @@ We are following the instructions from `emscripten.org <http://kripken.github.io
|
||||
|
||||
10. Build the Javascript module::
|
||||
|
||||
cmake .. -DCOOLPROP_JAVASCRIPT_MODULE=ON -DCMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Platform/Emscripten.cmake
|
||||
cmake .. -DCOOLPROP_JAVASCRIPT_MODULE=ON -DCMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake
|
||||
|
||||
Windows
|
||||
-------
|
||||
@@ -83,4 +85,4 @@ Windows
|
||||
|
||||
7. Build the Javascript module::
|
||||
|
||||
cmake ../.. -DCOOLPROP_JAVASCRIPT_MODULE=ON -DCMAKE_TOOLCHAIN_FILE=%EMSCRIPTEN%/cmake/Platform/Emscripten.cmake
|
||||
cmake ../.. -DCOOLPROP_JAVASCRIPT_MODULE=ON -DCMAKE_TOOLCHAIN_FILE=%EMSCRIPTEN%/cmake/Modules/Platform/Emscripten.cmake
|
||||
|
||||
@@ -16,6 +16,7 @@ Target Operating Systems Not
|
||||
:ref:`Python <Python>` linux, OSX, win Wrapper is Cython based
|
||||
:ref:`Octave <Octave>` linux, OSX, win Wrapper is SWIG based
|
||||
:ref:`C# <Csharp>` linux, OSX, win Wrapper is SWIG based
|
||||
:ref:`VB.net <VBdotNet>` windows only Wrapper is SWIG based
|
||||
:ref:`MATLAB <MATLAB>` linux, OSX, win Wrapper is SWIG based
|
||||
:ref:`Java <Java>` linux, OSX, win Wrapper is SWIG based
|
||||
:ref:`Scilab <Scilab>` linux, OSX, win Wrapper is SWIG based (experimental)
|
||||
@@ -122,4 +123,5 @@ and explicitly typing "agree" before closing. Then you can use the compiler from
|
||||
SMath/index.rst
|
||||
StaticLibrary/index.rst
|
||||
SharedLibrary/index.rst
|
||||
DelphiLazarus/index.rst
|
||||
DelphiLazarus/index.rst
|
||||
VBdotNET/index.rst
|
||||
@@ -10,7 +10,7 @@ The source code of CoolProp is stored in a github repository at https://github.c
|
||||
Doxygen formatted documentation of the source files
|
||||
---------------------------------------------------
|
||||
|
||||
Real-time builds of the `doxygen <http://www.stack.nl/~dimitri/doxygen/>`_ formatted HTML outputs for the development code are at :bbsphinx:`the buildbot development server<_static/doxygen/html>`.
|
||||
Real-time builds of the `doxygen <http://www.stack.nl/~dimitri/doxygen/>`_ formatted HTML outputs for the development code are at :bbsphinx:`the buildbot development server<http://www.coolprop.org/_static/doxygen/html/>`.
|
||||
|
||||
More information
|
||||
----------------
|
||||
|
||||
@@ -7,7 +7,6 @@ These pages help you to get started using CoolProp and provide detailed informat
|
||||
returning user. Please feel free to browse the pages and use the menu on the left to navigate
|
||||
on this website.
|
||||
|
||||
|
||||
What is CoolProp?
|
||||
-----------------
|
||||
|
||||
@@ -18,7 +17,6 @@ CoolProp is a C++ library that implements:
|
||||
- :ref:`Correlations of properties of incompressible fluids and brines <Pure>`
|
||||
- :ref:`Highest accuracy psychrometric routines <Humid-Air>`
|
||||
|
||||
|
||||
Environments Supported
|
||||
----------------------
|
||||
|
||||
@@ -48,6 +46,7 @@ Help
|
||||
|
||||
- File a `Github issue <https://github.com/CoolProp/CoolProp/issues>`_
|
||||
- Email the `Google group <https://groups.google.com/d/forum/coolprop-users>`_
|
||||
- `Docs for v4 of CoolProp <http://www.coolprop.org/v4/>`_
|
||||
|
||||
|
||||
Projects Using CoolProp
|
||||
|
||||
0
Web/scripts/fluid_properties.Incompressibles.sh
Normal file → Executable file
0
Web/scripts/fluid_properties.Incompressibles.sh
Normal file → Executable file
Reference in New Issue
Block a user