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

Revision history [back]

click to hide/show revision 1
initial version

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

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