1 Introduction

In recent years, significant advances have been made in predicting the aqueous solubility of crystalline drug molecules. From a pharmaceutical standpoint, crystalline solids are frequently preferred when formulating drugs for practical use. Therefore, accurate prediction of the solubility of crystalline drug molecules in different types of solvents would be extremely valuable. This would improve the selection of processes for their production, as well as providing a deeper understanding of how structural modifications affect solubility [1, 2]. Ketoprofen is a nonsteroidal anti-inflammatory drug derived from 2-arylpropionic acid and exhibits efficacy similar to other steroidal anti-inflammatory medications. It is marketed in the racemic form of their R and S enantiomers being widely prescribed for managing conditions such as spondylitis, rheumatoid arthritis, and osteoarthritis, offering antipyretic and analgesic effects. Like sodium naproxen, ketoprofen also acts as a prostaglandin synthesis inhibitor. However, the utilization of this medication has been linked to reported complications, notably gastrointestinal problems, with renal dysfunction and fluid retention being the most frequently observed issues [3]. A crucial challenge with anti-inflammatory drugs lies in their low water solubility, a meager 0.01% by mass. Such limited solubility interferes the drug’s bioavailability within human physiology. Several methodologies, such as including surfactants and creating water-soluble salts, have been employed to augment the drug’s solubility [4]. The use of supercritical fluids has become increasingly popular in industrial processes [5], replacing traditional methods for a variety of applications such as extraction [6], nanoparticle formation [7], impregnation [8], and polymer synthesis [9].

For these applications, phase equilibrium data are essential for binary and multiphase systems containing carbon dioxide (CO2), organic solvents, and solids. Information on liquid–liquid, liquid–vapor, and solid–fluid equilibrium is necessary to develop appropriate recrystallization methodologies [10]. CO2 is a cost-effective and non-toxic compound widely used as a solvent in supercritical extraction due to its high miscibility with other organic solvents used in recrystallization processes [11, 12] and non-flammability. However, solvent selection is critical in processes involving CO2 because it can act as an antisolvent, leading to precipitation of the solute present in the solution or as a co-solvent, increasing the solubility. This behavior is critical in controlling the solubility and morphology of the solid being purified or recrystallized [1]. Therefore, understanding the behavior of a multiphase system containing solute + organic solvent + CO2 is crucial for the abovementioned processes. While an extensive body of literature focuses on the empirical determination of solubilities in supercritical fluids [13], a lacuna exists concerning the experimental solubilities of most pharmaceutical compounds in supercritical fluids, especially sc-CO2. The difficulty of measuring solubility for all possible compounds under a wide range of operational conditions, such as temperature and pressure variations, intensifies this challenge [14, 15].

Consequently, considering these circumstances, predictive tools appear essential for estimating, correlating, and predicting substance solubility in supercritical fluids. The current investigation aims to measure the solubility of ketoprofen using a synthetic method with visual detection of phase transition. In contrast to the literature’s experimental data, which utilized a simple static method coupled with a gravimetric method within a wide range of pressure (16.0 to 40.0 MPa) and temperature (308.15 to 338.15 K) [16], the focus of study is evaluating the behavior of solid–fluid and fluid–fluid equilibria in binary {CO2 + ketoprofen} and ternary {CO2 + ethanol + ketoprofen} systems at different pressure ranges (7 to 14 MPa). The temperature range considered for the experiments was (313 to 333 K), and the investigation included varying molar fractions and solution concentrations of {ethanol + ketoprofen}. Phase transitions, including bubble points and solid–fluid points, were identified during the study. The thermodynamic model used to describe the non-ideal behavior of the fluid phases was the Redlich–Kwong–Peng–Robinson equation of state (RK–PR EoS) [17] with quadratic mixing rules assuming that the solid phase is composed solely of pure ketoprofen (purity state precipitation), implying a total absence of miscibility in the solid state. The assumption of the total absence of miscibility in the solid state can be reasonable considering the molecular size and shape differences between CO2 and ketoprofen molecules [18, 19]. Experimental solid–fluid saturation data for various global compositions were used to fit the parameters of the RK–PR equation of state. Complete isopleths, consisting of solid–fluid and fluid–fluid segments, were calculated for global compositions with available experimental data. Although ketoprofen is widely used as a medicine, limited experimental data are available for producing micro- and nanoparticles in pressurized systems [20]. The main limitations of the equipment are its dependence on the experimentalist’s visual ability to observe the phase transition and the very low solubility of the solute. [20]. The proposed study aims to integrate experimental data obtained using the synthetic static variable volume method with thermodynamic modeling of phase behavior using a cubic equation of state. This approach will be applied to construct a phase diagram that covers a wide range of temperatures, pressures, and compositions, thereby enabling the prediction of the drug’s behavior in regions not experimentally addressed.

