University of Ghana http://ugspace.ug.edu.gh DECISION SUPPORT SYSTEM FOR SIZING DRYING BINS, FAN SELECTION AND DRYING PARAMETERS DETERMINATION FOR SELECTED GRAINS BY CEDRIC KPAKPO PARKER – ALLOTEY (10877077) THIS THESIS IS SUBMITTED TO THE UNIVERSITY OF GHANA, LEGON IN PARTIAL FULFILMENT OF THE REQUIREMENT FOR THE AWARD OF MA IN AGRICULTURAL ENGINEERING DEGREE DEPARTMENT OF AGRICULTURAL ENGINEERING, UNIVERSITY OF GHANA LEGON JANUARY 2022 University of Ghana http://ugspace.ug.edu.gh DECLARATION I, CEDRIC KPAKPO PARKER-ALLOTEY, author and conductor of this project do hereby declare that this work, except for references cited, was done entirely by me at the University of Ghana from JUNE 2021 to JANUARY 2022, under the supervision of PROF. RICHARD J. BANI and DR. EMMANUEL ESSIEN. This work has never been presented either in whole or in part for any degree of the University of Ghana or elsewhere. i University of Ghana http://ugspace.ug.edu.gh DEDICATION This project is dedicated to God Almighty, my Lord and Saviour, my mother, Fanny Brown, and late father, Seth Parker-Allotey. ii University of Ghana http://ugspace.ug.edu.gh ACKNOWLEDGEMENTS First, I will exalt the Name of the Almighty God, my Master, Redeemer, and Friend. It is by His grace, strength, wisdom, and favour that I have been able to finish this project. To Him be all the Glory. I also thank Prof. Richard J. Bani and Dr. Emmanuel Essien, my project supervisors, whose guidance, and wisdom have been of immense help in completing this project. I am also indebted to Mr. Titus Anang, whose help has been massive. Lastly, I thank all who helped me in the undertaking of this project in one way or the other. iii University of Ghana http://ugspace.ug.edu.gh ABSTRACT Grain drying is a very important step in the storage and handling of grains. Computer models have been created over the past years to optimise and ease the amount of work and calculations that are invested into the planning, economics building, operation and management of drying systems and facilities. Although there have been advancements in computerised systems and programmes, decision making when it comes to planning, costing, construction, management, and operation of drying systems can still prove to be a strenuous task to undertake. Also, most computerised systems require in-depth knowledge in drying to operate. Most of these systems do not also provide features which allow for economic decision making. There is therefore still the need to develop a new programme which is relatively easier to use and can further optimise the decision-making process. A computer programme was developed using python that calculates the bin diameter, grain depth, airflow and airflow rate, and fan horsepower using the specific grain to be dried, the desired volume, drying method, and budget type as inputs. Various formulas and assumptions were used to perform calculations for each parameter. The programme was created to provide realistic estimates for each drying parameter depending on the inputs provided by the user. The programme also provides a database that allows users to select fans based on the calculated fan horsepower. The programme created was successful in performing calculations for all the parameters listed above. This programme simplified certain calculations that must be made during the decision- making process, thereby allowing for its use by people with shallow knowledge in drying systems decision making with respect to budgeting. iv University of Ghana http://ugspace.ug.edu.gh TABLE OF CONTENTS DECLARATION....................................................................................................................... i DEDICATION......................................................................................................................... ii ACKNOWLEDGEMENT ..................................................................................................... iii ABSTRACT ............................................................................................................................ iv TABLE OF CONTENTS ....................................................................................................... v List of Figures ...................................................................................................................... vii List of Tables ........................................................................................................................ vii 1. INTRODUCTION............................................................................................................... 1 1.1 Background ..................................................................................................................... 1 1.2 Statement of Problem and Justification ........................................................................... 4 1.3 Objectives ........................................................................................................................ 5 2. LITERATURE REVIEW .................................................................................................. 6 2.1 System Analysis and Design ........................................................................................... 6 2.2 Systems Design and Engineering .................................................................................... 7 2.3 Modelling and Simulation ............................................................................................... 7 2.4 Decision Support System ................................................................................................ 8 2.4 Decision Support System Used for Grain Drying ........................................................... 9 3. METHODOLOGY ........................................................................................................... 13 3.1 Categorization of Calculations ...................................................................................... 13 v University of Ghana http://ugspace.ug.edu.gh 3.2 Computer Program and User Interface .......................................................................... 13 3.3 Determination of Bin Diameter and Grain Depth ......................................................... 14 3.4 Determination of Airflow .............................................................................................. 15 3.5 Determination of Horsepower Rating of Fans .............................................................. 17 4. RESULTS AND DISCUSSION ....................................................................................... 21 Simulation 1 ........................................................................................................................ 21 Simulation 2 ........................................................................................................................ 22 Simulation 3 ........................................................................................................................ 23 Simulation 4 ........................................................................................................................ 24 Simulation 5 ........................................................................................................................ 25 5. CONCLUSION AND RECOMMENDATIONS ............................................................ 27 5.1 Conclusion ..................................................................................................................... 27 5.2 Recommendation ........................................................................................................... 27 REFERENCES ...................................................................................................................... 29 APPENDIX ………………………………………………………………………………. 34 vi University of Ghana http://ugspace.ug.edu.gh Table of Figures Figure 1 - Grain bin volume calculator .................................................................................... 11 Figure 2 - Drying DSS Flowchart ............................................................................................ 20 Figure 3 - Inputs for Simulation 1............................................................................................ 58 Figure 4 - Outputs for Simulation 1 ......................................................................................... 59 Figure 5 - PDF exportation of results ...................................................................................... 60 List of Tables Table 1: Conversion factors for various grains ........................................................................ 15 Table 2: Representative airflow rates for grain drying methods .............................................. 16 Table 3: A and B constants for various grains ......................................................................... 18 Table 4: Inputs for Simulation 1 .............................................................................................. 21 Table 5: Outputs for Simulation 1 ........................................................................................... 21 Table 6: Inputs for Simulation 2 .............................................................................................. 22 Table 7: Outputs for Simulation 2 ........................................................................................... 22 Table 8: Inputs for Simulation 3 .............................................................................................. 23 Table 9: Outputs for Simulation 3 ........................................................................................... 23 Table 10: Inputs for Simulation 4 ............................................................................................ 24 Table 11: Outputs for Simulation 4 ......................................................................................... 24 Table 12: Inputs for Simulation 5 ............................................................................................ 25 Table 13: Outputs for Simulation 5 ......................................................................................... 25 vii University of Ghana http://ugspace.ug.edu.gh 1. INTRODUCTION 1.1 Background Drying is defined as the removal of moisture from a material using heat (Basic Agricultural Study, 2020). In agriculture, commodities are dried for several reasons. Some of these reasons are to preserve the commodity by inhibiting bacterial growth as well as increasing shelf life (Kennedy, 2018), to decrease the size of commodities and make storage easier (Robbins, 2019), and to provide more prospects in processing. Grain drying is a very important step in the storage and handling of grains. Liu et al. (2022) mentioned that the process of drying grains is a delicate heat and mass transfer process. Grains are normally dried and stored in round bins or flat storage systems. Drying of grains can be done using the following methods as listed by Loewer et al., (1994): natural air drying, low temperature drying, layer drying, batch-in-bin drying, continuous flow drying, in-bin continuous flow drying, and combination drying. For the purposes of this project, low temperature drying, layer drying, and batch-in-bin drying will be defined. In low temperature drying, a fan is used to push air through the grain to be dried. While the fan does this, the air is heated to a temperature of 10 ˚F (-12.22 ˚C) or lower. This heating is achieved with the use of an auxiliary heater, which is usually driven by electricity. Due to this, low temperature drying is sometimes referred to as electric drying (Sadaka et al., 2017). The working principle of layer drying is very similar to that of low temperature drying. The difference here, however, is that for layer drying, grains are loaded into the drying bin in layers. These layers are typically about four (4) to five (5) feet (1.2192 to 1.524 m) in depth. When drying begins with the first layer, a region of drying is set up, and makes its way through the grains (Hellevang, 1994). 1 University of Ghana http://ugspace.ug.edu.gh According to Loewer et al., (1994), batch-in-bin drying involves daily drying of a batch of grains in a drying bin at a usual depth of 2.5 to 4 ft (0.762 to 1.2192 m). After drying is done, the grains are cooled and loaded into storage bins prior to the next day’s harvest. Some examples of grains that are dried using these methods are maize, wheat, sorghum, soybean, and rice. Maier and Bakker-Arkema (2002) enunciate that the safe moisture contents required for storage of grains are dependent on the geographical site of storage, the amount of time the grain will spend in storage, the type of grain to be stored, and the storage facility to be used. Computer models have been created over the past years to optimise and ease the amount of work and calculations that are invested into the planning, economics building, operation and management of drying systems and facilities. Khatchatourian et al., (2013) stated that mathematical modelling and computer simulations are extensively employed in the design of dryers and development of efficient grain drying control systems. Computer models make use of mathematical calculations and modelling to develop various solutions for specific drying problems or for the estimation and determination of various parameters needed to achieve specific drying needs. Computer models then create simulations based on these mathematical calculations and models to enable users make decisions, further calculations, and constructions. Examples of computer programs created in past years are the FANMATCH and NATAIR models by Thompson (1975). The FANMATCH model calculates the horsepower requirements for a fan moving a specified volume of air per bushel of grain, and the NATAIR model estimates the time taken to dry the top layer of grain in natural air or low temperature drying configurations, for a desired or final moisture content. 2 University of Ghana http://ugspace.ug.edu.gh Other examples include the CROSSFLOW model by Thompson et al., (1968). This model predicts the drying rate and drying time, the amount of energy required to achieve drying, and the costs incurred when drying maize or grain sorghum. The CACHE model (Loewer et al., 1976) analyses the economics of owning a facility for the drying and storage of grains with or without feed processing. Other existing examples include LAYERD (Bridges et al., 1982), CIRCLE (Loewer et al., 1986), DUCT (Bridges et al., 1988), and so on. In recent years, several further advancements have been made in computer modelling for grain drying systems. Some of these new models are improvements of some of the earlier models mentioned above. Some models also make use of a combination of some of the models mentioned above to provide a wider range of operations and more effective and accurate simulations. An example of such programmes is the LINSEC programme developed by Valente et al., (2012), which incorporates the CROSSFLOW model by Thompson et al., (1968) in its operation. Another example of a recent advancement in computer modelling programmes for drying is the Ag Decision Maker developed by Edwards (2014). This model enables one to calculate and project the costs that will be incurred when drying corn, depending on the method of drying used. While computer models may not be exactly accurate, in that they are mere simulations of what happens, they provide substantial data which when adjusted and used in real conditions, produce very accurate solutions to drying problems. Computer models allow for relatively easier decision making, since they take into consideration all the possible variables that play a 3 University of Ghana http://ugspace.ug.edu.gh role in the drying process and develop optimal solutions for them. Some of these variables may be miscalculated, misplaced, or even forgotten due to human limitations and error. Computer models therefore help make management of drying facilities easier, draft accurate budgets, construct better structures, and devise more efficient drying operations when put in use. 1.2 Statement of Problem and Justification A lot of farmers in Ghana encounter problems when making decisions concerning drying of grains and drying operations in general. There are several parameters to be considered, and a lot of research to be done when making these decisions. Some of these parameters include the variety of grain to be dried, the type of drying method to be used, the cost of construction, operation and management of the drying facility, the equipment to be used, the energy requirements of the entire system, weather conditions of the geographical location where the drying facility is to be sited, the rate of airflow needed to dry a grain mass, the static pressures involved, and so on. This task can prove to be herculean and time consuming if one must undertake it without any form of computerised help, since there are several variables and constraints to be factored into the decision-making process. This may even lead to error, oversight, and the development of inefficient systems, if care is not taken. Although there have been advancements made in computerised systems and programmes, decision making when it comes to planning, costing, construction, management and operation of drying systems can still prove to be an arduous task to undertake. Also, most computerised systems require in-depth knowledge in drying to operate. Most of these systems do not also provide features which allow for economic decision making. There is therefore still the need to develop a new programme which is relatively easier to use and can further optimise the decision-making process. This programme therefore aimed to simplify certain calculations that 4 University of Ghana http://ugspace.ug.edu.gh must be made during the decision-making process, thereby allowing for its use by people with shallow knowledge in drying systems. It also allows for decision making with respect to budgeting. 1.3 Objectives The main objective of this project is to develop a decision support system which will aid in the sizing of round bins for drying, selection of drying fans, and estimation of energy requirements for low temperature drying, layer drying (deep bed and thin layer drying), and batch-in-bin drying of shelled corn, rough rice (paddy rice) and soybean. The specific objectives are as follows: 1. Develop an algorithm that determines bin diameter and grain depth using the desired volume of produce to be dried. 2. Develop an algorithm for the determination of airflow and airflow rate to be delivered against the grains to be dried. 3. Develop an algorithm for the determination of horsepower rating of fans to be selected for drying. 4. Create a user-friendly input-output computer programme which aids in decision making using the above algorithms. 5 University of Ghana http://ugspace.ug.edu.gh 2. LITERATURE REVIEW 2.1 Systems Analysis and Design The word "systems analysis" refers to the study of real-world processes. It necessitates the dissection of problems into their constituent elements and the formulation of a conceptual understanding of the situation (Mason and Conger, 1994). According to Ramakrishnan (2012), systems analysis and design (SAD) is a general word encompassing approaches for designing high-quality information systems that blend information technology, people, and data to satisfy business goals. Rasmussen (2003) defines a system as a collection of interconnected components that work together to achieve a specific goal. Shafaat and Kenley (2015) believe that as essential components of the outcomes for each intended option, systems analysis examines cost, schedule, risk, and other performance criteria. Modelling, activity-based costing, life cycle costing, levelling, life cycle analysis, data models, object-oriented modelling, event modelling, systems engineering, risk management, probabilistic modelling, financial modelling, design, and other well-known procedures that may have been used to consider a system from a particular perspective may all be included in systems analysis (Gregory, 2005). Minder (1973) recounts that modern systems analysis was established in the computer field. Others, especially industrial engineers, found parallels between their own "efficiency" techniques and systems analysis, which they embraced and developed into non-computer fields. The study, design, assessment, and control of complex systems emerged from systems analysis. Engineers, however, limited its growth to the scientific approach. By the early 1960s systems analysis had evolved into an engineering field. 6 University of Ghana http://ugspace.ug.edu.gh According to Pienaar (2011), however, systems analysis is widely considered to be inspired by operations research, which emerged at the start of World War II. 2.2 Systems Design and Engineering Faisander and Adcock (2021) define design as the process of constructing, expressing, recording, and conveying a system's layout through a comprehensive set of design features stated in a format that can be implemented. Modelling, analysis, synthesis, and optimization are all part of the system design process (Sieniutycz, 2020). According to Friedenthal et al., (2015), systems engineering is an interdisciplinary approach to developing balanced system solutions that meet the varying needs of stakeholders. To achieve this balance and reduce risks that could jeopardize the project's success, systems engineering incorporates both managerial and technical processes. 2.3 Modelling and Simulation Gorinevsky (2005) stated that a mathematical conceptualisation (or representation) of a system is called a model. A system may be designed and analysed using models. Models are not entirely precise. Simulation is the process of studying a dynamic behaviour of the system and predicting the effects of changes by utilizing computer-based models. Simulating complex systems is a useful tool for understanding, creating, and operating them. It's a tried-and-true technique to test new processes and ideas without having to spend money on costly new programs or models (Reynolds, 2018). 7 University of Ghana http://ugspace.ug.edu.gh A computer can be used to create a mathematical model that contains important parameters of the physical system in modelling and simulation. The mathematical model is used to create a virtual representation of the physical system, and circumstances are applied to create the desired experiment. The simulation begins – that is, the computer determines the consequences of those conditions on the mathematical model, and produces results, according to the application. 2.4 Decision Support Systems With the advancement of modelling and simulation technology over the years, decision making tools have been created to aid in estimation and calculation of various parameters, depending on the area of research or discipline. These decision-making tools are termed as Decision Support Systems (DSS). According to Jain and Raju (2016), a well-designed decision support system is an intuitive software-based system that assists decision makers in combining meaningful information from a variety of sources, including raw data, documents, personal knowledge, and business models, in order to ascertain and solve issues and make choices. A DSS consists of some basic components. These components are outlined by Olavsrud (2020) as follows: • DSS Database: It consists of data from within the company, data created by programs, and external data acquired from third parties or gathered from the internet. The DSS database will range in size from a small, stand-alone system to a big data warehouse, depending on the requirements. • DSS Software System: The software system is based on a model that includes user objectives and decision scope. The quantity and types of models used in the DSS are determined by the goal of the DSS. 8 University of Ghana http://ugspace.ug.edu.gh • DSS User Interface: Users can interact with and view outcomes using panels and other user interfaces. Decision support systems have several benefits. Some of these benefits are documented by Alexander (2002): • The ability of a decision maker to assimilate information and knowledge is enhanced by decision support systems. • Decision support systems reduce the time it takes to make a choice. • Decision support systems enhance the consistency of a decision-making process or result. • They increase the capacity of the decision maker to handle large-scale, time-consuming, and complicated challenges. • They motivate the decision-maker to experiment and acquire knowledge. 2.4 Decision Support Systems Used for Grain Drying A MATLAB-based computer application has been created by researchers in the South Dakota State University (2021) with the aim of estimating drying performance in a continuous flow dryer. It allows the user to forecast a grain dryer's drying output for a variety of inbound corn moistures and dryer operation settings. The application processes systems of numerically relying algorithms based on the input and correlated partial differential equations describing the interaction of mass, energy, and moisture escape rates using a graphical user interface (GUI) that enables the user to readily define the required test criteria. The outputs include a series of graphical charts and estimated performance conditions for the drying column, including air temperature, grain temperature, and grain moisture content. Estimated drying time, drier throughput, and energy demands to dry the grain are added outputs. The application, 9 University of Ghana http://ugspace.ug.edu.gh however, requires in-depth knowledge in drying systems to operate and interpret results. It also deals with only one crop (corn) and one drying method (continuous flow drying). To simulate the operation of continuous flow grain dryers, a mathematical model and a computer software were created by Winik et al. (2013). Simulations were run for a variety of continuous flow dryer methods, including an energy-saving plan that recycles air for cooling and grain drying. The iterative technique was utilized to identify the starting conditions at the entry to each segment of the dryer. Computer simulations allowed for the evaluation of each system's energy efficiency, and the time of the drying process for geometry and the starting moisture content of the grains selected. This application, though efficient, also deals with just one drying method, making it limited in its use. Courtois (1995) developed a Computer-Aided Design (CAD) software specially for French mixed-flow corn dryers, which also forecasts wet milling quality. For the software to work efficiently, some strategies were adopted at certain levels in the software. These strategies are listed below: • Linkage of quality and drying models. • An innovative steady-state integral approach that takes air recirculation and final moisture content enhancement into consideration. • Limiting the number of equations using a compartmentalised method. • For numerical integration, a novel adaptive-step approach has been developed. • Assumptions to reduce the number of variables in equations. This software also requires in-depth knowledge to operate. Another decision support system worthy of note is the LINSEC programme developed by Valente et al. (2012). The programming language used for the development of this programme was Visual Basic 6.0. The goals of this programme were to utilise the Thompson model to 10 University of Ghana http://ugspace.ug.edu.gh simulate high temperature drying of grains, establish a suitable language for the generation of drying models, and create a graphical user interface with the purpose of making it easier for users to appreciate. LINSEC was extremely useful for modelling and simulating drying systems, as well as generating simulated values that were quite near to reality. During the modelling of various types of dryers, LINSEC was extremely adaptable and user-friendly. This program, however does not allow decision making with respect to budgeting. A grain bin volume calculator was created by the Institute of Agriculture and Natural Resources of the University of Nebraska – Lincoln (2017). The programme was written in HTML and calculates bin volume for both round and rectangular drying bins. For round bins, the calculator takes the radius and height of the bin to calculate the volume of grain the bin can hold. For rectangular bins, the inputs are the length, width, and height of the bin. All dimensions for the inputs are in feet (ft). The calculated volume of the bins is displayed in bushels. Figure 1 below shows the user interface of this programme: Figure 1 - Grain bin volume calculator 11 University of Ghana http://ugspace.ug.edu.gh While this programme is relatively easy to use, it also does not provide features for economic decision making. It also requires internet access to use. This means that it cannot be used in locations without access to the internet. 12 University of Ghana http://ugspace.ug.edu.gh 3. MATERIALS AND METHODS 3.1 Categorisation of Calculations All calculations in this project were done according to three categories of budgets that the user may have: low, medium, and high budget. After the calculations have been done, the user can choose their preferred option. It is important to note that the results of these calculations are simulated values. 3.2 Computer Programme and User Interface A computer programme was written, and a user interface was designed in Python. With the required inputs, calculations will be done by the computer, and the results will be displayed on the interface. The inputs are as follows: • Desired grain to be dried (shelled corn, rough rice, or soyabean) • Desired volume to be dried (capacity) – This value can be entered in either metric tonnes or bushels • Drying method (low temperature drying, layer drying, or batch-in-bin drying) • Type of budget (low, medium, or high budget) The outputs generated from these inputs are as follows: • Bin diameter in feet (ft) and metres (m). • Grain depth in feet (ft) and metres (m) • Airflow in cfm • Airflow in cfm/ft2 • Horsepower rating of the fan(s) to be used for drying 13 University of Ghana http://ugspace.ug.edu.gh Based on the value of the calculated horsepower rating of the fan, one can select a fan from a compiled database of fans listed on the interface. The database was retrieved from the online fan selection tool created by Wilcke and Morey (2018). 3.3 Determination of Bin Diameter and Grain Depth A database was created which consists of bushel capacities for round bins, with grain depths ranging from 0.5 ft (0.15 m) to 30 ft (9.14 m), with 0.5 ft increments, and bin diameters ranging from 15 ft (4.572 m) to 60 ft (18.288 m), with 3 ft (0.9144 m) increments, as computed by Loewer et al., (1994). This database is based on the formula below: 𝑪𝒂𝒑𝒂𝒄𝒊𝒕𝒚 (𝒃𝒖𝒔𝒉𝒆𝒍𝒔) = 𝑩𝒊𝒏 𝒗𝒐𝒍𝒖𝒎𝒆 × 𝟎. 𝟖 ( 1 ) Where: 𝑩𝒊𝒏 𝒗𝒐𝒍𝒖𝒎𝒆 = 𝝅𝒓𝟐𝒉 (𝒇𝒕𝟑) ( 2 ) 𝒃𝒊𝒏 𝒅𝒊𝒂𝒎𝒆𝒕𝒆𝒓 𝒓𝒂𝒅𝒊𝒖𝒔 𝒐𝒇 𝒃𝒊𝒏 = 𝒓 = 𝟐 ( 3 ) The desired volume to be dried can be entered in either bushels or metric tonnes (mt). All calculations were made in bushels. Due to this, when a value is inserted in metric tonnes, it is converted into bushels by multiplying the value by a conversion factor before further calculations take place. The conversion factors for each grain are listed in table 1 as follows: 14 University of Ghana http://ugspace.ug.edu.gh Table 1: Conversion factors for various grains Grain Conversion Factor Shelled Corn 39.368 Rough Rice 48.992 Soybean 36.7437 Also, when the desired volume is entered, the programme combs through the database and returns the corresponding bin diameter and grain depth. In cases where the desired volume is not found in the database, the programme returns values of the bin diameter and grain depth from the database that are closest to the exact value. These values are rounded up to the closest values found in the database. Hence it gives an estimate of the bin diameter and grain depth to be used for such a volume. For example, if the desired volume entered is 100 bushels, the program will return a bin diameter of 18 ft and a height of 0.5 ft. In the database, the actual volume that corresponds to these returned values is 102 bushels but since 100 bushels is not in the database it returns the value for 102 bushels. The program returns a value for the bin diameter in both feet and metres. All calculations in the programme were made in feet, therefore, to obtain values in metres, the values in feet are multiplied by 0.3048. 15 University of Ghana http://ugspace.ug.edu.gh 3.4 Determination of Airflow The required total airflow (cfm) to be delivered by the fans for drying of the grain were determined by multiplying the volume of grain to be dried by the representative airflow rates for each grain drying method listed. The representative airflow rates (cfm/bu) were obtained from Loewer et al. (1994). They are listed in table 2 below: Table 2: Representative airflow rates for grain drying methods Drying Method Range (cfm/bu) Low Temperature Drying 1 - 3 Layer Drying 1 - 3 Batch-in-bin Drying 5 - 15 The formula for finding the total airflow (cfm) is shown below: 𝑻𝒐𝒕𝒂𝒍 𝒂𝒊𝒓𝒇𝒍𝒐𝒘 (𝒄𝒇𝒎) = 𝒗𝒐𝒍𝒖𝒎𝒆 𝒐𝒇 𝒈𝒓𝒂𝒊𝒏 × 𝒓𝒆𝒑𝒓𝒆𝒔𝒆𝒏𝒕𝒂𝒕𝒊𝒗𝒆 𝒂𝒊𝒓𝒇𝒍𝒐𝒘 𝒓𝒂𝒕𝒆 (cfm/bu) (Loewer et al., 1994) ( 4 ) During the computation of these values for each drying method, the lowest value for each airflow range in cfm/bu was assumed for the low budget option, the middle value was assumed for the medium budget option, and the highest value for the high budget option. For low temperature drying and layer drying, an airflow rate of 1 cfm/bu was assumed for the low budget option, 2 cfm/bu for the medium budget option, and 3 cfm/bu for the high budget option. For batch-in-bin drying, an airflow rate of 5 cfm/bu was assumed for the low budget option, 10 cfm/bu for the medium budget option, and 15 cfm/bu for the high budget option. 16 University of Ghana http://ugspace.ug.edu.gh The airflow in cfm/ft2 was determined using the following formula: 𝑨𝒊𝒓𝒇𝒍𝒐𝒘 (cfm/𝒇𝒕𝟐) = 𝒈𝒓𝒂𝒊𝒏 𝒅𝒆𝒑𝒕𝒉 × 𝒂𝒊𝒓𝒇𝒍𝒐𝒘 𝒓𝒂𝒕𝒆 (cfm/bu)/1.25 (Loewer et al., 1994) ( 5 ) The same assumptions stated earlier were made for each calculation for the airflow in cfm/ft2. 3.5 Determination of Horsepower Rating of Fans Horsepower rating was determined using the formula by Sadaka (2013) below: 𝒄𝒇𝒎 × 𝑷𝒔 𝒉𝒑 = 𝟑𝟖𝟏𝟒 ( 6 ) Where: cfm = airflow (cfm) Ps = static pressure (in.H2O) Efficiency = fan efficiency For calculation purposes, the efficiency of the fan will be assumed to be 60% as suggested by Wilcke and Morey (2018). The static pressure, Ps was determined using the formula: 𝑷𝒔 = 𝑷𝒓𝒆𝒔𝒔𝒖𝒓𝒆 𝒅𝒓𝒐𝒑 (𝒊𝒏. 𝑯𝟐𝑶) × 𝒈𝒓𝒂𝒊𝒏 𝒅𝒆𝒑𝒕𝒉 × 𝟏. 𝟓 (Loewer et al., 1994) ( 7 ) 1.5 is the packing factor. The pressure drop, ΔP was determined using the formula proposed by Kenghe et al. (2012): 𝑨𝑽𝟐 𝜟𝑷 = 𝑰𝒏(𝟏 + 𝑩𝑽) ( 8 ) Where: 𝛥𝑃 = pressure drop, Pa or inches or water 17 University of Ghana http://ugspace.ug.edu.gh A = constant for particular grain B = constant for particular grain V = airflow, m3/s·m3 or cfm/ft2 The values of A and B for each grain to be dried were obtained from a table compiled by ASABE (2009). They are listed in table 3 as follows: Table 3: A and B constants for various grains Grain Value of A Value of B (Pa‧s2/m3) (m2‧s/m3) Shelled corn 2.07 × 104 30.4 Rough Rice 2.57 × 104 13.2 Soyabean 1.02 × 104 16.0 According to ASABE (2009), it is imperative to divide the above-mentioned A-values by 31635726 to get the equivalent values of A in inch-pound units (in‧H2O min 2/ft3). Divide the above-mentioned B-values by 196.85 to get matching values of B in inch-pound units (ft2/cfm). After the horsepower rating is determined, the appropriate fan(s) can be selected from a drop- down menu consisting of various types of axial and centrifugal fans in the user interface. The fans in the menu start from horsepower ratings of 0.33 hp to 75 hp. The calculated horsepower rating can be rounded up to the nearest horsepower rating found in the menu if it is not found in the menu. For example, a 10 hp fan is recommended if the calculated horsepower rating is 9.5 hp, since 9.5 hp is not found in the menu. 18 University of Ghana http://ugspace.ug.edu.gh If the calculated horsepower rating for a particular fan is found in the menu, that fan can either be chosen, or the horsepower rating can be divided by any number the user decides on, if the user wishes to use multiple fans. In cases where the calculated horsepower is greater than what is found in the menu, it will be compulsory to divide the horsepower by a number (which will be decided on by the user) to obtain values that can be found in the menu. This means that in such cases, multiple fans are recommended. For example, if the calculated horsepower is found to be 100 hp, the user can divide the value by two (2) to get two 50 hp fans, or four (4) to get four 25 hp fans. In cases where a relatively small volume is entered (for example, 100 bushels), the calculated horsepower turns out to be much less than the lowest horsepower rating of the fans in the drop- down menu. The programme then notifies the user that it is not economically viable to dry grain due to relatively low volume. This is because it is not practical to expend relatively large financial, material and energy resources to dry a relatively small volume of grain. Figure 2 shows a flowchart of the entire procedure: 19 University of Ghana http://ugspace.ug.edu.gh Figure 2 - Drying DSS Flowchart 20 University of Ghana http://ugspace.ug.edu.gh 4. RESULTS AND DISCUSSION After the programme was developed, five simulations were carried out on it to test its efficiency and accuracy in calculations. The programme was named “Drying DSS”, short for “Drying Decision Support System”. Below are the results for each simulation ran: Simulation 1 The inputs for this simulation are outlined in Table 4 below: Table 4: Inputs for Simulation 1 Input Value/Option Grain Shelled Corn Volume to be dried 100 tonnes Drying method Low temperature drying Budget type Low budget The results the programme returned are shown in Table 5 below: Table 5: Outputs for Simulation 1 Output Value Bin Diameter 21 ft / 6.40 m Grain Depth 14.50 ft / 4.42 m Airflow 3986.80 cfm Airflow Rate 11.60 cfm / ft2 Horsepower Rating 0.31 hp 21 University of Ghana http://ugspace.ug.edu.gh In the drop-down menu, a fan with a horsepower that is closest to the calculated horsepower can be selected. In this case, the appropriate fan is a 0.33 hp fan. Simulation 2 Table 6: Inputs for Simulation 2 Input Value/Option Grain Rough Rice Volume to be dried 150 tonnes Drying method Layer drying Budget type Medium budget Table 7: Outputs for Simulation 2 Output Value Bin Diameter 30.00 ft / 9.14 m Grain Depth 13.00 ft / 3.96 m Airflow 14697.60 cfm Airflow Rate 20.80 cfm / ft2 Horsepower Rating 3.48 hp The most suitable fan in this case is a 4.5 hp fan. 22 University of Ghana http://ugspace.ug.edu.gh Simulation 3 Table 8: Inputs for Simulation 3 Input Value/Option Grain Soybeans Volume to be dried 2000 Bushels Drying method Batch-in-bin drying Budget type High budget Table 9: Outputs for Simulation 3 Output Value Bin Diameter 36.00 ft / 10.97 m Grain Depth 2.50 ft / 0.76 m Airflow 30000.00 cfm Airflow Rate 30.00 cfm / ft2 Horsepower Rating 1.10 hp The most suitable fan that can be found in the menu is a 1.5 hp fan. 23 University of Ghana http://ugspace.ug.edu.gh Simulation 4 Table 10: Inputs for Simulation 4 Input Value/Option Grain Rough Rice Volume to be dried 70 tonnes Drying method Low temperature drying Budget type Medium budget Table 11: Outputs for Simulation 4 Output Value Bin Diameter 27.00 ft / 8.23 m Grain Depth 7.50 ft / 2.29 m Airflow 6858.88 cfm Airflow Rate 12.00 cfm / ft2 Horsepower Rating 0.35 hp The most suitable fan that can be chosen in this case is a 0.5 hp fan. 24 University of Ghana http://ugspace.ug.edu.gh Simulation 5 Table 12: Inputs for Simulation 5 Input Value/Option Grain Shelled Corn Volume to be dried 200 Bushels Drying method Layer Drying Budget type Low Budget Table 13: Outputs for Simulation 5 Output Value Bin Diameter 18.00 ft / 5.49 m Grain Depth 1.00 ft / 0.30 m Airflow 200.00 cfm Airflow Rate 0.80 cfm / ft2 Horsepower Rating Not economically viable to dry grain due to relatively low volume. In this case, the calculated horsepower is much less than the minimum horsepower rating in the dropdown menu due to the relatively small volume of grain to be dried, therefore the user is informed that it is not economically viable to dry that volume of grain. The bin diameter and grain depth results for each simulation were compared with the grain bin volume calculator (University of Nebraska, 2017) and returned very similar values for the bin diameter and grain depth. 25 University of Ghana http://ugspace.ug.edu.gh The results for the airflow and airflow rate were compared with the results of the airflow calculations carried out by Loewer et al. (1994). The values obtained for the simulations were the same as those of Loewer et al. (1994). The results of the horsepower calculations carried out by the programme were congruent with the results of the calculations carried out by Wilcke and Morey (2018). 26 University of Ghana http://ugspace.ug.edu.gh 5. CONCLUSION AND RECOMMENDATIONS 5.1 Conclusion The following conclusions are drawn from the study: • An algorithm was successfully developed to determine the bin diameter and grain depth when the grain volume is entered, based on the formula given and the assumptions that were made. • An algorithm was successfully developed to determine the airflow and airflow rates using the various formulas given and the assumptions made. • The horsepower rating of the fans was successfully calculated using the formulas stated by the assumptions made in the study. A list of fans was also successfully compiled to aid in fan selection after the horsepower has been calculated. • A computer programme was successfully created using Python, which integrates all these algorithms and provides estimated outputs with the required inputs through a simple, user- friendly interface. The programme can be used without internet access, and can be used by users with shallow knowledge in drying systems, as well as experts. The programme simplifies the calculations that must be made during the decision-making process, thereby optimising decision making with respect to drying specified volumes of the selected grains and the respective drying methods chosen. 27 University of Ghana http://ugspace.ug.edu.gh 5.2 Recommendations The following recommendations are made: 1. Field tests should be run to determine specific values for some of the assumptions made during calculations to reduce the number of assumptions when improvements are being made to the programme. 2. Algorithms can be developed to determine other parameters such as drying temperature and drying time. 3. The programme can be further extended to accommodate more grains and drying methods. 4. A mobile application version can be created to enhance portability. 28 University of Ghana http://ugspace.ug.edu.gh REFERENCES • Alexander, L. (2002). Decision support systems in the 21st century. In ACM SIGSOFT Software Engineering Notes (Vol. 27, Issue 5). https://doi.org/10.1145/571681.571692 • American Society of Agricultural and Biological Engineers (ASABE) (2009). Resistance to Airflow of Grains, Seeds, Other Agricultural Products, and Perforated Metal Sheets. ASAE D272.3 MAR1996 (R2007). • Basic Agricultural Study (2020). Drying Definition, Classification, Advantage, Disadvantage. https://agriculturistmusa.com/definition-of-drying-with-classification/ • Bridges, T. C., Overhults, D. G., McNeill, S, G., White, G, M. (1988). An Aeration Duct Design Model for Flat Grain Storage. Transactions of the ASAE 31(4):1283-1288. • Bridges, T. C., White, G. M., Ross., I. J., Loewer, O. J. (1982). A Computer Aid for Management of On-Farm Layer Drying Systems. Transactions of the ASAE 25(3):811- 815. • Courtois, F. (1995). Computer-Aided Design of Corn Dryers: A Dynamic Approach Including Quality Prediction. Journal of Drying Technology, 1995, 13(5-7) :1153-1165 • Edwards, W. (2014). Estimating the Cost for Drying Corn. File A2-31. https://www.extension.iastate.edu/agdm/crops/pdf/a2-31.pdf • Faisandier, A., Adcock, R. (2021). System Design. https://www.sebokwiki.org/w/index.php?title=System_Design&oldid =62975 • Friedenthal, S., Moore, A., Steiner, R. (2015). A Practical Guide to SysML (Third Edition). Chapter 1 - Systems Engineering Overview. ISBN 9780128002025. https://doi.org/10.1016/B978-0-12-800202-5.00001-1 • Gorinevsky, D. (2005). Lecture 9 - Modelling, Simulation, and Systems Engineering. Course PPT. 29 University of Ghana http://ugspace.ug.edu.gh • Gregory, M. A. (2005). Integrating Project Management and Service Management. November 2005, 1–15. • Institute of Agriculture and Natural Resources. (2017). Grain Bin Volume Calculator. University of Nebraska - Lincoln. https://cropwatch.unl.edu/2017/grain-bin-volume- calculator • Jain, R., Raju, S. S. (2018). Decision Support System in Agriculture Using Quantitative Analysis. Agrotech Publishing Academy. ISBN: 978-81-8321-395-0 • Kenghe, R. N., Nimkar, P. M., Shirkole, S. S., Shinde, K. J. (2012). Airflow resistance in soybean. International Agrophysics, 26(2), 137–143. https://doi.org/10.2478/v10247-012- 0020-z • Kennedy, S. (2018). Preserve Food and Increase Shelf Life. https://blogs.ifas.ufl.edu/wakullaco/2018/05/02/preserve-food-and-increase-shelf-life/ • Khatchatourian, O. A., Vielmo, H. A., & Bortolaia, L. A. (2013). Modelling and simulation of cross flow grain dryers. Biosystems Engineering, 116(4), 335–345. https://doi.org/10.1016/j.biosystemseng.2013.09.001 • Liu, Z., Xu, Y., Han, F., Zhang, Y., Wang, G., Wu, Z., & Wu, W. (2022). Control Method for Continuous Grain Drying Based on Equivalent Accumulated Temperature Mechanism and Artificial Intelligence. Foods, 11(6). https://doi.org/10.3390/foods11060834 • Loewer, O. J., Bridges, T. C., Bucklin, R. A. (1994). On-Farm Drying and Storage Systems. ISBN: 0-929355-53-9. • Loewer, O. J., Bridges, T. C., Overhults, D. G. (1976). CACHE: Computer Model for The Analysis of the Economics of Corn Harvesting and Processing Systems. Technical Series No. 10. Agr. Eng. Dept., University of Kentucky, Lexington. 30 University of Ghana http://ugspace.ug.edu.gh • Loewer, O. J., Siebenmorgen, T. J., Berry, I. L. (1986). Geometric Considerations in the Design of Circular Grain Storage Systems. Applied Engineering in Agriculture 2(1):114- 122. • Maeier, D. E., Bakker-Akema, F., W. (2002). Grain Drying Systems. Presented at the Facility Design Conference of the Grain Elevator and Processing Society, St. Charles, Illinois, U.S.A. • Mason, R. O., Conger, S. A. (1989). Systems analysis. Eos, Transactions American Geophysical Union, 70(38), 842–842. https://doi.org/10.1029/89EO00286. • Minder, T. (1973). Application of Systems Analysis in Designing a New System. • Olavsrud, T. (2020). Decision support systems: Sifting data for better business decisions. • Pienaar, W. J. (2011). Application of systems analysis and operations research methodology in the execution and control of business logistics processes. Corporate Ownership and Control, 9(1 B), 196–202. • Ramakrishnan. S. (2012). System Analysis and Design. Journal of Information Technology and Software Engineering, 02(05), 1–2. https://doi.org/10.4172/2165- 7866.s8-e001 • Rasmussen, J. (2003). Systems Design. Encyclopaedia of Information Systems, Elsevier. ISBN 9780122272400. https://doi.org/10.1016/B0-12-227240-4/00179-9 • Reynolds, P. (2018). What are Engineering Simulation (PES) Tools? https://www.arcweb.com/blog/what-engineering-simulation-pes-tools • Robbins, O. (2019). Food Storage and Preservation: Why it matters and How to Do it Properly. Food Revolution Network. https://foodrevolution.org/blog/food-storage-food- preservation/ • Sadaka, S. (2013). Selection, Performance and Maintenance of Grain Bin Fans. University of Arkansas. https://www.uaex.uada.edu/farm-ranch/crops-commercial- 31 University of Ghana http://ugspace.ug.edu.gh horticulture/Grain_drying_and_storage/Docs/FSA%201075%20Selection%20Performanc e%20and%20Maintenance%20of%20Grain%20Bin%20Fans.pdf • Sadaka, S., Atungulu G., Osborn, S. (2017). Low-Temperature Grain Drying. University of Arkansas. Division of Agriculture (Research and Extension). Agriculture and Natural Resources. https://www.uaex.uada.edu/publications/pdf/FSA-1063.pdf • Shafaat, A., Kenley, C. R. (2015). Exploring the Role of Design in Systems Engineering. INCOSE International Symposium, 25(1), 357–370. https://doi.org/10.1002/j.2334- 5837.2015.00068.x • Sieniutycz, S. (2020). Complexity and Complex Thermo-Economic Systems. Chapter 5 - Systems Design: Modelling, Analysis, Synthesis, and Optimization. ISBN 9780128185940. https://doi.org/10.1016/B978-0-12-818594-0.00005-2 • South Dakota State University. (2021). T-00287: Computer Application for Predicting Drying Performance in a Continuous Flow Corn Dryer. https://www.sdstate.edu/division- research-economic-development/office-technology-transfer-and-commercialization/t- 00287 • Thompson, T. L. (1975). FANMATCH: Fan Performance Computer Programs. Presented at the 1975 Grain Storage Computer Workshop, University of Kentucky, Lexington. • Thompson, T. L. (1975). NATAIR: Natural Air Drying Program. Presented at the 1975 Grain Storage Computer Workshop, University of Kentucky, Lexington. • Thompson, T. L., Peart, R. M., Foster, G. H. (1968). Mathematical Simulation of Corn Drying - A New Model. Transactions of the ASAE 11(4):582-586. • Valente, D. S. M., Queiroz, D. M. De, Silva, L., Oliveira, G. H. H. De. (2012). LINSEC - The software for modeling and simulation of grain drying. https://doi.org/10.1590/S1806-66902012000400007 32 University of Ghana http://ugspace.ug.edu.gh • Wilcke, W. F., Morey, R. V. (2018). Selecting fans and determining airflow for grain bins. University of Minnesota Extension. https://extension.umn.edu/corn- harvest/selecting-fans-and-determining-airflow-grain-bins#estimate-fan-power- requirements-1491412 • Winik, S. V., Khatchatourian, O., Lima, R. F. De. (2013). Simulation of continuous flow grain dryers. Proceeding Series of the Brazilian Society of Applied and Computational Mathematics, 1(1), 1–5. 33 University of Ghana http://ugspace.ug.edu.gh APPENDIX Python Code for Programme Development Controller from decimal import Decimal import math ####### defining class for the controller of the application class Compute(object): ##### initializing variables _bin_diameter = 0.00 _grain_depth = 0.00 _airflow_low = 0.00 _airflow_medium = 0.00 _airflow_high = 0.00 _airflow_rate_low = 0.00 _airflow_rate_medium = 0.00 _airflow_rate_high = 0.00 def __init__(self, crop='', capacity=0, capacity_format='tonnes', drying_method='', budget=''): self._capacity_data = dict() self.crop = crop self.capacity = float(capacity) self.capacity_format = capacity_format self.drying_method = drying_method self.budget = budget self._generate_data() ### This function gerates a list containing all the bushel capacities with their ### corresponding grain depths and bin diameters def _generate_data(self): grain_depth_data = [x*0.5 for x in range(1, 61)] bin_diameter_data = [x for x in range(15, 61, 3)] for b in bin_diameter_data: for g in grain_depth_data: capacity = math.pi * ((b / 2) ** 2) * g * 0.8 value = f"{b},{g}" self._capacity_data[capacity] = value 34 University of Ghana http://ugspace.ug.edu.gh def _calculate_capacity(self, multplier) -> None: self.capacity = self.capacity * multplier ##### this function converts the capacity from tonnes to bushels based on the crop selected def _convert_capacity(self) -> None: if self.capacity_format == 'tonnes': if self.crop == 'Shelled Corn': self._calculate_capacity(39.868) elif self.crop == 'Soybeans': self._calculate_capacity(36.7437) else: self._calculate_capacity(48.992) ##### this function finds the closest capacity to what the user desires def _get_closet_capacity(self): capacities = self._capacity_data.keys() return min([v for v in capacities if v >= self.capacity] or [None]) #### this function calculate airflow and airflow rate needed to build the drying system for various budjet levels def _calculate_air_flow(self) -> None: if self.drying_method in ('Low Temperature Drying', 'Layer Drying'): self._airflow_low = self.capacity * 1 self._airflow_medium = self.capacity * 2 self._airflow_high = self.capacity * 3 self._airflow_rate_low = (self._grain_depth * 1) / 1.25 self._airflow_rate_medium = (self._grain_depth * 2 ) / 1.25 self._airflow_rate_high = (self._grain_depth * 3) / 1.25 else: self._airflow_low = self.capacity * 5 self._airflow_medium = self.capacity * 10 self._airflow_high = self.capacity * 15 self._airflow_rate_low = (self._grain_depth * 5) / 1.25 self._airflow_rate_medium = (self._grain_depth * 10) / 1.25 self._airflow_rate_high = (self._grain_depth * 15) / 1.25 ##### function for calculating the static pressure based on crop selected for various budget levels def _static_pressure(self): crops = { 'Shelled Corn': { 'a': 2.07 * 10**4, 35 University of Ghana http://ugspace.ug.edu.gh 'b': 30.4 }, 'Soybeans': { 'a': 1.02 * 10**4, 'b': 16}, 'Rough Rice': { 'a': 2.18 * 10**4, 'b': 8.34 } } a = crops[self.crop]['a'] / 31635726 b = crops[self.crop]['b'] / 196.85 if self.budget == 'Low budget': pressure = (a * self._airflow_rate_low**2) / math.log(1 + b * self._airflow_low) static_pressure = pressure * self._grain_depth * 1.5 elif self.budget == 'Medium budget': pressure = (a * self._airflow_rate_medium**2) / math.log(1 + b * self._airflow_medium) static_pressure = pressure * self._grain_depth * 1.5 else: pressure = (a * self._airflow_rate_high**2) / math.log(1 + b * self._airflow_high) static_pressure = pressure * self._grain_depth * 1.5 return static_pressure ##### function to calculate the horsepower of the fans needed for drying def _horse_power(self): if self.budget == 'Low budget': return (self._airflow_low * self._static_pressure()) / (63.46 * 60) elif self.budget == 'Medium budget': return (self._airflow_medium * self._static_pressure()) / (63.46 * 60) else: return (self._airflow_high * self._static_pressure()) / (63.46 * 60) @staticmethod def _to_string(value): return '{:.2f}'.format(value) def _to_meters(self, ft): return self._to_string(ft*0.3048) 36 University of Ghana http://ugspace.ug.edu.gh ##### function to get the values of all calculated paremeters: bin diameter, grain depth, airflow, ##### airflow rate and horsepower. def get_calculated_data(self): self._convert_capacity() self._bin_diameter = float(self._capacity_data[self._get_closet_capacity()].split(',')[0]) self._grain_depth = float(self._capacity_data[self._get_closet_capacity()].split(',')[1]) self._calculate_air_flow() data = { 'bin_diameter': { 'ft': self._to_string(self._bin_diameter), 'm': self._to_meters(self._bin_diameter) }, 'grain_depth': { 'ft': self._to_string(self._grain_depth), 'm': self._to_meters(self._grain_depth) } } if self.budget == 'Low budget': data['budget'] = { 'airflow': self._to_string(self._airflow_low), 'airflow_rate': self._to_string(self._airflow_rate_low), } elif self.budget == 'Medium budget': data['budget'] = { 'airflow': self._to_string(self._airflow_medium), 'airflow_rate': self._to_string(self._airflow_rate_medium), } else: data['budget'] = { 'airflow': self._to_string(self._airflow_high), 'airflow_rate': self._to_string(self._airflow_rate_high), } data['horse_power'] = self._to_string(self._horse_power()) ##### A list of available fans and their horsepowers data['horse_powers'] = [ '0.33 hp AEROVENT 1240-DW | 12" (Axial)', '0.33 hp MFS 12" (Axial)', '0.33 hp ROLFES 5001-F (Axial)', 37 University of Ghana http://ugspace.ug.edu.gh '0.5 hp FARM FANS 0512 SH | 12" 3450 rpm (Axial)', '0.75 hp BROCK 12" 345O rpm (Axial)', '0.75 hp BUTTLER 12075 | 12" (Axial)', '0.75 hp CALDWELL F12.75 | 12" (Axial)', '0.75 hp CHICAGO 12" 3450 rpm (Axial)', '0.75 hp DMC 12" (Axial)', '0.75 hp GSI 12" (Axial)', '0.75 hp MFS 12" (Axial)', '0.75 hp MIDDLE STATE 12" 3450 rpm (Axial)', '0.75 hp NECO 12" (Axial)', '0.75 hp SCAFCO 12" (Axial)', '0.75 hp SUKUP 12" (Axial)', '1 hp AEROVENT 7-142-DW | 14" (Axial)', '1 hp BROCK 12" 3450 rpm (Axial)', '1 hp CALDWELL F14-1 | 14" (Axial)', '1 hp CHICAGO 13-1-102 (Axial)', '1 hp CHICAGO A14191F (Axial)', '1 hp DMC 12" (Axial)', '1 hp FARM FANS 114 SH | 14" 3450 rpm (Axial)', '1 hp GSI 12" (Axial)', '1 hp GSI 14" (Axial)', '1 hp MFS 14" (Axial)', '1 hp NECO 14" (Axial)', '1 hp ROLFES 5011-F (Axial)', '1 hp SUKUP 12" (Axial)', '1.5 hp AEROVENT 7-1880-DW | 18" (Axial)', '1.5 hp BROCK 14" 3450 rpm (Axial)', '1.5 hp BROCK 16" 3450 rpm (Axial)', '1.5 hp BUTLER 1415 | 14" (Axial)', '1.5 hp BUTLER 1815 | 18" (Axial)', '1.5 hp CALDWELL F18-1 | 18" (Axial)', '1.5 hp CALDWELL ILC18-1.5 | 3450 rpm (Centrif.)', '1.5 hp CHICAGO 14" 3450 rpm (Axial)', '1.5 hp CHICAGO 18" 3450 rpm (Axial)', '1.5-2 hp CHICAGO A18151F (Axial)', '1.5 hp DMC 18" (Axial)', '1.5 hp DMC 18" (Centrif.)', '1.5 hp DMC 18" InLineC (Centrif.)' '1.5 hp FARM FANS 116 AF | 16" 3450 rpm (Axial)' '1.5 hp FARM FANS 116 SH | 16" 3450 rpm (Axial)', '1.5 hp GSI 18" (Axial)', '1.5 hp GSI 18" (Centrif.)', '1.5 hp GSI 18" InLineC (Centrif.)', '1.5 hp MFS 16" (Axial)', '1.5 hp MFS 18" (Axial)', '1.5 hp MIDDLE STATE 12" 3450 rpm (Axial)', '1.5 hp MIDDLE STATE 14" 3450 rpm (Axial)', '1.5 hp MIDDLE STATE 16" 3450 rpm (Axial)', 38 University of Ghana http://ugspace.ug.edu.gh '1.5 hp MIDDLE STATE 18" 3450 rpm (Axial)', '1.5 hp NECO 16" (Axial)', '1.5 hp SCAFCO 14" (Axial)', '1.5 hp SCAFCO 18" (Axial)', '1.5 hp SUKUP 14" (Axial)', '1.5 hp SUKUP 18" (Axial)', '1.5 hp SUKUP 18" In Line, 3450 rpm, 1-3 Ph(Centrif.)', '2 hp BROCK 18" 3450 rpm (Axial)', '2 hp BROCK 18" 3450 rpm InLineC (Centrif.)', '3 hp AEROVENT 7-18992-DW | 18" 3450 rpm (Axial)', '3 hp AEROVENT 7-3281-DW | 32" (Axial)', '3 hp BROCK 15" 3450 rpm (Centrif.)', '3 hp BROCK 18" 3450 rpm (Axial)', '3 hp BROCK 18" 3450 rpm InLineC (Centrif.)', '3 hp BROCK 22" 1750 rpm (Centrif.)', '3 hp BROCK 24" 3450 rpm InLineC (Centrif.)', '3hp BUTLER 1830 | 18" (Axial)', '3 hp BUTLER 2430 | 24" (Axial)', '3 hp CALDWELL CF15-3 | 3500 rpm (Centrif.)', '3 hp CALDWELL CF22-3 | 1750 rpm (Centrif.)', '3-4 hp CALDWELL F18-3 | 18" (Axial)', '3 hp CALDWELL ILC18-3 | 3450 rpm (Centrif.)', '3 hp CALDWELL ILC24-3 | 3450 rpm (Centrif.)', '3 hp CHICAGO 18" 3450 rpm (Axial)', '3-4 hp CHICAGO A18301F (Axial)', '3 hp DMC 18" (Axial)', '3 hp DMC 18" InLineC (Centrif.)', '3 hp DMC 24" InLineC (Centrif.)', '3 hp DMC CF-3 | 1750 rpm (Centrif.)', '3 hp DMC CHS-3 | 3500 rpm (Centrif.)', '3 hp FARM FANS 316 SH | 16" 3450 rpm (Axial)', '3 hp FARM FANS 318 AF | 18" 3450 rpm (Axial)', '3 hp GSI 18" InLineC (Centrif.)', '3 hp GSI 24" InLineC (Centrif.)', '3 hp GSI CF-3 | 1750 rpm (Centrif.)', '3 hp GSI CHS-3 | 3500 rpm (Centrif.)', '3 hp KEHO (Centrif.)', '3 hp MFS 18" (Axial)', '3 hp MIDDLE STATE 16" 3450 rpm (Axial)', '3 hp MIDDLE STATE 18" 3450 rpm (Axial)', '3 hp MIDDLE STATE MS 18-240 (Centrif.)', '3 hp NECO 18" (Axial)', '3 hp SCAFCO 18" (Axial)', '3 hp SCAFCO 24H1503, 3450 RPM (Centrif.)', '3 hp SCAFCO 24L2203, 1750 RPM (Centrif.)', '3 hp SUKUP 18" (Axial)', '3 hp SUKUP 3 hp, 1750 rpm (Centrif.)', '3 hp SUKUP 3-223 (Centrif.)', 39 University of Ghana http://ugspace.ug.edu.gh '3 hp SUKUP 3-321 (Centrif.)', '3 hp SUKUP 3500 rpm (Centrif.)', '4.5 hp SUKUP 18" In Line, 3450 rpm, 1 Ph (Centrif.)', '4.5 hp SUKUP 18" In Line, 3500 rpm (Centrif.)', '5 hp AEROVENT 7-2490-DW | 24" (Axial)', '5 hp AEROVENT 7-3296-DW | 32" (Axial)', '5 hp AEROVENT 7-3613-DW | 36" (Axial)', '5 hp AEROVENT CD270-05 (Centrif.)', '5 hp BUTLER - (Centrif.)', '5 hp BUTLER 2450 | 24" (Axial)', '5 hp CALDWELL C24-51-53 | 1750 rpm (Centrif.)', '5 hp CALDWELL CF15-5 | 3450 rpm (Centrif.)', '5-7 hp CALDWELL F24-5 | 24" (Axial)', '5 hp CALDWELL ILC24-5 | 3450 rpm (Centrif.)', '5 hp CECO - (Centrif.)', '5 hp CECO - (Axial)', '5 hp CHICAGO 13-1-105 (Centrif.)', '5-7 hp CHICAGO BB501F & 503F | 22" (Axial)', '5 hp CIRCLE STEEL - (Centrif.)', '5 hp DMC 24" (Axial)', '5 hp DMC CF-5 | 1750 rpm (Centrif.)', '5 hp DMC CHS-5 | 3500 rpm (Centrif.)', '5 hp FARM FANS 524 SH | 24" (Axial)', '5 hp FARM FANS FFC-520B | 20" (Centrif.)', '5 hp FARM FANS FFCH-515E | 3500 rpm (Centrif.)', '5 hp GSI 24" (Axial)', '5 hp GSI CF-5 | 1750 rpm (Centrif.)', '5 hp GSI CHS-5 | 3500 rpm (Centrif.)', '5 hp KEHO (Centrif.)', '5 hp MFS 24" (Axial)', '5 hp MIDDLE STATE 18" 3450 rpm (Axial)', '5 hp MIDDLE STATE MS 18-240 (Centrif.)', '5 hp MIDDLE STATE MS 18-270 (Centrif.)', '5 hp MIDDLE STATE TF-5 | 24" (Axial)', '5-7 hp NECO 24" (Axial)', '5 hp NECO 27" (Centrif.)', '5 hp ROLFES (Centrif.)', '5 hp ROLFES (Axial)', '5 hp SCAFCO 24" (Axial)', '5 hp SCAFCO 24H1505, 3450 rpm (Centrif.)', '5 hp SCAFCO 24L2205, 1750 rpm (Centrif.)', '5-7 hp SUKUP 24" (Axial)', '5-7 hp SUKUP 24" In Line, 3450 rpm, 1-3 Ph (Centrif.)', '5-7 hp SUKUP 24" In Line, 3500 rpm (Centrif.)', '5 hp SUKUP 3500 rpm (Centrif.)', '5 hp SUKUP 5 hp, 1750 rpm (Centrif.)', '5 hp SUKUP 5-221 (Centrif.)', '5 hp SUKUP 5-223 (Centrif.)', 40 University of Ghana http://ugspace.ug.edu.gh '7 hp CALDWELL CF18-7 | 3500 rpm (Centrif.)', '7 hp DMC 24" (Axial)', '7 hp DMC 24" InLineC (Centrif.)', '7 hp GSI 24" (Axial)', '7 hp GSI 24" InLineC (Centrif.)', '7-10 hp SUKUP 24" (Axial)', '7-10 hp SUKUP 24" In Line, 3500 rpm (Centrif.)', '7.2 hp AEROVENT 7-2491-DW | 24" 3450 rpm (Axial)', '7.2 hp AEROVENT 7-2710-DW | 27" (Axial)', '7.5 hp AEROVENT 7-2495-DW | 24" 3450 rpm (Axial)', '7.5 hp AEROVENT 7-3615-DW | 36" (Axial)', '7.5 hp AEROVENT 7-4260-DW | 42" (Axial)', '7.5 hp AEROVENT CD270-07 | 27" (Centrif.)', '7.5 hp BUTLER - (Centrif.)', '7.5 hp BUTLER 2475 | 24" (Axial)', '7.5 hp CALDWELL C24-71-73 | 1750 rpm (Centrif.)', '7.5-9.2 hp CALDWELL F24-7 | 24" (Axial)', '7.5 hp CALDWELL ILC28-7 | 3450 rpm (Centrif.)', '7.5 hp CECO - (Centrif.)', '7.5 hp CECO - (Axial)', '7.5 hp CHICAGO 13-1-106 (Centrif.)', '7.5-8.5 hp CHICAGO BB751F & 3F | 22" (Axial)', '7.5 hp CIRCLE STEEL - (Centrif.)', '7.5 hp DMC CF-7.5 | 1750 rpm (Centrif.)', '7.5 hp DMC CHS-7.5 | 3500 rpm (Centrif.)', '7.5 hp FARM FANS 724 SH | 24" (Axial)', '7.5 hp GSI CF-7.5 | 1750 rpm (Centrif.)', '7.5 hp GSI CHS-7.5 | 3500 rpm (Centrif.)', '7.5 hp KEHO (Centrif.)', '7.5 hp MFS 24" (Axial)', '7.5 hp MIDDLE STATE 18-240 (Centrif.)', '7.5 hp MIDDLE STATE MS 18-270 (Centrif.)', '7.5 hp MIDDLE STATE TF 75-1 | 24" (Axial)', '7.5-10 hp NECO 24" (Axial)', '7.5-10 hp NECO 26" (Axial)', '7.5 hp NECO 27" (Centrif.)', '7.5 hp ROLFES - (Centrif.)', '7.5 hp ROLFES - (Axial)', '7.5 hp SCAFCO 24" (Axial)', '7.5 hp SCAFCO 24H1507, 3450 rpm (Centrif.)', '7.5 hp SCAFCO 24L2207, 1750 rpm (Centrif.)', '7.5 hp SUKUP 3500 rpm (Centrif.)', '7.5 hp SUKUP 7.5 hp, 1750 rpm (Centrif.)', '7.5 hp SUKUP 7.5-241 (Centrif.)', '7.5 hp SUKUP 7.5-243 (Centrif.)', '9.3 hp AEROVENT 7-2722-DW | 27" 3450 rpm (Axial)', '9.5 hp MIDDLE STATE TF 95-1 | 24" (Axial)', '9.5 hp MIDDLE STATE TS 95-1 | 26" (Axial)', 41 University of Ghana http://ugspace.ug.edu.gh '10 hp AEROVENT 7-2498-DW | 24" 3450 rpm (Axial)', '10 hp AEROVENT 7-3692-DW | 36" 1725 rpm (Axial)', '10 hp AEROVENT 7-4261-DW | 42" (Axial)', '10 hp AEROVENT CD270-10 | 27" (Centrif.)', '10 hp BEHLEN - (Centrif.)', '10 hp BUTLER - (Centrif.)', '10 hp BUTLER 27100 | 27" (Axial)', '10 hp CALDWELL C18-103 | 3500 rpm (Centrif.)', '10 hp CALDWELL C27-101-103 | 1750 rpm (Centrif.)', '10 hp CALDWELL ILC28-10 | 3450 rpm (Centrif.)', '10 hp CECO - (Centrif.)', '10 hp CECO - (Axial)', '10 hp CHICAGO BF1001 & 3 | 26" (Axial)', '10 hp CHICAGO CF241001 & 3 (Centrif.)', '10 hp CIRCLE STEEL - (Centrif.)', '10 hp DMC 24" (Axial)', '10 hp DMC 28" InLineC (Centrif.)', '10 hp DMC CF-10 | 1750 rpm (Centrif.)', '10 hp DMC CHS-10 | 3500 rpm (Centrif.)', '10 hp FARM FANS 1028 SH | 28" (Axial)', '10 hp FARM FANS FFC-1024B | 24" (Centrif.)', '10 hp FARM FANS FFCH-1018E | 3500 rpm (Centrif.)', '10 hp GSI 24" (Axial)', '10 hp GSI 28" InLineC (Centrif.)', '10 hp GSI CF-10 | 1750 rpm (Centrif.)', '10 hp GSI CHS-10 | 3500 rpm (Centrif.)', '10 hp KEHO (Centrif.)', '10 hp MFS 28" (Axial)', '10 hp MIDDLE STATE 18-240 (Centrif.)', '10 hp MIDDLE STATE MS 18-270 (Centrif.)', '10 hp NECO 27" (Centrif.)', '10-15 hp NECO 28" (Axial)', '10 hp ROLFES - (Centrif.)', '10 hp ROLFES - (Axial)', '10 hp SCAFCO 24H1810, 3450 rpm (Centrif.)', '10 hp SCAFCO 24L2410, 1750 rpm (Centrif.)', '10 hp SUKUP 10 hp, 1750 rpm (Centrif.)', '10 hp SUKUP 10-271 (Centrif.)', '10 hp SUKUP 10-273 (Centrif.)', '10-15 hp SUKUP 28" (Axial)', '10-15 hp SUKUP 28" In Line, 3450 rpm, 1-3 Ph (Centrif.)', '10-15 hp SUKUP 28" In Line, 3500 rpm (Centrif.)', '10 hp SUKUP 3500 rpm (Centrif.)', '10.5 hp CALDWELL F24-10 | 24" (Axial)', '12 hp CHICAGO - (Axial)', '12.2 hp MIDDLE STATE TF 120-1 | 26" (Axial)', '12.2 hp MIDDLE STATE TS 120-1 | 26" (Axial)', '12.5 hp AEROVENT 7-2725-DW | 27" 3450 rpm (Axial)', 42 University of Ghana http://ugspace.ug.edu.gh '12.5 hp CALDWELL F28-12 | 28" (Axial)', '13 hp SHIVVERS 28" 13 hp (Axial)', '15 hp AEROVENT 7-4267-DW | 42" (Axial)', '15 hp AEROVENT CD270-15 | 27" (Centrif.)', '15 hp BUTLER - (Centrif.)', '15 hp CALDWELL C18-153 | 3500 rpm (Centrif.)', '15 hp CALDWELL C27-151-153 | 1750 rpm (Centrif.)', '15 hp CECO - (Centrif.)', '15 hp CHICAGO - (Centrif.)', '15 hp CIRCLE STEEL - (Centrif.)', '15 hp DMC 26" (Axial)', '15 hp DMC 28" (Axial)', '15 hp DMC 28" InLineC (Centrif.)', '15 hp DMC CF-15 | 1750 rpm (Centrif.)', '15 hp DMC CHS-15 | 3500 rpm (Centrif.)', '15 hp FARM FANS FFC-1524B | 24" (Centrif.)', '15 hp FARM FANS FFCH-1518E (Centrif.)', '15 hp GSI 26" (Axial)', '15 hp GSI 28" (Axial)', '15 hp GSI 28" InLineC (Centrif.)', '15 hp GSI CF-15 | 1750 rpm (Centrif.)', '15 hp GSI CHS-15 | 3500 rpm (Centrif.)', '15 hp KEHO (Centrif.)', '15 hp MIDDLE STATE 18-240 (Centrif.)', '15 hp MIDDLE STATE MS 18-270 (Centrif.)', '15 hp MIDDLE STATE MS 18-300 (Centrif.)', '15 hp NECO 27" (Centrif.)', '15 hp ROLFES - (Centrif.)', '15 hp SCAFCO 24H1815, 3450 rpm (Centrif.)', '15 hp SCAFCO 24L2715, 1750 rpm (Centrif.)', '15 hp SUKUP 15 hp, 1750 rpm (Centrif.)', '15 hp SUKUP 15-271 (Centrif.)', '15 hp SUKUP 15-273 (Centrif.)', '15 hp SUKUP 3500 rpm (Centrif.)', '15 hp SUKUP 38" (Axial)', '20 hp AEROVENT CD270-20 | 27" (Centrif.)', '20 hp BEHLEN - (Centrif.)', '20 hp BUTLER - (Centrif.)', '20 hp CALDWELL C30-203 | 1750 rpm (Centrif.)', '20 hp CALDWELL CF-22-20 | 3500 rpm (Centrif.)', '20 hp CECO - (Centrif.)', '20 hp CHICAGO CF272001 & 3 (Centrif.)', '20 hp CIRCLE STEEL - (Centrif.)', '20 hp DMC CF-20 | 1750 rpm (Centrif.)', '20 hp DMC CHS-20 | 3500 rpm (Centrif.)', '20 hp FARM FANS FFC-2027B | 27" (Centrif.)', '20 hp GSI CF-20 | 1750 rpm (Centrif.)', '20 hp GSI CHS-20 | 3500 rpm (Centrif.)', 43 University of Ghana http://ugspace.ug.edu.gh '20 hp MIDDLE STATE MS 18-270 (Centrif.)', '20 hp MIDDLE STATE MS 18-300 (Centrif.)', '20 hp NECO 27" (Centrif.)', '20 hp ROLFES - (Centrif.)', '20 hp SCAFCO 24H1820, 3450 rpm (Centrif.)', '20 hp SCAFCO 24L2720, 1750 rpm (Centrif.)', '20 hp SUKUP 20 hp, 1750 rpm (Centrif.)', '20 hp SUKUP 20-301 (Centrif.)', '20 hp SUKUP 20-303 (Centrif.)', '20 hp SUKUP 3500 rpm (Centrif.)', '25 hp CALDWELL C30-253 | 1750 rpm (Centrif.)', '25 hp CALDWELL CF-22-25 | 3500 rpm (Centrif.)', '25 hp DMC CF-25 | 1750 rpm (Centrif.)', '25 hp FARM FANS FFC-2530A | 1750 rpm (Centrif.)', '25 hp GSI CF-25 | 1750 rpm (Centrif.)', '25 hp MIDDLE STATE MS 18-300 (Centrif.)', '25 hp MIDDLE STATE MS 18-330 (Centrif.)', '25 hp NECO 30" (Centrif.)', '25 hp SCAFCO 24H2225, 3450 rpm (Centrif.)', '25 hp SCAFCO 24L3025, 1750 rpm (Centrif.)', '25 hp SUKUP 25 hp, 1750 rpm (Centrif.)', '30 hp CALDWELL CF-22-30 | 3500 rpm (Centrif.)', '30 hp DMC CF-30 | 1750 rpm (Centrif.)', '30 hp DMC CHS-30 | 3500 rpm (Centrif.)', '30 hp GSI CF-30 | 1750 rpm (Centrif.)', '30 hp GSI CHS-30 | 3500 rpm (Centrif.)', '30 hp KEHO (Centrif.)', '30 hp MIDDLE STATE MS 18-300 (Centrif.)', '30 hp MIDDLE STATE MS 18-330 (Centrif.)', '30 hp NECO 33" (Centrif.)', '30 hp SCAFCO 24H2230, 3450 rpm (Centrif.)', '30 hp SCAFCO 24L3030, 1750 rpm (Centrif.)', '30 hp SHIVVERS 33" Big Blue (Centrif.)', '30 hp SHIVVERS 33" Double Inlet (Centrif.)', '30 hp SUKUP 30 hp, 1750 rpm, Double Inlet (Centrif.)', '30 hp SUKUP 30 hp, 1750 rpm, Single Inlet (Centrif.)', '30 hp SUKUP 30-303 (Centrif.)', '30 hp SUKUP 3500 rpm (Centrif.)', '30 hp SUKUP 44" (Axial)', '40 hp CALDWELL CF-22-40 | 3500 rpm (Centrif.)', '40 hp CALDWELL CF-33-40 | 1750 rpm (Centrif.)', '40 hp DMC CF-40 | 1750 rpm (Centrif.)', '40 hp DMC CF-40 | 1750 rpm x 2 inlets (Centrif.)', '40 hp DMC CF-50 | 1750 rpm (Centrif.)', '40 hp DMC CHS-40 | 3500 rpm (Centrif.)', '40 hp GSI CF-40 | 1750 rpm (Centrif.)', '40 hp GSI CF-40 | 1750 rpm x 2 inlets (Centrif.)', '40 hp GSI CF-50 | 1750 rpm (Centrif.)', 44 University of Ghana http://ugspace.ug.edu.gh '40 hp GSI CHS-40 | 3500 rpm (Centrif.)', '40 hp MIDDLE STATE MS 18-300 (Centrif.)', '40 hp MIDDLE STATE MS 18-330 (Centrif.)', '40 hp NECO 33" (Centrif.)', '40 hp SCAFCO 24H2240, 3450 rpm (Centrif.)', '40 hp SCAFCO 24L3340, 1750 rpm (Centrif.)', '40 hp SHIVVERS 33" Big Blue (Centrif.)', '40 hp SUKUP 3500 rpm (Centrif.)', '40 hp SUKUP 40 hp, 1750 rpm, Double Inlet (Centrif.)', '40 hp SUKUP 40-303 (Centrif.)', '50 hp DMC CF-50 | 1750 rpm x 2 inlets (Centrif.)', '50 hp DMC CHS-50 | 3500 rpm (Centrif.)', '50 hp GSI CF-50 | 1750 rpm x 2 inlets (Centrif.)', '50 hp GSI CHS-50 | 3500 rpm (Centrif.)', '50 hp MIDDLE STATE MS 18-330 (Centrif.)', '50 hp SCAFCO 24H2250, 3450 rpm (Centrif.)', '50 hp SCAFCO 24L3350, 1750 rpm (Centrif.)', '50 hp SHIVVERS 27" Big Blue (Centrif.)', '50 hp SHIVVERS 33" Big Blue (Centrif.)', '50 hp SUKUP 3500 rpm (Centrif.)', '50 hp SUKUP 50 hp, 1750 rpm, Double Inlet (Centrif.)', '50 hp SUKUP 50-303 (Centrif.)', '60 hp MIDDLE STATE MS 18-330 (Centrif.)', '60 hp SUKUP 3500 rpm (Centrif.)', '75 hp SHIVVERS 33" Big Blue (Centrif.)', ] return data 45 University of Ghana http://ugspace.ug.edu.gh Models from PyQt5.QtGui import QFont from PyQt5.QtWidgets import QApplication, QFileDialog from controller import Compute from helper import add_roboto_fonts from views import MainFrame, ResultDialog from fpdf import FPDF if __name__ == '__main__': ##### instantiating the application, setting font style and application name app = QApplication([]) add_roboto_fonts() roboto_font = QFont('Roboto') roboto_font.setHintingPreference(QFont.HintingPreference.PreferNoHinting) app.setApplicationDisplayName('Drying DSS') app.setApplicationName('Drying DSS') app.setApplicationVersion('1.0') app.setFont(roboto_font) win = MainFrame() win.show() ### function to handle the generate button def handle_generate(): dialog = ResultDialog(win) crop = win.crops_cb.currentText() capacity = win.capacity_le.text() tonnes_checked = win.tonnes_radio.isChecked() drying_method = win.drying_cb.currentText() budget = win.budget_cb.currentText() process_compute = False capacity_format = 'tonnes' if tonnes_checked: try: 46 University of Ghana http://ugspace.ug.edu.gh if crop == 'Shelled Corn': if float(capacity) <= 1702.0 and float(capacity) > 0: process_compute = True elif crop == 'Rough Rice': if float(capacity) <= 1385.0 and float(capacity) > 0: process_compute = True else: if float(capacity) <= 1846.0 and float(capacity) > 0: process_compute = True except: process_compute = False else: if float(capacity) <= 67858: capacity_format = 'bushel' process_compute = True else: process_compute = False if process_compute: compute = Compute(crop, capacity, capacity_format, drying_method, budget) results = compute.get_calculated_data() def handle_save_to_pdf(): filename, _ = QFileDialog.getSaveFileName(dialog, 'Save File', '', '*.pdf') if filename: text = f"""DRYING DSS* * * BIN DIAMETER* Feet: {results['bin_diameter']['ft']} ft* Meters: {results['bin_diameter']['m']} m* * GRAIN DEPTH* Feet: {results['grain_depth']['ft']} ft* Meters: {results['grain_depth']['m']} m* * AIRFLOW* Value: {results['budget']['airflow']} cfm* * AIRFLOW RATE* Value: {results['budget']['airflow_rate']} cfm/ft sq.* * HORSE POWER RATING* Value: {results['horse_power']} hp* * 47 University of Ghana http://ugspace.ug.edu.gh AVAILABLE FANS IN THE MARKET:- """ temp = """* {} """ for item in results['horse_powers']: text += temp.format(item) text = text.split('*') pdf = FPDF() pdf.add_page() i = 0 for x in text: if i == 0: pdf.set_font('helvetica', size=12) pdf.cell(200, 10, txt = x, ln = 1, align = 'C') else: pdf.set_font('helvetica', size=9) pdf.cell(200, 10, txt = x, ln = 1) i =+ 1 # save the pdf with name .pdf pdf.output(filename) dialog.close() dialog.to_pdf_button.clicked.connect(handle_save_to_pdf) dialog.bin_diameter_ft.setText(f"Feet: {results['bin_diameter']['ft']} ft") dialog.bin_diameter_m.setText(f"Meters: {results['bin_diameter']['m']} m") dialog.grain_depth_ft.setText(f"Feet: {results['grain_depth']['ft']} ft") dialog.grain_depth_m.setText(f"Meters: {results['grain_depth']['m']} m") dialog.airflow.setText(f"Value: {results['budget']['airflow']} cfm") dialog.airflow_rate.setText(f"Value: {results['budget']['airflow_rate']} cfm/ft2") 48 University of Ghana http://ugspace.ug.edu.gh if (results['horse_power'] == '0.00'): dialog.horse_power.setText('Not economically viable to dry grain due to relatively low volume') else : dialog.horse_power.setText(f"Value: {results['horse_power']} hp") dialog.fans_cb.addItems(results['horse_powers']) dialog.exec_() else: win.error_label.show() win.error_label.setText('Invalid value! Please enter a valid volume.') win.generate_btn.clicked.connect(handle_generate) import sys sys.exit(app.exec_()) 49 University of Ghana http://ugspace.ug.edu.gh User Interface Design #### UI design from PyQt5.QtWidgets import ( QDialog, QFrame, QRadioButton, QVBoxLayout, QHBoxLayout, QLineEdit, QPushButton, QLabel, QComboBox, QScrollArea ) from PyQt5.QtCore import Qt from PyQt5.QtGui import QIntValidator class MainFrame(QFrame): def __init__(self, parent=None): super().__init__(parent=parent) title_label = QLabel('Drying DSS') title_label.setStyleSheet('color: #333; font-size: 32px;') title_label.setContentsMargins(0, 10, 10, 25) ############ Crops crops_label = QLabel('Select Grains') self.crops_cb = QComboBox() self.crops_cb.addItems(('Shelled Corn', 'Rough Rice', 'Soybeans')) self.crops_cb.setMinimumSize(330, 40) self.crops_cb.setMaximumSize(330, 40) crops_lay = QVBoxLayout() crops_lay.addWidget(crops_label) crops_lay.addWidget(self.crops_cb) crops_lay.setSpacing(5) ############ Capacity capacity_label = QLabel('Volume') self.bushel_radio = QRadioButton('Bushels') self.tonnes_radio = QRadioButton('Tonnes') self.tonnes_radio.setChecked(True) 50 University of Ghana http://ugspace.ug.edu.gh cap_lay = QHBoxLayout() cap_lay.addWidget(capacity_label) cap_lay.addStretch(1) cap_lay.addWidget(self.bushel_radio) cap_lay.addWidget(self.tonnes_radio) self.capacity_le = QLineEdit() self.capacity_le.setPlaceholderText('Capacity') self.capacity_le.setMinimumSize(330, 40) self.capacity_le.setMaximumSize(330, 40) self.capacity_le.textChanged.connect(self.handle_capacity_text_change) capacity_lay = QVBoxLayout() capacity_lay.addLayout(cap_lay) capacity_lay.addWidget(self.capacity_le) capacity_lay.setSpacing(5) ########### Drying Methods drying_label = QLabel('Select drying method') self.drying_cb = QComboBox() self.drying_cb.addItems(('Low Temperature Drying', 'Layer Drying', 'Batch-in-bin Drying')) self.drying_cb.setMinimumSize(330, 40) self.drying_cb.setMaximumSize(330, 40) drying_lay = QVBoxLayout() drying_lay.addWidget(drying_label) drying_lay.addWidget(self.drying_cb) drying_lay.setSpacing(5) ######### Budget budget_label = QLabel('Select budget type') self.budget_cb = QComboBox() self.budget_cb.addItems(('Low budget', 'Medium budget', 'High budget')) self.budget_cb.setMinimumSize(330, 40) self.budget_cb.setMaximumSize(330, 40) budget_lay = QVBoxLayout() budget_lay.addWidget(budget_label) budget_lay.addWidget(self.budget_cb) budget_lay.setSpacing(5) ########### First Form Layout first_lay = QHBoxLayout() 51 University of Ghana http://ugspace.ug.edu.gh first_lay.addLayout(crops_lay) first_lay.addLayout(capacity_lay) first_lay.setSpacing(30) first_lay.setAlignment(Qt.AlignmentFlag.AlignLeft) ########## Second Form Layout sec_lay = QHBoxLayout() sec_lay.addLayout(drying_lay) sec_lay.addLayout(budget_lay) sec_lay.setAlignment(Qt.AlignmentFlag.AlignLeft) sec_lay.setSpacing(30) ########## Content Frame content_frame = QFrame() content_frame.setObjectName('content-frame') self.generate_btn = QPushButton('GENERATE') self.generate_btn.setObjectName('gen-btn') btn_lay = QHBoxLayout() btn_lay.addWidget(self.generate_btn) btn_lay.setAlignment(Qt.AlignmentFlag.AlignLeft) self.error_label = QLabel() self.error_label.setStyleSheet('font-size: 13px; color: #333;') content_lay = QVBoxLayout(content_frame) content_lay.addWidget(title_label) content_lay.addLayout(first_lay) content_lay.addLayout(sec_lay) content_lay.addLayout(btn_lay) content_lay.addStretch(1) content_lay.addWidget(self.error_label) content_lay.setAlignment(Qt.AlignmentFlag.AlignTop) content_lay.setSpacing(20) ######### Scrolling Area sa = QScrollArea() sa.setWidget(content_frame) sa.setFrameShape(QFrame.NoFrame) sa.setWidgetResizable(True) ######### Main Layout main_lay = QVBoxLayout(self) main_lay.addWidget(sa) self.setMinimumSize(740, 400) self.setMaximumSize(740, 400) 52 University of Ghana http://ugspace.ug.edu.gh self.setStyleSheet( """ MainFrame, QScrollArea, #content-frame { background: #fff; outline: none; } QLineEdit { outline: none; background: #fff; border-radius: 5px; padding: 5px; border: 2px solid #bdbdbd; } QLineEdit::hover { border: 2px solid teal; } QLineEdit::focus { border: 2px solid teal; } QRadioButton { font-size: 14px; } QComboBox { outline: none; border: 2px solid #bdbdbd; color: #121212; selection-background-color: #258cfd; border-radius: 5px; padding: 5px; } QComboBox::drop-down { subcontrol-origin: padding; subcontrol-position: top right; width: 20px; border-left-width: 0px; border-right-width: 0px; border-radius: 0px; padding-left: 0px; margin-left: 0xp; } QComboBox::down-arrow { 53 University of Ghana http://ugspace.ug.edu.gh width: 12px; height: 12px; image: url(icons/expand_arrow.png); } QComboBox:on { border-color: teal; } QComboBox QAbstractItemView { background: #fff; outline: none; selection-background-color: teal; min-height: 35px; } #gen-btn { outline: none; background: teal; color: #fff; border: none; padding: 10px; padding-right: 20px; padding-left: 20px; border-radius: 5px; } """ ) def handle_capacity_text_change(self, text: str): if text: self.error_label.hide() class ResultDialog(QDialog): def __init__(self, parent=None): super().__init__(parent=parent) results_label = QLabel('Results') results_label.setAlignment(Qt.AlignmentFlag.AlignCenter) results_label.setStyleSheet("font-size: 32px; color: #333;") bin_diameter_label = QLabel('Bin Diameter') bin_diameter_label.setAlignment(Qt.AlignmentFlag.AlignCenter) bin_diameter_label.setStyleSheet("font-size: 24px; color: #333; font- family: 'Roboto Medium'; font-weight: 500;") self.bin_diameter_ft = QLabel() 54 University of Ghana http://ugspace.ug.edu.gh self.bin_diameter_m = QLabel() self.bin_diameter_ft.setAlignment(Qt.AlignmentFlag.AlignCenter) self.bin_diameter_m.setAlignment(Qt.AlignmentFlag.AlignCenter) bin_diameter_lay = QVBoxLayout() bin_diameter_lay.addWidget(bin_diameter_label) bin_diameter_lay.addWidget(self.bin_diameter_ft) bin_diameter_lay.addWidget(self.bin_diameter_m) bin_diameter_lay.setSpacing(5) bin_diameter_lay.setAlignment(Qt.AlignmentFlag.AlignCenter) bin_diameter_lay.setContentsMargins(10, 15, 10, 10) grain_depth_label = QLabel('Grain Depth') grain_depth_label.setAlignment(Qt.AlignmentFlag.AlignCenter) grain_depth_label.setStyleSheet("font-size: 24px; color: #333; font- family: 'Roboto Medium'; font-weight: 500;") self.grain_depth_ft = QLabel() self.grain_depth_m = QLabel() self.grain_depth_ft.setAlignment(Qt.AlignmentFlag.AlignCenter) self.grain_depth_m.setAlignment(Qt.AlignmentFlag.AlignCenter) grain_depth_lay = QVBoxLayout() grain_depth_lay.addWidget(grain_depth_label) grain_depth_lay.addWidget(self.grain_depth_ft) grain_depth_lay.addWidget(self.grain_depth_m) grain_depth_lay.setSpacing(5) grain_depth_lay.setAlignment(Qt.AlignmentFlag.AlignCenter) grain_depth_lay.setContentsMargins(10, 15, 10, 10) airflow_label = QLabel('Airflow') airflow_label.setStyleSheet("font-size: 24px; color: #333; font- family: 'Roboto Medium'; font-weight: 500;") airflow_label.setAlignment(Qt.AlignmentFlag.AlignCenter) self.airflow = QLabel() self.airflow.setAlignment(Qt.AlignmentFlag.AlignCenter) airflow_lay = QVBoxLayout() airflow_lay.addWidget(airflow_label) airflow_lay.addWidget(self.airflow) airflow_lay.setSpacing(5) airflow_lay.setAlignment(Qt.AlignmentFlag.AlignCenter) airflow_lay.setContentsMargins(10, 15, 10, 10) airflow_rate_label = QLabel('Airflow Rate') 55 University of Ghana http://ugspace.ug.edu.gh airflow_rate_label.setAlignment(Qt.AlignmentFlag.AlignCenter) airflow_rate_label.setStyleSheet("font-size: 24px; color: #333; font- family: 'Roboto Medium'; font-weight: 500;") self.airflow_rate = QLabel() self.airflow_rate.setAlignment(Qt.AlignmentFlag.AlignCenter) airflow_rate_lay = QVBoxLayout() airflow_rate_lay.addWidget(airflow_rate_label) airflow_rate_lay.addWidget(self.airflow_rate) airflow_rate_lay.setSpacing(5) airflow_rate_lay.setAlignment(Qt.AlignmentFlag.AlignCenter) airflow_rate_lay.setContentsMargins(10, 15, 10, 10) horse_power_label = QLabel('Horse Power Rating') horse_power_label.setAlignment(Qt.AlignmentFlag.AlignCenter) horse_power_label.setStyleSheet("font-size: 24px; color: #333; font- family: 'Roboto Medium'; font-weight: 500;") self.horse_power = QLabel() self.horse_power.setAlignment(Qt.AlignmentFlag.AlignCenter) fans_label = QLabel('Available fans in the market') fans_label.setAlignment(Qt.AlignmentFlag.AlignCenter) self.fans_cb = QComboBox() self.fans_cb.setMinimumSize(400, 35) self.fans_cb.setMaximumSize(400, 35) self.fans_cb.setMaxVisibleItems(20) fans_lay = QVBoxLayout() fans_lay.addWidget(fans_label) fans_lay.addWidget(self.fans_cb) fans_lay.setSpacing(5) fans_lay.setContentsMargins(10, 15, 10, 10) fans_lay.setAlignment(Qt.AlignmentFlag.AlignCenter) horse_power_lay = QVBoxLayout() horse_power_lay.addWidget(horse_power_label) horse_power_lay.addWidget(self.horse_power) horse_power_lay.addLayout(fans_lay) horse_power_lay.setSpacing(5) horse_power_lay.setAlignment(Qt.AlignmentFlag.AlignCenter) horse_power_lay.setContentsMargins(10, 15, 10, 10) self.to_pdf_button = QPushButton('SAVE TO PDF') self.to_pdf_button.setMinimumHeight(35) self.to_pdf_button.setObjectName('btn') 56 University of Ghana http://ugspace.ug.edu.gh btn_lay = QHBoxLayout() btn_lay.addWidget(self.to_pdf_button) btn_lay.setAlignment(Qt.AlignmentFlag.AlignCenter) btn_lay.setContentsMargins(10, 15, 10, 10) results_lay = QVBoxLayout(self) results_lay.addWidget(results_label) results_lay.addLayout(bin_diameter_lay) results_lay.addLayout(grain_depth_lay) results_lay.addLayout(airflow_lay) results_lay.addLayout(airflow_rate_lay) results_lay.addLayout(horse_power_lay) results_lay.addStretch(1) results_lay.addWidget(self.to_pdf_button) results_lay.setAlignment(Qt.AlignmentFlag.AlignTop) results_lay.setContentsMargins(10, 10, 10, 10) self.setMinimumSize(400, 720) self.setStyleSheet(""" ResultDialog { background: #fff; } #btn { outline: none; background: teal; color: #fff; border: none; padding: 10px; padding-right: 20px; padding-left: 20px; border-radius: 5px; } """) 57 University of Ghana http://ugspace.ug.edu.gh Figure 3 - Inputs for Simulation 1 58 University of Ghana http://ugspace.ug.edu.gh Figure 4 - Outputs for Simulation 1 59 University of Ghana http://ugspace.ug.edu.gh Figure 5 - PDF exportation of results 60