Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Camille's profile - activity

2016-12-12 07:22:26 -0500 commented answer How to model air stratification in an industrial hall?

@ David, thanks a lot. I'm going to take a closer look at this! The diagram is amazing, I think I got it now, thanks again :)

2016-12-09 02:10:15 -0500 commented answer How to model air stratification in an industrial hall?

Good point ! Thank you :)

2016-12-08 12:57:29 -0500 received badge  Teacher (source)
2016-12-08 10:42:44 -0500 answered a question How to model air stratification in an industrial hall?

@David, I'm getting closer (at least, I hope so :) ) but I still have some problems with my E+ measure :

  • I don't understand what's the difference between OS measure and E+ measure
  • If I add a workspace object, is my measure E+ or OS?
  • How do you makeChoiceArgument for thermal spaces? I've seen that you already did it in several OS measures but I don't know how to deal with it in E+ measure. (You'll see I used one of your measure and I tried to adapt it for E+ measure ^^ but maybe I'm completely mistaken )

Could you help me? :)

Here is my code :

Thank you very much for your help

    # see the URL below for information on how to write OpenStudio measures
# http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/

# start the measure
class ChangeTheRoomType < OpenStudio::Ruleset::WorkspaceUserScript

# human readable name
def name
return "ChangeTheRoomType"
end

# human readable description
def description
return "Take stratification into account"
end

# human readable description of modeling approach
def modeler_description
return "By changing the room type to constant gradient (vertical)"
end

def arguments(workspace)
args = OpenStudio::Ruleset::OSArgumentVector.new

#----------------------THERMAL ZONE INTO ARGUMENTS------------------------------------------
#populate choice argument for thermal zones in the model
zone_handles = OpenStudio::StringVector.new
zone_display_names = OpenStudio::StringVector.new

#putting zone names into hash
zone_hash = {}
workspace.getObjectsByType("Zone".to_IddObjectType) do |zone|
  zone_hash[zone.name.to_s] = zone
end

#looping through sorted hash of zones
zone_hash.sort.map do |zone_name, zone|
  zone_handles << zone.handle.to_s
  zone_display_names << zone_name
end

#make an argument for zones
zone = OpenStudio::Ruleset::OSArgument::makeChoiceArgument("zone", zone_handles, zone_display_names, true)
zone.setDisplayName("Choose Thermal Zones to add zone ventilation to.")
args << zone
#----------------------------NAME ARGUMENT------------------------------------------
nameRoomAirModel = OpenStudio::Ruleset::OSArgument::makeStringArgument('nameRoomAirModel', true)
nameRoomAirModel.setDisplayName('Name the pattern')
args << nameRoomAirModel

#-------------------------------TEMPERATURE INPUT INTO ARGUMENTS -------------------------------
thermOffset = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('thermOffset',true)
thermOffset.setDisplayName('thermostat Offset')
thermOffset.setDefaultValue(0.0)
args << thermOffset

returnAirOffset = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('returnAirOffset',true)
returnAirOffset.setDisplayName('return Air Offset')
returnAirOffset.setDefaultValue(0.0)
args<<returnAirOffset

exhaustAirOffset = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('exhaustAirOffset',true)
exhaustAirOffset.setDisplayName('exhaust Air Offset')
exhaustAirOffset.setDefaultValue(0.0)
args << exhaustAirOffset

return args
end 

#When the measure is run    
def run(workspace,runner,user_arguments)
super(workspace, runner, user_arguments)

# errors management
if not runner.validateUserArguments(argumentents(workspace),user_arguments)
    return false
end

#assign to variables
nameRoomAirModel=runner.getStringArgumentValue('nameRoomAirModel',user_arguments)
zone=runner.getOptionalWorkspaceObjectChoiceValue('zone',user_arguments, workspace)
thermOffset=runner.getDoubleArgumentValue('thermOffset', user_arguments)
returnAirOffset=runner.getDoubleArgumentValue('returnAirOffset',user_arguments)
exhaustAirOffset=runner.getDoubleArgumentValue('exhaustAirOffset',user_arguments)

