Coverage for backend/django/flowsheetInternals/unitops/config/objects/willans_turbine_config.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-05-13 02:47 +0000

1from common.config_types import * 

2from common.config_utils import * 

3from ..spec_helpers import * 

4from .turbine_config import properties_default 

5from ..reusable_config.turbine_ports_config import turbine_ports 

6 

7# Define properties for Willans turbine: 

8willans_intercept = PropertyType(displayName="Willans Intercept", type = "numeric", unitType="heatflow") 

9willans_slope=PropertyType(displayName="Willans Slope",type="numeric",unitType="molarEnthalpy") 

10willans_max_mol=PropertyType(displayName="Maximum Molar Flow", type="numeric", unitType="molarflow") 

11properties_willans = { 

12 "willans_intercept": willans_intercept, 

13 "willans_slope": willans_slope, 

14 "willans_max_mol": willans_max_mol, 

15} 

16 

17 

18# Append the willans properties to the default properties: 

19properties = properties_default | properties_willans 

20 

21willans_turbine_config: ObjectType = ObjectType( 

22 displayType="Simple Willans Turbine", 

23 displayName="Simple Willans Turbine", 

24 ports=turbine_ports, 

25 propertyPackagePorts=default_property_package_ports(), 

26 graphicObject=unitop_graphic(), 

27 properties=properties, 

28 propertySetGroups={ 

29 "default": PropertySetType( 

30 type="stateVars", 

31 displayName="Properties", 

32 stateVars=( 

33 "willans_slope", 

34 "willans_intercept", 

35 "willans_max_mol", 

36 "deltaP_inverted", 

37 "efficiency_motor", 

38 ), 

39 ) 

40 }, 

41 keyProperties=["work_mechanical"], 

42 # Practically identical to a compressor. 

43 # An expander is called a turbine in IDAES. 

44 idaes_adapter=UnitModelAdapter( 

45 args=ArgAdapter({ 

46 "property_package": PropertyPackageAdapter(), 

47 "power_property_package": ConstantSchemaAdapter(PowerPPArgSchema()), 

48 "dynamic": ConstantArg(False), 

49 "calculation_method": ConstantArg("simple_willans"), 

50 }), 

51 properties=SerialisePropertiesAdapter(), 

52 ports=SerialisePortAdapter() 

53 ), 

54)