diff --git a/tests/trnsysGUI/proforma/data/actual/cases/.gitignore b/tests/trnsysGUI/proforma/data/actual/cases/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/tests/trnsysGUI/proforma/data/expected/Type137.ddck b/tests/trnsysGUI/proforma/data/expected/Type137.ddck deleted file mode 100644 index 8ce159b1..00000000 --- a/tests/trnsysGUI/proforma/data/expected/Type137.ddck +++ /dev/null @@ -1,141 +0,0 @@ -******************************* -** BEGIN Type137.ddck -******************************* - -*************************************************************************** -** Description: -** 4-Pipe Fan Coil: Heating and Cooling -*************************************************************************** - -*************************************************************************** -** Details: -** This component models a fan coil where the air is heated or cooled as it passes across coils containing hot and cold -** liquid flow streams. This model relies on user-provided external data files which contain the performance of the -** coils as a function of the entering air and fluid conditions. Refer to the sample data files which accompany this -** model for the format of these external files. -*************************************************************************** - -*********************************** -** inputs from hydraulic solver -*********************************** - -*********************************** -** outputs to hydraulic solver -*********************************** - -*********************************** -** outputs to other ddck -*********************************** - - -****************************************************************************************** -** outputs to energy balance in kWh and ABSOLUTE value -****************************************************************************************** - - -*********************************** -** Dependencies with other ddck -*********************************** - - -*********************************** -** Begin CONSTANTS -*********************************** - - -*********************************** -** Begin TYPE -*********************************** -UNIT 1 TYPE 137 -PARAMETERS 20 -2.0 ! 1: Humidity Mode [-] ([2,2]) -4.19 ! 2: Cooling Fluid Specific Heat [kJ/kg.K] ([0.0,+Inf]) -4.19 ! 3: Heating Fluid Specific Heat [kJ/kg.K] ([0.0,+Inf]) -943.89 ! 4: Rated Volumetric Air Flow Rate [l/s] ([0.,+Inf]) -564.0 ! 5: Rated Fan Power [kJ/hr] ([0.,+Inf]) -10.0 ! 6: Logical Unit - Cooling Performance [-] ([10,+Inf]) -7.0 ! 7: Number of Drybulb Temperatures - Cooling [-] ([1,+Inf]) -7.0 ! 8: Number of Wetbulb Temperatures - Cooling [-] ([1,+Inf]) -6.0 ! 9: Number of Air Flows - Cooling [-] ([1,+Inf]) -8.0 ! 10: Number of Liquid Temperatures - Cooling [-] ([1,+Inf]) -2.0 ! 11: Number of Liquid Flow Rates - Cooling [-] ([1,+Inf]) -11.0 ! 12: Logical Unit - Heating Performance [-] ([10,+Inf]) -7.0 ! 13: Number of Air Temperatures - Heating [-] ([1,+Inf]) -6.0 ! 14: Number of Air Flows - Heating [-] ([1,+Inf]) -11.0 ! 15: Number of Liquid Temperatures - Heating [-] ([1,+Inf]) -2.0 ! 16: Number of Liquid Flow Rates - Heating [-] ([1,+Inf]) -12.0 ! 17: Logical Unit - Fan Corrections [-] ([10,+Inf]) -11.0 ! 18: Number of Fan Speeds [-] ([1,+Inf]) -0.9 ! 19: Efficiency of Fan Motor [-] ([0.,1.]) -1.0 ! 20: Fraction of Fan Heat to Air [-] ([0.,1.]) -INPUTS 17 -0,0 ! 1: Cooling Fluid Inlet Temperature [C] ([-Inf,+Inf]) -0,0 ! 2: Cooling Fluid Flow Rate [kg/hr] ([0.0,+Inf]) -0,0 ! 3: Heating Fluid Inlet Temperature [C] ([-Inf,+Inf]) -0,0 ! 4: Heating Fluid Flow Rate [kg/hr] ([0.0,+Inf]) -0,0 ! 5: Return Air Temperature [C] ([-Inf,+Inf]) -0,0 ! 6: Return Air Humidity Ratio [-] ([0.,+Inf]) -0,0 ! 7: Return Air % Relative Humidity [% (base 100)] ([0,100]) -0,0 ! 8: Return Air Pressure [atm] ([0.0,+Inf]) -0,0 ! 9: Air-Side Pressure Rise: Fan [atm] ([0.0,+Inf]) -0,0 ! 10: Air-Side Pressure Drop: Coils [atm] ([0.0,+Inf]) -0,0 ! 11: Fresh Air Temperature [C] ([-Inf,+Inf]) -0,0 ! 12: Fresh Air Humidity Ratio [-] ([0.,+Inf]) -0,0 ! 13: Fresh Air % Relative Humidity [% (base 100)] ([0,100]) -0,0 ! 14: Heating Control Signal [-] ([0.,1.]) -0,0 ! 15: Cooling Control Signal [-] ([0.,1.]) -0,0 ! 16: Fan Control Signal [-] ([0.,1.]) -0,0 ! 17: Fraction of Outside Air [-] ([0.,1.]) -** initial values -10.0 ! 1: Cooling Fluid Inlet Temperature initial value -0.0 ! 2: Cooling Fluid Flow Rate initial value -10.0 ! 3: Heating Fluid Inlet Temperature initial value -0.0 ! 4: Heating Fluid Flow Rate initial value -20.0 ! 5: Return Air Temperature initial value -0.002 ! 6: Return Air Humidity Ratio initial value -50.0 ! 7: Return Air % Relative Humidity initial value -1.0 ! 8: Return Air Pressure initial value -0.0 ! 9: Air-Side Pressure Rise: Fan initial value -0.0 ! 10: Air-Side Pressure Drop: Coils initial value -20.0 ! 11: Fresh Air Temperature initial value -0.002 ! 12: Fresh Air Humidity Ratio initial value -50.0 ! 13: Fresh Air % Relative Humidity initial value -0.0 ! 14: Heating Control Signal initial value -0.0 ! 15: Cooling Control Signal initial value -0.0 ! 16: Fan Control Signal initial value -0.0 ! 17: Fraction of Outside Air initial value - -! EQUATIONS 18 -! XXX = [1, 1] ! Cooling Fluid Outlet Temperature [C] ([-Inf,+Inf]) -! XXX = [1, 2] ! Outlet Cooling Fluid Flow Rate [kg/hr] ([0.0,+Inf]) -! XXX = [1, 3] ! Heating Fluid Outlet Temperature [C] ([-Inf,+Inf]) -! XXX = [1, 4] ! Outlet Heating Fluid Flow Rate [kg/hr] ([0.0,+Inf]) -! XXX = [1, 5] ! Outlet Air Temperature [C] ([-Inf,+Inf]) -! XXX = [1, 6] ! Outlet Air Humidity Ratio [-] ([-Inf,+Inf]) -! XXX = [1, 7] ! Outlet Air % Relative Humidity [% (base 100)] ([-Inf,+Inf]) -! XXX = [1, 8] ! Outlet Air Flow Rate [kg/hr] ([-Inf,+Inf]) -! XXX = [1, 9] ! Outlet Air Pressure [atm] ([-Inf,+Inf]) -! XXX = [1, 10] ! Total Cooling Rate [kJ/hr] ([-Inf,+Inf]) -! XXX = [1, 11] ! Sensible Cooling Rate [kJ/hr] ([-Inf,+Inf]) -! XXX = [1, 12] ! Total Heating Rate [kJ/hr] ([-Inf,+Inf]) -! XXX = [1, 13] ! Fan Power [kJ/hr] ([-Inf,+Inf]) -! XXX = [1, 14] ! Fan Heat to Air Stream [kJ/hr] ([-Inf,+Inf]) -! XXX = [1, 15] ! Fan Heat to Ambient [kJ/hr] ([-Inf,+Inf]) -! XXX = [1, 16] ! Condensate Temperature [C] ([-Inf,+Inf]) -! XXX = [1, 17] ! Condensate Flow Rate [kg/hr] ([0.0,+Inf]) -! XXX = [1, 18] ! Conditioning Energy Rate [kJ/hr] ([-Inf,+Inf]) - -*********************************** -** Monthly printer -*********************************** - - -*********************************** -** Hourly printer -*********************************** - - -*********************************** -** Online Plotter -*********************************** - diff --git a/tests/trnsysGUI/proforma/data/expected/Type5b.ddck b/tests/trnsysGUI/proforma/data/expected/Type5b.ddck new file mode 100644 index 00000000..12f3c34c --- /dev/null +++ b/tests/trnsysGUI/proforma/data/expected/Type5b.ddck @@ -0,0 +1,158 @@ +******************************* +** BEGIN Type5b.ddck +******************************* + +************************************************************************************************************************ +** Description: +** Heat Exchanger: Counter Flow +************************************************************************************************************************ + +************************************************************************************************************************ +** Details: +** A zero capacitance sensible heat exchanger is modeled in various configurations. In this instance, a counter flow +** heat exchanger is modeled. Given the hot and cold side inlet temperatures and flow rates, the effectiveness is +** calculated for a given fixed value of the overall heat transfer coefficient. +************************************************************************************************************************ + +*********************************** +** inputs from hydraulic solver +*********************************** +EQUATIONS 6 +CpHot = @cp(HotIn) +CpCold = @cp(ColdIn) +THotIn = @temp(HotIn) +MHot = @mfr(HotIn) +TColdIn = @temp(ColdIn) +MCold = @mfr(ColdIn) + +*********************************** +** outputs to hydraulic solver +*********************************** +EQUATIONS 2 +@temp(HotOut) = THotOut +@temp(ColdOut) = TColdOut + +*********************************** +** outputs to other ddck +*********************************** + + +****************************************************************************************** +** outputs to energy balance in kWh and ABSOLUTE value +****************************************************************************************** + + +*********************************** +** Dependencies with other ddck +*********************************** + + +*********************************** +** Begin CONSTANTS +*********************************** + + +*********************************** +** Begin TYPE +*********************************** +UNIT 1 TYPE 5 +PARAMETERS 4 +** The general heat exchanger model may operate in various configuration modes. Setting this parameter to 2 indicates a +** counter flow arrangement. Do not change this parameter. +2.0 ! 1: Counter flow mode [-] ([2,2]) + +** The specific heat of the fluid flowing through the source side of the counter flow heat exchanger. NOTE: "source" and +** "load" are merely convenient designations; energy will be transfered from the source side to the load side if the +** source side is hotter than the load side. It will be transfered from the load side to the source side if the load +** side is hotter than the source side. +CpHot ! 2: Specific heat of source side fluid [kJ/kg.K] ([0,+Inf]) + +** The specific heat of the fluid flowing through the load side of the counter flow heat exchanger. NOTE: "source" and +** "load" are merely convenient designations; energy will be transfered from the source side to the load side if the +** source side is hotter than the load side. It will be transfered from the load side to the source side if the load +** side is hotter than the source side. +CpCold ! 3: Specific heat of load side fluid [kJ/kg.K] ([0,+Inf]) + +0.0 ! 4: Not used [-] ([0,+Inf]) + +INPUTS 5 +** The temperature of the fluid flowing into the source side of the counter flow heat exchanger. NOTE: "source" and +** "load" are merely convenient designations; energy will be transfered from the source side to the load side if the +** source side is hotter than the load side. It will be transfered from the load side to the source side if the load +** side is hotter than the source side. +THotIn ! 1: Source side inlet temperature [C] ([-Inf,+Inf]) + +** The flow rate of the fluid flowing through the source side of the counter flow heat exchanger. NOTE: "source" and +** "load" are merely convenient designations; energy will be transfered from the source side to the load side if the +** source side is hotter than the load side. It will be transfered from the load side to the source side if the load +** side is hotter than the source side. +MHot ! 2: Source side flow rate [kg/hr] ([0,+Inf]) + +** The temperature of the fluid flowing into the load side of the counter flow heat exchanger. NOTE: "source" and "load" +** are merely convenient designations; energy will be transfered from the source side to the load side if the source +** side is hotter than the load side. It will be transfered from the load side to the source side if the load side is +** hotter than the source side. +TColdIn ! 3: Load side inlet temperature [C] ([-Inf,+Inf]) + +** The flow rate of the fluid flowing through the load side of the counter flow heat exchanger. NOTE: "source" and +** "load" are merely convenient designations; energy will be transfered from the source side to the load side if the +** source side is hotter than the load side. It will be transfered from the load side to the source side if the load +** side is hotter than the source side. +MCold ! 4: Load side flow rate [kg/hr] ([0,+Inf]) + +** Overall heat transfer coefficient of the counter flow heat exchanger. +0,0 ! 5: Overall heat transfer coefficient of exchanger [kJ/hr.K] ([0,+Inf]) + +** initial values +20.0 ! 1: Source side inlet temperature initial value +100.0 ! 2: Source side flow rate initial value +20.0 ! 3: Load side inlet temperature initial value +100.0 ! 4: Load side flow rate initial value +10.0 ! 5: Overall heat transfer coefficient of exchanger initial value + +EQUATIONS 2 ! 6 +** The temperature of the fluid leaving the source side of the counter flow heat exchanger. NOTE: "source" and "load" +** are merely convenient designations; energy will be transfered from the source side to the load side if the source +** side is hotter than the load side. It will be transfered from the load side to the source side if the load side is +** hotter than the source side. +THotOut = [1, 1] ! Source side outlet temperature [C] ([-Inf,+Inf]) + +** The flow rate of fluid exiting the source side of the counter flow heat exchanger. NOTE: "source" and "load" are +** merely convenient designations; energy will be transfered from the source side to the load side if the source side is +** hotter than the load side. It will be transfered from the load side to the source side if the load side is hotter +** than the source side. +! XXX = [1, 2] ! Source side flow rate [kg/hr] ([-Inf,+Inf]) + +** The temperature of the fluid leaving the load side of the counter flow heat exchanger. NOTE: "source" and "load" are +** merely convenient designations; energy will be transfered from the source side to the load side if the source side is +** hotter than the load side. It will be transfered from the load side to the source side if the load side is hotter +** than the source side. +TColdOut = [1, 3] ! Load side outlet temperature [C] ([-Inf,+Inf]) + +** The flow rate of fluid exiting the load side of the counter flow heat exchanger. NOTE: "source" and "load" are merely +** convenient designations; energy will be transfered from the source side to the load side if the source side is hotter +** than the load side. It will be transfered from the load side to the source side if the load side is hotter than the +** source side. +! XXX = [1, 4] ! Load side flow rate [kg/hr] ([-Inf,+Inf]) + +** The total heat transfer rate between the fluids in the counter flow heat exchanger. +! XXX = [1, 5] ! Heat transfer rate [kJ/hr] ([-Inf,+Inf]) + +** The effectiveness of the counter flow heat exchanger. +! XXX = [1, 6] ! Effectiveness [-] ([-Inf,+Inf]) + + +*********************************** +** Monthly printer +*********************************** + + +*********************************** +** Hourly printer +*********************************** + + +*********************************** +** Online Plotter +*********************************** + diff --git a/tests/trnsysGUI/proforma/data/expected/cases/Type137.ddck b/tests/trnsysGUI/proforma/data/expected/cases/Type137.ddck new file mode 100644 index 00000000..79a8bb12 --- /dev/null +++ b/tests/trnsysGUI/proforma/data/expected/cases/Type137.ddck @@ -0,0 +1,276 @@ +******************************* +** BEGIN Type137.ddck +******************************* + +************************************************************************************************************************ +** Description: +** 4-Pipe Fan Coil: Heating and Cooling +************************************************************************************************************************ + +************************************************************************************************************************ +** Details: +** This component models a fan coil where the air is heated or cooled as it passes across coils containing hot and cold +** liquid flow streams. This model relies on user-provided external data files which contain the performance of the +** coils as a function of the entering air and fluid conditions. Refer to the sample data files which accompany this +** model for the format of these external files. +************************************************************************************************************************ + +*********************************** +** inputs from hydraulic solver +*********************************** + +*********************************** +** outputs to hydraulic solver +*********************************** + +*********************************** +** outputs to other ddck +*********************************** + + +****************************************************************************************** +** outputs to energy balance in kWh and ABSOLUTE value +****************************************************************************************** + + +*********************************** +** Dependencies with other ddck +*********************************** + + +*********************************** +** Begin CONSTANTS +*********************************** + + +*********************************** +** Begin TYPE +*********************************** +UNIT 1 TYPE 137 +PARAMETERS 20 +** This parameter indicates whether the inputs for absolute humidity ratio (this parameter = 1) or percent relative +** humidity (this parameter = 2) should be used to set the inlet air conditions. +2.0 ! 1: Humidity Mode [-] ([2,2]) + +** The specific heat of the liquid stream flowing through the fan coil cooling coils. +4.19 ! 2: Cooling Fluid Specific Heat [kJ/kg.K] ([0.0,+Inf]) + +** The specific heat of the liquid stream flowing through the fan coil heating coils. +4.19 ! 3: Heating Fluid Specific Heat [kJ/kg.K] ([0.0,+Inf]) + +** The volumetric flow rate of air through the device at its rated conditions. +943.89 ! 4: Rated Volumetric Air Flow Rate [l/s] ([0.,+Inf]) + +** The fan power draw at its rated conditions. +564.0 ! 5: Rated Fan Power [kJ/hr] ([0.,+Inf]) + +** The logical unit which wil be assigned to the external data file containing the total and sensible cooling load +** ratios as a function of the entering liquid temperature, entering liquid flow rate, the entering air dry bulb +** temperature, the entering air wet bulb temperature, and air flow rate. Logical units must be unique integers in each +** TRNSYS simulation. +10.0 ! 6: Logical Unit - Cooling Performance [-] ([10,+Inf]) + +** The number of air drybulb temperatures for which cooling coil performance data will be provided in the user-provided +** external data file. +7.0 ! 7: Number of Drybulb Temperatures - Cooling [-] ([1,+Inf]) + +** The number of air wetbulb temperatures for which cooling coil performance data will be provided in the user-provided +** external data file. +7.0 ! 8: Number of Wetbulb Temperatures - Cooling [-] ([1,+Inf]) + +** The number of normalized air flow rates for which cooling coil performance data will be provided in the user-provided +** external data file. +6.0 ! 9: Number of Air Flows - Cooling [-] ([1,+Inf]) + +** The number of liquid (water typically) temperatures for which cooling coil performance data will be provided in the +** user-provided external data file. +8.0 ! 10: Number of Liquid Temperatures - Cooling [-] ([1,+Inf]) + +** The number of normalized liquid flow rates for which cooling coil performance data will be provided in the user- +** provided external data file. +2.0 ! 11: Number of Liquid Flow Rates - Cooling [-] ([1,+Inf]) + +** The logical unit which wil be assigned to the external data file containing the heating performance data as a +** function of the air inlet temperature and flow rate and the liquid entering temperature and flow rate. Logical units +** must be unique integers in each TRNSYS simulation. +11.0 ! 12: Logical Unit - Heating Performance [-] ([10,+Inf]) + +** The number of air drybulb temperatures for which heating coil performance data will be provided in the user-provided +** external data file. +7.0 ! 13: Number of Air Temperatures - Heating [-] ([1,+Inf]) + +** The number of normalized air flow rates for which heating coil performance data will be provided in the user-provided +** external data file. +6.0 ! 14: Number of Air Flows - Heating [-] ([1,+Inf]) + +** The number of liquid (water typically) temperatures for which heating coil performance data will be provided in the +** user-provided external data file. +11.0 ! 15: Number of Liquid Temperatures - Heating [-] ([1,+Inf]) + +** The number of normalized liquid flow rates for which heating coil performance data will be provided in the user- +** provided external data file. +2.0 ! 16: Number of Liquid Flow Rates - Heating [-] ([1,+Inf]) + +** The logical unit which wil be assigned to the external data file containing the fraction of fan full-load power as a +** function of the normalized fan speed. +12.0 ! 17: Logical Unit - Fan Corrections [-] ([10,+Inf]) + +** The number of normalized fan speeds for which fan performance data will be provided in the user-provided external +** data file. +11.0 ! 18: Number of Fan Speeds [-] ([1,+Inf]) + +** The efficiency of the fan motor. +0.9 ! 19: Efficiency of Fan Motor [-] ([0.,1.]) + +** The fraction of the fan power/heat that ends up in the air stream. Values are typically zero for fans motors mounted +** outside of the air stream and 1 for fan motors mounted within the air stream. +1.0 ! 20: Fraction of Fan Heat to Air [-] ([0.,1.]) + +INPUTS 17 +** The temperature of the liquid stream fluid flowing into the fan coil unit's cooling coils. +0,0 ! 1: Cooling Fluid Inlet Temperature [C] ([-Inf,+Inf]) + +** The flow rate of the cooling liquid stream fluid flowing into the fan coil unit's cooling coils. +0,0 ! 2: Cooling Fluid Flow Rate [kg/hr] ([0.0,+Inf]) + +** The temperature of the liquid stream fluid flowing into the fan coil unit's heating coils. +0,0 ! 3: Heating Fluid Inlet Temperature [C] ([-Inf,+Inf]) + +** The flow rate of the heating liquid stream fluid flowing into the fan coil unit's heating coils. +0,0 ! 4: Heating Fluid Flow Rate [kg/hr] ([0.0,+Inf]) + +** The drybulb temperature of the return air entering the fan coil. This return air gets mixed with a user-specified +** fraction of outside air. +0,0 ! 5: Return Air Temperature [C] ([-Inf,+Inf]) + +** The absolute humidity ratio of the return air entering the fan coil. This return air gets mixed with a user-specified +** fraction of outside air. +0,0 ! 6: Return Air Humidity Ratio [-] ([0.,+Inf]) + +** The percent relative humidity of the return air entering the fan coil. This return air gets mixed with a user- +** specified fraction of outside air. +0,0 ! 7: Return Air % Relative Humidity [% (base 100)] ([0,100]) + +** The absolute pressure of the air streams entering the fan coil. +0,0 ! 8: Return Air Pressure [atm] ([0.0,+Inf]) + +** The pressure rise of the air stream as it flows across the fan. +0,0 ! 9: Air-Side Pressure Rise: Fan [atm] ([0.0,+Inf]) + +** The pressure drop of the air stream as it passes across the coils. +0,0 ! 10: Air-Side Pressure Drop: Coils [atm] ([0.0,+Inf]) + +** The drybulb temperature of the ambient air entering the fan coil for mixing with the return air. +0,0 ! 11: Fresh Air Temperature [C] ([-Inf,+Inf]) + +** The absolute humidity ratio of the ambient air entering the fan coil for mixing with the return air. +0,0 ! 12: Fresh Air Humidity Ratio [-] ([0.,+Inf]) + +** The percent relative humidity of the ambient air entering the fan coil for mixing with the return air. +0,0 ! 13: Fresh Air % Relative Humidity [% (base 100)] ([0,100]) + +** The control signal for heating operation: 0 = Off and 1 = On. +0,0 ! 14: Heating Control Signal [-] ([0.,1.]) + +** The control signal for cooling operation: 0 = Off and 1 = On. +0,0 ! 15: Cooling Control Signal [-] ([0.,1.]) + +** The control signal for fan operation: 0 = Off, 1 = Full On, Values between 0 and 1 set the fraction of rated fan +** speed. +0,0 ! 16: Fan Control Signal [-] ([0.,1.]) + +** The control signal for outside air mixing: 0 = No outside air and 100% return air and 1 = 100% outside air and no +** return air. Values between 0 and 1 set the fraction of outside air. +0,0 ! 17: Fraction of Outside Air [-] ([0.,1.]) + +** initial values +10.0 ! 1: Cooling Fluid Inlet Temperature initial value +0.0 ! 2: Cooling Fluid Flow Rate initial value +10.0 ! 3: Heating Fluid Inlet Temperature initial value +0.0 ! 4: Heating Fluid Flow Rate initial value +20.0 ! 5: Return Air Temperature initial value +0.002 ! 6: Return Air Humidity Ratio initial value +50.0 ! 7: Return Air % Relative Humidity initial value +1.0 ! 8: Return Air Pressure initial value +0.0 ! 9: Air-Side Pressure Rise: Fan initial value +0.0 ! 10: Air-Side Pressure Drop: Coils initial value +20.0 ! 11: Fresh Air Temperature initial value +0.002 ! 12: Fresh Air Humidity Ratio initial value +50.0 ! 13: Fresh Air % Relative Humidity initial value +0.0 ! 14: Heating Control Signal initial value +0.0 ! 15: Cooling Control Signal initial value +0.0 ! 16: Fan Control Signal initial value +0.0 ! 17: Fraction of Outside Air initial value + +! EQUATIONS 18 +** The temperature of the liquid stream exiting the fan coil unit's cooling coils. +! XXX = [1, 1] ! Cooling Fluid Outlet Temperature [C] ([-Inf,+Inf]) + +** The flow rate of the liquid stream exiting the fan coil unit's cooling coils. +! XXX = [1, 2] ! Outlet Cooling Fluid Flow Rate [kg/hr] ([0.0,+Inf]) + +** The temperature of the liquid stream exiting the fan coil unit's heating coils. +! XXX = [1, 3] ! Heating Fluid Outlet Temperature [C] ([-Inf,+Inf]) + +** The flow rate of the liquid stream exiting the fan coil unit's heating coils. +! XXX = [1, 4] ! Outlet Heating Fluid Flow Rate [kg/hr] ([0.0,+Inf]) + +** The drybulb temperature of the air exiting the fan coil. +! XXX = [1, 5] ! Outlet Air Temperature [C] ([-Inf,+Inf]) + +** The absolute humidity ratio of the air exiting the fan coil. +! XXX = [1, 6] ! Outlet Air Humidity Ratio [-] ([-Inf,+Inf]) + +** The percent relative humidity of the air exiting the fan coil. +! XXX = [1, 7] ! Outlet Air % Relative Humidity [% (base 100)] ([-Inf,+Inf]) + +** The flow rate of dry air exiting the fan coil. +! XXX = [1, 8] ! Outlet Air Flow Rate [kg/hr] ([-Inf,+Inf]) + +** The absolute pressure of the air exiting the fan coil. +! XXX = [1, 9] ! Outlet Air Pressure [atm] ([-Inf,+Inf]) + +** The rate at which energy is removed from the air stream (sensible plus latent) across the cooling coil. +! XXX = [1, 10] ! Total Cooling Rate [kJ/hr] ([-Inf,+Inf]) + +** The rate at which sensible energy is removed from the air stream across the cooling coil. +! XXX = [1, 11] ! Sensible Cooling Rate [kJ/hr] ([-Inf,+Inf]) + +** The rate at which energy is added to the air stream across the heating coil. +! XXX = [1, 12] ! Total Heating Rate [kJ/hr] ([-Inf,+Inf]) + +** The rate at which the fan consumes energy. +! XXX = [1, 13] ! Fan Power [kJ/hr] ([-Inf,+Inf]) + +** The rate at which energy is added to the air stream by the fan. +! XXX = [1, 14] ! Fan Heat to Air Stream [kJ/hr] ([-Inf,+Inf]) + +** The rate at which energy is rejected to the ambient by the fan. +! XXX = [1, 15] ! Fan Heat to Ambient [kJ/hr] ([-Inf,+Inf]) + +** The temperature of the condensed water from the air stream leaving the fan coil. +! XXX = [1, 16] ! Condensate Temperature [C] ([-Inf,+Inf]) + +** The rate at which condensed water from the air stream exits the fan coil. +! XXX = [1, 17] ! Condensate Flow Rate [kg/hr] ([0.0,+Inf]) + +** The rate at which energy is transferred to the air stream by the coils; positive implies energy added to the air +** stream (heating). This term does not include energy added by the fan or energy associated with the condensate +** draining from the unit but is strictly a measure of the coil heat transfer. +! XXX = [1, 18] ! Conditioning Energy Rate [kJ/hr] ([-Inf,+Inf]) + + +*********************************** +** Monthly printer +*********************************** + + +*********************************** +** Hourly printer +*********************************** + + +*********************************** +** Online Plotter +*********************************** + diff --git a/tests/trnsysGUI/proforma/data/expected/Type71-no-hydraulic-connections.ddck b/tests/trnsysGUI/proforma/data/expected/cases/Type71-no-hydraulic-connections.ddck similarity index 54% rename from tests/trnsysGUI/proforma/data/expected/Type71-no-hydraulic-connections.ddck rename to tests/trnsysGUI/proforma/data/expected/cases/Type71-no-hydraulic-connections.ddck index 93c25e2a..673e1f95 100644 --- a/tests/trnsysGUI/proforma/data/expected/Type71-no-hydraulic-connections.ddck +++ b/tests/trnsysGUI/proforma/data/expected/cases/Type71-no-hydraulic-connections.ddck @@ -2,12 +2,12 @@ ** BEGIN Type71-no-hydraulic-connections.ddck ******************************* -*************************************************************************** +************************************************************************************************************************ ** Description: ** Solar Collector; Evacuated Tube -*************************************************************************** +************************************************************************************************************************ -*************************************************************************** +************************************************************************************************************************ ** Details: ** Because the Solar Ratings and Certification Commission (SRCC) defines the efficiency of an evacuated tube collector ** bank using the same equations as those for a flat plat, the main difference (from a modeling point of view) between @@ -23,7 +23,7 @@ ** intercept, and curvature parameters to account for identical collectors in series, and flow rates other than those at ** test conditions. The effects of off-normal solar incidence are modeled by the provision of a bi-axial incidence angle ** modifier data file. -*************************************************************************** +************************************************************************************************************************ *********************************** ** inputs from hydraulic solver @@ -58,28 +58,90 @@ *********************************** UNIT 1 TYPE 71 PARAMETERS 11 +** The solar collector model can simulate an array of identical solar collectors hooked up in series. This parameter is +** used to specify how many collectors are hooked up in a series arrangement where the output of the first collector is +** the inlet to the second collector. NOTE: increasing this value does not change the array area. Total array area is +** set by parameter 2 1.0 ! 1: Number in series [-] ([1,+Inf]) + +** The total area of the solar collector array consistent with the supplied efficiency parameters (typically gross area +** and not net area). 2.0 ! 2: Collector area [m^2] ([0.0,+Inf]) + +** The specific heat of the fluid flowing through the solar collector array. 4.19 ! 3: Fluid specific heat [kJ/kg.K] ([0.0,+Inf]) + +** The collector efficiency equation can be written as a function of the inlet, average or outlet temperature. Specify 1 +** if the collector efficiency parameters are given as a function of the inlet temperature Specify 2 for a function of +** the collector average temperature Specify 3 for a function of the collector outlet temperature 1.0 ! 4: Efficiency mode [-] ([1,3]) + +** Collector Flow rate per unit area for efficiency test conditions 50.0 ! 5: Flow rate at test conditions [kg/hr.m^2] ([0.0,+Inf]) + +** This parameter is the y intercept of the collector efficiency curve versus the temperature difference / radiation +** ratio In equation form, this parameter is a0 in the following eq: Eff = a0 - a1 * (Tc-Tamb)/Rad. - a2 * (Tc-Tamb)^2 / +** Rad. where Tc is the collector inlet, average or outlet temperature according to parameter 4 0.7 ! 6: Intercept efficiency [-] ([0.0,1.0]) + +** This parameter is the slope of the collector efficiency curve versus the temperature difference / radiation ratio In +** equation form, this parameter is a1 in the following eq: Eff. = a0 - a1 * (Tc-Tamb)/Rad. - a2 * (Tc-Tamb)^2 /Rad. +** Where Tc is the collector inlet, average or outlet temperature according to parameter 4 10.0 ! 7: Negative of first order efficiency coeficient [kJ/hr.m^2.K] ([0.0,+Inf]) + +** This parameter is the curvature of the efficiency curve versus the temperature difference / radiation ratio In +** equation form, this parameter is a2 in the following eq: Eff. = a0 - a1 * (Tc-Tamb) /Rad.- a2 * (Tc-Tamb)^2/Rad where +** Tc is the collector inlet, average or outlet temperature according to parameter 4 0.03 ! 8: Negative of second order efficiency coeficient [kJ/hr.m^2.K^2] ([0.0,+Inf]) + +** FORTRAN Logical unit for file containing biaxial IAM data Make sure that each logical unit specified in an assembly +** is unique 13.0 ! 9: Logical unit of file containing biaxial IAM data [-] ([10,100]) + +** Number of data points for the IAM (longitudinal direction) 7.0 ! 10: Number of longitudinal angles for which IAMs are provided [-] ([1,+Inf]) + +** Number of data points for the IAM (transverse direction) 7.0 ! 11: Number of transverse angles for which IAMs are provided [-] ([1,+Inf]) + INPUTS 10 +** The temperature of the fluid entering the the solar collector. 0,0 ! 1: Inlet temperature [C] ([-Inf,+Inf]) + +** The flow rate of the fluid entering the solar collector. 0,0 ! 2: Inlet flowrate [kg/hr] ([0.0,+Inf]) + +** The temperature of the environment in which the solar collector is located. This temperature will be used for loss +** calculations. 0,0 ! 3: Ambient temperature [C] ([-Inf,+Inf]) + +** The total (beam + diffuse) radiation incident on the plane of the solar collector per unit area. This input is +** commonly hooked up to the TYPE 16 "total radiation on surface 1" output. 0,0 ! 4: Incident radiation [kJ/hr.m^2] ([0.0,+Inf]) + +** The incident diffuse solar radiation in the plane of the collector, per unit area 0,0 ! 5: Incident diffuse radiation [kJ/hr.m^2] ([0.0,+Inf]) + +** Incidence angle of beam radiation on the collector's surface 0,0 ! 6: Solar incidence angle [degrees] ([-360,+360]) + +** The solar zenith angle is the angle between the vertical and the line of sight of the sun 0,0 ! 7: Solar zenith angle [degrees] ([-360,+360]) + +** The solar azimuth angle is the angle between the local meridian and the projection of the line of sight of the sun +** onto the horizontal plane 0,0 ! 8: Solar azimuth angle [degrees] ([-360,+360]) + +** The slope of the collector is the angle between the collector surface and the horizontal 0= horizontal, 90= vertical +** The angle is positive when facing towards the collector surface azimuth As a general rule, the performance of the +** collector is somewhat optimiszed when the sollector slope is set to the latitude 0,0 ! 9: Collector slope [degrees] ([-360,+360]) + +** The collector surface azimuth is the angle between the local meridian and the projection of the normal to the surface +** onto the horizontal plane 0 = facing the equator 90 = facing West 180 = facing North in northern hemisphere, South in +** Southern hemisphere 270 = facing East 0,0 ! 10: Collector azimuth [degrees] ([-360,+360]) + ** initial values 20.0 ! 1: Inlet temperature initial value 100.0 ! 2: Inlet flowrate initial value @@ -93,12 +155,20 @@ INPUTS 10 0.0 ! 10: Collector azimuth initial value ! EQUATIONS 5 +** The temperature of the fluid exiting the solar collector array. ! XXX = [1, 1] ! Outlet temperature [C] ([-Inf,+Inf]) + +** The flowrate of the fluid exiting the solar collecor array. In this model: mdot,in = mdot,out ! XXX = [1, 2] ! Outlet flowrate [kg/hr] ([0.0,+Inf]) + +** The rate of useful energy gain by the solar collector fluid: Qu = mdot * Cp * (Tout - Tin) ! XXX = [1, 3] ! Useful energy gain [kJ/hr] ([0.0,+Inf]) + ! XXX = [1, 4] ! Collector efficiency [-] ([-Inf,+Inf]) + ! XXX = [1, 5] ! Incidence angle modifier - overall [-] ([-Inf,+Inf]) + *********************************** ** Monthly printer *********************************** diff --git a/tests/trnsysGUI/proforma/data/expected/Type71.ddck b/tests/trnsysGUI/proforma/data/expected/cases/Type71.ddck similarity index 53% rename from tests/trnsysGUI/proforma/data/expected/Type71.ddck rename to tests/trnsysGUI/proforma/data/expected/cases/Type71.ddck index d6614385..623ddc9d 100644 --- a/tests/trnsysGUI/proforma/data/expected/Type71.ddck +++ b/tests/trnsysGUI/proforma/data/expected/cases/Type71.ddck @@ -2,12 +2,12 @@ ** BEGIN Type71.ddck ******************************* -*************************************************************************** +************************************************************************************************************************ ** Description: ** Solar Collector; Evacuated Tube -*************************************************************************** +************************************************************************************************************************ -*************************************************************************** +************************************************************************************************************************ ** Details: ** Because the Solar Ratings and Certification Commission (SRCC) defines the efficiency of an evacuated tube collector ** bank using the same equations as those for a flat plat, the main difference (from a modeling point of view) between @@ -23,15 +23,15 @@ ** intercept, and curvature parameters to account for identical collectors in series, and flow rates other than those at ** test conditions. The effects of off-normal solar incidence are modeled by the provision of a bi-axial incidence angle ** modifier data file. -*************************************************************************** +************************************************************************************************************************ *********************************** ** inputs from hydraulic solver *********************************** EQUATIONS 3 -:CpIn = @cp(In) +:Cp = @cp(In) :TIn = @temp(In) -:MIn = @mfr(In) +:M = @mfr(In) *********************************** ** outputs to hydraulic solver @@ -64,28 +64,90 @@ EQUATIONS 1 *********************************** UNIT 1 TYPE 71 PARAMETERS 11 +** The solar collector model can simulate an array of identical solar collectors hooked up in series. This parameter is +** used to specify how many collectors are hooked up in a series arrangement where the output of the first collector is +** the inlet to the second collector. NOTE: increasing this value does not change the array area. Total array area is +** set by parameter 2 1.0 ! 1: Number in series [-] ([1,+Inf]) + +** The total area of the solar collector array consistent with the supplied efficiency parameters (typically gross area +** and not net area). 2.0 ! 2: Collector area [m^2] ([0.0,+Inf]) -:CpIn ! 3: Fluid specific heat [kJ/kg.K] ([0.0,+Inf]) + +** The specific heat of the fluid flowing through the solar collector array. +:Cp ! 3: Fluid specific heat [kJ/kg.K] ([0.0,+Inf]) + +** The collector efficiency equation can be written as a function of the inlet, average or outlet temperature. Specify 1 +** if the collector efficiency parameters are given as a function of the inlet temperature Specify 2 for a function of +** the collector average temperature Specify 3 for a function of the collector outlet temperature 1.0 ! 4: Efficiency mode [-] ([1,3]) + +** Collector Flow rate per unit area for efficiency test conditions 50.0 ! 5: Flow rate at test conditions [kg/hr.m^2] ([0.0,+Inf]) + +** This parameter is the y intercept of the collector efficiency curve versus the temperature difference / radiation +** ratio In equation form, this parameter is a0 in the following eq: Eff = a0 - a1 * (Tc-Tamb)/Rad. - a2 * (Tc-Tamb)^2 / +** Rad. where Tc is the collector inlet, average or outlet temperature according to parameter 4 0.7 ! 6: Intercept efficiency [-] ([0.0,1.0]) + +** This parameter is the slope of the collector efficiency curve versus the temperature difference / radiation ratio In +** equation form, this parameter is a1 in the following eq: Eff. = a0 - a1 * (Tc-Tamb)/Rad. - a2 * (Tc-Tamb)^2 /Rad. +** Where Tc is the collector inlet, average or outlet temperature according to parameter 4 10.0 ! 7: Negative of first order efficiency coeficient [kJ/hr.m^2.K] ([0.0,+Inf]) + +** This parameter is the curvature of the efficiency curve versus the temperature difference / radiation ratio In +** equation form, this parameter is a2 in the following eq: Eff. = a0 - a1 * (Tc-Tamb) /Rad.- a2 * (Tc-Tamb)^2/Rad where +** Tc is the collector inlet, average or outlet temperature according to parameter 4 0.03 ! 8: Negative of second order efficiency coeficient [kJ/hr.m^2.K^2] ([0.0,+Inf]) + +** FORTRAN Logical unit for file containing biaxial IAM data Make sure that each logical unit specified in an assembly +** is unique 13.0 ! 9: Logical unit of file containing biaxial IAM data [-] ([10,100]) + +** Number of data points for the IAM (longitudinal direction) 7.0 ! 10: Number of longitudinal angles for which IAMs are provided [-] ([1,+Inf]) + +** Number of data points for the IAM (transverse direction) 7.0 ! 11: Number of transverse angles for which IAMs are provided [-] ([1,+Inf]) + INPUTS 10 +** The temperature of the fluid entering the the solar collector. :TIn ! 1: Inlet temperature [C] ([-Inf,+Inf]) -:MIn ! 2: Inlet flowrate [kg/hr] ([0.0,+Inf]) + +** The flow rate of the fluid entering the solar collector. +:M ! 2: Inlet flowrate [kg/hr] ([0.0,+Inf]) + +** The temperature of the environment in which the solar collector is located. This temperature will be used for loss +** calculations. 0,0 ! 3: Ambient temperature [C] ([-Inf,+Inf]) + +** The total (beam + diffuse) radiation incident on the plane of the solar collector per unit area. This input is +** commonly hooked up to the TYPE 16 "total radiation on surface 1" output. 0,0 ! 4: Incident radiation [kJ/hr.m^2] ([0.0,+Inf]) + +** The incident diffuse solar radiation in the plane of the collector, per unit area 0,0 ! 5: Incident diffuse radiation [kJ/hr.m^2] ([0.0,+Inf]) + +** Incidence angle of beam radiation on the collector's surface 0,0 ! 6: Solar incidence angle [degrees] ([-360,+360]) + +** The solar zenith angle is the angle between the vertical and the line of sight of the sun 0,0 ! 7: Solar zenith angle [degrees] ([-360,+360]) + +** The solar azimuth angle is the angle between the local meridian and the projection of the line of sight of the sun +** onto the horizontal plane 0,0 ! 8: Solar azimuth angle [degrees] ([-360,+360]) + +** The slope of the collector is the angle between the collector surface and the horizontal 0= horizontal, 90= vertical +** The angle is positive when facing towards the collector surface azimuth As a general rule, the performance of the +** collector is somewhat optimiszed when the sollector slope is set to the latitude 0,0 ! 9: Collector slope [degrees] ([-360,+360]) + +** The collector surface azimuth is the angle between the local meridian and the projection of the normal to the surface +** onto the horizontal plane 0 = facing the equator 90 = facing West 180 = facing North in northern hemisphere, South in +** Southern hemisphere 270 = facing East 0,0 ! 10: Collector azimuth [degrees] ([-360,+360]) + ** initial values 20.0 ! 1: Inlet temperature initial value 100.0 ! 2: Inlet flowrate initial value @@ -99,12 +161,20 @@ INPUTS 10 0.0 ! 10: Collector azimuth initial value EQUATIONS 1 ! 5 +** The temperature of the fluid exiting the solar collector array. :TOut = [1, 1] ! Outlet temperature [C] ([-Inf,+Inf]) + +** The flowrate of the fluid exiting the solar collecor array. In this model: mdot,in = mdot,out ! :XXX = [1, 2] ! Outlet flowrate [kg/hr] ([0.0,+Inf]) + +** The rate of useful energy gain by the solar collector fluid: Qu = mdot * Cp * (Tout - Tin) ! :XXX = [1, 3] ! Useful energy gain [kJ/hr] ([0.0,+Inf]) + ! :XXX = [1, 4] ! Collector efficiency [-] ([-Inf,+Inf]) + ! :XXX = [1, 5] ! Incidence angle modifier - overall [-] ([-Inf,+Inf]) + *********************************** ** Monthly printer *********************************** diff --git a/tests/trnsysGUI/proforma/data/input/Type137.xmltmf b/tests/trnsysGUI/proforma/data/input/Type137.xmltmf deleted file mode 100644 index def6ee75..00000000 --- a/tests/trnsysGUI/proforma/data/input/Type137.xmltmf +++ /dev/null @@ -1,2 +0,0 @@ - -4-Pipe Fan Coil: Heating and CoolingTim McDowellThermal Energy System SpecialistsTPMv18June 2015434.\Studio\Proformas\HVAC\Fan Coil\Type137.bmp1379999Fan Coil4-Pipe Fan Coil
This component models a fan coil where the air is heated or cooled as it passes across coils containing hot and cold liquid flow streams. This model relies on user-provided external data files which contain the performance of the coils as a function of the entering air and fluid conditions. Refer to the sample data files which accompany this model for the format of these external files.
Performance Map 4-Pipe Fan Coil4-Pipe Fan Coil1Humidity ModeparameterDimensionless-integer22[ ; ]2SNThis parameter indicates whether the inputs for absolute humidity ratio (this parameter = 1) or percent relative humidity (this parameter = 2) should be used to set the inlet air conditions.2Cooling Fluid Specific HeatparameterSpecific HeatkJ/kg.Kreal0.0+Inf[ ; ]4.190SNThe specific heat of the liquid stream flowing through the fan coil cooling coils.3Heating Fluid Specific HeatparameterSpecific HeatkJ/kg.Kreal0.0+Inf[ ; ]4.190SNThe specific heat of the liquid stream flowing through the fan coil heating coils.4Rated Volumetric Air Flow RateparameterVolumetric Flow Ratel/sreal0.+Inf[ ; ]943.89SNThe volumetric flow rate of air through the device at its rated conditions.5Rated Fan PowerparameterPowerkJ/hrreal0.+Inf[ ; ]564.0SNThe fan power draw at its rated conditions.6Logical Unit - Cooling PerformanceparameterDimensionless-integer10+Inf[ ; ]10SNThe logical unit which wil be assigned to the external data file containing the total and sensible cooling load ratios as a function of the entering liquid temperature, entering liquid flow rate, the entering air dry bulb temperature, the entering air wet bulb temperature, and air flow rate. Logical units must be unique integers in each TRNSYS simulation.7Number of Drybulb Temperatures - CoolingparameterDimensionless-integer1+Inf[ ; ]7SNThe number of air drybulb temperatures for which cooling coil performance data will be provided in the user-provided external data file.8Number of Wetbulb Temperatures - CoolingparameterDimensionless-integer1+Inf[ ; ]7SNThe number of air wetbulb temperatures for which cooling coil performance data will be provided in the user-provided external data file.9Number of Air Flows - CoolingparameterDimensionless-integer1+Inf[ ; ]6SNThe number of normalized air flow rates for which cooling coil performance data will be provided in the user-provided external data file.10Number of Liquid Temperatures - CoolingparameterDimensionless-integer1+Inf[ ; ]8SNThe number of liquid (water typically) temperatures for which cooling coil performance data will be provided in the user-provided external data file.11Number of Liquid Flow Rates - CoolingparameterDimensionless-integer1+Inf[ ; ]2SNThe number of normalized liquid flow rates for which cooling coil performance data will be provided in the user-provided external data file.12Logical Unit - Heating PerformanceparameterDimensionless-integer10+Inf[ ; ]11SNThe logical unit which wil be assigned to the external data file containing the heating performance data as a function of the air inlet temperature and flow rate and the liquid entering temperature and flow rate. Logical units must be unique integers in each TRNSYS simulation.13Number of Air Temperatures - HeatingparameterDimensionless-integer1+Inf[ ; ]7SNThe number of air drybulb temperatures for which heating coil performance data will be provided in the user-provided external data file.14Number of Air Flows - HeatingparameterDimensionless-integer1+Inf[ ; ]6SNThe number of normalized air flow rates for which heating coil performance data will be provided in the user-provided external data file.15Number of Liquid Temperatures - HeatingparameterDimensionless-integer1+Inf[ ; ]11SNThe number of liquid (water typically) temperatures for which heating coil performance data will be provided in the user-provided external data file.16Number of Liquid Flow Rates - HeatingparameterDimensionless-integer1+Inf[ ; ]2SNThe number of normalized liquid flow rates for which heating coil performance data will be provided in the user-provided external data file.17Logical Unit - Fan CorrectionsparameterDimensionless-integer10+Inf[ ; ]12SNThe logical unit which wil be assigned to the external data file containing the fraction of fan full-load power as a function of the normalized fan speed.18Cooling Fluid Inlet TemperatureinputTemperatureCreal-Inf+Inf[ ; ]10.0SNThe temperature of the liquid stream fluid flowing into the fan coil unit's cooling coils.19Cooling Fluid Flow RateinputFlow Ratekg/hrreal0.0+Inf[ ; ]0.0SNThe flow rate of the cooling liquid stream fluid flowing into the fan coil unit's cooling coils.20Heating Fluid Inlet TemperatureinputTemperatureCreal-Inf+Inf[ ; ]10.0SNThe temperature of the liquid stream fluid flowing into the fan coil unit's heating coils.21Heating Fluid Flow RateinputFlow Ratekg/hrreal0.0+Inf[ ; ]0.0SNThe flow rate of the heating liquid stream fluid flowing into the fan coil unit's heating coils.22Return Air TemperatureinputTemperatureCreal-Inf+Inf[ ; ]20.0SNThe drybulb temperature of the return air entering the fan coil. This return air gets mixed with a user-specified fraction of outside air.23Return Air Humidity RatioinputDimensionless-real0.+Inf[ ; ]0.002SNThe absolute humidity ratio of the return air entering the fan coil. This return air gets mixed with a user-specified fraction of outside air.24Return Air % Relative HumidityinputPercentage% (base 100)real0100[ ; ]50.0SNThe percent relative humidity of the return air entering the fan coil. This return air gets mixed with a user-specified fraction of outside air.25Return Air PressureinputPressureatmreal0.0+Inf[ ; ]1.0SNThe absolute pressure of the air streams entering the fan coil.26Air-Side Pressure Rise: FaninputPressureatmreal0.0+Inf[ ; ]0.0SNThe pressure rise of the air stream as it flows across the fan.27Cooling Fluid Outlet TemperatureoutputTemperatureCreal-Inf+Inf[ ; ]0SNThe temperature of the liquid stream exiting the fan coil unit's cooling coils.28Outlet Cooling Fluid Flow RateoutputFlow Ratekg/hrreal0.0+Inf[ ; ]0SNThe flow rate of the liquid stream exiting the fan coil unit's cooling coils.29Heating Fluid Outlet TemperatureoutputTemperatureCreal-Inf+Inf[ ; ]0SNThe temperature of the liquid stream exiting the fan coil unit's heating coils.30Outlet Heating Fluid Flow RateoutputFlow Ratekg/hrreal0.0+Inf[ ; ]0SNThe flow rate of the liquid stream exiting the fan coil unit's heating coils.31Outlet Air TemperatureoutputTemperatureCreal-Inf+Inf[ ; ]0SNThe drybulb temperature of the air exiting the fan coil.32Outlet Air Humidity RatiooutputDimensionless-real-Inf+Inf[ ; ]0SNThe absolute humidity ratio of the air exiting the fan coil.33Outlet Air % Relative HumidityoutputPercentage% (base 100)real-Inf+Inf[ ; ]0SNThe percent relative humidity of the air exiting the fan coil.34Outlet Air Flow RateoutputFlow Ratekg/hrreal-Inf+Inf[ ; ]0SNThe flow rate of dry air exiting the fan coil.35Outlet Air PressureoutputPressureatmreal-Inf+Inf[ ; ]0SNThe absolute pressure of the air exiting the fan coil.36Total Cooling RateoutputPowerkJ/hrreal-Inf+Inf[ ; ]0SNThe rate at which energy is removed from the air stream (sensible plus latent) across the cooling coil.37Sensible Cooling RateoutputPowerkJ/hrreal-Inf+Inf[ ; ]0SNThe rate at which sensible energy is removed from the air stream across the cooling coil.38Total Heating RateoutputPowerkJ/hrreal-Inf+Inf[ ; ]0SNThe rate at which energy is added to the air stream across the heating coil.39Fan PoweroutputPowerkJ/hrreal-Inf+Inf[ ; ]0SNThe rate at which the fan consumes energy.40Fan Heat to Air StreamoutputPowerkJ/hrreal-Inf+Inf[ ; ]0SNThe rate at which energy is added to the air stream by the fan.41Fan Heat to AmbientoutputPowerkJ/hrreal-Inf+Inf[ ; ]0SNThe rate at which energy is rejected to the ambient by the fan.42Condensate TemperatureoutputTemperatureCreal-Inf+Inf[ ; ]20.0SNThe temperature of the condensed water from the air stream leaving the fan coil.43Condensate Flow RateoutputFlow Ratekg/hrreal0.0+Inf[ ; ]0SNThe rate at which condensed water from the air stream exits the fan coil.44Number of Fan SpeedsparameterDimensionless-integer1+Inf[ ; ]11SNThe number of normalized fan speeds for which fan performance data will be provided in the user-provided external data file.45Efficiency of Fan MotorparameterDimensionless-real0.1.[ ; ]0.9SNThe efficiency of the fan motor.46Fraction of Fan Heat to AirparameterDimensionless-real0.1.[ ; ]1.SNThe fraction of the fan power/heat that ends up in the air stream. Values are typically zero for fans motors mounted outside of the air stream and 1 for fan motors mounted within the air stream.47Air-Side Pressure Drop: CoilsinputPressureatmreal0.0+Inf[ ; ]0.0SNThe pressure drop of the air stream as it passes across the coils.48Fresh Air TemperatureinputTemperatureCreal-Inf+Inf[ ; ]20.0SNThe drybulb temperature of the ambient air entering the fan coil for mixing with the return air.49Fresh Air Humidity RatioinputDimensionless-real0.+Inf[ ; ]0.002SNThe absolute humidity ratio of the ambient air entering the fan coil for mixing with the return air.50Fresh Air % Relative HumidityinputPercentage% (base 100)real0100[ ; ]50.0SNThe percent relative humidity of the ambient air entering the fan coil for mixing with the return air.51Heating Control SignalinputDimensionless-real0.1.[ ; ]0.SNThe control signal for heating operation: 0 = Off and 1 = On.52Cooling Control SignalinputDimensionless-real0.1.[ ; ]0.SNThe control signal for cooling operation: 0 = Off and 1 = On.53Fan Control SignalinputDimensionless-real0.1.[ ; ]0.SNThe control signal for fan operation: 0 = Off, 1 = Full On, Values between 0 and 1 set the fraction of rated fan speed.54Fraction of Outside AirinputDimensionless-real0.1.[ ; ]0.SNThe control signal for outside air mixing: 0 = No outside air and 100% return air and 1 = 100% outside air and no return air. Values between 0 and 1 set the fraction of outside air.55Conditioning Energy RateoutputPowerkJ/hrreal-Inf+Inf[ ; ]0SNThe rate at which energy is transferred to the air stream by the coils; positive implies energy added to the air stream (heating). This term does not include energy added by the fan or energy associated with the condensate draining from the unit but is strictly a measure of the coil heat transfer.Which external file contains the cooling performance data?.\Examples\Sample Catalog Files\FanCoil_Cooling.dat.\Tess Models\SampleCatalogData\4-Pipe Performance Map Fan Coil\Normalized_FanCoil_Cooling.datLogical Unit - Cooling PerformancenoWhich external file contains the heating performance data?.\Examples\Sample Catalog Files\FanCoil_Heating.dat.\Tess Models\SampleCatalogData\4-Pipe Performance Map Fan Coil\Normalized_FanCoil_Heating.datLogical Unit - Heating PerformancenoWhich external file contains the fan performance data?.\Examples\Sample Catalog Files\FC_FanLawPerformance.dat.\Tess Models\SampleCatalogData\4-Pipe Performance Map Fan Coil\FanLawPerformance.datLogical Unit - Fan Correctionsno.\SourceCode\Types\Type137.f90
diff --git a/tests/trnsysGUI/proforma/data/input/Type5b.xmltmf b/tests/trnsysGUI/proforma/data/input/Type5b.xmltmf new file mode 100644 index 00000000..be3a0934 --- /dev/null +++ b/tests/trnsysGUI/proforma/data/input/Type5b.xmltmf @@ -0,0 +1,287 @@ + + + Heat Exchanger: Counter Flow + Contributors are listed in manuals + Solar Energy Laboratory, University of Wisconsin - Madison + CMR + TRNSYS v7.5 + May 2011 + 1 + 16 + .\Studio\Icon\Type5b.bmp + 5 + 9999 + +
A zero capacitance sensible heat exchanger is modeled in various configurations. In + this instance, a counter flow heat exchanger is modeled. Given the hot and cold side + inlet temperatures and flow rates, the effectiveness is calculated for a given fixed + value of the overall heat transfer coefficient.
+ + + 1 + Source side outlet temperature + output + Temperature + C + real + -Inf + +Inf + [ ; ] + 0 + SN + The temperature of the fluid leaving the source side of the counter + flow heat exchanger. NOTE: "source" and "load" are merely convenient + designations; energy will be transfered from the source side to the load + side if the source side is hotter than the load side. It will be + transfered from the load side to the source side if the load side is + hotter than the source side. + + + 2 + Source side flow rate + output + Flow Rate + kg/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The flow rate of fluid exiting the source side of the counter flow + heat exchanger. NOTE: "source" and "load" are merely convenient + designations; energy will be transfered from the source side to the load + side if the source side is hotter than the load side. It will be + transfered from the load side to the source side if the load side is + hotter than the source side. + + + 3 + Load side outlet temperature + output + Temperature + C + real + -Inf + +Inf + [ ; ] + 0 + SN + The temperature of the fluid leaving the load side of the counter + flow heat exchanger. NOTE: "source" and "load" are merely convenient + designations; energy will be transfered from the source side to the load + side if the source side is hotter than the load side. It will be + transfered from the load side to the source side if the load side is + hotter than the source side. + + + 4 + Load side flow rate + output + Flow Rate + kg/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The flow rate of fluid exiting the load side of the counter flow + heat exchanger. NOTE: "source" and "load" are merely convenient + designations; energy will be transfered from the source side to the load + side if the source side is hotter than the load side. It will be + transfered from the load side to the source side if the load side is + hotter than the source side. + + + 5 + Heat transfer rate + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The total heat transfer rate between the fluids in the counter flow + heat exchanger. + + + 6 + Effectiveness + output + Dimensionless + - + real + -Inf + +Inf + [ ; ] + 0 + SN + The effectiveness of the counter flow heat exchanger. + + + 7 + Source side inlet temperature + input + Temperature + C + real + -Inf + +Inf + [ ; ] + 20.0 + SN + The temperature of the fluid flowing into the source side of the + counter flow heat exchanger. NOTE: "source" and "load" are merely + convenient designations; energy will be transfered from the source side + to the load side if the source side is hotter than the load side. It + will be transfered from the load side to the source side if the load + side is hotter than the source side. + + + 8 + Source side flow rate + input + Flow Rate + kg/hr + real + 0 + +Inf + [ ; ] + 100.0 + SN + The flow rate of the fluid flowing through the source side of the + counter flow heat exchanger. NOTE: "source" and "load" are merely + convenient designations; energy will be transfered from the source side + to the load side if the source side is hotter than the load side. It + will be transfered from the load side to the source side if the load + side is hotter than the source side. + + + 9 + Load side inlet temperature + input + Temperature + C + real + -Inf + +Inf + [ ; ] + 20.0 + SN + The temperature of the fluid flowing into the load side of the + counter flow heat exchanger. NOTE: "source" and "load" are merely + convenient designations; energy will be transfered from the source side + to the load side if the source side is hotter than the load side. It + will be transfered from the load side to the source side if the load + side is hotter than the source side. + + + 10 + Load side flow rate + input + Flow Rate + kg/hr + real + 0 + +Inf + [ ; ] + 100.0 + SN + The flow rate of the fluid flowing through the load side of the + counter flow heat exchanger. NOTE: "source" and "load" are merely + convenient designations; energy will be transfered from the source side + to the load side if the source side is hotter than the load side. It + will be transfered from the load side to the source side if the load + side is hotter than the source side. + + + 11 + Counter flow mode + parameter + Dimensionless + - + integer + 2 + 2 + [ ; ] + 2 + SN + The general heat exchanger model may operate in various + configuration modes. Setting this parameter to 2 indicates a counter + flow arrangement. + Do not change this parameter. + + + 12 + Overall heat transfer coefficient of exchanger + input + Overall Loss Coefficient + kJ/hr.K + real + 0 + +Inf + [ ; ] + 10.0 + SN + Overall heat transfer coefficient of the counter flow heat + exchanger. + + + 13 + Specific heat of source side fluid + parameter + Specific Heat + kJ/kg.K + real + 0 + +Inf + [ ; ] + 4.19 + SN + The specific heat of the fluid flowing through the source side of + the counter flow heat exchanger. NOTE: "source" and "load" are merely + convenient designations; energy will be transfered from the source side + to the load side if the source side is hotter than the load side. It + will be transfered from the load side to the source side if the load + side is hotter than the source side. + + + 14 + Specific heat of load side fluid + parameter + Specific Heat + kJ/kg.K + real + 0 + +Inf + [ ; ] + 4.19 + SN + The specific heat of the fluid flowing through the load side of the + counter flow heat exchanger. NOTE: "source" and "load" are merely + convenient designations; energy will be transfered from the source side + to the load side if the source side is hotter than the load side. It + will be transfered from the load side to the source side if the load + side is hotter than the source side. + + + 15 + Not used + parameter + Dimensionless + - + integer + 0 + +Inf + [ ; ] + 0 + SN + + + + .\SourceCode\Types\Type5.f90 +
\ No newline at end of file diff --git a/tests/trnsysGUI/proforma/data/input/cases/Type137.xmltmf b/tests/trnsysGUI/proforma/data/input/cases/Type137.xmltmf new file mode 100644 index 00000000..62be660e --- /dev/null +++ b/tests/trnsysGUI/proforma/data/input/cases/Type137.xmltmf @@ -0,0 +1,878 @@ + + + 4-Pipe Fan Coil: Heating and Cooling + Tim McDowell + Thermal Energy System Specialists + TPM + v18 + June 2015 + 4 + 34 + .\Studio\Proformas\HVAC\Fan Coil\Type137.bmp + 137 + 9999 + + Fan Coil + 4-Pipe Fan Coil + +
This component models a fan coil where the air is heated or cooled as it passes across + coils containing hot and cold liquid flow streams. This model relies on user-provided + external data files which contain the performance of the coils as a function of the entering + air and fluid conditions. Refer to the sample data files which accompany this model for the + format of these external files.
+ Performance Map 4-Pipe Fan Coil + 4-Pipe Fan Coil + + + 1 + Humidity Mode + parameter + Dimensionless + - + integer + 2 + 2 + [ ; ] + 2 + SN + This parameter indicates whether the inputs for absolute humidity ratio + (this parameter = 1) or percent relative humidity (this parameter = 2) should be + used to set the inlet air conditions. + + + 2 + Cooling Fluid Specific Heat + parameter + Specific Heat + kJ/kg.K + real + 0.0 + +Inf + [ ; ] + 4.190 + SN + The specific heat of the liquid stream flowing through the fan coil cooling + coils. + + + 3 + Heating Fluid Specific Heat + parameter + Specific Heat + kJ/kg.K + real + 0.0 + +Inf + [ ; ] + 4.190 + SN + The specific heat of the liquid stream flowing through the fan coil heating + coils. + + + 4 + Rated Volumetric Air Flow Rate + parameter + Volumetric Flow Rate + l/s + real + 0. + +Inf + [ ; ] + 943.89 + SN + The volumetric flow rate of air through the device at its rated conditions. + + + 5 + Rated Fan Power + parameter + Power + kJ/hr + real + 0. + +Inf + [ ; ] + 564.0 + SN + The fan power draw at its rated conditions. + + + 6 + Logical Unit - Cooling Performance + parameter + Dimensionless + - + integer + 10 + +Inf + [ ; ] + 10 + SN + The logical unit which wil be assigned to the external data file containing + the total and sensible cooling load ratios as a function of the entering liquid + temperature, entering liquid flow rate, the entering air dry bulb temperature, the + entering air wet bulb temperature, and air flow rate. Logical units must be unique + integers in each TRNSYS simulation. + + + 7 + Number of Drybulb Temperatures - Cooling + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 7 + SN + The number of air drybulb temperatures for which cooling coil performance + data will be provided in the user-provided external data file. + + + 8 + Number of Wetbulb Temperatures - Cooling + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 7 + SN + The number of air wetbulb temperatures for which cooling coil performance + data will be provided in the user-provided external data file. + + + 9 + Number of Air Flows - Cooling + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 6 + SN + The number of normalized air flow rates for which cooling coil performance + data will be provided in the user-provided external data file. + + + 10 + Number of Liquid Temperatures - Cooling + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 8 + SN + The number of liquid (water typically) temperatures for which cooling coil + performance data will be provided in the user-provided external data file. + + + 11 + Number of Liquid Flow Rates - Cooling + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 2 + SN + The number of normalized liquid flow rates for which cooling coil + performance data will be provided in the user-provided external data file. + + + 12 + Logical Unit - Heating Performance + parameter + Dimensionless + - + integer + 10 + +Inf + [ ; ] + 11 + SN + The logical unit which wil be assigned to the external data file containing + the heating performance data as a function of the air inlet temperature and flow + rate and the liquid entering temperature and flow rate. Logical units must be unique + integers in each TRNSYS simulation. + + + 13 + Number of Air Temperatures - Heating + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 7 + SN + The number of air drybulb temperatures for which heating coil performance + data will be provided in the user-provided external data file. + + + 14 + Number of Air Flows - Heating + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 6 + SN + The number of normalized air flow rates for which heating coil performance + data will be provided in the user-provided external data file. + + + 15 + Number of Liquid Temperatures - Heating + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 11 + SN + The number of liquid (water typically) temperatures for which heating coil + performance data will be provided in the user-provided external data file. + + + 16 + Number of Liquid Flow Rates - Heating + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 2 + SN + The number of normalized liquid flow rates for which heating coil + performance data will be provided in the user-provided external data file. + + + 17 + Logical Unit - Fan Corrections + parameter + Dimensionless + - + integer + 10 + +Inf + [ ; ] + 12 + SN + The logical unit which wil be assigned to the external data file containing + the fraction of fan full-load power as a function of the normalized fan speed. + + + 18 + Cooling Fluid Inlet Temperature + input + Temperature + C + real + -Inf + +Inf + [ ; ] + 10.0 + SN + The temperature of the liquid stream fluid flowing into the fan coil unit's + cooling coils. + + + 19 + Cooling Fluid Flow Rate + input + Flow Rate + kg/hr + real + 0.0 + +Inf + [ ; ] + 0.0 + SN + The flow rate of the cooling liquid stream fluid flowing into the fan coil + unit's cooling coils. + + + 20 + Heating Fluid Inlet Temperature + input + Temperature + C + real + -Inf + +Inf + [ ; ] + 10.0 + SN + The temperature of the liquid stream fluid flowing into the fan coil unit's + heating coils. + + + 21 + Heating Fluid Flow Rate + input + Flow Rate + kg/hr + real + 0.0 + +Inf + [ ; ] + 0.0 + SN + The flow rate of the heating liquid stream fluid flowing into the fan coil + unit's heating coils. + + + 22 + Return Air Temperature + input + Temperature + C + real + -Inf + +Inf + [ ; ] + 20.0 + SN + The drybulb temperature of the return air entering the fan coil. This return + air gets mixed with a user-specified fraction of outside air. + + + 23 + Return Air Humidity Ratio + input + Dimensionless + - + real + 0. + +Inf + [ ; ] + 0.002 + SN + The absolute humidity ratio of the return air entering the fan coil. This + return air gets mixed with a user-specified fraction of outside air. + + + 24 + Return Air % Relative Humidity + input + Percentage + % (base 100) + real + 0 + 100 + [ ; ] + 50.0 + SN + The percent relative humidity of the return air entering the fan coil. This + return air gets mixed with a user-specified fraction of outside air. + + + 25 + Return Air Pressure + input + Pressure + atm + real + 0.0 + +Inf + [ ; ] + 1.0 + SN + The absolute pressure of the air streams entering the fan coil. + + + 26 + Air-Side Pressure Rise: Fan + input + Pressure + atm + real + 0.0 + +Inf + [ ; ] + 0.0 + SN + The pressure rise of the air stream as it flows across the fan. + + + 27 + Cooling Fluid Outlet Temperature + output + Temperature + C + real + -Inf + +Inf + [ ; ] + 0 + SN + The temperature of the liquid stream exiting the fan coil unit's cooling + coils. + + + 28 + Outlet Cooling Fluid Flow Rate + output + Flow Rate + kg/hr + real + 0.0 + +Inf + [ ; ] + 0 + SN + The flow rate of the liquid stream exiting the fan coil unit's cooling + coils. + + + 29 + Heating Fluid Outlet Temperature + output + Temperature + C + real + -Inf + +Inf + [ ; ] + 0 + SN + The temperature of the liquid stream exiting the fan coil unit's heating + coils. + + + 30 + Outlet Heating Fluid Flow Rate + output + Flow Rate + kg/hr + real + 0.0 + +Inf + [ ; ] + 0 + SN + The flow rate of the liquid stream exiting the fan coil unit's heating + coils. + + + 31 + Outlet Air Temperature + output + Temperature + C + real + -Inf + +Inf + [ ; ] + 0 + SN + The drybulb temperature of the air exiting the fan coil. + + + 32 + Outlet Air Humidity Ratio + output + Dimensionless + - + real + -Inf + +Inf + [ ; ] + 0 + SN + The absolute humidity ratio of the air exiting the fan coil. + + + 33 + Outlet Air % Relative Humidity + output + Percentage + % (base 100) + real + -Inf + +Inf + [ ; ] + 0 + SN + The percent relative humidity of the air exiting the fan coil. + + + 34 + Outlet Air Flow Rate + output + Flow Rate + kg/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The flow rate of dry air exiting the fan coil. + + + 35 + Outlet Air Pressure + output + Pressure + atm + real + -Inf + +Inf + [ ; ] + 0 + SN + The absolute pressure of the air exiting the fan coil. + + + 36 + Total Cooling Rate + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The rate at which energy is removed from the air stream (sensible plus + latent) across the cooling coil. + + + 37 + Sensible Cooling Rate + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The rate at which sensible energy is removed from the air stream across the + cooling coil. + + + 38 + Total Heating Rate + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The rate at which energy is added to the air stream across the heating coil. + + + 39 + Fan Power + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The rate at which the fan consumes energy. + + + 40 + Fan Heat to Air Stream + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The rate at which energy is added to the air stream by the fan. + + + 41 + Fan Heat to Ambient + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The rate at which energy is rejected to the ambient by the fan. + + + 42 + Condensate Temperature + output + Temperature + C + real + -Inf + +Inf + [ ; ] + 20.0 + SN + The temperature of the condensed water from the air stream leaving the fan + coil. + + + 43 + Condensate Flow Rate + output + Flow Rate + kg/hr + real + 0.0 + +Inf + [ ; ] + 0 + SN + The rate at which condensed water from the air stream exits the fan coil. + + + 44 + Number of Fan Speeds + parameter + Dimensionless + - + integer + 1 + +Inf + [ ; ] + 11 + SN + The number of normalized fan speeds for which fan performance data will be + provided in the user-provided external data file. + + + 45 + Efficiency of Fan Motor + parameter + Dimensionless + - + real + 0. + 1. + [ ; ] + 0.9 + SN + The efficiency of the fan motor. + + + 46 + Fraction of Fan Heat to Air + parameter + Dimensionless + - + real + 0. + 1. + [ ; ] + 1. + SN + The fraction of the fan power/heat that ends up in the air stream. Values + are typically zero for fans motors mounted outside of the air stream and 1 for fan + motors mounted within the air stream. + + + 47 + Air-Side Pressure Drop: Coils + input + Pressure + atm + real + 0.0 + +Inf + [ ; ] + 0.0 + SN + The pressure drop of the air stream as it passes across the coils. + + + 48 + Fresh Air Temperature + input + Temperature + C + real + -Inf + +Inf + [ ; ] + 20.0 + SN + The drybulb temperature of the ambient air entering the fan coil for mixing + with the return air. + + + 49 + Fresh Air Humidity Ratio + input + Dimensionless + - + real + 0. + +Inf + [ ; ] + 0.002 + SN + The absolute humidity ratio of the ambient air entering the fan coil for + mixing with the return air. + + + 50 + Fresh Air % Relative Humidity + input + Percentage + % (base 100) + real + 0 + 100 + [ ; ] + 50.0 + SN + The percent relative humidity of the ambient air entering the fan coil for + mixing with the return air. + + + 51 + Heating Control Signal + input + Dimensionless + - + real + 0. + 1. + [ ; ] + 0. + SN + The control signal for heating operation: 0 = Off and 1 = On. + + + 52 + Cooling Control Signal + input + Dimensionless + - + real + 0. + 1. + [ ; ] + 0. + SN + The control signal for cooling operation: 0 = Off and 1 = On. + + + 53 + Fan Control Signal + input + Dimensionless + - + real + 0. + 1. + [ ; ] + 0. + SN + The control signal for fan operation: 0 = Off, 1 = Full On, Values between 0 + and 1 set the fraction of rated fan speed. + + + 54 + Fraction of Outside Air + input + Dimensionless + - + real + 0. + 1. + [ ; ] + 0. + SN + The control signal for outside air mixing: 0 = No outside air and 100% + return air and 1 = 100% outside air and no return air. Values between 0 and 1 set + the fraction of outside air. + + + 55 + Conditioning Energy Rate + output + Power + kJ/hr + real + -Inf + +Inf + [ ; ] + 0 + SN + The rate at which energy is transferred to the air stream by the coils; + positive implies energy added to the air stream (heating). This term does not + include energy added by the fan or energy associated with the condensate draining + from the unit but is strictly a measure of the coil heat transfer. + + + + + + Which external file contains the cooling performance data? + .\Examples\Sample Catalog Files\FanCoil_Cooling.dat + + .\Tess Models\SampleCatalogData\4-Pipe Performance Map Fan + Coil\Normalized_FanCoil_Cooling.dat + + Logical Unit - Cooling Performance + no + + + Which external file contains the heating performance data? + .\Examples\Sample Catalog Files\FanCoil_Heating.dat + + .\Tess Models\SampleCatalogData\4-Pipe Performance Map Fan + Coil\Normalized_FanCoil_Heating.dat + + Logical Unit - Heating Performance + no + + + Which external file contains the fan performance data? + .\Examples\Sample Catalog Files\FC_FanLawPerformance.dat + + .\Tess Models\SampleCatalogData\4-Pipe Performance Map Fan + Coil\FanLawPerformance.dat + + Logical Unit - Fan Corrections + no + + + .\SourceCode\Types\Type137.f90 +
\ No newline at end of file diff --git a/tests/trnsysGUI/proforma/data/input/Type71-missing-closing-bracket.xmltmf b/tests/trnsysGUI/proforma/data/input/cases/Type71-missing-closing-bracket.xmltmf similarity index 100% rename from tests/trnsysGUI/proforma/data/input/Type71-missing-closing-bracket.xmltmf rename to tests/trnsysGUI/proforma/data/input/cases/Type71-missing-closing-bracket.xmltmf diff --git a/tests/trnsysGUI/proforma/data/input/Type71-no-hydraulic-connections.xmltmf b/tests/trnsysGUI/proforma/data/input/cases/Type71-no-hydraulic-connections.xmltmf similarity index 100% rename from tests/trnsysGUI/proforma/data/input/Type71-no-hydraulic-connections.xmltmf rename to tests/trnsysGUI/proforma/data/input/cases/Type71-no-hydraulic-connections.xmltmf diff --git a/tests/trnsysGUI/proforma/data/input/Type71.xmltmf b/tests/trnsysGUI/proforma/data/input/cases/Type71.xmltmf similarity index 100% rename from tests/trnsysGUI/proforma/data/input/Type71.xmltmf rename to tests/trnsysGUI/proforma/data/input/cases/Type71.xmltmf diff --git a/tests/trnsysGUI/proforma/testConvertXmlTmfToDdck.py b/tests/trnsysGUI/proforma/testConvertXmlTmfToDdck.py index c4d3d572..23c5b9eb 100644 --- a/tests/trnsysGUI/proforma/testConvertXmlTmfToDdck.py +++ b/tests/trnsysGUI/proforma/testConvertXmlTmfToDdck.py @@ -9,7 +9,10 @@ import pytrnsys.ddck.replaceTokens.defaultVisibility as _dv import pytrnsys.utils.result as _res + +import trnsysGUI.common.cancelled as _cancel import trnsysGUI.proforma.convertXmlTmfToDdck as _pc +import trnsysGUI.proforma.models as _models import trnsysGUI.proforma.dialogs.editHydraulicConnectionsDialog as _ehcd _DATA_DIR_PATH = _pl.Path(__file__).parent / "data" @@ -19,14 +22,14 @@ def testValidateXmlTmf() -> None: schema = _getSchema() - xmlFilePath = _INPUT_DIR_PATH / "Type71.xmltmf" + xmlFilePath = _INPUT_DIR_PATH / "cases" / "Type71.xmltmf" schema.validate(xmlFilePath) def testDecodeXmlTmf() -> None: schema = _getSchema() - xmlFilePath = _INPUT_DIR_PATH / "Type71.xmltmf" + xmlFilePath = _INPUT_DIR_PATH / "cases" / "Type71.xmltmf" deserializedData = schema.to_dict(xmlFilePath) _pp.pprint(deserializedData, indent=4) @@ -51,15 +54,15 @@ def fileStem(self) -> str: @staticmethod def createForStem(fileNameStem: str) -> "TestCase": - inputFilePath = (_INPUT_DIR_PATH / fileNameStem).with_suffix(".xmltmf") - actualOutputFilePath = (_DATA_DIR_PATH / "actual" / fileNameStem).with_suffix(".ddck") - expectedOutputFilePath = (_DATA_DIR_PATH / "expected" / fileNameStem).with_suffix(".ddck") + inputFilePath = (_INPUT_DIR_PATH / "cases" / fileNameStem).with_suffix(".xmltmf") + actualOutputFilePath = (_DATA_DIR_PATH / "actual" / "cases" / fileNameStem).with_suffix(".ddck") + expectedOutputFilePath = (_DATA_DIR_PATH / "expected" / "cases" / fileNameStem).with_suffix(".ddck") testCase = TestCase(inputFilePath, actualOutputFilePath, expectedOutputFilePath) return testCase def _getTestCases() -> _tp.Iterable[TestCase]: - inputDirPath = _INPUT_DIR_PATH + inputDirPath = _INPUT_DIR_PATH / "cases" for inputFilePath in inputDirPath.iterdir(): assert inputFilePath.is_file() @@ -94,3 +97,205 @@ def returnConnectionsUnmodifiedWithGlobalDefaultVisibility(connections, _): assert isinstance(result, _res.Error) print(result.message) assert not testCase.actualOutputFilePath.is_file() + + +def testConvertXmlTmfStringToDdckTwoConnections(monkeypatch) -> None: + xmlFilePath = _INPUT_DIR_PATH / "Type5b.xmltmf" + + xmlFileContent = xmlFilePath.read_text(encoding="utf8") + + def returnConnectionsUnmodifiedWithLocalDefaultVisibility(connections, _): + dialogResult = _ehcd.DialogResult(connections, _dv.DefaultVisibility.LOCAL) + return dialogResult + + monkeypatch.setattr( + _ehcd.EditHydraulicConnectionsDialog, + _ehcd.EditHydraulicConnectionsDialog.showDialogAndGetResults.__name__, + returnConnectionsUnmodifiedWithLocalDefaultVisibility, + ) + + outputFileName = xmlFilePath.with_suffix(".ddck").name + + suggestedHydraulicConnections = [ + _models.Connection( + name="Cold", + inputPort=_models.InputPort( + name="In", + temperature=_models.Variable( + tmfName="Load side inlet temperature", + definition=( + "The temperature of the fluid flowing into the load side of the " + 'counter flow heat exchanger. NOTE: "source" and "load" are merely ' + "convenient designations; energy will be transfered from the source side " + "to the load side if the source side is hotter than the load side. It " + "will be transfered from the load side to the source side if the load " + "side is hotter than the source side." + ), + order=9, + role="input", + roleOrder=3, + unit="C", + bounds="[-Inf,+Inf]", + defaultValue=20.0, + ), + massFlowRate=_models.Variable( + tmfName="Load side flow rate", + definition=( + "The flow rate of the fluid flowing through the load side of the " + 'counter flow heat exchanger. NOTE: "source" and "load" are merely ' + "convenient designations; energy will be transfered from the source side " + "to the load side if the source side is hotter than the load side. It " + "will be transfered from the load side to the source side if the load " + "side is hotter than the source side." + ), + order=10, + role="input", + roleOrder=4, + unit="kg/hr", + bounds="[0,+Inf]", + defaultValue=100.0, + ), + ), + outputPort=_models.OutputPort( + name="Out", + temperature=_models.Variable( + tmfName="Load side outlet temperature", + definition=( + "The temperature of the fluid leaving the load side of the counter " + 'flow heat exchanger. NOTE: "source" and "load" are merely convenient ' + "designations; energy will be transfered from the source side to the load " + "side if the source side is hotter than the load side. It will be " + "transfered from the load side to the source side if the load side is " + "hotter than the source side." + ), + order=3, + role="output", + roleOrder=3, + unit="C", + bounds="[-Inf,+Inf]", + defaultValue=0.0, + ), + reverseTemperature=None, + ), + fluid=_models.Fluid( + density=None, + heatCapacity=_models.Variable( + tmfName="Specific heat of load side fluid", + definition=( + "The specific heat of the fluid flowing through the load side of the " + 'counter flow heat exchanger. NOTE: "source" and "load" are merely ' + "convenient designations; energy will be transfered from the source side " + "to the load side if the source side is hotter than the load side. It " + "will be transfered from the load side to the source side if the load " + "side is hotter than the source side." + ), + order=14, + role="parameter", + roleOrder=3, + unit="kJ/kg.K", + bounds="[0,+Inf]", + defaultValue=4.19, + ), + ), + ), + _models.Connection( + name="Hot", + inputPort=_models.InputPort( + name="In", + temperature=_models.Variable( + tmfName="Source side inlet temperature", + definition=( + "The temperature of the fluid flowing into the source side of the " + 'counter flow heat exchanger. NOTE: "source" and "load" are merely ' + "convenient designations; energy will be transfered from the source side " + "to the load side if the source side is hotter than the load side. It " + "will be transfered from the load side to the source side if the load " + "side is hotter than the source side." + ), + order=7, + role="input", + roleOrder=1, + unit="C", + bounds="[-Inf,+Inf]", + defaultValue=20.0, + ), + massFlowRate=_models.Variable( + tmfName="Source side flow rate", + definition=( + "The flow rate of the fluid flowing through the source side of the " + 'counter flow heat exchanger. NOTE: "source" and "load" are merely ' + "convenient designations; energy will be transfered from the source side " + "to the load side if the source side is hotter than the load side. It " + "will be transfered from the load side to the source side if the load " + "side is hotter than the source side." + ), + order=8, + role="input", + roleOrder=2, + unit="kg/hr", + bounds="[0,+Inf]", + defaultValue=100.0, + ), + ), + outputPort=_models.OutputPort( + name="Out", + temperature=_models.Variable( + tmfName="Source side outlet temperature", + definition=( + "The temperature of the fluid leaving the source side of the counter " + 'flow heat exchanger. NOTE: "source" and "load" are merely convenient ' + "designations; energy will be transfered from the source side to the load " + "side if the source side is hotter than the load side. It will be " + "transfered from the load side to the source side if the load side is " + "hotter than the source side." + ), + order=1, + role="output", + roleOrder=1, + unit="C", + bounds="[-Inf,+Inf]", + defaultValue=0.0, + ), + reverseTemperature=None, + ), + fluid=_models.Fluid( + density=None, + heatCapacity=_models.Variable( + tmfName="Specific heat of source side fluid", + definition=( + "The specific heat of the fluid flowing through the source side of " + 'the counter flow heat exchanger. NOTE: "source" and "load" are merely ' + "convenient designations; energy will be transfered from the source side " + "to the load side if the source side is hotter than the load side. It " + "will be transfered from the load side to the source side if the load " + "side is hotter than the source side." + ), + order=13, + role="parameter", + roleOrder=2, + unit="kJ/kg.K", + bounds="[0,+Inf]", + defaultValue=4.19, + ), + ), + ), + ] + + maybeCancelled = _pc.convertXmlTmfStringToDdck( + xmlFileContent, suggestedHydraulicConnections, fileName=outputFileName + ) + + assert not _cancel.isCancelled(maybeCancelled) + result = maybeCancelled + + assert not _res.isError(result) + actualContent = _res.value(result) + + assert isinstance(actualContent, str) + + actualFilePath = _DATA_DIR_PATH / "actual" / outputFileName + actualFilePath.write_text(actualContent) + + expectedFilePath = _DATA_DIR_PATH / "expected" / outputFileName + + assert actualContent == expectedFilePath.read_text("UTF8") diff --git a/trnsysGUI/buildDck.py b/trnsysGUI/buildDck.py index 27b7a990..efbded47 100644 --- a/trnsysGUI/buildDck.py +++ b/trnsysGUI/buildDck.py @@ -3,12 +3,12 @@ import logging import os -import typing as _tp import pytrnsys.rsim.getConfigMixin as _rcm import pytrnsys.trnsys_util.buildTrnsysDeck as _btd import pytrnsys.trnsys_util.readConfigTrnsys as _rc import pytrnsys.utils.result as _res +import pytrnsys.utils.warnings as _warn logger = logging.getLogger("root") @@ -51,7 +51,7 @@ def _defaultInputs(self): self.variablesOutput = [] - def buildTrnsysDeck(self) -> _res.Result[_tp.Optional[str]]: + def buildTrnsysDeck(self) -> _res.Result[_warn.ValueWithWarnings[str | None]]: """ It builds a TRNSYS Deck from a listDdck with pathDdck using the BuildingTrnsysDeck Class. it reads the Deck list and writes a deck file. Afterwards it checks that the deck looks fine @@ -73,7 +73,7 @@ def buildTrnsysDeck(self) -> _res.Result[_tp.Optional[str]]: deck = _btd.BuildTrnsysDeck( self.path, self.nameBase, - self._ddckFilePathWithComponentNames, + self._includedDdckFiles, self._defaultVisibility, self._ddckPlaceHolderValuesJsonPath, ) @@ -86,11 +86,13 @@ def buildTrnsysDeck(self) -> _res.Result[_tp.Optional[str]]: if _res.isError(result): return _res.error(result) + warnings = _res.value(result) deck.overwriteForcedByUser = self.overwriteForcedByUser deck.writeDeck(addedLines=deckExplanation) if deck.abortedByUser: - return + return warnings.withValue(None) + self.overwriteForcedByUser = deck.overwriteForcedByUser result = deck.checkTrnsysDeck(deck.nameDeck, check=self.inputs["checkDeck"]) @@ -106,7 +108,7 @@ def buildTrnsysDeck(self) -> _res.Result[_tp.Optional[str]]: deck.analyseDck() - return deck.nameDeck + return warnings.withValue(deck.nameDeck) def _readConfig(self, path, name, parseFileCreated=False) -> _res.Result[None]: """ diff --git a/trnsysGUI/changelogs.txt b/trnsysGUI/changelogs.txt deleted file mode 100644 index e9a3ae51..00000000 --- a/trnsysGUI/changelogs.txt +++ /dev/null @@ -1,1329 +0,0 @@ -============================================================== -12/03/2020 12:13:27 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\ASHP+Tes.dck - -Differences: -1:Version 17 - -Reason for change: - -============================================================== -============================================================== -13/03/2020 12:41:18 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+Tes.dck - -Differences: -2:CONSTANTS 2 -14:TOLERANCES FrInte_Tol FrConv_Tol - -Reason for change: -testing -============================================================== -============================================================== -13/03/2020 12:41:56 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+Tes.dck - -Differences: -3:dtSim = 1. -18:LIST ! NOLIST statement - -Reason for change: -test -============================================================== -============================================================== -13/03/2020 12:46:23 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+Tes.dck - -Differences: -8:PI = 3.1415927 -26: rhoWat=1000 - -Reason for change: -test -============================================================== -============================================================== -16/03/2020 10:51:09 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\ASHP+Tes.dck - -Differences: -30:EQUATIONS 10 -32:TsupplyWater = TCW -33:TRadFloor=1 -34:THp=1 -35:THxDhw=1 -36:TPortLeft98=1 -37:TPortLeft44=1 -38:TPortRight30=1 -39:TPortLeft67=1 -40:TPortLeft0=1 -41:TPortRight5=1 -42: -43:EQUATIONS 3 -44:*** Pump outlet temperatures -45:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:15 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\Combi+1Tes.dck - -Differences: -30:EQUATIONS 7 -33:TsupplyWater = TCW -34:TRadFloor=1 -35:THxDhw=1 -36:THxSolar=1 -37:TPortRight30=1 -38:TPortRight5=1 -39: -40:EQUATIONS 3 -41:*** Pump outlet temperatures -42:TPuCol = TPiTesToCol -43:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:20 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\Combi+2Tes.dck - -Differences: -30:EQUATIONS 12 -33:TsupplyWater = TCW -34:TRadFloor=1 -35:TBoiler=1 -36:TShPortLeft100=1 -37:TShPortRight100=1 -38:TShPortLeft0=1 -39:TShPortRight0=1 -40:T642=1 -41:T689=1 -42:TDhwPortLeft90=1 -43:TDhwPortLeft70=1 -44: -45:EQUATIONS 4 -46:*** Pump outlet temperatures -47:TPuCol = TPiTesToCol -48:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:26 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\DHWSolar+Tes.dck - -Differences: -30:EQUATIONS 5 -33:TsupplyWater = TCW -34:THxSolar=1 -35:TDhwPortRight100=1 -36:TDhwPortRight0=1 -37: -38:EQUATIONS 2 -39:*** Pump outlet temperatures -40:TPuCol = TPiTesToCol -41:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:31 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\GSHP+Tes.dck - -Differences: -30:EQUATIONS 12 -32:TsupplyWater = TCW -33:TRadFloor=1 -34:THxDhw=1 -35:TPortLeft98=1 -36:TPortLeft44=1 -37:TPortRight30=1 -38:TPortLeft67=1 -39:TPortLeft0=1 -40:TPortRight5=1 -41:THpX0=1 -42:THpX1=1 -43:TGhx=1 -44: -45:EQUATIONS 4 -46:*** Pump outlet temperatures -47:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:36 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+2Tes.dck - -Differences: -30:EQUATIONS 12 -33:TsupplyWater = TCW -34:TRadFloor=1 -35:TShPortLeft100=1 -36:TShPortRight100=1 -37:TShPortLeft0=1 -38:TShPortRight0=1 -39:T642=1 -40:T689=1 -41:TDhwPortLeft90=1 -42:TDhwPortLeft70=1 -43:THp=1 -44: -45:EQUATIONS 4 -46:*** Pump outlet temperatures -47:TPuCol = TPiTesToCol -48:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:40 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+Tes.dck - -Differences: -30:EQUATIONS 12 -33:TsupplyWater = TCW -34:TRadFloor=1 -35:THp=1 -36:THxDhw=1 -37:THxSolar=1 -38:TPortLeft98=1 -39:TPortLeft44=1 -40:TPortRight30=1 -41:TPortLeft67=1 -42:TPortLeft0=1 -43:TPortRight5=1 -44: -45:EQUATIONS 4 -46:*** Pump outlet temperatures -47:TPuCol = TPiTesToCol -48:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:45 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\SGSHP+2Tes.dck - -Differences: -30:EQUATIONS 14 -33:TsupplyWater = TCW -34:TRadFloor=1 -35:TShPortLeft100=1 -36:TShPortRight100=1 -37:TShPortLeft0=1 -38:TShPortRight0=1 -39:THxSolar=1 -40:THxDhw=1 -41:TDhwPortLeft90=1 -42:TDhwPortLeft70=1 -43:THPX0=1 -44:THPX1=1 -45:TGhx=1 -46: -47:EQUATIONS 5 -48:*** Pump outlet temperatures -49:TPuCol = TPiTesToCol -50:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -16/03/2020 10:51:50 - -Name of file: -U:\Desktop\TrnsysGUI\trnsysGUI\Reference\SGSHP+Tes.dck - -Differences: -30:EQUATIONS 14 -33:TsupplyWater = TCW -34:TRadFloor=1 -35:THxDhw=1 -36:THxSolar=1 -37:TPortLeft98=1 -38:TPortLeft44=1 -39:TPortRight30=1 -40:TPortLeft67=1 -41:TPortLeft0=1 -42:TPortRight5=1 -43:THpX0=1 -44:THpX1=1 -45:TGhx=1 -46: -47:EQUATIONS 5 -48:*** Pump outlet temperatures -49:TPuCol = TPiTesToCol -50:TWTapTop = TPiDhwDemand - -Reason for change: -After cold water temperature export problem fixed -============================================================== -============================================================== -24/03/2020 23:32:35 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\ASHP+Tes.dck - -Differences: -32:TWTapBottom = 1 - -Reason for change: -Supplywater -============================================================== -============================================================== -24/03/2020 23:32:42 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\Combi+1Tes.dck - -Differences: -33:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -24/03/2020 23:32:46 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\Combi+2Tes.dck - -Differences: -33:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -24/03/2020 23:32:49 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\DHWSolar+Tes.dck - -Differences: -33:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -24/03/2020 23:32:53 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\GSHP+Tes.dck - -Differences: -32:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -24/03/2020 23:32:56 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+2Tes.dck - -Differences: -33:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -24/03/2020 23:32:59 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+Tes.dck - -Differences: -33:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -24/03/2020 23:33:02 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\SGSHP+2Tes.dck - -Differences: -33:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -24/03/2020 23:33:05 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\SGSHP+Tes.dck - -Differences: -33:TWTapBottom = 1 - -Reason for change: - -============================================================== -============================================================== -03/04/2020 15:17:07 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\BigIceTwoStorages.dck - -Differences: -46:TDhwPortLeft35=1 -198:83 84 0 0 !82 : ConnDhwL3772 -201:86 87 91 2 !85 : TPieceTesDhwR3781 -204:89 90 91 2 !88 : TPieceTesDhwR3791 -207:88 85 0 0 !91 : PiTesRDhw_853 -211:96 97 0 0 !95 : ConnSHL3813 -214:99 100 0 0 !98 : ConnSHR3822 -428:MfrConnDhwL3772_A=[450,244] -429:MfrConnDhwL3772_B=[450,245] -442:MfrPiTesRDhw_853_A=[450,271] -443:MfrPiTesRDhw_853_B=[450,272] -450:MfrConnSHL3813_A=[450,283] -451:MfrConnSHL3813_B=[450,284] -456:MfrConnSHR3822_A=[450,292] -457:MfrConnSHR3822_B=[450,293] -1723:TDhwPortLeft35 - -Reason for change: -changed port heights in big ice template -============================================================== -============================================================== -08/04/2020 13:47:00 - -Name of file: -C:\Users\User\Desktop\TrnsysGUI\trnsysGUI\Reference\SASHP+Tes.dck - -Differences: -49:TPuAux = TPiDivHpToHp -52:EQUATIONS 6 -55:MfrWTapBottom = 1000 -58:xFracDivHp = 0.0 -59:xFracDivHpRt = 0.0 -60: -61:CONSTANTS 2 -62:T_set_MixDhw=50 -63:T_set_MixSh=50 -64: -65:UNIT 441 TYPE 811 ! Passive Divider for heating -66:PARAMETERS 1 -67:5 !Nb.of iterations before fixing the value -68:INPUTS 4 -69:TPiTesDhwOut -70:TPiDhwMix -71:MfrPiDhwDemand -72:T_set_MixDhw -73:*** INITIAL INPUT VALUES -74:35.0 21.0 800.0 T_set_MixDhw -75:EQUATIONS 1 -76:xFracMixDhw = 1.-[441,5] -77: -78:UNIT 442 TYPE 811 ! Passive Divider for heating -79:PARAMETERS 1 -80:5 !Nb.of iterations before fixing the value -81:INPUTS 4 -82:TPiShTesOut -83:TPiShMix -84:MfrPiRadFloorIn -85:T_set_MixSh -86:*** INITIAL INPUT VALUES -87:35.0 21.0 800.0 T_set_MixSh -88:EQUATIONS 1 -89:xFracMixSh = 1.-[442,5] -90: -91: -92:UNIT 450 TYPE 935 -93:PARAMETERS 165 -94:41 -95:30 10 0 0 !1 : Collector -96:31 10 0 1 !2 : PuCol -97:16 27 8 3 !3 : MixDhw -98:16 0 0 5 !4 : WTapTop -99:9 0 0 4 !5 : WTapBottom -100:28 9 8 2 !6 : TPiece -101:23 25 0 1 !7 : PuAux -102:6 3 0 0 !8 : PiDhwMix -103:5 6 0 0 !9 : PiDhwMains -104:2 1 0 0 !10 : PiColIn -105:13 18 0 0 !11 : RadFloor -106:13 40 15 3 !12 : MixSh -107:12 11 0 0 !13 : PiRadFloorIn -108:41 19 15 2 !14 : TeeSh -109:14 12 0 0 !15 : PiShMix -110:3 4 0 0 !16 : PiDhwDemand -111:18 19 0 1 !17 : PuSh -112:11 17 0 0 !18 : PiRadFloorOut -113:17 14 0 0 !19 : PiShPuToMix -114:25 24 0 0 !20 : Hp -115:24 33 36 3 !21 : DivHp -116:23 37 34 3 !22 : DivHpRt -117:7 22 0 0 !23 : PiDivHpToHp -118:20 21 0 0 !24 : PiHpCondOut -119:20 7 0 0 !25 : PiHpCondIn -120:27 28 0 0 !26 : HxDhw -121:3 26 0 0 !27 : PiTesDhwOut -122:6 26 0 0 !28 : PiTesDhwIn -123:30 31 0 0 !29 : HxSolar -124:29 1 0 0 !30 : PiColOut -125:2 29 0 0 !31 : PiTesToCol -126:33 34 38 2 !32 : TPieceTesL1703 -127:21 32 0 0 !33 : PiHpToTesDhwIn -128:32 22 0 0 !34 : PiHpToTesDhwOut -129:36 37 38 2 !35 : TPieceTesL1713 -130:21 35 0 0 !36 : PiHpToTesShIn -131:35 22 0 0 !37 : PiHpToTesShOut -132:35 32 0 0 !38 : PiTesL_479 -133:40 41 0 0 !39 : ConnR1726 -134:12 39 0 0 !40 : PiShTesOut -135:14 39 0 0 !41 : PiShTesIn -136:INPUTS 41! for Type 935 -137:0,0 MfrPuCol xFracMixDhw 0,0 MfrWTapBottom 0,0 MfrPuAux 0,0 0,0 -138:0,0 0,0 xFracMixSh 0,0 0,0 0,0 0,0 MfrPuSh 0,0 -139:0,0 0,0 xFracDivHp xFracDivHpRt 0,0 0,0 0,0 0,0 0,0 -140:0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 -141:0,0 0,0 0,0 0,0 0,0 -142: -143:*** Initial Inputs * -144:-1 0.0 0.0 -1 0.0 -1 0.0 -1 -1 -145:-1 -1 0.0 -1 -1 -1 -1 0.0 -1 -146:-1 -1 0.0 0.0 -1 -1 -1 -1 -1 -147:-1 -1 -1 -1 -1 -1 -1 -1 -1 -148:-1 -1 -1 -1 -1 -149: -150:EQUATIONS 84 ! Output up to three (A,B,C) mass flow rates of each component, positive = input/inlet, negative = output/outlet -151:MfrCollector_A=[450,1] -152:MfrCollector_B=[450,2] -155:MfrMixDhw_A=[450,7] -156:MfrMixDhw_B=[450,8] -157:MfrMixDhw_C=[450,9] -158:MfrWTapTop_A=[450,10] -159:MfrWTapTop_B=[450,11] -160:MfrWTapBottom_A=[450,13] -161:MfrWTapBottom_B=[450,14] -162:MfrTPiece_A=[450,16] -163:MfrTPiece_B=[450,17] -164:MfrTPiece_C=[450,18] -167:MfrPiDhwMix_A=[450,22] -168:MfrPiDhwMix_B=[450,23] -169:MfrPiDhwMains_A=[450,25] -170:MfrPiDhwMains_B=[450,26] -171:MfrPiColIn_A=[450,28] -172:MfrPiColIn_B=[450,29] -173:MfrRadFloor_A=[450,31] -174:MfrRadFloor_B=[450,32] -175:MfrMixSh_A=[450,34] -176:MfrMixSh_B=[450,35] -177:MfrMixSh_C=[450,36] -178:MfrPiRadFloorIn_A=[450,37] -179:MfrPiRadFloorIn_B=[450,38] -180:MfrTeeSh_A=[450,40] -181:MfrTeeSh_B=[450,41] -182:MfrTeeSh_C=[450,42] -183:MfrPiShMix_A=[450,43] -184:MfrPiShMix_B=[450,44] -185:MfrPiDhwDemand_A=[450,46] -186:MfrPiDhwDemand_B=[450,47] -189:MfrPiRadFloorOut_A=[450,52] -190:MfrPiRadFloorOut_B=[450,53] -191:MfrPiShPuToMix_A=[450,55] -192:MfrPiShPuToMix_B=[450,56] -193:MfrHp_A=[450,58] -194:MfrHp_B=[450,59] -195:MfrDivHp_A=[450,61] -196:MfrDivHp_B=[450,62] -197:MfrDivHp_C=[450,63] -198:MfrDivHpRt_A=[450,64] -199:MfrDivHpRt_B=[450,65] -200:MfrDivHpRt_C=[450,66] -201:MfrPiDivHpToHp_A=[450,67] -202:MfrPiDivHpToHp_B=[450,68] -203:MfrPiHpCondOut_A=[450,70] -204:MfrPiHpCondOut_B=[450,71] -205:MfrPiHpCondIn_A=[450,73] -206:MfrPiHpCondIn_B=[450,74] -207:MfrHxDhw_A=[450,76] -208:MfrHxDhw_B=[450,77] -209:MfrPiTesDhwOut_A=[450,79] -210:MfrPiTesDhwOut_B=[450,80] -211:MfrPiTesDhwIn_A=[450,82] -212:MfrPiTesDhwIn_B=[450,83] -213:MfrHxSolar_A=[450,85] -214:MfrHxSolar_B=[450,86] -215:MfrPiColOut_A=[450,88] -216:MfrPiColOut_B=[450,89] -217:MfrPiTesToCol_A=[450,91] -218:MfrPiTesToCol_B=[450,92] -219:MfrPiHpToTesDhwIn_A=[450,97] -220:MfrPiHpToTesDhwIn_B=[450,98] -221:MfrPiHpToTesDhwOut_A=[450,100] -222:MfrPiHpToTesDhwOut_B=[450,101] -223:MfrPiHpToTesShIn_A=[450,106] -224:MfrPiHpToTesShIn_B=[450,107] -225:MfrPiHpToTesShOut_A=[450,109] -226:MfrPiHpToTesShOut_B=[450,110] -227:MfrPiTesL_479_A=[450,112] -228:MfrPiTesL_479_B=[450,113] -229:MfrConnR1726_A=[450,115] -230:MfrConnR1726_B=[450,116] -231:MfrPiShTesOut_A=[450,118] -232:MfrPiShTesOut_B=[450,119] -233:MfrPiShTesIn_A=[450,121] -234:MfrPiShTesIn_B=[450,122] -235: -236: -237:UNIT 451 TYPE 929 -238:!MixDhw -239:PARAMETERS 0 -240:INPUTS 6 -241:MfrMixDhw_A -242:MfrMixDhw_B -243:MfrMixDhw_C -244:TPiDhwDemand -245:TPiTesDhwOut -246:TPiDhwMix -247:***Initial values -248:0 0 0 20 20 20 -249:EQUATIONS 1 -250:TMixDhw= [451,1] -251: -252:UNIT 452 TYPE 929 -253:!TPiece -254:PARAMETERS 0 -255:INPUTS 6 -256:MfrTPiece_A -257:MfrTPiece_B -258:MfrTPiece_C -259:TPiTesDhwIn -260:TPiDhwMains -261:TPiDhwMix -262:***Initial values -263:0 0 0 20 20 20 -264:EQUATIONS 1 -265:TTPiece= [452,1] -266: -267:UNIT 453 TYPE 931 -268:!PiDhwMix -269:PARAMETERS 6 -270:diPiDhwMix -271:LPiDhwMix -272:UPiDhwMix -273:RhoWat -274:CPWat -275:20 -276:INPUTS 4 -277:TTPiece -278:MfrPiDhwMix_A -279:TRoomStore -280:TMixDhw -281:***Initial values -282:20 0.0 20 20 -283: -284:EQUATIONS 3 -285:TPiDhwMix= [453,1] -286:PPiDhwMix_kW= [453,3]/3600 !kW -287:MfrPiDhwMix= MfrPiDhwMix_A -288: -289:UNIT 454 TYPE 931 -290:!PiDhwMains -291:PARAMETERS 6 -292:diPiDhwMains -293:LPiDhwMains -294:UPiDhwMains -295:RhoWat -296:CPWat -297:20 -298:INPUTS 4 -299:TWTapBottom -300:MfrPiDhwMains_A -301:TRoomStore -302:TTPiece -303:***Initial values -304:20 0.0 20 20 -305: -306:EQUATIONS 3 -307:TPiDhwMains= [454,1] -308:PPiDhwMains_kW= [454,3]/3600 !kW -309:MfrPiDhwMains= MfrPiDhwMains_A -310: -311:UNIT 455 TYPE 931 -312:!PiColIn -313:PARAMETERS 6 -314:diPiColIn -315:LPiColIn -316:UPiColIn -317:RhoWat -318:CPWat -319:20 -320:INPUTS 4 -321:TPuCol -322:MfrPiColIn_A -323:TRoomStore -324:TCollector -325:***Initial values -326:20 0.0 20 20 -327: -328:EQUATIONS 3 -329:TPiColIn= [455,1] -330:PPiColIn_kW= [455,3]/3600 !kW -331:MfrPiColIn= MfrPiColIn_A -332: -333:UNIT 456 TYPE 929 -334:!MixSh -335:PARAMETERS 0 -336:INPUTS 6 -337:MfrMixSh_A -338:MfrMixSh_B -339:MfrMixSh_C -340:TPiRadFloorIn -341:TPiShTesOut -342:TPiShMix -343:***Initial values -344:0 0 0 20 20 20 -345:EQUATIONS 1 -346:TMixSh= [456,1] -347: -348:UNIT 457 TYPE 931 -349:!PiRadFloorIn -350:PARAMETERS 6 -351:diPiRadFloorIn -352:LPiRadFloorIn -353:UPiRadFloorIn -354:RhoWat -355:CPWat -356:20 -357:INPUTS 4 -358:TMixSh -359:MfrPiRadFloorIn_A -360:TRoomStore -361:TRadFloor -362:***Initial values -363:20 0.0 20 20 -364: -365:EQUATIONS 3 -366:TPiRadFloorIn= [457,1] -367:PPiRadFloorIn_kW= [457,3]/3600 !kW -368:MfrPiRadFloorIn= MfrPiRadFloorIn_A -369: -370:UNIT 458 TYPE 929 -371:!TeeSh -372:PARAMETERS 0 -373:INPUTS 6 -374:MfrTeeSh_A -375:MfrTeeSh_B -376:MfrTeeSh_C -377:TPiShTesIn -378:TPiShPuToMix -379:TPiShMix -380:***Initial values -381:0 0 0 20 20 20 -382:EQUATIONS 1 -383:TTeeSh= [458,1] -384: -385:UNIT 459 TYPE 931 -386:!PiShMix -387:PARAMETERS 6 -388:diPiShMix -389:LPiShMix -390:UPiShMix -391:RhoWat -392:CPWat -393:20 -394:INPUTS 4 -395:TTeeSh -396:MfrPiShMix_A -397:TRoomStore -398:TMixSh -399:***Initial values -400:20 0.0 20 20 -401: -402:EQUATIONS 3 -403:TPiShMix= [459,1] -404:PPiShMix_kW= [459,3]/3600 !kW -405:MfrPiShMix= MfrPiShMix_A -406: -407:UNIT 460 TYPE 931 -408:!PiDhwDemand -409:PARAMETERS 6 -410:diPiDhwDemand -411:LPiDhwDemand -412:UPiDhwDemand -413:RhoWat -414:CPWat -415:20 -416:INPUTS 4 -417:TMixDhw -418:MfrPiDhwDemand_A -419:TRoomStore -420:TWTapTop -421:***Initial values -422:20 0.0 20 20 -423: -424:EQUATIONS 3 -425:TPiDhwDemand= [460,1] -426:PPiDhwDemand_kW= [460,3]/3600 !kW -427:MfrPiDhwDemand= MfrPiDhwDemand_A -428: -429:UNIT 461 TYPE 931 -430:!PiRadFloorOut -431:PARAMETERS 6 -432:diPiRadFloorOut -433:LPiRadFloorOut -434:UPiRadFloorOut -435:RhoWat -436:CPWat -437:20 -438:INPUTS 4 -439:TRadFloor -440:MfrPiRadFloorOut_A -441:TRoomStore -442:TPuSh -443:***Initial values -444:20 0.0 20 20 -445: -446:EQUATIONS 3 -447:TPiRadFloorOut= [461,1] -448:PPiRadFloorOut_kW= [461,3]/3600 !kW -449:MfrPiRadFloorOut= MfrPiRadFloorOut_A -450: -451:UNIT 462 TYPE 931 -452:!PiShPuToMix -453:PARAMETERS 6 -454:diPiShPuToMix -455:LPiShPuToMix -456:UPiShPuToMix -457:RhoWat -458:CPWat -459:20 -460:INPUTS 4 -461:TPuSh -462:MfrPiShPuToMix_A -463:TRoomStore -464:TTeeSh -465:***Initial values -466:20 0.0 20 20 -467: -468:EQUATIONS 3 -469:TPiShPuToMix= [462,1] -470:PPiShPuToMix_kW= [462,3]/3600 !kW -471:MfrPiShPuToMix= MfrPiShPuToMix_A -472: -473:UNIT 463 TYPE 929 -474:!DivHp -475:PARAMETERS 0 -476:INPUTS 6 -477:MfrDivHp_A -478:MfrDivHp_B -479:MfrDivHp_C -480:TPiHpCondOut -481:TPiHpToTesDhwIn -482:TPiHpToTesShIn -483:***Initial values -484:0 0 0 20 20 20 -485:EQUATIONS 1 -486:TDivHp= [463,1] -487: -488:UNIT 464 TYPE 929 -489:!DivHpRt -490:PARAMETERS 0 -491:INPUTS 6 -492:MfrDivHpRt_A -493:MfrDivHpRt_B -494:MfrDivHpRt_C -495:TPiDivHpToHp -496:TPiHpToTesShOut -497:TPiHpToTesDhwOut -498:***Initial values -499:0 0 0 20 20 20 -500:EQUATIONS 1 -501:TDivHpRt= [464,1] -502: -503:UNIT 465 TYPE 931 -504:!PiDivHpToHp -505:PARAMETERS 6 -506:diPiDivHpToHp -507:LPiDivHpToHp -508:UPiDivHpToHp -509:RhoWat -510:CPWat -511:20 -512:INPUTS 4 -513:TPuAux -514:MfrPiDivHpToHp_A -515:TRoomStore -516:TDivHpRt -517:***Initial values -518:20 0.0 20 20 -519: -520:EQUATIONS 3 -521:TPiDivHpToHp= [465,1] -522:PPiDivHpToHp_kW= [465,3]/3600 !kW -523:MfrPiDivHpToHp= MfrPiDivHpToHp_A -524: -525:UNIT 466 TYPE 931 -526:!PiHpCondOut -527:PARAMETERS 6 -528:diPiHpCondOut -529:LPiHpCondOut -530:UPiHpCondOut -531:RhoWat -532:CPWat -533:20 -534:INPUTS 4 -535:THp -536:MfrPiHpCondOut_A -537:TRoomStore -538:TDivHp -539:***Initial values -540:20 0.0 20 20 -541: -542:EQUATIONS 3 -543:TPiHpCondOut= [466,1] -544:PPiHpCondOut_kW= [466,3]/3600 !kW -545:MfrPiHpCondOut= MfrPiHpCondOut_A -546: -547:UNIT 467 TYPE 931 -548:!PiHpCondIn -549:PARAMETERS 6 -550:diPiHpCondIn -551:LPiHpCondIn -552:UPiHpCondIn -553:RhoWat -554:CPWat -555:20 -556:INPUTS 4 -557:THp -558:MfrPiHpCondIn_A -559:TRoomStore -560:TPuAux -561:***Initial values -562:20 0.0 20 20 -563: -564:EQUATIONS 3 -565:TPiHpCondIn= [467,1] -566:PPiHpCondIn_kW= [467,3]/3600 !kW -567:MfrPiHpCondIn= MfrPiHpCondIn_A -568: -569:UNIT 468 TYPE 931 -570:!PiTesDhwOut -571:PARAMETERS 6 -572:diPiTesDhwOut -573:LPiTesDhwOut -574:UPiTesDhwOut -575:RhoWat -576:CPWat -577:20 -578:INPUTS 4 -579:TMixDhw -580:MfrPiTesDhwOut_A -581:TRoomStore -582:THxDhw -583:***Initial values -584:20 0.0 20 20 -585: -586:EQUATIONS 3 -587:TPiTesDhwOut= [468,1] -588:PPiTesDhwOut_kW= [468,3]/3600 !kW -589:MfrPiTesDhwOut= MfrPiTesDhwOut_A -590: -591:UNIT 469 TYPE 931 -592:!PiTesDhwIn -593:PARAMETERS 6 -594:diPiTesDhwIn -595:LPiTesDhwIn -596:UPiTesDhwIn -597:RhoWat -598:CPWat -599:20 -600:INPUTS 4 -601:TTPiece -602:MfrPiTesDhwIn_A -603:TRoomStore -604:THxDhw -605:***Initial values -606:20 0.0 20 20 -607: -608:EQUATIONS 3 -609:TPiTesDhwIn= [469,1] -610:PPiTesDhwIn_kW= [469,3]/3600 !kW -611:MfrPiTesDhwIn= MfrPiTesDhwIn_A -612: -613:UNIT 470 TYPE 931 -614:!PiColOut -615:PARAMETERS 6 -616:diPiColOut -617:LPiColOut -618:UPiColOut -619:RhoWat -620:CPWat -621:20 -622:INPUTS 4 -623:THxSolar -624:MfrPiColOut_A -625:TRoomStore -626:TCollector -627:***Initial values -628:20 0.0 20 20 -629: -630:EQUATIONS 3 -631:TPiColOut= [470,1] -632:PPiColOut_kW= [470,3]/3600 !kW -633:MfrPiColOut= MfrPiColOut_A -634: -635:UNIT 471 TYPE 931 -636:!PiTesToCol -637:PARAMETERS 6 -638:diPiTesToCol -639:LPiTesToCol -640:UPiTesToCol -641:RhoWat -642:CPWat -643:20 -644:INPUTS 4 -645:TPuCol -646:MfrPiTesToCol_A -647:TRoomStore -648:THxSolar -649:***Initial values -650:20 0.0 20 20 -651: -652:EQUATIONS 3 -653:TPiTesToCol= [471,1] -654:PPiTesToCol_kW= [471,3]/3600 !kW -655:MfrPiTesToCol= MfrPiTesToCol_A -656: -657:UNIT 472 TYPE 931 -658:!PiHpToTesDhwIn -659:PARAMETERS 6 -660:diPiHpToTesDhwIn -661:LPiHpToTesDhwIn -662:UPiHpToTesDhwIn -663:RhoWat -664:CPWat -665:20 -666:INPUTS 4 -667:TDivHp -668:MfrPiHpToTesDhwIn_A -669:TRoomStore -670:TPortLeft98 -671:***Initial values -672:20 0.0 20 20 -673: -674:EQUATIONS 3 -675:TPiHpToTesDhwIn= [472,1] -676:PPiHpToTesDhwIn_kW= [472,3]/3600 !kW -677:MfrPiHpToTesDhwIn= MfrPiHpToTesDhwIn_A -678: -679:UNIT 473 TYPE 931 -680:!PiHpToTesDhwOut -681:PARAMETERS 6 -682:diPiHpToTesDhwOut -683:LPiHpToTesDhwOut -684:UPiHpToTesDhwOut -685:RhoWat -686:CPWat -687:20 -688:INPUTS 4 -689:TPortLeft67 -690:MfrPiHpToTesDhwOut_A -691:TRoomStore -692:TDivHpRt -693:***Initial values -694:20 0.0 20 20 -695: -696:EQUATIONS 3 -697:TPiHpToTesDhwOut= [473,1] -698:PPiHpToTesDhwOut_kW= [473,3]/3600 !kW -699:MfrPiHpToTesDhwOut= MfrPiHpToTesDhwOut_A -700: -701:UNIT 474 TYPE 931 -702:!PiHpToTesShIn -703:PARAMETERS 6 -704:diPiHpToTesShIn -705:LPiHpToTesShIn -706:UPiHpToTesShIn -707:RhoWat -708:CPWat -709:20 -710:INPUTS 4 -711:TDivHp -712:MfrPiHpToTesShIn_A -713:TRoomStore -714:TPortLeft44 -715:***Initial values -716:20 0.0 20 20 -717: -718:EQUATIONS 3 -719:TPiHpToTesShIn= [474,1] -720:PPiHpToTesShIn_kW= [474,3]/3600 !kW -721:MfrPiHpToTesShIn= MfrPiHpToTesShIn_A -722: -723:UNIT 475 TYPE 931 -724:!PiHpToTesShOut -725:PARAMETERS 6 -726:diPiHpToTesShOut -727:LPiHpToTesShOut -728:UPiHpToTesShOut -729:RhoWat -730:CPWat -731:20 -732:INPUTS 4 -733:TPortLeft0 -734:MfrPiHpToTesShOut_A -735:TRoomStore -736:TDivHpRt -737:***Initial values -738:20 0.0 20 20 -739: -740:EQUATIONS 3 -741:TPiHpToTesShOut= [475,1] -742:PPiHpToTesShOut_kW= [475,3]/3600 !kW -743:MfrPiHpToTesShOut= MfrPiHpToTesShOut_A -744: -745:UNIT 476 TYPE 931 -746:!PiShTesOut -747:PARAMETERS 6 -748:diPiShTesOut -749:LPiShTesOut -750:UPiShTesOut -751:RhoWat -752:CPWat -753:20 -754:INPUTS 4 -755:TMixSh -756:MfrPiShTesOut_A -757:TRoomStore -758:TPortRight30 -759:***Initial values -760:20 0.0 20 20 -761: -762:EQUATIONS 3 -763:TPiShTesOut= [476,1] -764:PPiShTesOut_kW= [476,3]/3600 !kW -765:MfrPiShTesOut= MfrPiShTesOut_A -767:UNIT 477 TYPE 931 -768:!PiShTesIn -769:PARAMETERS 6 -770:diPiShTesIn -771:LPiShTesIn -772:UPiShTesIn -773:RhoWat -774:CPWat -775:20 -776:INPUTS 4 -777:TTeeSh -778:MfrPiShTesIn_A -779:TRoomStore -780:TPortRight5 -781:***Initial values -782:20 0.0 20 20 -783: -784:EQUATIONS 3 -785:TPiShTesIn= [477,1] -786:PPiShTesIn_kW= [477,3]/3600 !kW -787:MfrPiShTesIn= MfrPiShTesIn_A -788: -789:CONSTANTS 3 -790:** Fluid Loop : defaultGroup -791:di_loop_0=0.2 -792:L_loop_0=2 -793:U_loop_0=10 -794: -795: -796:EQUATIONS 63 -797:** Fluid Loop : defaultGroup -798:**di_loop_0=0.2 -799:**L_loop_0=2 -800:**U_loop_0=10 -801:*** PiDhwMix -802:diPiDhwMix=di_loop_0 -803:LPiDhwMix=L_loop_0 -804:UPiDhwMix=U_loop_0 -805:*** PiDhwMains -806:diPiDhwMains=di_loop_0 -807:LPiDhwMains=L_loop_0 -808:UPiDhwMains=U_loop_0 -809:*** PiDivHpToHp -810:diPiDivHpToHp=di_loop_0 -811:LPiDivHpToHp=L_loop_0 -812:UPiDivHpToHp=U_loop_0 -813:*** PiHpToTesShOut -814:diPiHpToTesShOut=di_loop_0 -815:LPiHpToTesShOut=L_loop_0 -816:UPiHpToTesShOut=U_loop_0 -817:*** PiHpToTesDhwIn -818:diPiHpToTesDhwIn=di_loop_0 -819:LPiHpToTesDhwIn=L_loop_0 -820:UPiHpToTesDhwIn=U_loop_0 -821:*** PiHpCondOut -822:diPiHpCondOut=di_loop_0 -823:LPiHpCondOut=L_loop_0 -824:UPiHpCondOut=U_loop_0 -825:*** PiHpCondIn -826:diPiHpCondIn=di_loop_0 -827:LPiHpCondIn=L_loop_0 -828:UPiHpCondIn=U_loop_0 -829:*** PiColIn -830:diPiColIn=di_loop_0 -831:LPiColIn=L_loop_0 -832:UPiColIn=U_loop_0 -833:*** PiRadFloorIn -834:diPiRadFloorIn=di_loop_0 -835:LPiRadFloorIn=L_loop_0 -836:UPiRadFloorIn=U_loop_0 -837:*** PiShMix -838:diPiShMix=di_loop_0 -839:LPiShMix=L_loop_0 -840:UPiShMix=U_loop_0 -841:*** PiDhwDemand -842:diPiDhwDemand=di_loop_0 -843:LPiDhwDemand=L_loop_0 -844:UPiDhwDemand=U_loop_0 -845:*** PiRadFloorOut -846:diPiRadFloorOut=di_loop_0 -847:LPiRadFloorOut=L_loop_0 -848:UPiRadFloorOut=U_loop_0 -849:*** PiShPuToMix -850:diPiShPuToMix=di_loop_0 -851:LPiShPuToMix=L_loop_0 -852:UPiShPuToMix=U_loop_0 -853:*** PiHpToTesDhwOut -854:diPiHpToTesDhwOut=di_loop_0 -855:LPiHpToTesDhwOut=L_loop_0 -856:UPiHpToTesDhwOut=U_loop_0 -857:*** PiHpToTesShIn -858:diPiHpToTesShIn=di_loop_0 -859:LPiHpToTesShIn=L_loop_0 -860:UPiHpToTesShIn=U_loop_0 -861:*** PiTesDhwOut -862:diPiTesDhwOut=di_loop_0 -863:LPiTesDhwOut=L_loop_0 -864:UPiTesDhwOut=U_loop_0 -865:*** PiTesDhwIn -866:diPiTesDhwIn=di_loop_0 -867:LPiTesDhwIn=L_loop_0 -868:UPiTesDhwIn=U_loop_0 -869:*** PiShTesOut -870:diPiShTesOut=di_loop_0 -871:LPiShTesOut=L_loop_0 -872:UPiShTesOut=U_loop_0 -873:*** PiShTesIn -874:diPiShTesIn=di_loop_0 -875:LPiShTesIn=L_loop_0 -876:UPiShTesIn=U_loop_0 -877:*** PiColOut -878:diPiColOut=di_loop_0 -879:LPiColOut=L_loop_0 -880:UPiColOut=U_loop_0 -881:*** PiTesToCol -882:diPiTesToCol=di_loop_0 -883:LPiTesToCol=L_loop_0 -884:UPiTesToCol=U_loop_0 -885: -886: -887:EQUATIONS 2 -888:PipeLoss0=PPiDhwMix_kW+PPiDhwMains_kW+PPiDivHpToHp_kW+PPiHpToTesShOut_kW+PPiHpToTesDhwIn_kW+PPiHpCondOut_kW+PPiHpCondIn_kW+PPiColIn_kW+PPiRadFloorIn_kW+PPiShMix_kW+PPiDhwDemand_kW+PPiRadFloorOut_kW+PPiShPuToMix_kW+PPiHpToTesDhwOut_kW+PPiHpToTesShIn_kW+PPiTesDhwOut_kW+PPiTesDhwIn_kW+PPiShTesOut_kW+PPiShTesIn_kW+PPiColOut_kW+PPiTesToCol_kW -889:PipeLossTotal=PipeLoss0 -891:ASSIGN SASHP+Tes_Mfr.prt 478 -892: -893:UNIT 478 TYPE 25! User defined Printer -894:PARAMETERS 10 -895:dtSim! 1 Printing interval -896:START! 2 Start time -897:STOP! 3 Stop time -898:478! 4 Logical unit -899:0! 5 Units printing mode -900:0! 6 Relative or absolute start time -901:-1! 7 Overwrite or Append -902:-1! 8 Print header -903:0! 9 Delimiter -904:1! 10 Print labels -905: -906:INPUTS 25 -907:xFracMixDhw MfrPiDhwMix MfrPiDhwMains MfrPiColIn xFracMixSh MfrPiRadFloorIn MfrPiShMix -908:MfrPiDhwDemand MfrPiRadFloorOut MfrPiShPuToMix xFracDivHp xFracDivHpRt MfrPiHpToTesDhwOut MfrPiHpToTesShIn MfrPiTesDhwOut -909:MfrPiTesDhwIn MfrPiShTesOut MfrPiShTesIn MfrPiColOut MfrPiTesToCol MfrPiDivHpToHp MfrPiHpToTesShOut MfrPiHpToTesDhwIn -910:MfrPiHpCondOut MfrPiHpCondIn -911:*** -912:xFracMixDhw MfrPiDhwMix MfrPiDhwMains MfrPiColIn xFracMixSh MfrPiRadFloorIn MfrPiShMix -913:MfrPiDhwDemand MfrPiRadFloorOut MfrPiShPuToMix xFracDivHp xFracDivHpRt MfrPiHpToTesDhwOut MfrPiHpToTesShIn MfrPiTesDhwOut -914:MfrPiTesDhwIn MfrPiShTesOut MfrPiShTesIn MfrPiColOut MfrPiTesToCol MfrPiDivHpToHp MfrPiHpToTesShOut MfrPiHpToTesDhwIn -915:MfrPiHpCondOut MfrPiHpCondIn -916: -917:ASSIGN SASHP+Tes_T.prt 479 -918: -919:UNIT 479 TYPE 25! User defined Printer -920:PARAMETERS 10 -921:dtSim! 1 Printing interval -922:START! 2 Start time -923:STOP! 3 Stop time -924:479! 4 Logical unit -925:0! 5 Units printing mode -926:0! 6 Relative or absolute start time -927:-1! 7 Overwrite or Append -928:-1! 8 Print header -929:0! 9 Delimiter -930:1! 10 Print labels -931: -932:INPUTS 21 -933:TPiDhwMix TPiDhwMains TPiColIn TPiRadFloorIn TPiShMix TPiDhwDemand TPiRadFloorOut -934:TPiShPuToMix TPiHpToTesDhwOut TPiHpToTesShIn TPiTesDhwOut TPiTesDhwIn TPiShTesOut TPiShTesIn TPiColOut -935:TPiTesToCol TPiDivHpToHp TPiHpToTesShOut TPiHpToTesDhwIn TPiHpCondOut TPiHpCondIn -936:*** -937:TPiDhwMix TPiDhwMains TPiColIn TPiRadFloorIn TPiShMix TPiDhwDemand TPiRadFloorOut -938:TPiShPuToMix TPiHpToTesDhwOut TPiHpToTesShIn TPiTesDhwOut TPiTesDhwIn TPiShTesOut TPiShTesIn TPiColOut -939:TPiTesToCol TPiDivHpToHp TPiHpToTesShOut TPiHpToTesDhwIn TPiHpCondOut TPiHpCondIn -940: -941:ENDS -Reason for change: -changes in SASHP+Tes.json -============================================================== -============================================================== -20/04/2020 12:49:05 - -Name of file: -C:\Users\parad\OneDrive\Desktop\TrnsysGUI\trnsysGUI\Reference\ASHP+Tes.dck - -Differences: -2:CONSTANTS 2 - -Reason for change: -test -============================================================== diff --git a/trnsysGUI/loadDdckFile.py b/trnsysGUI/loadDdckFile.py index 39732596..5178d925 100644 --- a/trnsysGUI/loadDdckFile.py +++ b/trnsysGUI/loadDdckFile.py @@ -18,9 +18,6 @@ class DdckFileLoader: hasInternalPipingsProvider: _ip.HasInternalPipingsProvider def loadDdckFile(self, targetDirPath: _pl.Path) -> None: - if not targetDirPath.is_dir(): - raise ValueError("Not a directory.", targetDirPath) - sourceFilePathString, _ = _qtw.QFileDialog.getOpenFileName(None, "Load file") if not sourceFilePathString: return @@ -48,6 +45,21 @@ def loadDdckFile(self, targetDirPath: _pl.Path) -> None: if standardButton != _qtw.QMessageBox.StandardButton.Yes: # pylint: disable=no-member return + targetContainingDirPath = targetFilePath.parent + if not targetContainingDirPath.exists(): + message = f"The target parent directory `{targetContainingDirPath}` doesn't exist. Should it be created?" + standardButton = _qtw.QMessageBox.question( + None, + message, + "Create directory?", + _qtw.QMessageBox.Ok | _qtw.QMessageBox.Cancel, + ) + + if standardButton != _qtw.QMessageBox.Ok: + return + + targetContainingDirPath.mkdir(parents=True, exist_ok=True) + if not isSourceProformaFile: _su.copy(sourceFilePath, targetFilePath) return diff --git a/trnsysGUI/mainWindow.py b/trnsysGUI/mainWindow.py index dd777522..4e05bbd3 100644 --- a/trnsysGUI/mainWindow.py +++ b/trnsysGUI/mainWindow.py @@ -13,6 +13,7 @@ import pytrnsys.utils.log as _ulog import pytrnsys.utils.result as _res +import pytrnsys.utils.warnings as _warn import trnsysGUI.loggingCallback as _lgcb import trnsysGUI.menus.projectMenu.exportPlaceholders as _eph from trnsysGUI import buildDck as buildDck @@ -491,6 +492,12 @@ def exportDck(self): if _res.isError(result): errorMessage = f"The deck file could not be generated: {result.message}" _werrors.showMessageBox(errorMessage) + return + warnings: _warn.ValueWithWarnings[str | None] = _res.value(result) + + if warnings.hasWarnings(): + warningMessage = warnings.toWarningMessage() + _werrors.showMessageBox(warningMessage, _werrors.Title.WARNING) def toggleAlignMode(self): self.logger.info("Toggling alignMode") diff --git a/trnsysGUI/menus/projectMenu/placeholders.py b/trnsysGUI/menus/projectMenu/placeholders.py index be5d46dd..6faae8fb 100644 --- a/trnsysGUI/menus/projectMenu/placeholders.py +++ b/trnsysGUI/menus/projectMenu/placeholders.py @@ -1,8 +1,6 @@ -import pathlib as _pl import typing as _tp import pytrnsys.utils.warnings as _warn -import trnsysGUI.BlockItem as _bi import trnsysGUI.connection.connectionBase as _cb import trnsysGUI.connection.names as _cnames import trnsysGUI.connection.singlePipeConnection as _spc @@ -12,7 +10,7 @@ import trnsysGUI.massFlowSolver.names as _mnames import trnsysGUI.massFlowSolver.networkModel as _mfn import trnsysGUI.temperatures as _temps - +import trnsysGUI.placeHolderNames as _phn PlaceHolders = _tp.NewType("PlaceHolders", _tp.Mapping[str, str]) PlaceHoldersByQualifiedPortName = _tp.NewType("PlaceHoldersByQualifiedPortName", _tp.Mapping[str, PlaceHolders]) @@ -68,8 +66,7 @@ def _getPlaceHoldersForNode( ) -> PlaceHoldersByQualifiedPortName: placeHoldersForNode = {} for modelPortItem in node.getPortItems(): - nodeNameOrEmpty = node.name or "" - qualifiedPortName = f"{nodeNameOrEmpty}{modelPortItem.name}" + qualifiedPortName = _phn.getQualifiedPortName(node.name, modelPortItem.name) placeholdersForPort = _getPlaceholdersForPort( hydraulicLoops, componentName, internalPiping, node, modelPortItem diff --git a/trnsysGUI/placeHolderNames.py b/trnsysGUI/placeHolderNames.py new file mode 100644 index 00000000..9613fa4a --- /dev/null +++ b/trnsysGUI/placeHolderNames.py @@ -0,0 +1,9 @@ +def getQualifiedPortName(nodeName: str | None, portName: str) -> str: + nodeNameOrEmpty = nodeName or "" + nodeNamePart = nodeNameOrEmpty.capitalize() + + portNamePart = portName.capitalize() + + qualifiedPortName = f"{nodeNamePart}{portNamePart}" + + return qualifiedPortName diff --git a/trnsysGUI/proforma/convertXmlTmfToDdck.py b/trnsysGUI/proforma/convertXmlTmfToDdck.py index c781ffd7..7234a233 100644 --- a/trnsysGUI/proforma/convertXmlTmfToDdck.py +++ b/trnsysGUI/proforma/convertXmlTmfToDdck.py @@ -5,6 +5,7 @@ import textwrap as _tw import typing as _tp import xml.etree.ElementTree as _etree +import shutil as _su import jinja2 as _jj import xmlschema as _xs @@ -42,6 +43,10 @@ def convertXmltmfToDdck( suggestedHydraulicConnections: _cabc.Sequence[_models.Connection] | None, ddckFilePath: _pl.Path, ) -> _cancel.MaybeCancelled[_res.Result[None]]: + + containingDir = ddckFilePath.parent + containingDir.mkdir(parents=True, exist_ok=True) + xmlTmfContent = xmlTmfFilePath.read_text(encoding="utf8") maybeCancelled = convertXmlTmfStringToDdck(xmlTmfContent, suggestedHydraulicConnections, ddckFilePath.name) if _cancel.isCancelled(maybeCancelled): @@ -64,16 +69,15 @@ def convertXmltmfToDdck( class _HydraulicConnectionsData: name: str | None portName: str - stringConstants: _models.VariableStringConstants + variableNameBuilder: _models.VariableNameBuilder @property def variableName(self) -> str: - capitalizedPortName = self.portName.capitalize() - return f"{self.stringConstants.variableNamePrefix}{capitalizedPortName}" + return self.variableNameBuilder.getVariableName(self.name, self.portName) @property def rhs(self) -> str: - return f"@{self.stringConstants.propertyName}({self.portName})" + return self.variableNameBuilder.getRhs(self.name, self.portName) @staticmethod def createForTemperature(connectionName: str | None, portName: str) -> "_HydraulicConnectionsData": @@ -150,17 +154,20 @@ def _createVariablesForRole( variables = [] for roleOrder, serializedVariable in enumerate(sortedSerializedVariablesForRole, start=1): - order = serializedVariable["order"] + definition = _getDefinition(serializedVariable) bounds = _getBounds(serializedVariable) + variable = _models.Variable( serializedVariable["name"], - order, + definition, + serializedVariable["order"], role, roleOrder, serializedVariable["unit"], bounds, serializedVariable["default"], ) + variables.append(variable) return variables @@ -208,8 +215,8 @@ def convertXmlTmfStringToDdck( otherJinjaVariables = { "fileName": fileName, "type": proforma["type"], - "description": _makeMultilineComment(proforma["object"]), - "details": _makeMultilineComment(proforma["details"]), + "description": proforma["object"], + "details": proforma["details"], "visibilityModifier": _getVisibilityModifier(defaultVisibility), } @@ -227,15 +234,20 @@ def _getVisibilityModifier( # pylint: disable=inconsistent-return-statements _tp.assert_never(defaultVisibility) -def _makeMultilineComment(text: str) -> str: - textWithCollapsedWhitespace = _re.sub(r"\s+", " ", text.strip(), count=0, flags=_re.MULTILINE) +def _makeMultilineComment(text: str, width: int = 120) -> str: + textWithCollapsedWhitespace = _collapseWhitespace(text) linePrefix = "** " - maxWidth = 120 - len(linePrefix) + maxWidth = width - len(linePrefix) wrappedLines = _tw.wrap(textWithCollapsedWhitespace, maxWidth) newText = "\n".join(f"** {l}" for l in wrappedLines) return newText +def _collapseWhitespace(text: str) -> str: + textWithCollapsedWhitespace = _re.sub(r"\s+", " ", text.strip(), count=0, flags=_re.MULTILINE) + return textWithCollapsedWhitespace + + def _convertXmlTmfStringToDdck( hydraulicConnections: _cabc.Sequence[_models.Connection], variablesByRole: _models.VariablesByRole, @@ -245,7 +257,13 @@ def _convertXmlTmfStringToDdck( parameters = _createProcessedVariables(variablesByRole.parameters, connectionsDataByOrder) inputs = _createProcessedVariables(variablesByRole.inputs, connectionsDataByOrder) outputs = _createProcessedVariables(variablesByRole.outputs, connectionsDataByOrder) - ddckContent = _JINJA_TEMPLATE.render(parameters=parameters, inputs=inputs, outputs=outputs, **otherJinjaVariables) + ddckContent = _JINJA_TEMPLATE.render( + parameters=parameters, + inputs=inputs, + outputs=outputs, + multilineComment=_makeMultilineComment, + **otherJinjaVariables, + ) return ddckContent @@ -330,6 +348,14 @@ def _getSerializedVariablesWithRole( return [v for v in variables if v["role"] == role] +def _getDefinition(variable: _StringMapping) -> str | None: + definition = variable.get("definition") + if not definition: + return None + + return _collapseWhitespace(definition) + + def _getBounds(variable: _StringMapping) -> str: leftBracket, rightBracket = [b.strip() for b in variable["boundaries"].split(";")] minimum = variable["min"] diff --git a/trnsysGUI/proforma/dialogs/_hydraulicConnections.ui b/trnsysGUI/proforma/dialogs/_hydraulicConnections.ui index 78e1333d..17e0022c 100644 --- a/trnsysGUI/proforma/dialogs/_hydraulicConnections.ui +++ b/trnsysGUI/proforma/dialogs/_hydraulicConnections.ui @@ -19,7 +19,7 @@ - <html><head/><body><p>Note: Fields in <span style=" font-weight:700;">bold</span> are required. You can hover over light bulbs (<img src=":/tango-icons/status/tango-icon-theme-0.8.90/scalable/status/dialog-information.svg" height="20" widht="20"/>) and disabled buttons to get more information.</p></body></html> + <html><head/><body><p>Note: Fields in <span style=" font-weight:700;">bold</span> are required. You can hover over light bulbs (<img src=":/tango-icons/status/tango-icon-theme-0.8.90/scalable/status/dialog-information.svg" height="20"/>), drop down entries and disabled buttons to get more information. Drop downs can be searched by typing into them.</p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -76,7 +76,11 @@ - + + + true + + @@ -86,7 +90,11 @@ - + + + true + + @@ -105,12 +113,19 @@ - Mass flow rate + Temperature - + + + true + + + QComboBox::NoInsert + + @@ -120,12 +135,16 @@ - Temperature + Mass flow rate - + + + true + + @@ -144,10 +163,18 @@ - + + + true + + - + + + true + + diff --git a/trnsysGUI/proforma/dialogs/editHydraulicConnectionsDialog.py b/trnsysGUI/proforma/dialogs/editHydraulicConnectionsDialog.py index 90465a84..78e2ecfd 100644 --- a/trnsysGUI/proforma/dialogs/editHydraulicConnectionsDialog.py +++ b/trnsysGUI/proforma/dialogs/editHydraulicConnectionsDialog.py @@ -1,9 +1,11 @@ import collections.abc as _cabc import copy as _copy import dataclasses as _dc +import textwrap as _tw +import re as _re -import PyQt5.QtCore as _qtc -import PyQt5.QtWidgets as _qtw +from PyQt5 import QtCore as _qtc +from PyQt5 import QtWidgets as _qtw import pytrnsys.ddck.replaceTokens.defaultVisibility as _dv import trnsysGUI.common as _com @@ -16,20 +18,35 @@ from . import _UI_hydraulicConnections_generated as _uigen # type: ignore[import] # pylint: disable=wrong-import-position -class _OnActivatedCallBack: - def __init__(self, dialog: "EditHydraulicConnectionsDialog", comboBox: _qtw.QComboBox) -> None: +class _Callbacks: + def __init__( + self, + dialog: "EditHydraulicConnectionsDialog", + comboBox: _qtw.QComboBox, + proxyModel: _qtc.QSortFilterProxyModel, + ) -> None: self._dialog = dialog self._comboBox = comboBox + self._proxyModel = proxyModel @staticmethod - def createAndConnect(dialog: "EditHydraulicConnectionsDialog", comboBox: _qtw.QComboBox) -> "_OnActivatedCallBack": - callback = _OnActivatedCallBack(dialog, comboBox) + def createAndConnect( + dialog: "EditHydraulicConnectionsDialog", + comboBox: _qtw.QComboBox, + proxyModel: _qtc.QSortFilterProxyModel, + ) -> "_Callbacks": + callback = _Callbacks(dialog, comboBox, proxyModel) comboBox.activated.connect(callback.onActivated) + comboBox.lineEdit().textEdited.connect(callback.onLineEditTextEdited) return callback def onActivated(self, newIndex: int) -> None: self._dialog.onVariableComboBoxActivated(self._comboBox, newIndex) + def onLineEditTextEdited(self, newText: str) -> None: + newTextWithWildcardsForWhitespace = _re.sub(r"\s+", "*", newText) + self._proxyModel.setFilterWildcard(f"*{newTextWithWildcardsForWhitespace}*") + @_dc.dataclass class DialogResult: @@ -51,7 +68,7 @@ def __init__( self._variablesByRole = variablesByRole self.hydraulicConnections = self._getDeepCopiesSortedByName(suggestedHydraulicConnections) - self._onActivatedCallbacks = list[_OnActivatedCallBack]() + self._callbacks = list[_Callbacks]() self.summaryTextEdit.setReadOnly(True) @@ -117,34 +134,17 @@ def _reconfigureFluid(self): self._addParametersAndInputOptions(self.fluidHeatCapacityComboBox) def _addParametersAndInputOptions(self, comboBox: _qtw.QComboBox) -> None: - self._addOptions(comboBox, self._getParameters(comboBox)) + _addOptions(comboBox, self._getParameters(comboBox)) comboBox.addItem("-----", _models.UNSET) - self._addOptions(comboBox, self._getInputs(comboBox), withUnset=False, clear=False) + _addOptions(comboBox, self._getInputs(comboBox), withUnset=False, clear=False) def _reconfigureInputs(self) -> None: - self._addOptions(self.massFlowRateComboBox, self._getInputs(self.massFlowRateComboBox)) - self._addOptions(self.inputTempComboBox, self._getInputs(self.inputTempComboBox)) + _addOptions(self.massFlowRateComboBox, self._getInputs(self.massFlowRateComboBox)) + _addOptions(self.inputTempComboBox, self._getInputs(self.inputTempComboBox)) def _reconfigureOutputs(self) -> None: - self._addOptions(self.outputTempComboBox, self._getOutputs(self.outputTempComboBox)) - self._addOptions(self.outputRevTempComboBox, self._getInputs(self.outputRevTempComboBox)) - - @staticmethod - def _addOptions( - comboBox: _qtw.QComboBox, - variables: _cabc.Sequence[_models.Variable], - withUnset: bool = True, - clear: bool = True, - ) -> None: - if clear: - comboBox.clear() - - if withUnset: - comboBox.addItem("", _models.UNSET) - - for variable in variables: - text = variable.getInfo(withRole=True) - comboBox.addItem(text, variable) + _addOptions(self.outputTempComboBox, self._getOutputs(self.outputTempComboBox)) + _addOptions(self.outputRevTempComboBox, self._getInputs(self.outputRevTempComboBox)) @property def _selectedVariables(self) -> _cabc.Sequence[_models.Variable]: @@ -196,8 +196,20 @@ def _getSelectedConnection(self) -> _models.Connection: def _configureVariableComboBoxes(self) -> None: for variableComboBox in self._variableComboBoxes: - onActivatedCallback = _OnActivatedCallBack.createAndConnect(self, variableComboBox) - self._onActivatedCallbacks.append(onActivatedCallback) + sortFilterProxyModel = self._createSortFilterProxyModelAndAddToCompleter(variableComboBox) + + onActivatedCallback = _Callbacks.createAndConnect(self, variableComboBox, sortFilterProxyModel) + self._callbacks.append(onActivatedCallback) + + @staticmethod + def _createSortFilterProxyModelAndAddToCompleter(variableComboBox: _qtw.QComboBox) -> _qtc.QSortFilterProxyModel: + sortFilterProxyModel = _qtc.QSortFilterProxyModel() + sortFilterProxyModel.setSourceModel(variableComboBox.model()) + sortFilterProxyModel.setFilterCaseSensitivity(_qtc.Qt.CaseInsensitive) + completer = variableComboBox.completer() + completer.setCompletionMode(_qtw.QCompleter.UnfilteredPopupCompletion) + completer.setModel(sortFilterProxyModel) + return sortFilterProxyModel def onVariableComboBoxActivated(self, comboBox: _qtw.QComboBox, newIndex: int) -> None: data = comboBox.itemData(newIndex) @@ -295,12 +307,45 @@ def showDialogAndGetResults( return dialogResult +def _addOptions( + comboBox: _qtw.QComboBox, + variables: _cabc.Sequence[_models.Variable], + withUnset: bool = True, + clear: bool = True, +) -> None: + if clear: + comboBox.clear() + + if withUnset: + comboBox.addItem("", _models.UNSET) + + for variable in variables: + text = variable.getInfo(withRole=True) + comboBox.addItem(text, variable) + + _maybeAddToolTipToLatestEntry(variable, comboBox) + + +def _maybeAddToolTipToLatestEntry(variable: _models.Variable, comboBox: _qtw.QComboBox) -> None: + if not variable.definition: + return + + wrappedLines = _tw.wrap(variable.definition, width=60) + toolTipText = "\n".join(wrappedLines) + + index = comboBox.count() - 1 + comboBox.setItemData(index, toolTipText, _qtc.Qt.ToolTipRole) + + def _setSelected(comboBox: _qtw.QComboBox, data: _models.Variable | _models.Unset) -> None: # Cannot use `QComboBox.findData` as `findData` works by reference, but we want by value for index in range(comboBox.count()): rowData = comboBox.itemData(index) if rowData == data: comboBox.setCurrentIndex(index) + if isinstance(data, _models.Variable) and (definition := data.definition): + lineEdit = comboBox.lineEdit() + lineEdit.setToolTip(definition) return raise AssertionError(f"{data} not a member of combo box.") diff --git a/trnsysGUI/proforma/models.py b/trnsysGUI/proforma/models.py index 87fdf587..edae629e 100644 --- a/trnsysGUI/proforma/models.py +++ b/trnsysGUI/proforma/models.py @@ -4,10 +4,13 @@ import dataclasses as _dc import typing as _tp +import trnsysGUI.placeHolderNames as _phn + @_dc.dataclass -class Variable: +class Variable: # pylint: disable=too-many-instance-attributes tmfName: str + definition: str | None order: int role: str roleOrder: int @@ -36,22 +39,49 @@ class Unset: @_dc.dataclass -class VariableStringConstants: +class VariableNameBuilder: propertyName: str variableNamePrefix: str | None + usePortInVariableName: bool + + def getVariableName(self, connectionName: str | None, portName: str) -> str: + if self.usePortInVariableName: + qualifiedPortName = _phn.getQualifiedPortName(connectionName, portName) + return f"{self.variableNamePrefix}{qualifiedPortName}" + + connectionNameOrEmpty = connectionName or "" + + return f"{self.variableNamePrefix}{connectionNameOrEmpty}" + + def getRhs(self, connectionName: str | None, portName: str) -> str: + qualifiedPortName = _phn.getQualifiedPortName(connectionName, portName) + return f"@{self.propertyName}({qualifiedPortName})" + + @staticmethod + def _getConnectionNamePart(connectionName: str | None, shallCapitalize: bool) -> str: + connectionNamePart = connectionName or "" + + if shallCapitalize: + connectionNamePart = connectionNamePart.capitalize() + + return connectionNamePart + + def _getPortNamePart(self, portName: str) -> str: + capitalizedPortNameOrEmpty = portName.capitalize() if self.usePortInVariableName else "" + return capitalizedPortNameOrEmpty class AllVariableStringConstants: - TEMPERATURE = VariableStringConstants("temp", "T") - MASS_FLOW_RATE = VariableStringConstants("mfr", "M") - REVERSE_TEMPERATURE = VariableStringConstants("revtemp", None) - DENSITY = VariableStringConstants("rho", "Rho") - HEAT_CAPACITY = VariableStringConstants("cp", "Cp") + TEMPERATURE = VariableNameBuilder("temp", "T", usePortInVariableName=True) + MASS_FLOW_RATE = VariableNameBuilder("mfr", "M", usePortInVariableName=False) + REVERSE_TEMPERATURE = VariableNameBuilder("revtemp", None, usePortInVariableName=True) + DENSITY = VariableNameBuilder("rho", "Rho", usePortInVariableName=False) + HEAT_CAPACITY = VariableNameBuilder("cp", "Cp", usePortInVariableName=False) def _getSummaryLine( qualifiedPortName: str, - variableStringConstants: VariableStringConstants, + variableStringConstants: VariableNameBuilder, variable: Variable | None | Unset, direction: _tp.Literal["input", "output"], ) -> str: diff --git a/trnsysGUI/proforma/templates/ddck.jinja b/trnsysGUI/proforma/templates/ddck.jinja index 92857a66..ca927570 100644 --- a/trnsysGUI/proforma/templates/ddck.jinja +++ b/trnsysGUI/proforma/templates/ddck.jinja @@ -2,15 +2,15 @@ ** BEGIN {{fileName}} ******************************* -*************************************************************************** +{{"*" * 120}} ** Description: -{{description}} -*************************************************************************** +{{multilineComment(description, 120)}} +{{"*" * 120}} -*************************************************************************** +{{"*" * 120}} ** Details: -{{details}} -*************************************************************************** +{{multilineComment(details, 120)}} +{{"*" * 120}} *********************************** ** inputs from hydraulic solver @@ -60,19 +60,27 @@ EQUATIONS {{outputsWithHydraulicData|length}} UNIT 1 TYPE {{type}} PARAMETERS {{parameters|length}} {% for parameter in parameters %} + {% if parameter.definition %} +{{multilineComment(parameter.definition)}} + {% endif %} {% if parameter.hydraulicConnectionsData %} {{visibilityModifier}}{{parameter.hydraulicConnectionsData.variableName}} ! {{parameter.info}} {% else %} {{parameter.defaultValue}} ! {{parameter.info}} {% endif %} + {% endfor %} INPUTS {{inputs|length}} {% for input in inputs %} + {% if input.definition %} +{{multilineComment(input.definition)}} + {% endif %} {% if input.hydraulicConnectionsData %} {{visibilityModifier}}{{input.hydraulicConnectionsData.variableName}} ! {{input.info}} {% else %} 0,0 ! {{input.roleOrder}}: {{input.tmfName}} [{{input.unit}}] ({{input.bounds}}) {% endif %} + {% endfor %} ** initial values {% for input in inputs %} @@ -85,11 +93,15 @@ EQUATIONS {{outputsWithHydraulicData|length}} ! {{outputs|length}} ! EQUATIONS {{outputs|length}} {% endif %} {% for output in outputs %} + {% if output.definition %} +{{multilineComment(output.definition)}} + {% endif %} {% if output.hydraulicConnectionsData %} {{visibilityModifier}}{{output.hydraulicConnectionsData.variableName}} = [1, {{output.roleOrder}}] ! {{output.tmfName}} [{{output.unit}}] ({{output.bounds}}) {% else %} ! {{visibilityModifier}}XXX = [1, {{output.roleOrder}}] ! {{output.tmfName}} [{{output.unit}}] ({{output.bounds}}) {% endif %} + {% endfor %} ***********************************