2 Material and Methods

2.1 Materials

The characteristics of the compounds used in the present study are specified in Table 1. It is worth mentioning that the material presented was utilized with no further treatment. The naphthalene used in this study was for verification of the equipment and method, and the ketoprofen is a racemic mixture whose stereoisomeric composition is unknown.

Table 1 The characteristics of the compound used in the present work

2.2 Method

2.2.1 Differential Scanning Calorimetry (DSC)

The melting temperature (Tfus) and enthalpy change of fusion (∆Hfus) were determined using the differential scanning calorimetry (DSC) method. The experimental procedure and equipment were the same as used before by Facchi et al. [21]. The DSC method measures the difference in electrical power of a sample as a function of temperature using a differential calorimeter, which enables precise measurements of the heat of the sample’s phase transition. A known amount of the sample was placed in an aluminum dish and heated at a rate of 10 K·min−1 under an argon flow of 50 mL·min−1, with an operating temperature range of 293 to 573 K. The DSC analysis was performed using a Shimadzu model 60 Plus instrument. The instrument was previously calibrated using indium, known for its melting point of 429.78 K, and the calibration result was within the expected range of ± 1.0 K.

2.2.2 Phase Equilibria: Experimental Procedure

The phase equilibrium experiments were conducted using a visual synthetic static method for identifying the phase transition, which involved a variable volume cell operating at high pressures, as illustrated in Fig. 1.

Fig. 1
figure 1

Phase equilibria apparatus: C1 – CO2 cylinder, P1 – syringe pump, TB-1 – thermostatic bath, V1 – V6 – valves, V7 – needle valve, M1 – pressure transducer, T1 – T2 – thermocouples, EC – equilibrium cell, O.W – observation window, L – flashlight, R – electric resistance, P – piston and MS – magnetic stirring

The present phase equilibrium measurement method has been previously introduced in other phase equilibrium studies [5, 22,23,24,25,26]. The experimental setup consisted of a variable volume cell with two sapphire windows for visualizing the cell’s interior and illuminating it, a pressure transducer (Smar model M6) with an uncertainty of ± 0.03 MPa, and a syringe pump (ISCO, model 260 D). The cell had a movable internal piston, allowing for internal pressure control. Phase transitions were visually identified by controlling the temperature and reducing the internal pressure of the cell with the syringe pump. Initially, the syringe pump added a pre-weighed amount of the solution (ethanol + ketoprofen) to the cell. The syringe was weighed before and after, on an analytical balance with an uncertainty of ± 0.0001 g, adding the solution to ensure the actual molar fraction. Ketoprofen was solubilized in ethanol at two different molality concentrations for the ternary system, 0.05073 and 0.10277 molketoprofen·kgethanol−1, and for the binary system was followed the same procedure but without the solubilization of ketoprofen in ethanol. The system was purged with CO2 at low pressure to remove residual atmospheric air, and a known amount of CO2 was fed into the cell using the syringe pump (with a feed uncertainty of 0.005 g). A Teflon-coated magnetic stirrer continuously stirred the cell contents. The temperature was gradually increased to the desired level, with the temperature value having a maximum uncertainty of ± 0.5 K. The pressure was then increased until a single phase was observed in the system. The system was kept under agitation and constant pressure for approximately 30 min to allow for stabilization. The pressure was then slowly reduced (at a rate of 0.1–0.4 MPa·min−1) until a new phase was observed. The procedure was repeated at least thrice for the predetermined temperatures and compositions. Standard deviations (u) were calculated using Eq. 1, where is the mean value, xi is the observed value, and N is the number of samples.

$$u\left(X\right)= \sqrt{\frac{{\sum }_{i=1}^{N}{({X}_{i}-\overline{X })}^{2}}{N-1}}$$
(1)

Considering the experimental procedures detailed above, the expanded uncertainty was estimated as described in the literature [27] at 95% of confidence level, and were never greater than 0.11% in mole fraction basis for carbon dioxide, 0.26% in mole fraction basis for naphthalene, were never greater than 7.64 × 10–6 mol fraction of ketoprofen for the binary system and 1.76 × 10–6 for the ternary system, 0.5 K for temperature and 0.1 MPa for pressure.

2.2.3 Modeling of The Phase Behavior of CO2 (1) + Ketoprofen (4) System

