Coverage for backend/flowsheetInternals/unitops/config/objects/willans_turbine_config.py: 100%
14 statements
« prev ^ index » next coverage.py v7.10.7, created at 2025-11-06 23:27 +0000
« prev ^ index » next coverage.py v7.10.7, created at 2025-11-06 23:27 +0000
1from common.config_types import *
2from common.config_utils import *
3from common.config_generator import generate_config
4from .turbine_config import properties_default
6# Define properties for Willans turbine:
7willans_intercept = PropertyType(displayName="Willans Intercept", type = "numeric", unitType="heatflow")
8willans_slope=PropertyType(displayName="Willans Slope",type="numeric",unitType="molarEnthalpy")
9willans_max_mol=PropertyType(displayName="Maximum Molar Flow", type="numeric", unitType="molarflow")
10willans_properties=[("willans_intercept",willans_intercept),("willans_slope",willans_slope),("willans_max_mol",willans_max_mol)]
12# Create dictionary of properties that is passed to generate_config:
13properties_willans = dict(willans_properties)
16# Append the willans properties to the default properties:
17properties = properties_default | properties_willans
19# Create property set groups:
20default_willans = PropertySetType(type="stateVars",displayName="Properties",stateVars=("willans_slope","willans_intercept","willans_max_mol","deltaP_inverted","efficiency_motor"))
21property_set_groups_willans = [("default",default_willans)]
23# Create key properties:
24key_properties_willans = [
25 "work_mechanical",
27]
29willans_turbine_config: ObjectType = generate_config("Simple Willans Turbine", None, properties, property_set_groups_willans, None, key_properties_willans)