Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page

How to set COP using PAT for Zone Equipment

Greetings, I am a novice OS user seeking to modify a PAT measure to include COP for equipment that was assigned via Zone and not Air Loop.
In my model I am using Cycling PTAC 1 Spd DX Clg Coil with capacity and ratings Autosized. I have tried using the OS measure "Set COP for Single Speed DX Cooling Units" and have discovered this measure will not work unless there are Air Loops. Can this Ruby code be easily changed so that the OS measure will search beyond Air Loops to include all Zone equipment as the EnergyPlus Measure does. I would use the E+ Measure but this will require setting all performance parameters and forgo Autosizing.

Thank you, Matt

2015-02-21 Comment Moved from Answer

https://www.dropbox.com/s/lrjz90otohn...

@David Goldwasser, I plugged the below into the template provided for Pat measures and was unsuccessful in attempting to run this code. Please find attached the complete code. Thank you, Matt

edit retag close merge delete

Sort by » oldest newest most voted

Matt, that is a good catch. The logic in the existing measures that change single and two speed dx COP's loops through air loops, and then supply components. You want to loop through zone equipment instead. The code below should do what you want. It is specifically looking for PTAC with single speed DX, but you could expand it to look for other types of objects.

# loop through zone equipment
model.getZoneHVACComponents.each do |component|

# see if it is a PTAC
if component.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized
runner.registerInfo("#{component.name} is a PTAC")
ptac = component.to_ZoneHVACPackagedTerminalAirConditioner.get

# get the cooling coil
coil_cooling = ptac.coolingCoil

# see if it is single speed dx
if coil_cooling.to_CoilCoolingDXSingleSpeed.is_initialized
single_speed_dx = coil_cooling.to_CoilCoolingDXSingleSpeed.get
runner.registerInfo("The intial COP is #{single_speed_dx.ratedCOP}")

# set cop
target_cop = 1.5 * single_speed_dx.ratedCOP.get # need the get because ratedCOP returns an optional, should check if it exists before doing a get
optionalDoubleCOP = OpenStudio::OptionalDouble.new(target_cop) # not many objects need this step, this is an odd one
single_speed_dx.setRatedCOP(optionalDoubleCOP)
runner.registerInfo("The adjusted COP is #{single_speed_dx.ratedCOP}")

else
# could add in elsif to look for other types of cooling coils
end

else
# could add in elsif to look for other kinds of zone equipment
end

end


Here is the documentation on ZoneHVACPackagedTerminalAirConditioner

And here is the documentation on CoilCoolingDXSingleSpeed

more

Hello David, I would be grateful if you could take a look at the measure. I attempted to modify the existing measure for changing COP of Cooling Coils in Air Loops but have run into some difficulty. My thought was to replace air loop with zone and AirLoopHVACs to ZoneHVACComponents. I may be fundamentally off-track based on the error statement: failed to compute arguments for measure: undefined method 'supplyComponents' for OpenStudio::Model::ZoneHVACComponent

https://www.dropbox.com/s/lrjz90otohn...

I try a simple fix of changing supplyComponents to ZoneHVACComponent. Tx.

( 2015-02-21 03:51:53 -0500 )edit

Your code is missing the run section as described here.

I think you also need the arguments section before it even if you don't have any arguments. You should be able to make a new measure with all the right parts using the "Create New Measure" button in PAT. It has a green plus. Then just remove the contents of the run section except for the "return true" which should be the last thing in that section. Then paste in the code show earlier. Ideally you will want to add an argument to set or alter the COP

( 2015-02-22 14:08:50 -0500 )edit

Hi David, I've converted the model back to using Air Loops. This will allow me to use a large variety of measures in Pat and is representative of the actual system. I need to do more investigating to understand how OA requirements are being handled during the shoulder seasons. The model calibrates nicely with the air loops and I have run a number of measures using PAT. I have been experiencing some crashing which has me confounded. I suspect PAT is losing track of the weather file location. I say this because I have run instances of measures that Fail and this seems to be the only reason

( 2015-02-22 16:01:09 -0500 )edit