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

9 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 

7from .pl_willans_config import pl_willans_properties 

8 

9# Define properties for Willans turbine: 

10 

11properties = properties_default | properties_willans | pl_willans_properties 

12 

13cs_willans_config: ObjectType = ObjectType( 

14 displayType="Condensing Sun-Willans Turbine", 

15 displayName="Condensing Sun-Willans Turbine", 

16 ports=turbine_ports, 

17 propertyPackagePorts=default_property_package_ports(), 

18 graphicObject=unitop_graphic(), 

19 properties=properties, 

20 propertySetGroups={ 

21 "default": PropertySetType( 

22 type="stateVars", 

23 displayName="Properties", 

24 stateVars=("willans_max_mol", "deltaP_inverted", "efficiency_motor"), 

25 ) 

26 }, 

27 keyProperties=[ 

28 "work_mechanical", 

29 "efficiency_isentropic", 

30 "willans_intercept", 

31 "willans_slope", 

32 "willans_a", 

33 "willans_b", 

34 "willans_efficiency", 

35 ], 

36 # Practically identical to a compressor. 

37 # An expander is called a turbine in IDAES. 

38 idaes_adapter=UnitModelAdapter( 

39 args=ArgAdapter({ 

40 "property_package": PropertyPackageAdapter(), 

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

42 "dynamic": ConstantArg(False), 

43 "calculation_method": ConstantArg("CT_willans"), 

44 }), 

45 properties=SerialisePropertiesAdapter(), 

46 ports=SerialisePortAdapter() 

47 ), 

48)