#Array to hold new IDF Objects = RoomAirModelType here
string_RoomAirModelType=[]

#this instruction doesnt use the arguments, it s a test
string_RoomAirModelType << "
RoomAir:TemperaturePattern:UserDefined,
#{nameRoomAirModel} ,   ! Name
#{zone} ,               ! Zone Name (thermal zone) = user choice
AllwaysOn,          ! Availability Schedule Name = integer used need to be the same as the RoomAir:TemperaturePattern:ConstantGradient (here is 1)
Roomair Pattern 1;      ! Pattern Control Schedule Name"

#Instruction in EP
string_RoomAirModelGradient=[]
#this instruction doesnt use the arguments, it s a test
string_RoomAirModelGradient << "
RoomAir:TemperaturePattern:ConstantGradient,
StratProduction,        !- Name
1,                      !- Control Integer for Pattern Control Schedule Name
#{thermOffset},         !- Thermostat Offset {deltaC}
#{returnAirOffset} ,    !- Return Air Offset {deltaC ...
(more)
2016-12-08 01:52:43 -0500 commented answer How to model air stratification in an industrial hall?

Thank you David ! When my measure is finished I'll share it with the community for sure! I'll ask you how to do it though :)

2016-12-08 01:47:27 -0500 commented answer How to model air stratification in an industrial hall?

Thank you very much for your help ! I totally forgot about it !

2016-12-08 01:47:18 -0500 received badge  Supporter (source)
2016-12-02 13:35:57 -0500 received badge  Student (source)
2016-12-02 10:32:54 -0500 asked a question How to model air stratification in an industrial hall?

Hi everyone, I'm new with OpenStudio and EnergyPlus. I'm trying to do an energy simulation of an industrial hall. The height of this building is 7m so the air stratification is really important. Do you know how to deal with it? I've tried to write an energyPlus measure with the RoomAir:TemperaturePattern:ConstantGradient. Here is my code : Thank you very much for your help

    class ChangeTheRoomType < OpenStudio::Ruleset::ModelUserScript

def name
    return "Taking stratification into account"
    end

def description
    return "Change the room type in order to model air stratification with a certain temperature gradient"
    end

# arguments description
def argments(model)
    ThermOffset = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('ThermOffset',true)
    ThermOffset.setDisplayName('Thermostat Offset')
    ThermOffset.setDefaultValue(0.0)
    args<<ThermOffset

    ReturnAirOffset = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('ReturnAirOffset',true)
    ReturnAirOffset.setDisplayName('Return Air Offset')
    ReturnAirOffset.setDefaultValue(0.0)
    args<<ReturnAirOffset

    ExhaustAirOffset = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('ExhaustAirOffset',true)
    ExhaustAirOffset.setDisplayName('Exhaust Air Offset')
    ExhaustAirOffset.setDefaultValue(0.0)
    args<<ExhaustAirOffset

    return args
    end 

#When the measure is run    
def run(model,runner,user_arguments)
    super(model, runner, user_arguments)

    # errors management
    if not runner.validateUserArguments(argumentents(model),user_arguments)
        return false
    end

    #assign to variables
    ThermOffset=runner.getDoubleArgumentValue("ThermOffset", user_arguments)
    ReturnAirOffset=runner.getDoubleArgumentValue("ReturnAirOffset",user_arguments)
    ExhaustAirOffset=runner.getDoubleArgumentValue("ExhaustAirOffset",user_arguments)

    #Instruction in EP
    Instruction=[]
    #this instruction doesnt use the arguments, it s a test
    Instruction = "
  RoomAir:TemperaturePattern:ConstantGradient,
    StratProduction,  !- Name
    1,                   !- Control Integer for Pattern Control Schedule Name
    0.0,                     !- Thermostat Offset {deltaC}
    0.0,                     !- Return Air Offset {deltaC}
    1.5,                     !- Exhaust Air Offset {deltaC}
    0.5;                     !- Temperature Gradient {K/m}"

    return true
end
ChangeTheRoomType.new.registerWithApplication