### CSV format example for Hysopt configuration values Source: https://knowledge.hysopt.com/hysopt-wiki/functional-questions.md Example of a CSV file in Hysopt's fixed format: UTF-8 encoding, semicolon field separator, dot decimal separator, no quotes, and no thousand separators. The header row lists evaporatorTemperature, condenserTemperature, modulation, and cop, followed by five data rows. ```csv evaporatorTemperature;condenserTemperature;modulation;cop -15;25;0.3;2.84491071428571 -15;30;0.3;2.624375 -15;35;0.3;2.44121822033898 -15;40;0.3;2.2866796875 -15;45;0.3;2.15453804347826 ``` -------------------------------- ### Ternary operator example: (x==1)? a : b Source: https://knowledge.hysopt.com/hysopt-wiki/piecewise-linear-function-function-expression.md Example of a ternary operator in a function expression. If x equals 1, output is a, otherwise output is b. Note that the expression is written without x = prefix. ```plaintext (x==1)? a : b ``` -------------------------------- ### Ternary operator example for switch command Source: https://knowledge.hysopt.com/hysopt-wiki/programmable-controller-extra-large.md Shows the ternary operator syntax for a switch command: if Switch equals 1, Output is a, else Output is b. This is a single-line assignment. ```javascript Output = (Switch ==1) ? a: b; ``` -------------------------------- ### Output Mapping (out1 to out30) Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Assigns values to outputs out1 through out30, mapping internal variables to output ports. Includes direct assignments and a sum for out30. ```hysopt //OUTPUTS //----------------------------------------------------------------------------- out1 = HP; out2 = HPPumps; out3 = ATESPump; out4 = ATESLoadUnloadValves; out5 = ATESBypassValve; out6 = ATESSoilVolumeFlow; out7 = AEColdRelease; out8 = AEHotRelease; out9 = AEColdSupply; out10 = AEColdDeposit; out11 = AEColdWithdraw; out12 = HeatingSP; out13 = CoolingSP; out14 = HPHeatingATESColdDeposit; out15 = HPHeatingAEColdRelease; out16 = ATESCoolingColdWithdraw; out17 = HPCoolingAEHotRelease; out18 = AEColdSupply; out19 = ATESHeatingCoolingColdWithdraw; out20 = HPDirectHeatingCooling; out21 = ATESColdDepositLimitationHeating; out22 = ATESColdDepositLimitationHeatingCooling; out23 = ATESColdWithdrawLimitationCooling; out24 = ATESColdWithdrawLimitationHeatingCooling; out25 = AEColdDeposit; out26 = AEColdWithdraw; out27 = HPActiveColdDeposit; out28 = HeatingDemand; out29 = CoolingDemand; out30 = HeatingDemand + CoolingDemand; ``` -------------------------------- ### System Configuration Settings Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Defines global constants for flow rates, hysteresis, storage temperatures, and operational limits for the thermal system. ```text //SETTINGS //----------------------------------------------------------------------------- FlowrateHeatingHTmin = 1; FlowrateHeatingLTmin = 0.8; FlowrateCoolingLTmin = 2; FlowrateCoolingHTmin = 2; FlowrateHysteresisPercentage = 20; TempATESCold = 4; TempATESHot = 18; TempATESHysteresis = 2; StorageHotTopHPon = 60; StorageHotBottomHPoff = 60; StorageColdTopHPon = 2; StorageColdBottomHPoff = 2; TempHPcondenserHot = 80; TempHPevaporatorCold = -5; FlowrateHPevaporatorMin = 45; FlowrateHPcondenserMin = 15; HPdelay = 5; ATESSoilVolumeFlowColdDeposit = 50; ATESSoilVolumeFlowColdWithdraw = 50; TempATESColdWithdrawMin = TempCoolingReturn - 2; TempATESColdWithdrawMax = TempCoolingReturn - 1; TempHPColdSupplyMin = CoolingSP - 1; TempHPColdSupplyMax = CoolingSP + 1; AEHotReleaseOn = 0; AEColdReleaseOn = 0; AEColdSupplyOn = 0; HPDirectHeatingCoolingOn = 1; StorageHotMiddleAEHotReleaseOn = 60; StorageHotTopAEHotReleaseOff = 60; StorageColdMiddleAEColdReleaseOn = 2; StorageColdTopAEColdReleaseOff = 2; ATESColdDepositLimitationHeatingOn = 0; ATESColdDepositLimitationHeatingCoolingOn = 0; ATESColdWithdrawLimitationCoolingOn = 0; ATESColdWithdrawLimitationHeatingCoolingOn = 0; ATESColdDepositLimit = 999999999999; ATESColdWithdrawLimit = 999999999999; AEColdDepositLimit = 999999999999; AEColdWithdrawLimit = 999999999999; HPActiveColdDepositLimit = 999999999999; AEColdDepositOn = 0; AEColdWithdrawOn = 0; HPActiveColdDepositOn = 0; ``` -------------------------------- ### Temperature Setpoint Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Determines the active heating and cooling setpoints based on current demand status. ```text //TEMPERATURE SETPOINTS //----------------------------------------------------------------------------- //HT-Heating SP if ( HTheatingDemand == 1 ) { HeatingSP = HTheatingSP; } //LT-Heating SP if ( HTheatingDemand == 0 ) { HeatingSP = LTheatingSP; } //LT-Cooling SP if ( LTcoolingDemand == 1 ) { CoolingSP = LTcoolingSP; } //LT-Heating SP if ( LTcoolingDemand == 0 ) { CoolingSP = HTcoolingSP; } ``` -------------------------------- ### Heat Pump Active Cold Deposit Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Manages the counter and activation state for heat pump active cold deposit. ```text //Heat Pump Active Cold Deposit counter if ( HPActiveColdDeposit == 1 ) { ColdStepHPActiveColdDeposit = - (ColdPowerATESColdDeposit * 30) / 3600000; ColdTotalHPActiveColdDeposit = ColdTotalHPActiveColdDeposit + ColdStepHPActiveColdDeposit; } //Heat Pump Active Cold Deposit ON if ( HeatingDemand == 0 && CoolingDemand == 0 && HPActiveColdDepositOn == 1 ) { HPActiveColdDeposit = 1; } //Heat Pump Active Cold Deposit OFF if ( HeatingDemand == 1 || CoolingDemand == 1 || ColdTotalHPActiveColdDeposit >= HPActiveColdDepositLimit || HPActiveColdDepositOn == 0 ) { HPActiveColdDeposit = 0; } ``` -------------------------------- ### Input Variable Mapping Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Maps external input signals to internal system variables. ```text //INPUTS //----------------------------------------------------------------------------- FlowrateHeatingHT = in1; FlowrateHeatingLT = in2; FlowrateCoolingLT = in3; FlowrateCoolingHT = in4; HTheatingSP = in5; LTheatingSP = in6; LTcoolingSP = in7; HTcoolingSP = in8; StorageHotTop = in9; StorageHotMiddle = in10; StorageHotBottom = in11; StorageColdTop = in12; StorageColdMiddle = in13; StorageColdBottom = in14; TempATESColdWell = in15; TempATESHotWell = in16; TempOutside = in17; TempCoolingReturn = in18; TempCoolingReturnAfterATES = in19; TempHPcondenser = in20; TempHPevaporator = in21; FlowrateHPcondenser = in22; FlowrateHPevaporator = in23; ColdPowerATESColdDeposit = in24; ColdPowerATESColdWithdraw = in25; ColdPowerAEColdDeposit = in26; ColdPowerAEColdWithdraw = in27; ``` -------------------------------- ### Ambient Exchange Cold Deposit and Withdraw Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Calculates energy counters and manages the ON/OFF states for ambient exchange cold deposit and withdrawal processes. ```text //Ambient Exchange Cold Deposit counter ColdStepAEColdDeposit = (ColdPowerAEColdDeposit * 30) / 3600000; ColdTotalAEColdDeposit = ColdTotalAEColdDeposit + ColdStepAEColdDeposit; //Ambient Exchange Cold Deposit ON if ( HeatingDemand == 0 && CoolingDemand == 0 && TempOutside < (TempATESColdWell - 1) && AEColdDepositOn == 1 ) { AEColdDeposit = 1; } //Ambient Exchange Cold Deposit OFF if ( HeatingDemand == 1 || CoolingDemand == 1 || TempOutside > (TempATESColdWell - 1) || ColdTotalAEColdDeposit >= AEColdDepositLimit || AEColdDepositOn == 0 ) { AEColdDeposit = 0; } //Ambient Exchange Cold Withdraw counter ColdStepAEColdWithdraw = - (ColdPowerAEColdWithdraw * 30) / 3600000; ColdTotalAEColdWithdraw = ColdTotalAEColdWithdraw + ColdStepAEColdWithdraw; //Ambient Exchange Cold Withdraw ON if ( CoolingDemand == 0 && TempOutside > (TempATESColdWell + 1) && AEColdWithdrawOn == 1 ) { AEColdWithdraw = 1; } //Ambient Exchange Cold Withdraw OFF if ( CoolingDemand == 1 || TempOutside < (TempATESColdWell + 1) || ColdTotalAEColdWithdraw >= AEColdWithdrawLimit || AEColdWithdrawOn == 0 ) { AEColdWithdraw = 0; } ``` -------------------------------- ### Heat Pump and Pump Enable Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Controls the activation of the heat pump and its associated pumps based on storage temperatures, flow rates, and operational conditions. ```text //HP ON if ( StorageHotTop < StorageHotTopHPon && StorageColdTop > StorageColdTopHPon && (HPHeatingATESColdDeposit == 1 || HPHeatingAEColdRelease == 1 || HPCoolingAEHotRelease == 1 || HPDirectHeatingCooling == 1 || HPActiveColdDeposit == 1) && HPtimer >= HPdelay && TempHPcondenser < TempHPcondenserHot && TempHPevaporator > TempHPevaporatorCold && FlowrateHPevaporator > FlowrateHPevaporatorMin && FlowrateHPcondenser > FlowrateHPcondenserMin ) { HP = 1; HPtimer = 0; } //HP OFF if ( StorageHotBottom > StorageHotBottomHPoff || StorageColdBottom < StorageColdBottomHPoff || TempHPcondenser > TempHPcondenserHot || TempHPevaporator < TempHPevaporatorCold || FlowrateHPevaporator < FlowrateHPevaporatorMin || FlowrateHPcondenser < FlowrateHPcondenserMin ) { HP = 0; } //HP Pumps ON if ( StorageHotTop < StorageHotTopHPon && StorageColdTop > StorageColdTopHPon && (HPHeatingATESColdDeposit == 1 || HPHeatingAEColdRelease == 1 || HPCoolingAEHotRelease == 1 || HPDirectHeatingCooling == 1 || HPActiveColdDeposit == 1) && TempHPcondenser < TempHPcondenserHot && TempHPevaporator > TempHPevaporatorCold ) { HPPumps = 1; } //HP Pumps OFF if ( StorageHotBottom > StorageHotBottomHPoff || StorageColdBottom < StorageColdBottomHPoff || TempHPcondenser > TempHPcondenserHot || TempHPevaporator < TempHPevaporatorCold ) { HPPumps = 0; } ``` -------------------------------- ### Ambient Exchange Cold Supply/Deposit/Withdraw Flags Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Sets AEColdSupply, AEColdDeposit, and AEColdWithdraw flags to 1 if they are already 1, otherwise sets them to 0. This appears to be a redundant assignment pattern. ```hysopt //Ambient Exchange Cold Supply if ( AEColdSupply == 1 ) { AEColdSupply = 1; } else { AEColdSupply = 0; } //Ambient Exchange Cold Deposit if ( AEColdDeposit == 1 ) { AEColdDeposit = 1; } else { AEColdDeposit = 0; } //Ambient Exchange Cold Withdraw if ( AEColdWithdraw == 1 ) { AEColdWithdraw = 1; } else { AEColdWithdraw = 0; } ``` -------------------------------- ### ATES Limitation Counters and Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Calculates limitation counters and sets flags for ATES cold deposit and withdrawal limitations. ```text //ATES Cold Deposit Limitation counter ColdStepATESColdDepositLimitation = - (ColdPowerATESColdDeposit * 30) / 3600000; ColdTotalATESColdDepositLimitation = ColdTotalATESColdDepositLimitation + ColdStepATESColdDepositLimitation; //ATES Cold Deposit Limitation for Heating if ( ColdTotalATESColdDepositLimitation >= ATESColdDepositLimit && ATESColdDepositLimitationHeatingOn == 1 ) { ATESColdDepositLimitationHeating = 1; } else { ATESColdDepositLimitationHeating = 0; } //ATES Cold Deposit Limitation for Heating and Cooling if ( ColdTotalATESColdDepositLimitation >= ATESColdDepositLimit && ATESColdDepositLimitationHeatingCoolingOn == 1 && HPIndirectHeatingCoolingOn == 1 ) { ATESColdDepositLimitationHeatingCooling = 1; } else { ATESColdDepositLimitationHeatingCooling = 0; } //ATES Cold Withdraw Limitation counter ColdStepATESColdWithdrawLimitation = - (ColdPowerATESColdWithdraw * 30) / 3600000; ColdTotalATESColdWithdrawLimitation = ColdTotalATESColdWithdrawLimitation + ColdStepATESColdWithdrawLimitation; ``` -------------------------------- ### Ambient Exchange Cold Release ON/OFF Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Controls AEColdRelease flag. Turns ON when StorageColdMiddle is below threshold and HPHeatingAEColdRelease is active. Turns OFF when StorageColdTop exceeds threshold or HPHeatingAEColdRelease is inactive. ```hysopt //Ambient Exchange Cold Release ON if ( StorageColdMiddle < StorageColdMiddleAEColdReleaseOn && HPHeatingAEColdRelease == 1 ) { AEColdRelease = 1; } //Ambient Exchange Cold Release OFF if ( StorageColdTop > StorageColdTopAEColdReleaseOff || HPHeatingAEColdRelease == 0 ) { AEColdRelease = 0; } ``` -------------------------------- ### Thermal Demand Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Calculates heating and cooling demands based on flow rate thresholds and hysteresis. ```text //THERMAL DEMAND //----------------------------------------------------------------------------- //HT-Heating demand on if ( FlowrateHeatingHT > (FlowrateHeatingHTmin + (FlowrateHeatingHTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { HTheatingDemand = 1; } //HT-Heating demand off if ( FlowrateHeatingHT < (FlowrateHeatingHTmin - (FlowrateHeatingHTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { HTheatingDemand = 0; } //LT-Heating demand on if ( FlowrateHeatingLT > (FlowrateHeatingLTmin + (FlowrateHeatingLTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { LTheatingDemand = 1; } //LT-Heating demand off if ( FlowrateHeatingLT < (FlowrateHeatingLTmin - (FlowrateHeatingLTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { LTheatingDemand = 0; } //Heating demand if ( HTheatingDemand == 1 || LTheatingDemand == 1 ) { HeatingDemand = 1; } else { HeatingDemand = 0; } //LT-Cooling demand on if ( FlowrateCoolingLT > (FlowrateCoolingLTmin + (FlowrateCoolingLTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { LTcoolingDemand = 1; } //LT-Cooling demand off if ( FlowrateCoolingLT < (FlowrateCoolingLTmin - (FlowrateCoolingLTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { LTcoolingDemand = 0; } //HT-Cooling demand on if ( FlowrateCoolingHT > (FlowrateCoolingHTmin + (FlowrateCoolingHTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { HTcoolingDemand = 1; } //HT-Cooling demand off if ( FlowrateCoolingHT < (FlowrateCoolingHTmin - (FlowrateCoolingHTmin * (FlowrateHysteresisPercentage / 2) / 100)) ) { HTcoolingDemand = 0; } //Cooling demand if ( LTcoolingDemand == 1 || HTcoolingDemand == 1 ) { CoolingDemand = 1; } else { CoolingDemand = 0; } ``` -------------------------------- ### ATES Cold Withdraw Control for Cooling Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Logic for managing ATES cold withdrawal during cooling demand. ```text //ATES Cold Withdraw ON if ( HeatingDemand == 0 && CoolingDemand == 1 && TempATESColdWell > (TempATESCold + (TempATESHysteresis / 2)) && TempATESHotWell < (TempATESHot - (TempATESHysteresis / 2)) && TempATESColdWell < TempATESColdWithdrawMin && ATESColdWithdrawLimitationCooling == 0 ) { ATESCoolingColdWithdraw = 1; } //ATES Cold Withdraw OFF if ( HeatingDemand == 1 || CoolingDemand == 0 || TempATESColdWell < (TempATESCold - (TempATESHysteresis / 2)) || TempATESHotWell > (TempATESHot + (TempATESHysteresis / 2)) || TempATESColdWell > TempATESColdWithdrawMax || ATESColdWithdrawLimitationCooling == 1 ) { ATESCoolingColdWithdraw = 0; } ``` -------------------------------- ### Ambient Exchange Hot Release ON/OFF Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Controls AEHotRelease flag. Turns ON when StorageHotMiddle is above threshold and either HPCoolingAEHotRelease or HPActiveColdDeposit is active. Turns OFF when StorageHotTop is below threshold or both conditions are inactive. ```hysopt //Ambient Exchange Hot Release ON if ( StorageHotMiddle > StorageHotMiddleAEHotReleaseOn && (HPCoolingAEHotRelease == 1 || HPActiveColdDeposit == 1) ) { AEHotRelease = 1; } //Ambient Exchange Hot Release OFF if ( StorageHotTop < StorageHotTopAEHotReleaseOff || (HPCoolingAEHotRelease == 0 && HPActiveColdDeposit == 0) ) { AEHotRelease = 0; } ``` -------------------------------- ### Heat Pump Heating and ATES Cold Deposit Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Logic to toggle the heat pump heating and ATES cold deposit state based on demand and temperature thresholds. ```text //Heat Pump Heating and ATES Cold Deposit ON if ( HeatingDemand == 1 && CoolingDemand == 0 && TempATESColdWell > (TempATESCold + (TempATESHysteresis / 2)) && TempATESHotWell < (TempATESHot - (TempATESHysteresis / 2)) && ATESColdDepositLimitationHeating == 0 ) { HPHeatingATESColdDeposit = 1; } //Heat Pump Heating and ATES Cold Deposit OFF if ( HeatingDemand == 0 || CoolingDemand == 1 || TempATESColdWell < (TempATESCold - (TempATESHysteresis / 2)) || TempATESHotWell > (TempATESHot + (TempATESHysteresis / 2)) || ATESColdDepositLimitationHeating == 1 ) { HPHeatingATESColdDeposit = 0; } ``` -------------------------------- ### ATES Cold Withdraw Control for Heating and Cooling Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Logic for managing ATES cold withdrawal when both heating and cooling demands are active. ```text //ATES Cold Withdraw ON if ( HeatingDemand == 1 && CoolingDemand == 1 && TempATESColdWell > (TempATESCold + (TempATESHysteresis / 2)) && TempATESHotWell < (TempATESHot - (TempATESHysteresis / 2)) && TempATESColdWell < TempATESColdWithdrawMin && ATESColdWithdrawLimitationHeatingCooling == 0 ) { ATESHeatingCoolingColdWithdraw = 1; } //ATES Cold Withdraw OFF if ( HeatingDemand == 0 || CoolingDemand == 0 || TempATESColdWell < (TempATESCold - (TempATESHysteresis / 2)) || TempATESHotWell > (TempATESHot + (TempATESHysteresis / 2)) || TempATESColdWell > TempATESColdWithdrawMax || ATESColdWithdrawLimitationHeatingCooling == 1 ) { ATESHeatingCoolingColdWithdraw = 0; } ``` -------------------------------- ### Heat Pump Direct Heating and Cooling Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Optional logic for managing direct heat pump heating and cooling. ```text //Heat Pump Direct Heating and Cooling ON (Optional) if ( HeatingDemand == 1 && CoolingDemand == 1 && TempCoolingReturnAfterATES > TempHPColdSupplyMax && HPDirectHeatingCoolingOn == 1 ) { HPDirectHeatingCooling = 1; } //Heat Pump Direct Heating and Cooling OFF (Optional) if ( HeatingDemand == 0 || CoolingDemand == 0 || TempCoolingReturnAfterATES < TempHPColdSupplyMin || HPDirectHeatingCoolingOn == 0 ) { HPDirectHeatingCooling = 0; } ``` -------------------------------- ### Ambient Exchange Cold Supply Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Optional logic for managing ambient exchange cold supply. ```text //Ambient Exchange Cold Supply ON (Optional) if ( HeatingDemand == 0 && CoolingDemand == 1 && TempOutside < (TempATESColdWell - 1) && TempOutside < TempATESColdWithdrawMin && AEColdSupplyOn == 1 ) { AEColdSupply = 1; } //Ambient Exchange Cold Supply OFF (Optional) if ( HeatingDemand == 1 || CoolingDemand == 0 || TempOutside > (TempATESColdWell - 1) || TempOutside > TempATESColdWithdrawMax || AEColdSupplyOn == 0 ) { AEColdSupply = 0; } ``` -------------------------------- ### ATES Cold Withdraw Limitation Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Logic to determine if cold withdrawal is permitted for cooling or combined heating and cooling based on defined limits. ```text //ATES Cold Withdraw Limitation for Cooling if ( ColdTotalATESColdWithdrawLimitation >= ATESColdWithdrawLimit && ATESColdWithdrawLimitationCoolingOn == 1 ) { ATESColdWithdrawLimitationCooling = 1; } else { ATESColdWithdrawLimitationCooling = 0; } //ATES Cold Withdraw Limitation for Heating and Cooling if ( ColdTotalATESColdWithdrawLimitation >= ATESColdWithdrawLimit && ATESColdWithdrawLimitationHeatingCoolingOn == 1 ) { ATESColdWithdrawLimitationHeatingCooling = 1; } else { ATESColdWithdrawLimitationHeatingCooling = 0; } ``` -------------------------------- ### Heat Pump Heating and AE Cold Release Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Optional logic for managing AE cold release during heating operations. ```text //Heat Pump Heating and AE Cold Release ON (Optional) if ( HeatingDemand == 1 && CoolingDemand == 0 && HPHeatingATESColdDeposit == 0 && StorageColdTop < (TempOutside - 1) && AEColdReleaseOn == 1 ) { HPHeatingAEColdRelease = 1; } //Heat Pump Heating and AE Cold Release OFF (Optional) if ( HeatingDemand == 0 || CoolingDemand == 1 || HPHeatingATESColdDeposit == 1 || StorageColdTop > TempOutside || AEColdReleaseOn == 0 ) { HPHeatingAEColdRelease = 0; } ``` -------------------------------- ### Annual Counter Reset Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Resets all cold storage and exchange counters after a period of 8760 hours. ```text //Annual reset counters AnnualResetTimer = AnnualResetTimer + (1/2); if ( AnnualResetTimer >= (8760 * 60) ) { AnnualResetTimer = 0; ColdTotalATESColdDepositLimitation = 0; ColdTotalATESColdWithdrawLimitation = 0; ColdTotalAEColdDeposit = 0; ColdTotalAEColdWithdraw = 0; ColdTotalHPActiveColdDeposit = 0; } ``` -------------------------------- ### ATES Soil Volume Flow Control Logic Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Determines ATESSoilVolumeFlow based on deposit and withdraw conditions. If any cold deposit flag is active, uses ATESSoilVolumeFlowColdDeposit; else if any cold withdraw flag is active, uses negative ATESSoilVolumeFlowColdWithdraw; otherwise sets to 0. ```hysopt //ATES Soil Volume Flow if ( HPHeatingATESColdDeposit == 1 || AEColdDeposit == 1 || HPActiveColdDeposit == 1 ) { ATESSoilVolumeFlow = ATESSoilVolumeFlowColdDeposit; } else { if ( ATESCoolingColdWithdraw == 1 || ATESHeatingCoolingColdWithdraw == 1 || AEColdWithdraw == 1 ) { ATESSoilVolumeFlow = -ATESSoilVolumeFlowColdWithdraw; } else { ATESSoilVolumeFlow = 0; } } ``` -------------------------------- ### Heat Pump Delay Timer Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Increments the heat pump timer when pumps are active. ```text //HP delay if ( HPPumps == 1 ) { HPtimer = HPtimer + (1/2); } ``` -------------------------------- ### Heat Pump Cooling and AE Hot Release Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Optional logic for managing AE hot release during cooling operations. ```text //Heat Pump Cooling and AE Hot Release ON (Optional) if ( HeatingDemand == 0 && CoolingDemand == 1 && TempCoolingReturnAfterATES > TempHPColdSupplyMax && AEHotReleaseOn == 1 ) { HPCoolingAEHotRelease = 1; } //Heat Pump Cooling and AE Hot Release OFF (Optional) if ( HeatingDemand == 1 || CoolingDemand == 0 || TempCoolingReturnAfterATES < TempHPColdSupplyMin || AEHotReleaseOn == 0 ) { HPCoolingAEHotRelease = 0; } ``` -------------------------------- ### ATES Pump and Valve Control Source: https://knowledge.hysopt.com/__attachments/a_183855dde77327056107bb686e5b68876dd3c0d3a43417e603d80e75baab6b0b/example.txt?cb=54cc6e77add337ccc9affb2c3feb9a0d Manages the ATES pump, load/unload valves, and bypass valve based on system operational modes. ```text //ATES Pump if ( HPHeatingATESColdDeposit == 1 || AEColdDeposit == 1 || HPActiveColdDeposit == 1 ) { ATESPump = 1; } else { ATESPump = 0; } //ATES Load and Unload Valves if ( HPHeatingATESColdDeposit == 1 || AEColdDeposit == 1 || HPActiveColdDeposit == 1 ) { ATESLoadUnloadValves = 1; } else { if ( ATESCoolingColdWithdraw == 1 || ATESHeatingCoolingColdWithdraw == 1 || AEColdWithdraw == 1 ) { ATESLoadUnloadValves = -1; } else { ATESLoadUnloadValves = 0; } } //ATES Bypass Valve if ( ATESLoadUnloadValves == -1 ) { ATESBypassValve = 0; } else { ATESBypassValve = 1; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.