mission

CAPE-OPEN
COCO
Excel Thermo Import
Excel Unit Operation
Matlab Unit Operation
Matlab Thermo Import
OO Calc Thermo Import
REFPROP PPM
SciLab Unit Operation
SciLab Thermo Import
Python Thermo Import
Examples
» 
Help
FlowExchange
ThermoSystemAdapter

ScanIt

downloads

services

links

about us

contact us

Help on Python CAPE-OPEN Thermo Import

module capeopen_thermo
Module for importing thermodynamics functionality from CAPE-OPEN version 1.1 compliant thermodynamic servers (C) AmsterCHEM 2017
Functions
systems() List available CAPE-OPEN thermodynamics systems, string list. A valid system name is required to construct a System
unit_of_measure(property_name) Returns the unit of measure for the given property, string
version() Returns the version number of capeopen_thermo, string
license([license_code]) Print license and license status. Or enter a license number.
class System
A Thermo Package System is a software component from which a Package can be created. To see which Package Systems are installed at your system, use capeopen_thermo.systems(). Then use any system name to create a System.
Methods
__new__(name) Create and return a new System. A list of installed systems can be obtained from capeopen_thermo.systems()
create_package(name) Instantiate package with specified name. A list of package names can be obtained from package_names. Returns a Package.
Data members
name System name, string value.
package_names Names of packages provided by the package system, string list. To create a package, use create_package().
class Package
A Package is a complete thermodynamic configuration that includes compound definitions, phase definitions, property calculation routines and a phase equilibruim calculator. To calculate mixture properties, create a Phase object (directly or from a PhaseType).
Methods
create_vapor_phase([t,p,x]) Create a vapor phase, returns a Phase object. T, P and mole fraction can optionally be specified. Will raise an error in case the Package does not support any vapor phases.
create_liquid_phase([t,p,x]) Create a vapor liquid, returns a Phase object. T, P and mole fraction can optionally be specified. Will raise an error in case the Package does not support any liquid phases.
create_solid_phase([t,p,x]) Create a solid phase, returns a Phase object. T, P and mole fraction can optionally be specified. Will raise an error in case the Package does not support any solid phases.
create_phase_equilibrium(z,condition1_name,
   condition1_value,condition2_name,condition2_value
   [,solution_type])
Calculate phase equilibruim, specifying overall composition, first condition, value of first condition, second condition, value of second condition and optionally a solution type. Valid conditions are listed in phase_equilibrium_properties; valid values for solution type include "unspecified", "normal" and "retrograde". A solution should not be specified unles vaporFraction is one of the flash conditions. Supported equilibrium conditions can be obtained from phase_equilibrium_properties. Returns a PhaseEquilibrium if the calculation succeeds.
Data members
name Package name, string
compounds Compounds for this packages; a list of Compound objects
phase_types Phase types for this packages; a list of PhaseType objects
constant_compound_properties Names of compound constants supported by the package, string list. Use Compound.get_constant() to obtain constant values for a compound.
temperature_dependent_compound_properties Names of compound temperature dependent properties supported by the package, string list. Use Compound.get_temperature_dependent_property() to obtain values of temperature dependent properties for a compound.
phase_properties Names of single phase properties supported by the package, string list. To calculate properties, use Phase.get_property()
phase_pair_properties Names of two phase properties supported by the package, string list. To calculate properties, use PhasePair.get_property()
phase_equilibrium_properties Names of properties supported by the package that may be used for phase equilibrium conditions, see create_phase_equilibrium(), string list. These are also properties that can be obtained from PhaseEquilibrium.get_property()
class Compound
This object represents a single compound in the package. It provides name, chemical formula, compound constant properties and temperature dependent properties.
A compound is obtained from Package.compounds.
Methods
cas_registry_number() Chemical Abstracts registry number, string
formula() Chemical formula, string
get_constant(constant_name) Get a compound constant by name, returns a string or real value. For a list of supported constants, see constant_properties or Package.constant_compound_properties. Units of measure can be obtained from capeopen_thermo.unit_of_measure()
get_temperature_dependent_property
   (property_names,temperature)
