© 2024 Jasper van Baten, AmsterCHEM

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 2022
Functions
license Print license and license status or specify license number. Keyword arguments: licenseNumber -- license number. If not specified, license status is printed.
systems List available CAPE-OPEN thermodynamics systems.
unit_of_measure Returns the unit of measure for the given property. Required arguments: propertyname -- name of the property.
version Returns the version number of capeopen_thermo
class Compound
A compound. A Compound represents a single compound in package. It provides name, chemical formula, compound constant properties and temperature dependent properties.
Data members
cas_registry_number Chemical Abstracts registry number.
constant_properties Names of supported constants.
formula Chemical formula.
index Index in compound list.
molecular_weight Relative molecular mass.
name Compound name.
temperature_dependent_properties Names of supported temperature dependent properties.
Methods
get_constant Get compound constant by name. Required arguments: name -- compound constant name. Constant names are listed by constant_properties.
get_temperature_dependent_property Get one or more temperature dependent properties. Required arguments: properties -- a temperature dependent property name or list of temperature dependent property names. t -- temperature [K]. Temperature dependent property names are listed by temperature_dependent_properties.
class Package
A thermodynamic and physical property package. To calculate mixture properties, create a Phase object (directly or from a PhaseType). To calculate phase equilibrium properties, create a PhaseEquilibrium object. The compound member lists the compound in the package.
Data members
compounds Compounds.
constant_compound_properties Names of compound constants supported by the package.
name Package name.
phase_equilibrium_properties Names of properties supported by the package that may be used for phase equilibrium conditions.
phase_pair_properties Names of two phase properties supported by the package.
phase_properties Names of single phase properties supported by the package.
phase_types Descriptions of defined phases
temperature_dependent_compound_properties Names of compound temperature dependent properties supported by the package.
Methods
create_liquid_phase Create a liquid phase. Keyword arguments: t -- temperature [K]. p -- pressure [Pa]. x -- composition [mol/mol].
create_phase_equilibrium Calculate phase equilibrium. Legacy calling method: Required arguments: x -- overall composition [mol/mol]. condition1 -- first condition name. value1 -- value of first condition. condition2 -- second condition name. value2 -- value of second condition. Keyword arguments: solution_type -- solution type. New calling method: Keyword arguments: flow_rate -- total molar flow rate [mol/s]. x -- composition [mol/mol] t -- temperature [K] p -- pressure [Pa] vapor_fraction -- molar vapor fraction [mol/mol] solution_type -- solution type for product flash In addition to the above keywords, any property returned by phase_equilibrium_properties may be specified as keyword argument. Valid conditions are listed in phase_equilibrium_properties. Valid values for solution_type include "unspecified", "normal" and "retrograde". A solution_type should not be specified unless vaporFraction is one of the flash conditions.
create_phase_pair Create a phase pair. Required arguments: phase1 -- first Phase. phase2 -- second Phase.
create_solid_phase Create a solid phase. Keyword arguments: t -- temperature [K]. p -- pressure [Pa]. x -- composition [mol/mol].
create_vapor_phase Create a vapor phase. Keyword arguments: t -- temperature [K]. p -- pressure [Pa]. x -- composition [mol/mol].
class Phase
A Phase. A Phase represents a mixture in a certain state of aggregation. It is defined by temperature, pressure and composition (mole fractions). Once defined, it can be used for mixture property calculations. To calculate two-phase properties, first create a PhasePair.
Data members
excluded_compound Excluded compound, or empty.
key_compound Key compound, or empty.
name Phase name.
p Pressure [Pa].
phase_fraction Phase fraction [mol/mol].
properties Names of supported properties.
state_of_aggregation State of aggregation, vapor, liquid or solid (empty if unknown).
t Temperature [K].
x Mole fraction [mol/mol].
Methods
get_property Calculate and one or more properties by name. Required arguments: properties -- specify one or more property names as string or list of strings. Valid property names are listed in the properties member.
set Set conditions. Keyword arguments: t -- temperature [K]. p -- pressure [Pa]. x -- composition [mol/mol].
class PhaseEquilibrium
A Phase Equilibrium. A PhaseEquilibrium represents a set of phases at thermodynamic phase equilibrium. Each of the phases is a Phase, populated with temperature, pressure, phase fraction and composition (mole fraction). The PhaseEquilibrium itself provides overall properties.
Data members
p Pressure [Pa].
phases Phases coexisting at thermodynamic phase equilibrium.
properties Names of supported properties.
t Temperature [K].
vapor_fraction Fraction [mol/mol] of vapor phase, or 0 if vapor is not present.
x Overall composition [mol/mol].
Methods
get_property Calculate and one or more properties by name. Required arguments: properties -- specify one or more property names as string or list of strings. Valid property names are listed in the properties member.
class PhasePair
A pair of two distinct phases. A PhasePair is a combination of two phases for calculation of two-phase properties.
Data members
phase1 First phase.
phase2 Second phase.
properties Names of supported properties.
Methods
get_property Calculate and one or more properties by name. Required arguments: properties -- specify one or more property names as string or list of strings. Valid property names are listed in the properties member.
class PhaseType
A phase type. A PhaseType describes the properties of a phase, prior to actually creating a Phase instance.
Data members
excluded_compound Excluded compound, or empty.
index Index in phase type list.
key_compound Key compound, or empty.
name Phase name.
properties Names of supported properties.
state_of_aggregation State of aggregation, vapor, liquid or solid (empty if unknown).
Methods
create_phase Create a phase of this type. Keyword arguments: t -- temperature [K]. p -- pressure [Pa]. x -- composition [mol/mol].
class System
A manager for packages. A Thermodynamic 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.
Data members
name Package system name.
package_names Names of packages provided by the package system.
Methods
create_package Instantiate package with specified name. Required arguments: name -- package name. Valid package names are listed by package_names.