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

12 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 

6from .willans_turbine_config import properties_willans 

7 

8# Define properties for Willans turbine: 

9willans_a = PropertyType(displayName="Willans A", type="numeric",unitType="ratio") 

10willans_b = PropertyType(displayName= "Willans B", type="numeric",unitType="heatflow") 

11willans_efficiency = PropertyType(displayName="Willans Efficiency", type ="numeric", unitType="ratio") 

12 

13pl_willans_properties = { 

14 "willans_a": willans_a, 

15 "willans_b": willans_b, 

16 "willans_efficiency": willans_efficiency, 

17} 

18properties = properties_default | properties_willans | pl_willans_properties 

19 

20pl_willans_config: ObjectType = ObjectType( 

21 displayType="Part-Load Willans Turbine", 

22 displayName="Part-Load Willans Turbine", 

23 ports=turbine_ports, 

24 propertyPackagePorts=default_property_package_ports(), 

25 graphicObject=unitop_graphic(), 

26 properties=properties, 

27 propertySetGroups={ 

28 "default": PropertySetType( 

29 type="stateVars", 

30 displayName="Properties", 

31 stateVars=( 

32 "willans_a", 

33 "willans_b", 

34 "willans_efficiency", 

35 "willans_max_mol", 

36 "deltaP_inverted", 

37 "efficiency_motor", 

38 ), 

39 ) 

40 }, 

41 keyProperties=[ 

42 "work_mechanical", 

43 "willans_intercept", 

44 "willans_slope", 

45 ], 

46 # Practically identical to a compressor. 

47 # An expander is called a turbine in IDAES. 

48 idaes_adapter=UnitModelAdapter( 

49 args=ArgAdapter({ 

50 "property_package": PropertyPackageAdapter(), 

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

52 "dynamic": ConstantArg(False), 

53 "calculation_method": ConstantArg("part_load_willans"), 

54 }), 

55 properties=SerialisePropertiesAdapter(), 

56 ports=SerialisePortAdapter() 

57 ), 

58)