https://cold-room-duty-calc.herokuapp.com/
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.
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.
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
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
- Correctly size the necessary refrigeration equipment.
- Design the most energy efficient room structure by running 'mock' room details to see how the construction of the room effects power requirements.
- Help the electrical engineers size the required cabling and electrical installation requirements to match the duty.
- Calculate running costs and potential energy savings.
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:
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.
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.
- If the user confirms the data entered is correct then the program calculates room volume and surface area of the roof, walls and ceilings.
- 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.
- 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.
- 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.
Sample image of Google Sheet:
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:
Inputting a number, 8, instead of a yes or no:
Inputting a letter, t, instead of numerical value:
Inputting a letter, r, and a number, 8, instead of number in the range 1 to 4:
Inputting a letter, S, and a symbol, =, instead of positive numerical value:
Inputting letters, H and x, instead of a numerical value:
Inputting letters, P and GGG, instead of a yes or no value. Entering letter E and the ? symbol instead of a whole positive number:
Inputting letters, JKLM, and symbols, ..., instead of a positive numerical value:
The program was validated using PEP8 Online Python validator.
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.
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.
- Test 1 with 80mm PIR Panels
- Test 2 with 150mm PIR Panels
- Test 3 with 200mm PIR Panels
Google Sheet with 80mm Panels:
Google Sheet with 150mm Panels:
Google Sheet with 200mm Panels:
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.
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.
- Test 1 with 100mm PIR Panels
- Test 2 with 150mm PIR Panels
- Test 3 with 200mm PIR Panels
Google Sheet with 100mm Panels:
Google Sheet with 150mm Panels:
Google Sheet with 200mm Panels:
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.
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:
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
Deployment of this project is carried out with Heroku, https://www.heroku.com . The deployment procedure is a follows.
- Log in to Heroku, creating a new account if you are not a current user.
- Click on the 'New' button in the top right corner and from the drop-down menu select 'Create new app'.
- Create an App name and select your Region from menu.
- Click the 'Create App' button.
- 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.
- 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.
- 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.
- Scroll down to the Buildpacks section. Click Add buildpack. From the menu select Python and click Save Changes.
- 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.
- Return to menu at the top of the page and click on Deploy. Select Github as the deployment method.
- 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.
- 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.
- Log in to GitHub and locate the [GitHub Repository] https://github.com/TNolan01/Cold_Store
- Under the repository name, click "Code".
- To clone the repository using HTTPS. Under "HTTPS" copy the link.
- Go to your local terminal with git installed
- Change the current working directory to the location where you want the cloned directory to be created/located.
- Type
git clone
and then you paste in the URL you copied in Step 3. - Press Enter. Your local clone will be created.
- GITHUB
- GITPOD
- Heroku
- Colorama
- G Spread, Google Sheets
- Google Auth
- Coded using the Code Institute Python Essentials Template
- Code Institute 'Love Sandwiches' walkthrough
- Stack Overflow
- ThePythonCode.com
Click here to retrieve pictures for some of the buttons and more detailed explanations of the above process.
$ git clone https://github.com/TNolan01/Cold_Store
The following technologies and libraries were used.
The program was written in Python with the following libraries.
The following resources were used in the development of the program and require credit.