Skip to content

Python program to calculate require kW duty for cold storage rooms

Notifications You must be signed in to change notification settings

TNolan01/Cold_Store

Repository files navigation

Project No.3 based on Code Institute template for deployment.

logo

Cold Room Calculation Software:

https://cold-room-duty-calc.herokuapp.com/


Contents:
  1. Project Scope

  2. User Experience

  3. Project Design

  4. Structure

  5. Testing

  6. Validation

  7. Bugs & Issues

  8. Deployment & Cloning

  9. Technologies Used

  10. Project Credits


Project Scope:

The scope of this project is to create a simple command line driven program written in Python. I have written a Python program to calculate the power requirement in kilowatts of the refrigeration equipment needed for cold and freezer storage rooms.

The program intakes a number of variables from the user to make this calculation. The following list main criteria required to work out the refrigeration duty.

Data Required:


Length, width and height of the walls:

The dimensions of the refrigerated room are required to calculate the volume of the room and surface area of the walls.


Thickness of the insulated panel from which the room is constructed:

The user has numerical choice of 1 to 4 to choose the type of insulated panel from which the room is constructed. Each choice has an associated U valve for its insulation properties. The thicker the insulation, the lower the U value and hence the lower the amount of energy required to achieve the rooms target temperature.


Target temperature:

The target temperature is the temperature we want the room to achieve and hold. The temperature range for chill room is +2 to +4°C, the target temperature for a freezer room would be between -18 to -20°C. For particular applications or types of storage the target temperature can span between those two figures. The lower the target temperature is the higher the required power duty will be.


Floor insulation:

The user is offered a yes / no choice, is there insulation under the floor? If the floor has insulation it receives a better U value.


Quantity of product:

The quantity of product entering the refrigerated room in a 24 hour period is necessary as it forms a large part of the heat load. This is numerical figure and represents the quantity in kilograms


Temperature of the product:

The entry temperature of the product will form the large heat input value. The higher the temperature of the product the harder the refrigeration equipment will be required to work and ergo the higher power required.


Are there people in the room?:

Another potentially significant source of heat is the presence of people working inside the room. The heat generated needs to be countered.


Number of door openings:

The greater the number of door openings the larger the number of air changes. Refrigerated air leaving the room during door openings will be replaced with warm ambient air which will need to be chilled to the meet the target temperature, this will affect the required kW duty. A refrigerated room which experiences multiple loadings and unloadings during the day will need to work harder to replace the lost frigid air.


Back to Contents

UX / User Experience

User Stories

The target audience for this program would include the following people:

  • Refrigeration Engineers
  • Electrical Engineers
  • Cold Storage Suppliers
  • Transport Managers
  • Energy Management Engineers
  • Building and Facility Managers
  • Factories or Facilities with requirements for cold or frozen storage

Potential uses for this program:

The program is designed to calculate the kilowatt load of the refrigeration plant, equipment, necessary to cool or freeze product(s) from a particular entry temperature to an ideal holding temperature. With this information a user can do the following

  1. Correctly size the necessary refrigeration equipment.
  2. Design the most energy efficient room structure by running 'mock' room details to see how the construction of the room effects power requirements.
  3. Help the electrical engineers size the required cabling and electrical installation requirements to match the duty.
  4. Calculate running costs and potential energy savings.

Back to Contents

Project Design:


The project is a command line-based program run running in a compact terminal window. As the program is designed to be functional and practical design stylings are limited on this project.

I have used colorama to add some color changes to the text.

In instances where the user has entered and invalid input the text which prompts them to enter a value of the correct is red in color.

The text to prompt the user for input is blue.


Image of intro screen:

screen shot of intro screen


Program Structure:


The program follows a step through process. Asking the user for data, verifying the data, and then using the entered data in the appropriate calculation.


Path of program:

The program requests user input in this order.

  • Length of the coldroom in metres.
  • Width of the coldroom in metres.
  • Height of the coldroom in metres.
  • The program then displays the entered data back to the user to confirm if it is correct. If the user enters yes then the program continues, if not the user is asked to input the correct measurements.

