{'fraction_non_alphanumeric': 0.030639957289756506, 'fraction_numerical': 0.013602284069543419, 'mean_word_length': 4.855123674911661, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Methods of Ensuring Energy Security with the Use of Hard Coal—The Case of Poland

: In this article, the authors present methods based on hard coal that may ensure energy security for European Union countries. The research was carried out based on the example of Poland. The main reason for which coal is being gradually withdrawn from the energy mixes in EU countries is its negative impact on the natural environment and the health of citizens and economic factors related to domestic fuel production. The authors propose the creation of energy–chemical clusters as a solution to these problems. It is assumed that the clusters would operate following the principles of the circular economy. We also propose methods for the optimization of the production and transport costs within the cluster. Then, we conduct proﬁtability analysis of the proposed waste management methods. At the level of the designated cluster, using network algorithms enabled us to reduce the transport costs by at least 50%. It is possible to obtain rare earth elements (REEs) worth USD 22,970 from 1 Mg of ash. At the level of the analyzed cluster, this leads to an annual proﬁt of USD 3.5 billion. The proﬁt related to algae production at the cluster level is approximately USD 2.5 bn.


Introduction
For each country, one of the fundamental aspects of national security is energy security. Access to energy is crucial for a sound economy and to ensure decent living standards for citizens. In the twenty-first century, countries worldwide are facing new challenges related to ensuring energy security for citizens. This security should be considered in terms of the availability of energy in adequate amounts at a given time; the price of energy, which enables every citizen to use it; and the impact of energy production on the natural environment. Each aspect is undoubtedly a challenge; in the European Union, the ecological aspect of energy production is becoming particularly critical. This is reflected in EU policy [1]. This article presents the case of Poland, a country whose energy mix is mainly based on coal (i.e., in approximately 50%). In electricity production, this share is even more significant and amounts to nearly 75% [2]. The use of coal emits 50% more CO 2 into the atmosphere than the use of natural gas and 25% more than the use of crude oil. Therefore, EU countries must comply with the provisions of the Climate Change Convention to limit the share of coal in the energy mix.
The situation is similar in Poland. However, Poland is a special case in comparison to other EU countries. Its coal resources are at the level of 5% of the world's reserves [2]. Therefore, it is not surprising that coal is the main raw material in the Polish energy industry. Accordingly, removing coal from the Polish mix represents an enormous challenge. Firstly, heat and electricity generation infrastructure is tailored to this fossil fuel; secondly, Poland does not have indigenous sources of energy that might replace coal. Even assuming that it would be possible to obtain a stable supply of renewable energy in the future or to store it at a large scale, renewable energy sources will not replace coal for another 30 years [2].

•
In terms of fuel and energy competitiveness: methods of designing an energy-chemical cluster and optimizing the cluster's functioning; • In terms of environmental protection: clean coal technology (CCT).
The research began with an analysis of the literature related to the theory of clusters. Then, to create clusters, the tools of the spatial information system were used. The next step was to develop cluster optimization and CCT methods to reduce the emission of pollutants in the coal combustion process. Waste obtained in the incineration process, following the assumptions of the circular economy, was treated as intermediate products, and the methods of their management were proposed. The methodology used in the research is presented in the scheme (Figure 1). The combustion of fossil fuels, in addition to solid waste in the form of fly ash, also produces gases. The most problematic of these gases is CO 2 , responsible for global warming and climate change [19]. There are many strategies for reducing CO 2 emissions, such as sequestration (CCS), including post-combustion, oxyfuel, pre-combustion and carbon capture [20,21]. The separated CO 2 can be used in enhanced oil recovery (EOR) operations or to feed algae, phytoplankton, or bacteria, which enables the production of food, nutritional supplements, livestock feed, methane, and lipids that can be converted into biofuel and even an algal plastic called polyethylene furandicarboxylate (PEF) [22]. Because conventional methods used in CO 2 separation are energy-consuming and not environmentally friendly [23], membrane technologies are introduced as an alternative. These methods are increasingly used due to their high efficiency, low energy demand, simple design, expandability, and economic and ecological reasons [23][24][25]. Both inorganic and organic membranes are promising in CO 2 separation. However, each of the two types of membranes has advantages and disadvantages. Therefore, the best solution is to use hybrid membranes, also known as mixed matrix membranes (MMMs). These membranes are obtained by introducing inorganic additives into a polymer matrix [26,27]. For the production of CO 2 selective hybrid membranes, the most common fillers are silica, metal oxides, CNTs, graphene, nanofibers, zeolites, CMS, MOFs, and POFs, which are incorporated into various polymer matrices, such as poly(1-trimethylsilyl-1-propyne) (PTMSP), PEBAX, Matrimid, polydimethylsiloxane (PDMS), poly(vinyl acetate (PVAc), polysulfone (PSF), cellulose acetate (CA), poly(2,6-dimethyl-1,4-phenylene oxide) (PPO), brominated sulfonated poly(2,6-dimethyl-1,4-phenylene oxide) (BSPPO), sulfonated poly(ether ether ketone) (SPEEK), poly(ether-block-amide), Ultrason, polyvinylamine, polymers of intrinsic microporosity (PIM-1), various polyimides, fluorinated polyimides (FPI), and many others [19][20][21][23][24][25][28][29][30][31][32]. This usually leads to the creation of hybrid materials with enhanced gas transport, mechanical, thermal, electric, or magnetic properties, adjusted by control of the composition, content, and morphology of the filler addition, application of different processing techniques, or by applied modification of both phases [33,34].
Considering China's monopoly, shrinking REE deposits, and their increasing use in modern technologies, there is a need to find alternative sources of these elements. Moreover, conventional REE mining techniques are energy-consuming and generate large amounts of toxic waste [35]. It has been found that fly ash from coal combustion may become an extremely interesting secondary source of REEs. However, even though there are many publications on the disposal of coal fly ash, a small percentage of them treat them as a potential source of REEs [36]. Most of the research focuses on their use in the cement industry, mine reclamation, and agricultural application [36,37], while their use as a potential REE source is a new research area.
Methods used for REE recovery from coal fly ash could be divided into a few groups, such as physical, acid-alkaline leaching, and biological. All these methods have their advantages and disadvantages. The application of physical methods was ineffective for fly ashes [38][39][40]. In comparison, the biological methods based on bioleaching are less efficient but are environmentally friendly [41,42]. The efficiency of the next group, namely acid-alkaline leaching, depends on many factors, such as ash physicochemical characteristics, leaching of other metals, and the influence of the extract composition. They are characterized by the highest efficiency and high consumption of reagents and energy [43][44][45][46]. To modify them, the roasting of coal fly ashes with various reagents, optimization of process parameters, removal of iron oxides, and combination with physical methods have been proposed [38,43]. Because the conventional methods used to recover REEs from obtained extracts have many limitations, some alternative methods based on ionic liquids and membrane techniques were introduced [47]. It was found that the membrane techniques made it possible to achieve REE recovery of over 90%.
On the other hand, introducing ELM and HFLM membranes and their modification (multistage process, complexation with EDTA or DTPA, and introduction of IIPs) made it possible to achieve 100% recovery of REEs [48][49][50][51]. In turn, the use of appropriately selected ionic liquids and multistage extraction allows for the enrichment of REEs above 95% [52,53]. They could be an alternative for conventionally used organic extractants because of their excellent extractability and safety for the natural environment.
Despite the fact that there are ores more abundant in REEs than fly ash around the world, they often contain a small amount of the most valuable elements, such as neodymium or scandium. In turn, this is a sufficient condition to make the process financially attractive [54,55]. It will be profitable to obtain REEs from Polish ashes because they contain a high concentration of the most valuable elements [55].
This has prompted research on technologies for obtaining REEs from ashes, as was the case with, for example, the US Department of Energy [56], the Battelle Memorial Institute, the University of Wyoming, and the Southern Research Institute's [56] research on several dozen methods of obtaining REEs in Germany [57], or research conducted in Poland by the Central Mining Institute and the Polish Academy of Sciences [58]. Until now, extraction processes were carried out on the bench or pilot scale [56]. In Poland, no extensive research has yet been carried out on fly ash as an REE source [59]. It has been proven that the best results are achieved by the chemical leaching of ashes, which are additionally subjected to chemical treatment [57]. Apart from economic considerations, an important aspect motivating the interest in fly ash as a source of REEs is the ecological factor. This enables the sustainable management of natural resources and waste disposal [59].

Materials and Methods
Polish mining and energy industries have had a stable position so far and they comprise individual plants. The focus of their activity is the creation of only one product, i.e., hard coal or electricity. However, concerns about the natural environment and the need to reduce production costs as well as fuel and energy prices are forcing the introduction of modifications to the production organization of these units. This must be considered taking into account creating "energy factories". In such a type of factory, both the inputs and outputs of the model are considered. The main focus of energy factories is not only the final product as such, as the boundary between intermediate products and finished products is becoming blurred. Applying a holistic approach to an integrated system of using coal, it should be noted that hard coal is an intermediate product that is further processed through subsequent links in the distribution chain.
Additionally, the generated energy is also not the final product in this supply chain because it is created in conjunction with other products (waste) that maximize the value of intermediates such as coal or electricity. In the current market, and considering the current political conditions, the circular economy is a very effective organizational solution that enables the use of waste [60,61]. This is consistent with the provisions of the European Union and, at the same time, shall enable the adoption of environmentally safe solutions. The basic ideas of the circular economy concept appeared as early as in the 1960s [62]. The European Union emphasizes implementing this type of economy wherever possible. The resolution of the European Parliament draws attention to the advantages of the circular economy and indicates the need for creating appropriate legal regulations and administrative conditions to facilitate its implementation [63]. The resolution also indicates the importance of using all kinds of waste, especially net greenhouse gas emissions for the environment.
The European Green Deal Communication presents an action plan for the efficient use of resources thanks to the circular economy and assumes that, by 2050, the EU economy will be characterized by zero greenhouse gas emissions [64]. The circular economy is a tool for the European Union that will enable the transition towards a competitive and low-emission economy in all Member States. According to the European Commission definition, the circular economy is an economy in which the value of products, materials, and resources is maintained for as long as possible and the generation of waste is kept to a minimum [65]. As a result, the processed resources are used as much as possible, leading to an increase in resource efficiency. The waste is recycled, which brings extra added value. Methods of creating clusters and their optimization, including the principles of the circular economy, are presented below.

Cluster Design Methods
The authors of the paper have proposed both organizational and technical methods for building and optimizing integrated systems to produce energy and co-products based on fossil fuels. The authors proposed the creation of energy and chemical clusters [66,67]. The idea of creating clusters in the industry was disseminated in the 1990s by Michael Porter [68]. Since then, they have been successfully used in many industries worldwide [69][70][71][72]. In Poland, this idea has evolved slowly since 2004, i.e., when Poland joined the European Union [73]. Regarding the creation of energy clusters, the first serious steps in this direction were taken in 2016. This was related to developing the definition of an energy cluster included in the Law on Renewable Energy Sources [74]. Clusters created in Poland are mainly based on renewable energy sources and on dispersed energy generation [75].
The EU promotes their development, and economic efficiency is not always the main priority. Therefore, it can be concluded that these are clusters created on a top-down basis, i.e., the stimuli to create such structures come from local government units. On the other hand, the clusters proposed by the authors are a bottom-up initiative and their construction should be carried out by enterprises operating in the energy market. The clusters proposed by the authors may enhance competition in the market, reduce the costs of obtaining fuel and energy, and offer added value obtained from the use of waste from the fossil fuel combustion process.
The cluster consists of such facilities as mines, power plants, combined heat and power plants, chemical plants, photovoltaic farms, and biomass-producing units. The clusters were built in the geographical area of the Silesian Voivodeship. It was determined mainly by the concentration of hard coal deposits in this area. Cooperation of the entities included in the cluster should ensure an increase in the effectiveness of their operation.
The distribution chain of products and intermediate products within the energychemical cluster is presented in Figure 2. It is started by a fuel producer or supplier. The fuel can be converted, for example, into liquid fuels or syngas, electricity, or heat. Finished products are delivered to the recipients. Heat and electricity are generated using clean coal technologies, i.e., the membrane technology proposed by the authors (described later in the paper). Then, the production waste from the process is transferred along the chain to the next stage, where it is reused as raw material for further processing. The gases separated in the membrane modules, such as CO 2 , are the basis for producing usable chemicals or in biomass production. In the cultivation of biomass (e.g., algae), waste heat from power plants and heating plants is also used, which speeds up the photosynthesis process. Biomass can be delivered to the recipient, used in the co-combustion of fuels, or processed into liquid fuels. On the other hand, combustion solid waste, such as coal fly ash (CFA), can be a source of valuable elements, such as rare earth metals. Depending on the type of waste, its sale process will vary. CFA recycling scenarios have been developed and described in the literature. They indicate that the waste may be used within the cluster or may be of interest to a third party [76]. The products that will be created thanks to the waste management of the coal combustion process are: CO 2 -will be used within the cluster for the production of biomass; Sulfuric and nitric acids-will be used within the cluster to obtain REEs; Fly ash-by keeping waste in a closed circuit, the amount of waste will be reduced, and its storage costs will be lowered. The developed CFA recycling scenarios also assume that part of the fly ash may be sold to companies interested in using it, e.g., to produce building materials [76]. The product will be delivered to the recipient, e.g., via the manufacturer's car transport. This type of sale is carried out by the Tauron Group using an internet service [77]. The remainder of the ashes will be used for the production of REEs, during the sale of which an internet service will also be used. Fly ash for processing within the cluster can be transported in the same way as coal. The use of network algorithms proposed in the article will also make it possible to optimize the route of ash transmission from the power plant to the chemical unit.
The clusters were designed using the Quantum GIS 3.10.2 spatial information system. The input data were partially obtained from the OSM website and geoportal.gov.pl, while the authors created other vector layers that were used during the analysis. For this purpose, spatial information systems tools were used, such as geocoding, heat map creation, attribute-based clustering, and network analysis.
Geocoding is a very useful business analytics tool. It involves assigning geographic coordinates to a postal address. Thanks to this, spatial data, which were subjected to further analysis, were obtained [78,79].
Heat maps are used in many fields of science [80][81][82]. In GIS, a map is created by adding a color gradient to an object with a specified radius. This gradient is determined on the basis of a given attribute, e.g., the frequency of a given phenomenon in a specific area. Therefore, the heat map shows the locations with the highest density of objects presented on the map [83].
For attribute-based clustering, the k-means clustering method was used. It consists in adjusting the classification of objects and determining the cluster centroids. The algorithm selects the clusters in individual iterations so that the position of the centroids remains constant in the following steps. The stability of the centroid position is determined based on the Euclidean distance [84][85][86][87].
Network analysis performed for the conducted research was carried out using the Dijkstra algorithm. This algorithm is based on graph theory. The cost attribute is assigned to the edges of the graph, which, for the analysis performed, was the distance covered on a given path. The input data for the analysis were the road network in the studied area. The algorithm determined the shortest path connecting the indicated starting point and endpoint [88].
The authors created a point layer containing the coordinates of all analyzed objects. Based on this, the thermal map and clusters were determined in further steps.

Cluster Functioning Optimization Methods
The transportation problem (TP) is one of the problems falling within the scope of integer programming. The transport algorithm makes it possible to optimize the transport of goods from the producer to the recipient. Thanks to this, it is possible to reduce the costs of transport. The mathematical model of the classical TP can be described by the following formulas [89,90]: where: x ij -the volume of coal transported from the i-mine to the j-power plant; c ij -the unit cost of coal transported from the i-mine to the j-th power plant; a i -the supply limit of the i-th mine; b j -the demand of the j-th power plant; m-the number of mines; n-the number of recipients. The transport issue can occur in two varieties: If the demand and the supply are the same, it is a balanced problem. Otherwise, it is an unbalanced transport problem.

Clean Coal Technologies (CCT)
The authors conduct research on clean coal technology that would enable the separation of the mixture of gases generated during the combustion of fossil fuels [91]. This especially applies to the separation of gases such as SO X , CO 2, or NO X . Thanks to this, the problem of the emission of harmful substances would be eliminated. Additionally, the technology proposed by the authors enables the capture and management of gaseous waste generated during the fossil fuel combustion process.
Clean coal technologies (CCT) are all technological solutions designed to increase the efficiency of the combustion, processing, and extraction of hard coal. As the level of greenhouse gas emissions is constantly increasing worldwide, it is necessary to use technologies that will reduce the negative impact on the natural environment. The authors used membrane techniques for this purpose. These were chosen due to their numerous advantages-first of all, their high energy efficiency and mechanical, thermal, and chemical resistance. Membrane techniques are also much more financially attractive than competing methods [92,93].
The fundamental problem related to the research on finding effective membranes is identifying their proper composition, which would guarantee optimization of their parameters, mainly selectivity and permeability. Additionally, the membranes must be stable and adapted to the conditions of the fuel combustion process. Therefore, the authors proposed using hybrid membranes, also called mixed matrix membranes (MMMs) [94][95][96]. Hybrid membranes allow us to take advantage of a polymer matrix and inorganic additives. The conducted research made it possible to design a membrane module. A module consists of membranes whose type will be selected depending on the composition of the separated gas mixture.
The module may consist of several types of membranes. Additionally, a dust separator will be installed in it, whose purpose will be the protection of the membranes from structural damage caused by solid particles, which are emitted from the furnace during fuel combustion. The feed will first be led through the separator. After pre-cleaning, it will be directed to the membrane module, where the individual gases are separated. Carbon dioxide constitutes 80% of these gases. The rest are, among others, sulfur and nitrogen oxides. The separated gases can be stored as retentate, while the cleaned air can be discharged back into the atmosphere.

Conventional Fuel Combustion Waste Management
The waste generated during the combustion of fossil fuels can be separated into solid and gaseous waste. In line with the principles of the circular economy, these wastes should be used to produce value-added products for the energy generation process. Therefore, the authors proposed methods that allow, firstly, the generation of financial benefits resulting from their utilization and, secondly, the elimination of the waste storage problem. It should be noted that the necessity to store waste clearly creates a cost and has a negative impact on the natural environment.
The obtained gases, which are waste from the combustion process, can be utilized. However, in line with the circular economy principles, it has been assumed that they can be reused. For example, carbon dioxide is used during gas or oil production [106][107][108][109]. It is a factor that stimulates the bed to displace volumes of fuel. After the crude oil has been exploited, CO 2 will be stored in depleted deposits.
Carbon dioxide is also used in phytoplankton or algae production, as it is an indispensable component of the photosynthesis process. Algae biomass is a raw material used to produce biofuels. It can also be used during co-combustion with conventional fuels. Algae are used in agriculture as fodder and fertilizers rich in calcium, magnesium, and phosphorus [22]. A biomass-producing and burning unit has been installed near the Jaworzno III Power Plant as a part of the designed cluster. It was assumed that it would produce biomass in the form of algae. To ensure algae's rapid growth, their cultivation must take place under appropriate conditions. These could be provided by CO 2 delivered via a pipeline directly from the power plant and waste heat generated during electricity production.
Solid waste from the combustion process is currently used in the construction industry, in cement production, for filling voids in the rock mass, etc. Fly ash is also successfully used all over the world in many industries, inter alia, in the cement industry [110,111], in the production of synthetic zeolites [112][113][114], in agricultural applications, and in mine reclamation [37,38]. These methods of fly ash usage eliminate the need for waste storage and thus prevent the migration of harmful substances into soil and water [115]. The use of fly ash in the construction industry is common. In Poland, it can be used in construction if it complies with the developed standards, e.g., PN-EN 450-1: 2012, PN-EN 206: 2014.
As mentioned, the most significant problem is that fly ash is produced in huge quantities and must be stored. The authors also proposed the application of these wastes in the production of rare earth elements (REEs) [112,116].
Fly ash can therefore be a source of obtaining REEs. This kind of extraction process is considered to be less intensive than mining raw products. Additionally, the composition of fly ash contains many REEs, while most mines deliver only several elements. As a result, obtaining REEs from fly ash may be less harmful to the natural environment [117][118][119]. Therefore, obtaining REEs from fly ash has attracted interest among many researchers and companies. For example, the Neumann Systems Group announced that their method made it possible to obtain 60% of REEs from the tested samples [112].

Results and Discussion
It was assumed that the functioning of the proposed clusters would be based on the principles of the circular economy. For this reason, the clusters could produce fuel, generate energy, but also recycle the waste generated in the combustion process to produce additional products. The analysis was limited to the geographical area of the Silesian Province. The province was chosen as energy infrastructure, chemical plants, and hard coal producers are located in the described area and are connected by a well-developed transportation network. The high level of industrialization of the Silesian Voivodeship enables access to expertise, a qualified workforce, and specialists. There are also universities and research centers in the Silesian Province. These are the primary conditions for building clusters. The production and transport plan within the cluster is presented in Figure 3. The following two sections of the chapter present the clusters' creation and the optimization methodology as well as the financial analysis of the proposed waste management solutions.

Creating Energy-Chemical Clusters
Planning of fuel production should begin with preparing forecasts of customer demand and the level of production of coal companies. In their numerous papers, the authors have proposed reliable mathematical models that can be used for this purpose [120][121][122].
The first step in the analysis was to collect the data necessary to build the energy and chemical clusters. For this purpose, the administrative map of the provinces in Poland was obtained [123]. It was also necessary to obtain maps of roads and railway routes in Poland from the Open Street Map website [124]. Data that did not fall within the analyzed area were eliminated with the geoprocessing tools of the QGIS system. Thanks to this, it was possible to speed up the performed analysis. The geocoding process was carried out on the basis of the created maps. This made it possible to build a vector layer, as presented in Figure 4. The layer was called "Objects" and was used in further stages of the analysis. The map contains all the objects that are to be included in the created clusters. In addition, to facilitate visual analysis, individual objects were assigned Scalable Vector Graphics that characterized them.
In the next step, the cluster map was constructed on the basis of the vector layer. This helped to identify hotspots and a group of points was obtained during geocoding. The QGIS plug-in uses Kernel Density Estimation for this purpose. The Kernel shows how the influence of a point decreases as the distance from it increases. Thanks to the conducted analysis, three clusters of points were initially identified ( Figure 5).
Clusters were selected using attribute-based clustering. The coordinates of the analyzed objects were input as attributes for the analysis. It was assumed that the phenomenon of spatial autocorrelation occurs between the individual n elements. This means that geographically close objects are more similar to each other than those that are spatially distant. The similarity of individual objects was determined based on the distance between them. For this purpose, the Euclidean measure was used, which is the distance between two points in the x-space. The determined clusters are shown in Figure 6.
Cluster 1 was selected for further analysis. The operation of the proposed methods was presented based on this example (Figure 7). The analyzed cluster included the following facilities: Jaworzno III and Łaziska Power Plants, Ziemowit, Mysłowice-Wesoła, Piast and BolesławŚmiały mines, EC2 and Bielsko-Biała Power Plants, Synthos chemical plant, and Tauron Solar Farm. In addition to these existing facilities, a biomass production and combustion unit was introduced.    After creating the cluster, a network analysis was performed. This made it possible to determine the shortest routes connecting individual cluster objects. Maps of the road network in the Upper Silesia area were used as input data. The authors applied the Dijkstra algorithm. The shortest paths were determined using the length of the road in km as the selection criterion. There was also the option to select the travel time on a given path as a decision parameter. The algorithm could choose optimal routes and thus the network of connections between the mines and power plants was determined. Two networks were created separately for rail and car connections. The results of the analysis are presented in Figure 8. Table 1 shows the length of the shortest routes for rail transport and Table 2 for road transport.  The created database stored in the QGIS program contains data on the chemical composition of the fuel, its price, and the volume of production for each of the mines included in cluster 1. This enables the preliminary selection of mines following the criteria provided by fuel recipients. An exemplary selection was made by imposing restrictions on calorific value and fuel moisture on the records stored in the database. The database was a reference database. Therefore, its search and filtering were performed in SQL. The entire structure of the used query sent to the database was as follows: SELECT Mine FROM Tab_atryb_21 WHERE "Moisture" < 19 AND "Calorific value" ≥ 19 The inquiry made it possible to reject those producers whose fuel did not meet the recipient's expectations. The next step in the analysis was to build a mathematical model of the transport issue. On the basis of data from the websites of the fuel producers (PGG) and the electricity producer (Tauron), it was determined that the constructed transport issue would be unbalanced. The volume of fuel producers' supply included in the cluster exceeded the volume of power plants' demand. Therefore, the surplus fuel had to be sent to other recipients, e.g., heat and power plants, authorized sellers, or be exported. Since the transport issue is a linear programming algorithm, the simplex method was used to solve it.
The limiting conditions were adjusted to the relationship between the volume of demand and supply. It was assumed that the demand would be fully covered while the supply would be greater than or equal to the demand. The objective function is the sum of the products of transport costs and transport amount on a given route. The function aims at a minimum. Based on the length of the routes and DB Cargo price lists [125], the cost of rail transport on the designated routes was determined. In the case of road transport, the lowest rate was assumed for the coal delivery service of Katowicki Węgiel [126]. The results of the analysis are presented in Tables 3 and 4. We determined the amount of coal to be transferred from the producer to the recipient, thus reducing the transport costs.   Table 5 presents the analysis results considering limitations regarding customers' requirements of fuel quality following the SELECT query presented above. As a result of sending the query to the database, one of the mines that did not meet the selection criteria was eliminated. Therefore, an additional restriction was introduced to the transport issue, eliminating this mine from the transport plan. The presented example concerns rail transport. The information obtained with respect to the optimal fuel transport plan within the cluster was entered into the database in order to create an annual transport plan (Figure 9).
According to the data of the Polish Central Statistical Office, 95 million Mg of coal was transported by rail transport in 2018, while approximately 28 million Mg of coal was transported by road. The average lengths of the transport routes were 158 km and 132 km, respectively. Therefore, if the rate per ton-kilometer of coal was set at a minimum level of PLN 1, the annual costs of coal transport would amount to approximately PLN 15 billion for rail transport and almost PLN 4 billion for road transport. Due to such considerable costs, their reduction, even to a minimal extent, will bring significant financial benefits (Table 6).

CO 2 and REE Management
Annually, approximately 320 million Mg of CO 2 is produced in Poland [2], almost half of which (138 million Mg) is emitted during the combustion of hard coal [127]. The production of 1 Mg of algae needs 1.78 Mg CO 2 [128]. If the CO 2 generated during the combustion of hard coal was used to produce biomass, 77 million tons of algae could be obtained annually.
Such management of CO 2 brings a dual benefit. First, there is no need to purchase CO 2 for algae production. The cost of Mg of CO 2 is approximately USD 25/Mg [129], which translates into savings of USD 3 billion. In addition, this procedure allows us to avoid CO 2 emission payments. The cost of emission is USD 67/Mg CO 2 [130]. Considering the rates for the emission of one Mg, this gives savings of USD 9 billion. The cost of producing 1 kg of algae is USD 0.67 [131]. The total production volume adopted in the analysis amounts to USD 51.5 billion, while the total savings amount to USD 12.7 billion. The average market price per Mg of algae was assumed to be USD 1300 [132]. The revenue from the sale of algae is USD 104.74 billion. Profit after savings is USD 65.8 billion nationwide per year. A similar analysis was performed for the Jaworzno III Power Plant, a part of cluster 1, proposed in this paper. The results of the financial analysis are presented in Tables 7 and 8. Algae production cost, (bn USD) 51. 59 7 Total savings, (mil USD) (4 + 5) 12. 70 8 Income, (bn USD) 104. 72 9 Profit, (bn USD) (8 − 6 + 7) 65.83 Table 8. Economic analysis of the profitability of algae cultivation within cluster 1. Therefore, it should be noted that this type of industrial undertaking brings enormous financial benefits, both on a national scale and within the analyzed cluster. In the initial phase, the production of algae will require investments. However, the authors indicated a potential source of funding. Funds can be obtained based on the shown savings, i.e., the lack of necessity to pay fees for CO 2 emission payments. In addition, power plants such as Jaworzno will not have to allocate funds to the purchase of CO 2 . In the case of REE production, an analysis of the project profitability was also carried out based on a literature study. It was established that 12 million Mg of fly ash is produced annually in Poland. Based on the analyses of ash composition [113] and the prices of elements from the end of 2020 [133], it was determined that from 1 Mg of ash, it is possible to obtain REEs worth USD 22,970. The purchase cost of Mg of fly ash is approximately USD 13 [133]. Therefore, it is possible to obtain revenues of USD 275 billion. The calculations were based on the average operating costs of obtaining REEs from various sources [134]. This cost is USD 15/kg. Including these, the profit is USD 94.6 billion nationwide. A similar analysis was performed for cluster 1.

Factor Value
Additionally, in this case, the necessity to purchase ashes was eliminated. It was calculated that the profit is USD 3.5 billion. The necessary investments will also be inevitable in the construction process of an REE recovery facility. However, the storage of ashes also involves fees that must be paid throughout the entire storage period. Therefore, energy companies could allocate these funds to make the necessary investments. The results are presented in Tables 9 and 10. Table 9. Economic analysis of the profitability of REE recovery in Poland.

Factor Value
Opex, (USD/Mg) 15,000 Purchase of ash, (USD/Mg) 0 Amount of ash produced annually, (mil Mg) 0.45 REE value, (USD/Mg) of ash 22,927 REE value (annual production), (bn USD) 10 Profit, (bn USD) 3.55 Currently, the demand for energy resources is growing worldwide. Their availability is varied, and the resources are limited. Therefore, it is necessary to search for solutions enabling their most effective use and, secondly, the use of waste generated during raw materials processing. Here, the solution is to apply a circular economy model to the mining and energy industries. To meet this challenge and the European Union requirements, it is necessary to develop appropriate technologies and organizational methods. They will allow for: • A reduction in raw material consumption; • A reduction in the emissions level; • Use of the waste's potential and, on the basis, the generation of added value; • Optimization of cooperation between objects included in the cluster.
The emission of gases and dust in Poland has a negative impact on the life and health of citizens and on the flora and fauna of the country. Therefore, importantly, the presented technologies will also reduce the negative impact of the energy industry on the natural environment. Since energy security is of crucial importance for the development and security of countries and their citizens, it is necessary to ensure it at an appropriate level. Poland's energy security is based on coal. The combustion of this fuel is becoming increasingly controversial. The reason for this is the emission of pollutants in the combustion process and the price of Polish fuel. For the next several dozen years, Poland will not be able to build an energy potential that meets the needs of consumers based on a different energy source. Therefore, the authors proposed methods to eliminate emissions and allow coal and energy companies to survive in a competitive market.

Conclusions
The article presents methods for ensuring the energy security of EU countries based on coal. The research was conducted and presented based on the example of Poland. The authors made such a choice due to the composition of the country's energy mix. The methods were classified into two categories: organizational and technological. The organizational methods presented in the article are, above all, combining the units of the fuel and energy industry into clusters. Such a solution will make it possible to reduce the operating costs of individual cluster facilities in many respects. The authors presented some of them, such as optimization of transport in the cluster area. This solution alone would result in savings of PLN 15 million per cluster.
The annual costs of rail coal transport in Poland reach PLN 15 billion, and PLN 4 billion in the case of road transport. Therefore, reducing them even by 1% brings savings of PLN 200 million. Additionally, and importantly, the organizational methods proposed by the authors do not require any investments. They can be applied within a few months directly to cluster objects in their present form. This only requires the implementation of appropriate regulations and organizational procedures. The second category, i.e., technological solutions, will, of course, require financial outlays. However, the proposed Clean Coal Technology can eliminate the negative features of the solutions used so far. Firstly, it does not require interference with the combustion process itself and does not burden it with additional energy consumption. Moreover, it can be used in the case of already existing energy infrastructure.
Additionally, it is suitable for both industrial and household power engineering. The obtained by-products are no longer treated as waste but are processed as an intermediate product. This applies to both solid waste in the form of fly ashes and gaseous waste. The authors proposed using ashes to obtain REEs and gaseous waste to produce biomass used within the cluster for co-combustion. The financial analysis showed that the investments made to produce the goods mentioned above, i.e., biomass and REEs, will be economically viable. Savings associated with such waste management may constitute a source of financing the necessary investments.
It has been estimated that the solutions proposed by the authors will bring substantial financial benefits. At the level of the designated cluster, the use of network algorithms will allow for a reduction in transport costs by at least 50%. From 1 Mg of ash, it is possible to obtain REEs worth USD 22,970. At the level of the analyzed cluster, this would provide an annual profit of USD 3.5 bn. The profit generated in connection with algae production at the cluster level would be approximately USD 2.5 bn.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to the extremely large size.

Conflicts of Interest:
The authors declare no conflict of interest.