Get one or more temperature dependent properties at given temperature (K). If property_names is a single string, a scalar is returned. Otherwise a list of property values corresponding to the property list is returned. Valid property names can be obtained from temperature_dependent_properties, or from Package.temperature_dependent_compound_properties. Units of measure can be obtained from capeopen_thermo.unit_of_measure()
Data members
name Compound name, string
constant_properties Names of supported constants, string list. Constant values can be obtained from get_constant()
temperature_dependent_properties Names of supported temperature dependent properties, string list. Property values can be obtained from get_temperature_dependent_property()
class PhaseType
A PhaseType describes the properties of a phase, prior to actually creating an instance of a Phase. Use create_phase to create an instance of a Phase. Any Package contains a list of PhaseType objects in phase_types.
Methods
create_phase([t,p,x]) Create a phase of this type; returns a Phase object. T, P and mole fraction can optionally be specified.
Data members
name Phase name, string
state_of_aggregation State of aggregation, string, 'vapor', 'liquid' or 'solid' (empty if unknown)
key_compound Key compound, or empty; string
excluded_compound Excluded compound, or empty; string
properties Names of supported properties, string list. Use Phase.get_property() to calculate property values.
class Phase
A Phase represents a mixture in a certain state of aggregation. It is defined by phase type, temperature, pressure and composition (mole fractions). Once defined, it can be used for mixture property calculations. Two calculate two-phase properties, first create a PhasePair. A Phase can be created from Package.create_vapor_phase(), Package.create_liquid_phase(), Package.create_solid_phase(), PhaseType.create_phase(), and a PhaseEquilibrium object contains a list of Phase objects.
Methods
set(t,p,x) Set temperature [K], pressure [Pa} and composition [mol/mol]
get_property(property_names) Calculate and one or more properties by name. If a single property name is provided, the return value is a single property. Otherwise the return value is a list of properties that corresponds to the list of property names. Each property can be a scalar value, or a list of values. The supported properties can be obtained from properties, PhaseType.properties or Package.phase_properties
Data members
name Phase name, string
state_of_aggregation State of aggregation, string, 'vapor', 'liquid' or 'solid' (empty if unknown)
t Temperature in K, real.
p Pressure in Pa, real.
x Composition in mol/mol, real list.
phase_fraction Phase fraction at phase equilibrium in mol/mol, real.
key_compound Key compound, or empty; string
excluded_compound Excluded compound, or empty; string
properties Names of supported properties, string list. Use get_property() to calculate property values.
class PhasePair
A PhasePair is a combination of two phases for calculation of two-phase properties.
Methods
__new__(phase1, phase2) Create and return a new PhasePair, existing of phases phase1 and phase2, both of which must be Phase objects.
get_property(property_names) Calculate and one or more properties by name. If a single property name is provided, the return value is a single property. Otherwise the return value is a list of properties that corresponds to the list of property names. Each property can be a scalar value, or a list of values. The supported properties can be obtained from properties or Package.phase_pair_properties
Data members
phase1 First phase; a Phase object
phase2 Second phase; a Phase object
properties Names of supported properties, string list. To calculate properties, use get_property
class PhaseEquilibrium
A PhaseEquilibrium object represents a set of phases at thermodynamic phase equilibrium. Each of the phases is populated with temperature, pressure, phase fraction and composition (mole fraction). The phase equilibrium itself provides overall properties.
A PhaseEquilibrium is obtained from Package.create_phase_equilibrium()
Methods
get_property(property_names) Calculate and one or more properties by name. Valid property names are given by properties and Package.phase_equilibrium_properties. If a single property_name is given, the return value is a scalar. If a list of properties is given, the return value is a list of property values corresponding to the list of property names.
Data members
t Temperature in K, real.
p Pressure in Pa, real.
vapor_fraction Fraction of vapor phase in mol/mol, or 0 if vapor is not present, real
phases Phases coexisting at thermodynamic phase equilibrium. A list of Phase objects.
properties Names of supported properties, string list. To calculate properties, use get_property()