screen shot of intro screen

  • If the user confirms the data entered is correct then the program calculates room volume and surface area of the roof, walls and ceilings.

screen shot of step 2 screen


  • The user now inputs the temperature in Celsius which is required in the room.
  • User is presented with the four choices for the insulated panel of which the room is constructed. The program looks for an option between 1 and 4.
  • Once the panel size is selected the user then confirms if the room has an insulated floor with a yes or no selection.

screen shot of step 3 screen


  • Now the program looks for details of the product entering the room. The user enters the quantity of the product entering the room every 24 hours and the entry temperature of that product.
  • The user then must confirm if the room has people working in it, yes or no. If the user submits 'yes' then they will be asked to enter the number of people.
  • Next, the program asks for an approximation for the number of door openings in a 24-hour period.

screen shot of step 4 screen


  • Once all details are entered the program returns a refrigeration duty loading in kilowatts based on the entered data. The program also updates a Google Sheet with the key data entered and the calculations made during the process.

screen shot of step 5 screen


Sample image of Google Sheet:

google_sheet

Back to Contents

Testing:


The program was tested for error handling by entering incorrect values at the user input stage.

Inputting a letter, L, instead of a numerical value:

testing_1
Inputting a number, 8, instead of a yes or no:

testing_2
Inputting a letter, t, instead of numerical value:

testing_3
Inputting a letter, r, and a number, 8, instead of number in the range 1 to 4:

testing_4
Inputting a letter, S, and a symbol, =, instead of positive numerical value:

testing_5
Inputting letters, H and x, instead of a numerical value:

testing_6
Inputting letters, P and GGG, instead of a yes or no value. Entering letter E and the ? symbol instead of a whole positive number:

testing_7
Inputting letters, JKLM, and symbols, ..., instead of a positive numerical value:

testing_8

Back to Contents

Validation:


The program was validated using PEP8 Online Python validator.

http://pep8online.com

The program was free of errors. There was one warning message which is addressed in the Bugs & Issues section

In addition as part of the validation and testing process I carried out two tests, one based on a room designed as a chill room and the second based on a freezer room.


Chill Room Test:

The criteria for the chill room Test is as follows:

  • Room Height at 4.0 metres
  • Room Width at 6.2 metres
  • Room Length at 5.5 metres
  • No floor insulation
  • Temperature of the room at 4°C
  • Product quantity at 250kg
  • Product temperature at 16°C
  • No people working in the room
  • 6no. door openings in a day

I carried out three tests with only variable changing being the panel size of which the room is constructed.

  1. Test 1 with 80mm PIR Panels
  2. Test 2 with 150mm PIR Panels
  3. Test 3 with 200mm PIR Panels

Google Sheet with 80mm Panels:

test1_criteria1
Google Sheet with 150mm Panels:

test1_criteria2
Google Sheet with 200mm Panels:

test1_criteria3

We can see the duty required declines on each test as the panel size increases and hence room becomes more energy efficient, requiring less duty to run.


Freezer Room Test:

The criteria for the freezer room Test is as follows:

  • Room Height at 4.12 metres
  • Room Width at 8.0 metres
  • Room Length at 4.7 metres
  • No floor insulation
  • Temperature of the room at -18°C
  • Product quantity at 300kg
  • Product temperature at 6°C
  • No people working in the room
  • 4no. door openings in a day

Again, I carried out three tests changing only the panel size of which the room is constructed.

  1. Test 1 with 100mm PIR Panels
  2. Test 2 with 150mm PIR Panels
  3. Test 3 with 200mm PIR Panels

Google Sheet with 100mm Panels:

test2_criteria1
Google Sheet with 150mm Panels:

test2_criteria2
Google Sheet with 200mm Panels:

test2_criteria3