The RK-PR EoS equation has been used to model the phase behavior of the carbon dioxide (1) + ketoprofen (4) system and to compute complete isopleths at set global composition. The interaction parameters of the RK–PR EoS were fitted using the experimental data measured. The primary objective is to determine if the model can accurately replicate the experimental data for SF equilibria with a constant overall composition. Determining a priori whether two components would exhibit partial or complete miscibility in the solid phase is challenging. The extent of solid phase miscibility is deemed insignificant for nonpolar compounds characterized by significant variations in molecular size and shape [28, 29]. Based on practical experience, various empirical guidelines have been employed to forecast the likelihood of solubility in the solid state [30].

Nevertheless, the existing understanding appears inadequate to solely anticipate whether solid solutions or solid precipitation would predominantly occur in a (practically) pure state, or vice versa, without supplementary experimental solid-state data for the system under investigation [30]. The present study has adopted the most straightforward approach, assuming that the solid phase consists solely of pure ketoprofen. In other words, it has assumed a complete lack of miscibility in the solid state, which appears reasonable given the significant molecular size and shape disparities between ketoprofen and CO2. Furthermore, when considering the two extreme assumptions for the solid state, namely complete miscibility versus complete immiscibility, it is generally more realistic to assume complete immiscibility in most cases [30]. Although this study has chosen to model precipitation in a pure state, there is insufficient evidence to completely dismiss the possibility of CO2 coexisting with ketoprofen in the solid phase at equilibrium under sufficiently high pressure. The modeling methodology employed in the present study has previously been utilized [31] differing for depicting the phase behavior of binary asymmetric mixtures, where it has assumed that the solid phase consists solely of the pure heavy compound. Similar to the cited references, this study employed the RK–PR–EoS [17] to calculate the fugacity of components in the fluid state for pure compounds and mixtures. For solid–fluid equilibrium calculations, it has been assumed that the solid phase consists solely of pure ketoprofen (4), considering its highly asymmetric mixture with CO2 (1). “High asymmetry” refers to significant disparities in molecular size and shape between the components in this binary system. The Eq. 2 provides the fugacity of the pure heavy compound in the solid state \({f}_{i}^{S}\left(T, P, {v}_{o}\right)\) at the temperature (T) and pressure (P) of the system [31].

$${f}_{i}^{S}\left(T, P, {v}_{o}\right)= {f}_{i}\left(T,{v}_{o}\right)\text{exp}(U)$$
(2)

In Eq. 2, the symbol \({v}_\text{o}\) corresponds to the molar volume of the pure heavy component (4) when it exists in a (subcooled hypothetical) liquid state at the specific temperature (T) and pressure (P). The fugacity of the pure heavy component in such a pure liquid is \({f}_{i}\left(T,{v}_\text{o}\right)\). The exponential factor in Eq. 2 establishes the relationship between the hypothetical liquid state and the solid state of a pure substance under specific temperature and pressure conditions. The variable U, which is dependent on temperature (T) and pressure (P), is defined as follows:

$$U=\frac{{\Delta v}^\text{S--L}}{{RT}_{tp}}\left[{C}_{1}\left(1-\frac{{T}_\text{tp}}{T}\right)+ {C}_{2}\left(\frac{{T}_\text{tp}}{T}-1+\text{ln}\left(\frac{T}{{T}_\text{tp}}\right)\right)+{C}_{3}\left(\frac{T}{{2T}_\text{tp}}-1+\frac{{T}_\text{tp}}{2T}\right)+\frac{{T}_\text{tp}}{T}(P-{P}_\text{tp})\right]$$
(3)

within Eq. 3, the constants Ttp, Ptp, \({\Delta v}^\text{S--L}\), C1, C2, and C3 are associated with the pure heavy component. \({\Delta v}^\text{S--L}\) is the solid−liquid molar volume difference (\({\nu }_\text{solid}-{\nu }_\text{liquid})\) of the pure component. Ttp and Ptp represent the triple point temperature and pressure, respectively, of the pure component while R denotes the universal gas constant [31]. The constants C1, C2, and C3, in conjunction with Ttp and Ptp, define the solid–fluid equilibrium curve (PT melting curve) of the pure heavy component. The system of equations to be solved for computing a phase equilibrium point involving fluid phases and also solid phases each consisting of a pure component arises from imposing the classical necessary equilibrium conditions, which include equal temperatures, equal pressures, and equal fugacity for each component in all phases. In terms of the computational algorithms utilized, we employed numerical continuation methods (NCMs) to compute all phase equilibrium curves [16, 21, 27, 32].

2.2.4 Parameterization of RK-PR—EoS

The interaction parameters kij and lij were fitted using experimental solid–fluid saturation data using Eq. 4. The temperature dependence of the attractive parameter kij implemented in this study is given by the following Eq. 4

$$k_{{ij}} = k_{{ij}}^{{ + \infty }} + \frac{{A \cdot \left( {k_{{ij}}^{{ - \infty }} - k_{{ij}}^{{ + \infty }} } \right)}}{{A + {\text{exp}}\left[ {p \cdot \left( {T - T_{0} } \right)} \right]}}$$
(4)

The Eq. 4 establishes a sigmoidal function of kij with temperature T. kij asymptotically tends to \({k}_{ij}^{+\infty }\) as T approaches positive infinity and to \({k}_{ij}^{-\infty }\) as T approaches negative infinity (mathematically, since the minimum temperature that could be considered is 0 K). As only three data points are available, and Eq. 4 has five parameters (\(A\), \(p\), \({T}_{0}\), \({k}_{12}^{+\infty }\) and \({k}_{12}^{-\infty }\)), the values of the horizontal asymptotes \({k}_{12}^{+\infty }\) and \({k}_{12}^{-\infty }\) were fixed at − 0.04 and − 0.11, respectively. Then, the remaining three parameters A, \(p\), and \({T}_{0}\) were fitted by the least squares method to the data in Table 2, resulting in the values \(A\) = 22.31, \(p\) = 9.458 × 10–2, and \({T}_{0}\) = 288.63 K. The temperature dependence of the attractive interaction parameter given by Eq. 4 allows kij to vary only within the temperature range where experimental data exist, remaining nearly constant for very low and very high temperatures where the phase behavior of the binary system CO2 (1) + ketoprofen (4) is not known.

Table 2 Properties of pure compounds

The properties of the pure substances employed in this study are documented in Table 2. In the RK–PR–EoS, only Tcrit, Pcrit, and ω are considered. Due to the lack of data regarding the ketoprofen melting curve, the values of C2 and C3 were assumed to be zero. Only the value of C1 was considered, and it was determined using Eq. 5, and the value is reported in Table 3.

Table 3 Ketoprofen constants for Eq. 3
$${C}_{1}=\frac{\Delta {H}_\text{fus}}{{\Delta v}^\text{S--L}}$$
(5)

3 Results

3.1 Experimental Apparatus Validation

Drug characterization was performed to ensure that the ketoprofen used in present study was the same as the drug used in the literature. Figure 2 shows the DSC analysis data of ketoprofen, which allowed for the calculation of the fusion enthalpy change (ΔHfus) and the melting point (Tfus) based on the area under the curve. The experimental results are presented in Table 4 and compared with literature values.

Fig. 2
figure 2

DSC analysis of ketoprofen

Table 4 Experimental measured and literature data of ketoprofen properties used on phase equilibria

As described in the literature [35], the solubility of ketoprofen varies according to the organic solvent used, and its solubility is also dependent on temperature, the higher the temperature, the greater the solubility of ketoprofen in the organic solvent. The solubility values in molar fraction are shown in Table 5.

Table 5 Literature data of ketoprofen solubility in mole fraction in different solvents [35]

The experimental apparatus was validated by comparing the phase equilibrium results of three main systems that have been extensively discussed in the literature, namely {pure CO2}, {CO2 (1) + naphthalene (2)}, and {CO2 (1) + ethanol (3)}.

Table 6 presents the liquid–vapor equilibrium data obtained for CO2 used in this work with 99.5% of purity, which are compared with data obtained by NIST [39] at three different temperatures: 293 K, 297 K, and 303 K.

Table 6 Results obtained from measuring the liquid–vapor (LV) phase equilibrium of pure CO2 were compared to those present in NIST

The Eq. 6 represents the absolute deviation of calculated pressure and experimental pressure.

$$\left|\%\Delta P\right|=\frac{\left|{P}^\text{calc}-{P}^\text{exp}\right|}{{P}^\text{exp}}100$$
(6)

The experimental results shown in Table 6 demonstrate that the accuracy and reliability of the experimental apparatus used are consistent with the literature data, with a difference of pressure not higher than 5.3%.

The equilibrium data of the binary {CO2 (1) + naphthalene (2)} system obtained experimentally are shown in Figs. 3,4 and compared to literature data [40,41,42,43,44,45,46,47,48]. Table 7 summarizes the experimental results obtained for this binary system.

Fig. 3
figure 3

Solubility of naphthalene (y2) in CO2 at 328 K in comparison between data reported in the literature at the same temperature: ♦ – this work; □ – Ref. [43]; Δ – Ref. [48]; ○ – Ref. [45]; ■ – Ref. [44]; +—Ref. [40]; x – Ref. [42]; ӿ – Ref. [46]; ▲ – Ref. [41]; ● – Ref. [47]

Fig. 4
figure 4

Solubility of naphthalene (y2) in CO2 at 338 K in comparison between data reported in the literature at the same temperature: ♦ – this work; □ – Ref. [43]; ○ – Ref. [45]; ● – Ref. [47]

Table 7 Experimental results obtained from the solubility measuring of the binary system {CO2 (1) + naphthalene (2)}

The binary {CO2 (1) + ethanol (3)} system was the third system used to validate the equipment used in the phase equilibrium measurements, and its results are presented in Table 8 and Fig. 5. The experimental data were compared with literature data [49,50,51].

Table 8 Experimental results obtained from measuring the liquid–vapor bubble point (LV-BP) phase equilibrium for the binary {CO2 (1) + ethanol (3)} system
Fig. 5
figure 5

Experimental vapor – liquid transitions for the {CO2 (1) + ethanol (3)} system in three different temperatures, 313, 323, and 333 K; ♦ (313 K), ● (323 K) and ■ (333 K) – this work; □ – Ref. [49]; Δ – Ref. [50]; ◊—Ref. [51]

The validation of the equipment produces phase equilibrium data that are consistent with literature data for the three proposed systems.

3.2 Experimental Data of Binary and Ternary Systems

The phase behavior of both systems is present in Table 9 and Table 11, which contain the experimental data for the binary { CO2 (1) + ketoprofen (4)} system at molar fraction of 3.14 × 10–5, 4.70 × 10–5 and 8.11 × 10–5 and ternary { CO2 (1) + ethanol (3) + ketoprofen (4)} system at concentration of 0.05073 and 0.10277 molketoprofen·kgethanol−1 in a CO2-free basis in the temperature range of 313–333 K. The results shown in Figs. 6, 7 include phase equilibria data for the binary {CO2 (1) + ethanol (3)} system, allowing for comparison of binary and ternary systems under the same temperature conditions. Table 9 and Table 10 show the experimental results for a two-phase transition of the liquid–vapor type, identified as bubble point (BP). Table 11 presents the comprehensive phase transition data for the binary system consisting of carbon dioxide (1) and ketoprofen (4). Table 11 encompasses the solid–fluid system and a temperature range from 313 to 333 K. The corresponding experimental findings are visually depicted in Fig. 8.

Table 9 Experimental results obtained from measuring the liquid–vapor bubble point (LV-BP) phase equilibrium for the ternary system {CO2 (1) + ethanol (3) + ketoprofen (4)} at a concentration of 0.05073 molketoprofen·kgethanol−1
Fig. 6
figure 6

Experimental vapor–liquid transitions for the system {CO2 (1) + ethanol (3) + ketoprofen (4)} at 0.05073 mol·kg−1 concentration, in comparison with the system {CO2 (1) + ethanol (3)}, at three different temperatures, 313, 323 and 333 K: ♦ (313 K), ● (323 K) and ■ (333 K) – ternary system; ◊ (313 K), ○ (323 K) and □ (333 K) – binary system

Fig. 7
figure 7

Experimental vapor–liquid transitions for the system {CO2 (1) + ethanol (3) + ketoprofen (4)} at 0.10277 mol·kg−1 concentration, in comparison with the system {CO2 (1) + ethanol (3)}, at three different temperature, 313, 323 and 333 K: ♦ (313 K), ■ (323 K) and ● (333 K) – ternary system; ◊ (313 K), ○ (323 K) and □ (333 K) – binary system

Table 10 Experimental results obtained from measuring the liquid–vapor bubble point (LV-BP) phase equilibrium for the ternary system {CO2 (1) + ethanol (3) + ketoprofen (4)} at a concentration of 0.10277 molketoprofen·kgethanol−1
Table 11 Experimental results obtained from measuring the solid–fluid (SF) transition for the binary system {CO2 (1) + ketoprofen (4)} with ketoprofen in insipient solid phase
Fig. 8
figure 8

Experimental solid – Fluid transitions for the binary {CO2 (1) + ketoprofen (4)}. The system consists of three concentrations of ketoprofen (3.14 × 10–5, 4.70 × 10−5and 8.11 × 10–5) at temperatures of 313 K, 323 K, 328 K, and 333 K, respectively: ■ (concentration of 3.14 × 10–55 at 313, 323 and 328 K), ▲ (concentration of 4.70 × 10–5 at 313, 323 and 333 K) and ● (concentration of 8.11 × 10–5 at 313, 323 and 333 K)

Table 11 shows the experimental data for composition, temperature, phase transition pressure (P), and the pressure values calculated (Pcalc) by the RK-PR model. In Table 11, the results of the absolute deviation are less than 10%, it represents an acceptable result of the thermodynamic model and the experimental data. No formation of precipitate or suspended solids was observed in the measured phase transition data for the ternary system {CO2 (1) + ethanol (3) + ketoprofen (4)}. In the binary system {CO2 (1) + ketoprofen (4)}, the solid formation of ketoprofen is directly influenced by the temperature of the system and the density of sc-CO2. This behavior is explained in the literature as due to the association of vapor pressure, which increases with temperature [16]. According to the literature [16] as the system’s pressure rises, the density of CO2 also increases, which in turn leads to a higher solvating strength, the same behavior is observed in the experimental data of this work.

Figure 8 shows the PT diagram of the experimental data for the binary system {CO2 (1) + ketoprofen (4)} contained in Table 11.

Figures 9 (a), 9 (b) and 9 (c) compare the experimental solid–fluid phase transition data measured in this work and those reported in the literature [14,15,16, 52] for the binary system CO2 (1) + ketoprofen (4). The experimental solubility data reported in the literature for the binary system CO2 (1) + ketoprofen (4) employed the dynamic analytical method and its variations. In addition, the purity of the CO2 used in the solubility measurements of ketoprofen in CO2 reported in the literature is between 99.98 and 99.999% by volume. The purity of the CO2 used in this study was 99.5% (industrial grade). The industrial grade of CO2 used in this work and the dynamic analytical method, and its variations used to measure ketoprofen solubility in CO2 reported in the literature reflect the differences observed between the solubility data of the CO2 (1) + ketoprofen (4) binary system measured and those reported in the literature.

Fig. 9
figure 9

Solubility of ketoprofen in sc-CO2 as a function of pressure P compared to data reported in the literature; a) ■ – this work (313 K), Δ – Ref. [14] (313 K), ○ – Ref [15]. (313 K), and ӿ—Ref. [52] (313 K); b) ■ – this work (323 K), ● – this work (328 K), Δ – Ref. [14] (328 K) and ◊—Ref. [16] (328 K); c) ■ – this work (333 K), ○ – Ref. [15] (333 K)

For the Fig. 9, the solubility of ketoprofen in a solvent-free base was expressed using Eq. 2 given in the literature [53], where the mole fraction of the solute is divided by the sum of the mole fractions of the solvents, or analogously, 1 – xs, where xs is the mole fraction of the solute. As in Ref. [53], this solute solubility is indicated by y4, as shown in Eq. 7.

$${y}_{4}=\frac{xs}{1-xs}$$
(7)

3.3 Modeling Results

The temperature-dependent attractive interaction parameter and the repulsive interaction parameter of the RK-PR EoS for fluid phases were fitted in this work to experimental carbon dioxide (1) + ketoprofen (4) solid–fluid equilibrium data due to the lack of experimental fluid–fluid equilibrium data. The value of the repulsive parameter lij was adjusted to ensure an appropriate relative stability continuity between the calculated fluid–fluid and solid–fluid saturation curves. The kij interaction parameter was calculated for each experimental point in Table 12 by solving the Eq. 8 derived from the imposition of the isofugacity condition for ketoprofen at the specified temperature and pressure for solid–fluid equilibrium. The fugacity of component “i\(\hat{f}_{i}^\text{L} (T,z,\upsilon_{L} )\) in the liquid phase is dependent of T, vL and the vector of global composition z.

Table 12 Experimental data for solid–fluid saturation points for the CO2 (1) + ketoprofen (4) system, and interaction parameters kij calculated for lij = − 0.05
$${\widehat{f}}_{i}^\text{L}\left(T,\mathbf{z},{v}_\text{L}\right)= {f}_{i}^\text{S}(T,P,{v}_\text{HL})$$
(8)

Experimental data points 2 and 9, corresponding to z4 = 4.70 × 10–5, were not considered in the fit due to the non-monotonic isoplectic behavior, unlike the sets of experimental data points corresponding to z4 = 3.14 × 10–5 and z4 = 8.11 × 10–5. Furthermore, experimental data point 7 in Table 12, corresponding to z4 = 3.14 × 10–5, was excluded from the adjustment because it is the only one measured at a temperature of 328 K. The kij values calculated for the same temperature were averaged, resulting in a single kij value for each temperature, regardless of the global composition of the system, as shown in Table 13.

Table 13 Interaction parameters calculated for the CO2 (1) + ketoprofen (4) system for lij = − 0.05

Figure 10 illustrates how the attractive parameter kij varies with the temperature for the CO2 (1) + ketoprofen (4) binary system present in this work.

Fig. 10
figure 10

Behavior of the interaction parameter kij as a function of temperature for the CO2 (1) + ketoprofen (4) system according to Eq. 4. ○—Calculated values of kij shown in Table 13

The thermodynamic modeling approach described, and the parameters provided in Table 2, Table 3, and Table 12, Table 13 were used to represent the measured experimental data of the CO2 (1) + ketoprofen (4) system. Part of the isopleths corresponding to the measured experimental global compositions was also generated.

Figure 11a shows the pressure versus temperature projection of the calculated isopleth for the system CO2 (1) + ketoprofen (4) for the global mole fraction z4 = 3.14 × 10–5. The isopleth of Fig. 11a is composed of two solid–fluid (SF) segments, two fluid–fluid (FF) segments, calculated following the methodology as proposed in the literature [19, 30], respectively, and two segments of three-phase curves (SFF) compatible with the global composition, calculated by a methodology similar to that used in the literature [18]. Three experimental SF data points obtained for the global composition z4 = 3.14 × 10–5 are included in Fig. 11a (indicated with □). The points indicated as α, β, and γ in Fig. 11a are double saturation points compatible with the specified global composition. At points α and β, there is an equilibrium between a major liquid phase with the global mole fraction z4 = 3.14 × 10–5, a fluid phase, and an incipient solid phase formed by pure ketoprofen. At the double saturation point γ, a major vapor phase with a global mole fraction of z4 = 3.14 × 10–5 coexists in equilibrium with an incipient liquid phase and with an incipient solid phase formed by pure ketoprofen.

Fig. 11
figure 11

Pressure—temperature projection of the Isopleths calculated for the CO2 (1) + ketoprofen (4) system with: a): z4 = 3.14 × 10–5. □—Experimental data; b) z4 = 4.70 × 10–5. △—Experimental data; c) z4 = 8.11 × 10–5. ○—Experimental data. ▲: solid–fluid-fluid double saturation points. Red SF curve: Solid–fluid saturation curve (incipient solid). Black FF curve: Fluid–fluid saturation curve. Magenta SF curve: Solid–vapor saturation curve (incipient solid). Blue FF curve: Fluid–fluid saturation curve. Dashed violet SFF curve and dashed green SFF curve: Segments of solid–fluid-fluid three-phase curves compatible with the value of z4. Model: RK–PR EoS with quadratic mixing rules, kij from Fig. 10, and lij = − 0.05

The red SF curve is a solid–fluid saturation curve. At each point of the red SF curve a major liquid phase (L) is at equilibrium with an incipient solid phase formed by pure ketoprofen. The red SF curve starts at point α and extends at low temperatures and low pressures until it ends at point β. The metastable segments of the red SF curve are not shown in Fig. 11a. The blue FF curve is a fluid–fluid saturation curve that starts at the γ point at low temperatures and low pressures like a dew point curve and ends at the α point at high temperatures and high pressures as a cloud point curve. Along the blue FF curve, there is no FF-type critical point. The continuous magenta SF curve is a solid–fluid saturation curve where a major vapor phase with global mole fraction z4 = 3.14 × 10–5 coexists at equilibrium with an incipient solid phase formed by pure ketoprofen. The magenta SF curve starts at the γ double saturation point and extends indefinitely for low temperatures and low pressures.

The complete isopleths, derived from the thermodynamic model and experimental data of the {CO2 + ketoprofen} system, are depicted in Fig. 11a, b, c. Analysis of these curves reveals that elevated temperatures increase transition pressure and alterations in the type of transition observed. Initially, there is a shift from a solid–fluid–fluid (SFF) equilibrium, passing through a β double saturation point, to a solid–fluid (SF) equilibrium in the region of the experimental data and subsequently to a fluid–fluid (FF) equilibrium after the α double saturation point. The transition pressure for the FF equilibrium continues to rise until approximately 400 K (maximum pressure); beyond this point, the pressure begins to decrease with further temperature increases. This trend is consistent across the three studied concentrations. With a decrease in temperature following the maximum temperature, the transition pressure declines, reaching a new γ double saturation point and reversing the equilibrium from FF to SF. This behavior is consistent across all isopleths. A purple dashed line connects the points of double saturation α and γ, demarcating the SFF equilibrium region and delimiting the solid phase region.

The dashed violet curve shown in Fig. 11a is a segment of a three-phase curve compatible with the specified global mole fraction z4 = 3.14 × 10–5 (segments of the SFF curve that are not compatible with z4 = 3.14 × 10−5 are not shown in Fig. 11. It extends from the double saturation point α and ends at the double saturation point γ. On the other hand, the dashed green SFF curve is a segment of a solid–fluid–fluid three-phase curve compatible with z4 = 3.14 × 10–5. It extends from a critical end point (not indicated in Fig. 11) at a temperature of approximately 304 K toward low temperatures and low pressures, passing through the double saturation point β. When computing this line, it was found to self-intersect, presenting metastable three-phase segments. This indicates a solid–fluid–fluid quadruple point at approximately 295 K and 6.03 MPa. This quadruple point is not shown in Fig. 11a.

Finally, the black FF curve is a fluid–fluid saturation curve that originates at point β and extends toward low temperatures and low pressures. This FF saturation curve is above the dashed green SFF curve; however, due to the temperature and pressure scale used, both curves may be superimposed in the pressure vs temperature plane. The red SF curve calculated for z4 = 3.14 × 10–5 is consistent with the experimental data obtained for the same global composition, meaning that the model is capable of describing, at least qualitatively, the observed experimental behavior for the CO2 (1) + ketoprofen (4) system at z4 = 3.14 × 10–5.

Figures 11b, c show the pressure versus temperature projections of the isopleths computed for z4 = 4.70 × 10–5 and z4 = 8.11 × 10–5, respectively, along with the experimental data obtained for the same global compositions. These isopleths are analogous to the one corresponding to the global mole fraction z4 = 3.14 × 10–5 shown in Fig. 11a; therefore, the phase behavior analysis is the same.

The isopleths shown in Fig. 12 represent the modeling based on the experimental data of the binary system at the respective ketoprofen mole fractions of 3.14 × 10–5, 4.70 × 10–5 and 8.11 × 10–5. It can be observed in Fig. 12 that the slope of the SF saturation lines of the isopleths are positive, just like those of the experimental points for each global composition. Furthermore, as the global molar fraction of ketoprofen increases, the SF saturation curve shifts toward higher pressures and the size of the SF heterogeneous region increases.

Fig. 12
figure 12

Pressure—temperature projection of the SF saturation segment of the isopleths calculated for the CO2 (1) + ketoprofen (4) system. Δ represents the experimental data of the mole fraction of ketoprofen value (3.14 × 10–5); □ represents the experimental data of the mole fraction of ketoprofen value (4.70 × 10–5), and ○ represents the experimental data of the mole fraction of ketoprofen value (8.11 × 10–5). The continuous line is for the first isopleth, the semi-continuous is for the second isopleth, and the dot line is for the third isopleth

In the Fig. 8 and Fig. 12, the saturation points of the solid and liquid should increase monotonically between 313 and 333 K for each composition. However, in the Table 12, the points 2 and 9 (z4 = 4.70 × 10–5) do not align with point 5 and are below a trend line that should pass through points 1, 4, and 7. This behavior is unexpected because, as the overall mole fraction of component 4 increases, the saturation points of the solid and liquid should shift toward higher pressures, all else being equal. The discrepancy between points 2 and 9 may be associated with experimental uncertainties or perhaps other factors we have not yet identified.

4 Conclusion

This study investigated the phase transitions of systems {CO2 (1) + ketoprofen (4)} and {CO2 (1) + ethanol (3) + ketoprofen (4)} at temperatures of (313–333) K and pressures up to 14 MPa. Experimentally, it observed the solid–fluid phase transition at a binary system containing CO2 and ketoprofen, and phase transition vapor–liquid was observed at a ternary system composed of CO2, ethanol, and ketoprofen. Results also revealed that in a binary system, the temperature and pressure are significant factors for the ketoprofen solubility, implying the solid formation and this approach facilitate the understanding of the system’s behavior in precipitation or recrystallization processes involving CO2. In the ternary system, with the presence of ethanol, solid precipitation was not observed in any range of experimental temperatures. Furthermore, the drug at low concentrations has shown no significant influence in the phase equilibria between the binary system involving CO2 and ethanol and the ternary system. The thermodynamic modeling results showed a vast region of solid–fluid equilibrium in different temperature and pressure ranges. This approach allows an understanding of the binary system’s behavior and identifies the drug’s precipitation regions in carbon dioxide. These results help produce microparticles or recrystallization processes in which sc-CO2 acts as an antisolvent. Additionally, DSC thermal analyses were performed to ensure that the drug used had the same characteristics reported in the literature.