Again, we can see the duty required declines when the panel size increases. The duty required being a lot higher than the chill room test as the freezer room requires more power to bring product from 6°C to -18°C.


Back to Contents

Bugs & Issues:


The initial validation process with PEP 8 produced numerous E501 errors. This error was generated by the length of multiple lines of code in the program.

These faults were addressed with the re-factoring of the code, however, this re-factoring generated multiple W503 warnings - 'line break before binary operator'. The issue being that '+' in the 'Fore +' which is a formatting option used as part of the Colorama package to add color to certain text was seen as a 'binary operator'.

Splitting a line of code with the '+' at the end or the start of a line would generate a warning.


Sample of initial code which generated the error:

pep8_sample

Based on this warning all relevant lines containing Fore code were altered and split at different points which eliminated multiple W503 and W504 warnings.

There is 1no. W503 warning remaining. This relates to a line of code which had to be split due to its length generating an E501 error. As the line was split in line with Python best practices in terms of readability, with the '+' operator to the front of the line, presenting the relevant calculation code more clearly. Having researched the warning I dont believe it to be an issue.

https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator

Image of PEP8 results:
pep8_results

Back to Contents

Deployment & Cloning:


Deployment:


Deployment of this project is carried out with Heroku, https://www.heroku.com . The deployment procedure is a follows.

  1. Log in to Heroku, creating a new account if you are not a current user.
  2. Click on the 'New' button in the top right corner and from the drop-down menu select 'Create new app'.
  3. Create an App name and select your Region from menu.
  4. Click the 'Create App' button.
  5. You will now have a menu for your new app. From here click on the Settings Tab and in the Config Vars. Click Reveal Config Vars.

  6. screen shot of Heroku app menu


  7. You need to create Config Vars for the Google API Credentials. Enter 'CREDS' as the KEY and then copy the entire contents of the creds.json file from GITPOD in the VALUE section, click the Add button to finish.
  8. A second Config Vars will be required. In the KEY box enter 'PORT' and in the VALUE box enter 8000 and then click the Add button.
  9. Scroll down to the Buildpacks section. Click Add buildpack. From the menu select Python and click Save Changes.
  10. Click Add buildpack again and Node.js. The Buildpacks must added in this order. If not, you can click on the packs and drag them to the correct order as shown in the image.

  11. screen shot of Heroku settings


  12. Return to menu at the top of the page and click on Deploy. Select Github as the deployment method.
  13. Confirm you want to connect to GitHub using your account credentials for Git. Once Heroku has access search for the relevant repository name and click the connect button.
  14. At the bottom of the deploy page select the preferred deployment type. You can use Manual Deploy which will deploy based on the current state of the selected Git branch. You can also Enable Automatic Deploys for automatic deployment when you push updates to Github selected branch.

  15. Back to Contents

    Cloning:

    Click here to retrieve pictures for some of the buttons and more detailed explanations of the above process.

    1. Log in to GitHub and locate the [GitHub Repository] https://github.com/TNolan01/Cold_Store
    2. Under the repository name, click "Code".
    3. To clone the repository using HTTPS. Under "HTTPS" copy the link.
    4. Go to your local terminal with git installed
    5. Change the current working directory to the location where you want the cloned directory to be created/located.
    6. Type git clone and then you paste in the URL you copied in Step 3.
    $ git clone https://github.com/TNolan01/Cold_Store
    
    1. Press Enter. Your local clone will be created.

    Back to Contents

    Technologies Used:

    The following technologies and libraries were used.

    • GITHUB
    • GITPOD
    • Heroku

    The program was written in Python with the following libraries.

    • Colorama
    • G Spread, Google Sheets
    • Google Auth
    • Coded using the Code Institute Python Essentials Template

    Back to Contents

    Project Credits:

    The following resources were used in the development of the program and require credit.

    • Code Institute 'Love Sandwiches' walkthrough
    • Stack Overflow
    • ThePythonCode.com

    Back to Contents

About

Python program to calculate require kW duty for cold storage rooms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages