Keywords

1 Introduction

Diverse materials, like metallic alloys, notably multiphase advanced high-strength steels (AHSS), are extensively utilized in modern-day applications [1, 2]. The microstructure of AHSSs typically consists of multiple phases with distinct properties in order to achieve a favourable combination of strength and ductility [3]. Among multiphase steels, dual-phase (DP) and complex-phase (CP) steels are the two widely used in car body applications [4]. Both these steels have good strength and global formability represented by elongation in the tensile tests, but local formability is much better for the CP steels. It is due to the complexity of the CP microstructure, which is characterized by smoother gradients of properties compared to the DP steels. Despite the growing application of CP steels, the correlation between the CP microstructure and its unique mechanical properties has not been fully understood so far. It is expected that advanced numerical models can support the investigation of heterogeneous microstructure in the CP steels. Thus, numerical tools, which can predict distributions of various parameters in heterogeneous materials, are intensively searched for. Mean-field and full-field material models have been distinguished in the literature during the last few decades. The latter have much wider predictive capabilities which, however, go side by side with high computing costs. The need for a reliable and fast prediction of the distribution of microstructural parameters in metallic materials after processing was the motivation for our work. The objective was to develop mean-field (fast) model capable of predicting distributions (histograms) of microstructural features instead of their average values. The model describing the evolution of dislocation populations and grain size, which considers the stochastic aspects of phenomena occurring during hot forming, was formulated in [5]. The coefficients in this model were identified on the basis of experimental data in [6, 7] and the validated version of the model with examples of applications is presented in [8]. Because product properties develop during the cooling process following hot forming, we opted to expand the model’s scope by incorporating phase transformations. Utilizing the dislocation density and grain size histograms derived from the stochastic hot deformation model, we employed them as inputs for simulating phase transformations in the initial method outlined in the publication [9], the deterministic model incorporated this data to calculate phase composition histograms. The model’s evolution involves considering the stochastic nature of new phase nucleation as the subsequent stage. In the present paper, the stochastic phase transformation model is proposed. The model calculates distributions (histograms) of microstructural features after cooling of products after hot forming. In the present paper, we focused on the numerical tests of the model and the sensitivity analysis. Formulation of the inverse problem dedicated to the identification of the coefficients in the model was the next objective. A specific form of the objective function for the inverse analysis was proposed using a measure of the distance between two histograms, measured and calculated ones.

2 Stochastic Model of Phase Transformations

The developed model simulates phase transformations occurring in steels during controlled cooling after hot deformation processes. The main equations of the model are described below.

2.1 State of the Equilibrium

The equilibrium state of the metallurgical system is described by the thermodynamics. The phase transformation model describes the kinetics of the transient state between the two equilibrium states. The equilibrium state for steels is characterized by the phase equilibrium diagram Fe–Fe3C. Approximation of the two important lines (GS, ES) in this diagram gives the following equations:

Equilibrium carbon concentration in the austenite (at the γ/α interface)

$$c_{\gamma \alpha } = c_{\gamma \alpha 0} + c_{\gamma \alpha 1} T\left( t \right)$$
(1)

Maximum carbon concentration in the austenite (at the γ/cementite interface)

$$c_{\gamma \beta } = c_{\gamma \beta 0} + c_{\gamma \beta 1} T\left( t \right)$$
(2)

In Eqs. (1) and (2), temperature T is in oC and cγα0, cγα1, cγβ0 and cγβ1 are coefficients, which were determined using ThermoCalc software by researchers from the Silesian Institute of Technology, see joint publication [6]. The current average carbon content in the austenite cγ is another crucial parameter, which determines whether a phase transformation may occur

$$c_{\gamma } = \frac{{c_{0} - F_{f} c_{\alpha } }}{{1 - F_{f} }}$$
(3)

where c0—carbon content in steel, Ff—ferrite volume fraction with respect to the whole volume and cα—carbon content in ferrite.

Other parameters in the model are Ae3—theoretical temperature of the beginning of phase transformations, Ae1—theoretical temperature of the end of ferritic transformation and ceut—equilibrium carbon concentration in the austenite at the eutectic temperature, which is defined by a cross point of lines (1) and (2):

$$c_{eut} = c_{\gamma \alpha 0} + c_{\gamma \alpha 1} \frac{{c_{\gamma \alpha 0} - c_{\gamma \beta 0} }}{{c_{\gamma \beta 1} - c_{\gamma \alpha 1} }}$$
(4)

The equilibrium volume fraction of ferrite at the temperature Ae1 is calculated from the following equation:

$$F_{eut} = \frac{{c_{eut} - c_{0} }}{{c_{eut} - c_{\alpha } }}$$
(5)

Equilibrium parameters determined by Eqs. (1)–(5) were used as boundary conditions for the model, which describes the kinetics of phase transformations.

2.2 Nucleation of a New Phase

The nucleus of a new phase may appear only if the condition for starting a given transformation is met. These conditions for ferrite, pearlite, bainite and martensite are listed in Table 1, where Bs, Ms—bainite and martensite start temperatures, a25, a31, a32—coefficients. The ferritic transformation cannot start if the pearlitic, bainitic or martensitic transformation has already started, the pearlitic transformation cannot start if the bainitic or martensitic transformation has already started and the bainitic transformation cannot start if the martensitic transformation has already started.

Table 1 Conditions determining the beginning of subsequent transformations

As it has been mentioned above, the phase transformations introduce stochastic elements in the model connected with the random character of the nucleation of the new phase. In the first approach, we will perform a solution assuming Poisson homogenous nucleation. The statistical approach is based on the fundamental knowledge regarding nucleation [10]. The deterministic nucleation rate equation is replaced by an equation with a stochastic variable, which accounts for the stochastic character of the nucleation. The parameter ξ(ti) representing this stochastic variable, satisfies

$$\begin{gathered} {\mathbf{P}}\left[ {\xi \left( {t_{i} } \right) = 0} \right] = \left\{ {\begin{array}{*{20}c} {p\left( {t_{i} } \right)\,\,\,\,if\,\,p\left( {t_{i} } \right) < 1} \\ {1\,\,\,\;\quad otherwise} \\ \end{array} } \right. \hfill \\ {\mathbf{P}}\left[ {\xi \left( {t_{i} } \right) = 1} \right] = 1 - {\mathbf{P}}\left[ {\xi \left( {t_{i} } \right) = 0} \right] \hfill \\ \end{gathered}$$
(6)

In Eq. (6), p(ti) is a function, which bounds together the probability that the material point becomes a critical nucleus in a current time step and present state of the material. This probability is based on the following knowledge about nucleation sites:

  • Nucleation rate increases with an increase of the undercooling below temperature specific for given transformation, Ae3, Ae1 and Bs = a25 for ferrite, pearlite and bainite transformations, respectively.

  • Grain boundaries and shear bands in the deformed microstructure are the privileged locations of the nuclei. Therefore, the probability of nucleation should increase with an increase of dislocation density and a decrease of the austenite grain size.

Based on this knowledge and assuming Poisson homogenous nucleation, the following equations are used:

  • Ferrite

    $$p\left( {t_{i} } \right) = a_{1} D^{{ - a_{2} }} \rho^{{a_{3} }} \left[ {A_{e3} - T\left( t \right)} \right]^{{a_{4} }} \Delta t$$
    (7)
  • Pearlite

    $$p\left( {t_{i} } \right) = a_{11} D^{{ - a_{12} }} \rho^{{a_{13} }} \left[ {A_{e1} - T\left( t \right)} \right]^{{a_{14} }} \Delta t$$
    (8)
  • Bainite

    $$p\left( {t_{i} } \right) = a_{21} D^{{ - a_{22} }} \rho^{{a_{23} }} \left[ {a_{25} - T\left( t \right)} \right]^{{a_{24} }} \Delta t$$
    (9)

where D—austenite grain size, ρ—dislocation density, a1, a2, a3, a4, a11, a12, a13, a14, a21, a22, a23, a24, a25—coefficients.

In each time step of calculations, a random number within the range [0,1] is generated and compared with the probability p(t). If the value of the function p(t) in a given time step is greater than the generated random number, ξ(ti) = 0 and the nucleus appears. In the case of martensite, this random number is not generated and martensitic transformation occurs always when temperature drops below the Ms temperature. However, according to Table 1 Ms depends on the current carbon concentration in the austenite, which, in turn, depends on the progress of earlier transformations, see Eq. (3). In consequence, the stochastic component is introduced into the martensitic transformation as well. In Eqs. (7), (8) and (9), grain size and dislocation density are stochastic variables (in the form of histograms), which are calculated by the hot forming model described in [8], see selected example of such results in Fig. 1.

Fig. 1
figure 1

Selected examples of the calculated histograms of the dislocation density a and the grain size and b at the beginning of phase transformations for the fully recrystallized and not recrystallized material

In the present solution, hot forming model and phase transformation model are connected. Calculations for each MC point begin after heating before hot deformation and go through the whole process of hot deformation and cooling of samples.

2.3 Kinetics of Transformations

After the appearance of a nucleus of a new phase, it starts to grow until another transformation begins or until all phases excluding austenite occupy the whole volume, which marks the end of the simulation. We assumed that phase growth in the model is deterministic in nature, which corresponds to the real phase growth process. To avoid problems which occur when the temperature varies during the process, we selected the upgrade of the Leblond model [11], which describes the kinetics of the growth of the new phase using the differential equation with respect to time. In consequence, it does not need application of the additivity rule when the temperature varies during the process. It is the main advantage of this approach. The original Leblond model [11] assumes that the rate of the transformation is proportional to the distance from the thermodynamic equilibrium in a given temperature:

$$\frac{dX}{{dt}} = k\left( {X_{eq} - X} \right)$$
(10)

where t—time, X—volume fraction of a new phase, Xeq—equilibrium volume fraction of the new phase at the temperature T, k—coefficient

Coefficient k for each phase depends on the temperature and it is defined by a modified Gauss function, see Table 2, where a6, a7, a8, a9, a10, a30, a16, a17, a18, a19, a20, a26, a27, a28 and a29 are coefficients.

Table 2 Formulae describing coefficient k in Eq. (10) for ferrite, pearlite and bainite

The Eq. (10) is solved using explicit Euler method:

$$X\left( {t_{i} } \right) = X\left( {t_{i - 1} } \right) + k\left( {T\left( {t_{i} } \right)} \right)\left( {X_{eq} \left( {T\left( {t_{i - 1} } \right)} \right) - X\left( {t_{i - 1} } \right)} \right)\Delta t$$
(14)

where Δt—time increment.

Volume fraction X in Eq. (14) is calculated with respect to the maximum volume fraction of the considered phase at the temperature T(t), whereas the final result of the model calculations is F, which is the volume fraction of the considered phase with respect to the whole volume. Thus, X for each phase is within a range [0,1] and the sum of F of all phases equals 1 because it corresponds to occupancy of the whole volume of the sample. As it has been mentioned, grain grows until another transformation starts or until all phases, excluding austenite, occupy the whole volume. In the case of martensite, it is assumed that this phase occupies the whole volume of the austenite, which remained after ferrite, pearlite and bainite transformations at the temperature Ms. Formulae describing equilibrium volume fractions Xeq in Eq. (10) and volume fractions F for each phase are listed in Table 3. In this table, Ffmax(T) is the equilibrium volume fraction of the ferrite in steel at the current temperature T. Maximum ferrite volume fraction in steel is equal to the equilibrium ferrite volume fraction at the eutectic point Feut, which is defined by Eq. (5).

Table 3 Formulae describing equilibrium volume fractions Xeq in Eq. (10) and volume fractions F for each phase

Coefficients in the developed model are grouped in the vector a = {a1, …, a32}T and they are determined by the inverse analysis for the experimental data. The model with optimized coefficients predicts distributions of such parameters as volume fractions of phases. The parameters will be used to predict local gradients of properties, which influence formability [12].

3 Numerical Tests and Validation of the Stochastic Model

The objectives of the numerical tests were twofold. The first was to evaluate the influence of selected numerical parameters in the model on the accuracy of simulations and on the computing times. The following parameters were investigated: (i) type of the random number generator (RNG), (ii) maximum time step and temperature change during the time step and (iii) a number of the Monte Carlo points. The optimal values of these parameters were proposed having in mind a balance between accuracy and computing times. Sensitivity analysis of the model’s output with respect to the coefficients was the second objective of the numerical tests.

All the numerical tests were carried out for the model coefficients obtained in the primary identification, which was performed using inverse analysis based on the comparison of the measured and calculated average output parameters. In all the tests the output histograms were divided into 10 bins.

3.1 Selection of the Optimal Numerical Parameters

The tests that were designed to check the influence of the random number generator (RNG) on the model output were performed first. As a basis, we considered the RNGs from the C++ Standard Library. In the tests, we performed computations with 20,000 Monte Carlo points with the default RNG (default_random_engine from <random> C++ header) and with few other RNGs available in the library: mt19937, mt19937_64, minstd_rand0, minstd_rand, ranlux24_base, ranlux24, ranlux48_base and ranlux48, knuth_b. The results obtained for various RNGs were compared with the ones obtained for default RNG. The comparison consisted of computing Earth Mover’s Distance (EMD) between the output histograms. According to this metric, the distance between histograms H1 and H2 is calculated as follows:

$$\begin{aligned} & d\left( {H_{1} ,H_{2} } \right) = EMD = \sum\limits_{i = 1}^{n} {\left| {EMD_{i} } \right|} \\ & EMD_{i} = \sum\limits_{j = 1}^{i} {\left[ {H_{1} \left( j \right) - H_{2} \left( j \right)} \right]} \\ \end{aligned}$$
(15)

The EMD, which is explained in detail in [13], was used in our earlier publication [10] and it gave good results in the comparison of histograms arising in applications considered there. The analysis of the results of the test allowed to conclude that the influence of the used RNG on the model output is negligible. Additionally, due to the stochastic nature of the model, the model output varies slightly in each simulation run, even when the same RNG is used. So, the received positive distances may have occurred only because of generated random numbers and not because of the RNG itself. It is also worth noting that the model works as intended because in each simulation run it gives a similar output (small values of EMD), but slightly different due to its stochastic nature.

The maximum temperature change per time step and the maximum time step are other model parameters, which were considered. They should be constant for all the simulations for all the materials. When both are calibrated, the first one affects mainly simulations with high cooling rates and the second one affects mainly simulations with low cooling rates. The influence of these parameters on the model output was investigated. Obviously, the shorter the time step and the smaller the temperature change per time step, the better the accuracy of simulations, but it is paid with an increase in the computational cost. Thus, our objective was to find a balance between accuracy and computing costs. We took into consideration many values of these parameters and compared the average output parameters with the ones obtained in the experiments. We took into consideration every cooling speed that was included in the experimental data, which included both high and low cooling speeds. After these comparisons, we decided to set the maximum temperature change per step equal to 0.1 °C and the maximum time change per step equal to 0.5 s.

Searching for the optimal number of the Monte Carlo points was the next objective of the numerical tests. This number is a crucial model parameter. Since the model is stochastic in nature, the output parameters for individual points may be different. The number of the Monte Carlo points determines the result stability, i.e. how much the results differ between simulation runs. If the number of the Monte Carlo points is too small, the model output is too random. The stability of the results is paid with computational cost, because, for each Monte Carlo point, the computations have to be performed separately. The tests were designed to find the least number of the Monte Carlo points for which the results are stable. The simulations were performed with exactly the same parameters, excluding the number of Monte Carlo points, which took all values from the set {100, 200, …, 19,900, 20,000}. For every number of Monte Carlo points, the simulation was repeated five times. Then all the results were compared with the basic result, which was obtained for the 20,000 Monte Carlo points. In comparison, we took into consideration the difference between the average output parameters and the Earth Mover’s distance between the output histograms. Then the largest value (in each compared item) for each number of Monte Carlo points was selected and these values are shown in Fig. 2. In the case of the average output parameters, there are no values for the pearlite because, for the investigated range of the parameters, the pearlitic transformation has not occurred for a majority of the Monte Carlo points in all simulations. We assumed that the solution for the average output parameter is stable when it differs from the basic result by less than 1oC for temperatures and by less than 0.003 for volume fractions. It was fulfilled for at least 7500 Monte Carlo points. However, it can be seen in Fig. 2c that the curve for the histogram distances flattens out above 10,000 Monte Carlo points. Thus, we decided that the least number for which the results are stable is 10000. Performing a simulation for more points is futile because this increases the computational cost and does not improve the result. Examples of a comparison of the output histograms for 100, 1000 and 10,000 points are shown in Fig. 3. It is seen that indeed the output histograms differ noticeably for a small number of the Monte Carlo points, and that for 10,000 Monte Carlo points or more, the difference stabilizes.

Fig. 2
figure 2

Maximum difference from 5 simulation runs between the result with a given number of Monte Carlo points and the basic result with 20,000 Monte Carlo points for the average output temperatures (a), the average output volume fractions (b) and the histograms of the volume fractions (EMD between histograms) (c). Notation: Fs, Bs, Ms—start temperatures for ferrite, bainite and martensite, respectively, F, B, M—volume fractions of ferrite, bainite and martensite, respectively

Fig. 3
figure 3

A comparison of the output histograms for 100 (a), 1000 (b) and 10,000 (c) MC points—an example for bainite volume fraction

3.2 Sensitivity Analysis

Identification of the model with 32 coefficients is time-consuming and problems with the uniqueness of the solution can be encountered. To avoid these problems, sensitivity analysis (SA) [14] was applied prior to the inverse analysis. The goal of the SA was to find the coefficients which influence the output most and to identify these coefficients in the first step of the IA. The effect of the change of the ith coefficient (Δai) on the solution (χi) at the time t is given below:

For the average output parameters:

$$\chi_{i} ({\mathbf{a}}) = \frac{{a_{i} }}{{\Delta a_{i} }}\frac{{y_{c} \left( {a_{1} , \ldots ,a_{i - 1} ,a_{i} + \Delta a_{i} ,a_{i + 1} , \ldots ,a_{k} } \right) - y_{c} \left( {\mathbf{a}} \right)}}{{y_{c} \left( {\mathbf{a}} \right)}}$$
(16)

For the output histograms:

$$\chi_{i} ({\mathbf{a}}) = a_{i} \frac{{d\left( {H_{1} ,H_{2} } \right)}}{{\Delta a_{i} }}$$
(17)

where Δai—small increment of the ith parameter, yc(a)—model output, H1—the basic histogram calculated for the coefficients a, H2—histogram obtained after small disturbance of ai.

The Earth Movers Distance, see (15), was used to calculate the distance between histograms H1 and H2 in the Eq. (17).

During the SA the simulation was performed for 10,000 Monte Carlo points, and the ∆ai was set to 10% of ai. The SA determined the model parameters, which contribute the most to the model output and those which are not significant [15]. The SA preceded identification of the model using inverse analysis and the SA results were used to design the best optimization strategy. The coefficients a3, a13 and a23 were not taken into consideration in the SA because they are responsible for the influence of a dislocation density which currently is not taken into account in the model. The coefficients a5 and a15 also were not taken into consideration in the SA because, currently, they do not appear in the model. In the case of the average output parameters, there are no values for the pearlite because, for the investigated range of the parameters, this transformation has not occurred for a majority of the Monte Carlo points in all simulations. In the whole SA, the pearlite temperature end and the bainite temperature end were not taken into consideration because, for the investigated range of the parameters, these output values have not appeared in any Monte Carlo point. The results of the sensitivity analysis are shown in Fig. 4. The analysis of the results of the SA brought us to the conclusion that for the simulation result, the most crucial coefficients are a2, a4, a10, a25, a30 and a31. For the individual output parameters, the following coefficients have the biggest influence:

  • ferrite start temperature: a2, a4

  • pearlite start temperature: a2, a10, a12, a25

  • bainite start temperature: a22, a25

  • martensite start temperature: a31

  • ferrite volume fraction: a2, a4, a10, a25

  • pearlite volume fraction: a2, a10, a12, a25

  • bainite volume fraction: a2, a10, a25, a30, a31

  • martensite volume fraction: a2, a10, a30, a31

Fig. 4
figure 4

Results of the sensitivity analysis: influence of the model coefficients on the output parameters: temperatures of the beginning of transformations (a), average volume fractions of phases (b) and histograms of the volume fractions of phases (c). Symbols in the legend are explained in the Fig. 2 caption

Coefficients a1, a2, …, a9, a10 appear in the ferrite transformation in the model, coefficients a11, a12, …, a19, a20 in the pearlite transformation, coefficients a21, a22, …, a29, a30 in the bainite transformation, and coefficients a31 and a32 in the martensite transformation. A coefficient may significantly influence the respective temperature or volume fraction in the model output and it is quite obvious. However, the coefficients that appear in one transformation can influence the volume fraction of other as well. Since the volume fractions of all phases sum up to 1, if one phase takes significantly more/less volume (because of an earlier/later start of the transformation or a faster/slower growth of the phase), it will also affect other phases. That change in the volume does not affect the temperatures at the start of the transformations, though—in Fig. 4a, it is clearly seen that the main influence on the temperatures comes from the coefficients that appear in the respective transformation.

4 Identification of the Coefficients in the Stochastic Model

As it has been mentioned, the stochastic model of phase transformations contains several coefficients, which must be determined for each specific material. Identification of the coefficients is performed using inverse analysis for the experimental data. These data contain both measurements of the average values of some microstructural parameters and measurements of histograms of other parameters.

4.1 Formulation of the Inverse Problem for the Stochastic Experimental Data

The problem of the identification of the coefficients in material models is well-known and widely discussed in the scientific literature as an inverse problem [16, 17]. The algorithm for the stochastic inverse problem is described in detail in [18]; we repeat it briefly below for the completeness of the paper. Since our model is non-linear, there is no analytic solution for the inverse problem. Therefore, we reformulated the inverse problem as an optimization task with the coefficients in the model a becoming the state variables. The aim of the inverse analysis was finding the optimal values of coefficients a, which are determined by searching for a minimum of the following objective function:

$$\Phi ({\mathbf{a}}) = d\left( {y_{c} ({\mathbf{a}}),y_{m} } \right)$$
(18)

where yc(a)—outputs calculated for the model coefficients a, ym—measurements in the experimental tests, d—metric in the output space Y.

The optimization task defined for the deterministic model by Eq. (18) was redefined in [5] for the stochastic variable model and the following objective function was proposed:

$$\Phi ({\mathbf{a}}) = d\left( {H_{c} \left( {\mathbf{a}} \right),H_{m} } \right)$$
(19)

where Hc(a)—histogram obtained by several calculations of y(a), Hmmeasured histogram (from the experiment), d—a ranking function comparing two histograms.

The stochastic model solution is in the form of a histogram, approximating the real distribution of phase fractions. Therefore, it was necessary to compare the model outputs for particular sets of coefficients, taking into account that the random variable ξ(ti) in the Eq. (6) and stochastic nature of D and ρ (input parameters for the model) can lead to completely different single solutions for the same starting values. Similarly, as it was done in the sensitivity analysis (Sect. 3.2), EMD was used as the metrics d(Hc(a), Hm). It ensured good convergence in the optimization.

As we have said before, for the identification task, the objective function (19) should be minimized with respect to the model coefficients a. To be able to apply metrics (15), the experimental data should include information on distributions of the temperatures of phase transformations and phase fractions. Since the measurement of histograms of temperatures is not physical, we decided to compare only histograms of phase fractions and average start and end temperatures of transformations. Thus, the objective function (19) was reformulated to a hybrid form as follows:

$$\Phi ({\mathbf{a}}) = \Phi_{T} ({\mathbf{a}}) + \Phi_{F} ({\mathbf{a}})$$
(20)

The components of the objective function are calculated as follows:

$$\Phi_{T} ({\mathbf{a}}) = d\left( {T^{c} \left( {\mathbf{a}} \right),T^{m} } \right)$$
(21)
$$\Phi_{F} ({\mathbf{a}}) = d\left( {H^{c} \left( {\mathbf{a}} \right),H^{m} } \right)$$
(22)

where Tc(a)—expected average value of the start/end temperature of transformation calculated for model coefficients a, Tm—the average start/end temperature of transformation determined from the dilatometric tests [6], Hc(a)—distribution (histogram) of the phase fraction after cooling calculated for the model using coefficients a. Superscripts m and c refer to measurement and calculations, respectively.

The distance d(Tc(a),Tm) in Eq. (21) is defined as the sum of the mean square root errors (MSRE) between measured and calculated average start/end temperatures of transformations, that is

$$d\left( {T^{c} \left( {\mathbf{a}} \right),T^{m} } \right) = \sqrt {\frac{1}{Ne}\sum\limits_{i = 1}^{Ne} {\frac{1}{{Nt_{i} }}\sum\limits_{j = 1}^{{Nt_{i} }} {\left( {\frac{{T_{ij}^{c} \left( {\mathbf{a}} \right) - T_{ij}^{m} }}{{T_{ij}^{m} }}} \right)^{2} } } }$$
(23)

where Ne—number of the tests, Nti—number of the temperatures measured in the ith test.

Recall that as before, the distance between histograms in the Eq. (22) is calculated as the sum of the EMDs, which are defined in the Eq. (15).

4.2 Optimization with the Objective Function Based on the Measured and Calculated Average Values of Microstructural Parameters

The correct definition of the objective function is a crucial factor from the point of view of the quality of the solution obtained from the optimization. In the case of the reverse analysis carried out in this work, the coefficients a = {a1,..., a32}T for the analysed stochastic model of phase transformations have to be determined. As it is shown in Chap. 2, the coefficients a directly influence modelling of the investigated process, which is the cooling of the steel components after hot forming. In this process, the model predicts the start and end temperatures of phase transformations (T) and volume fractions of structural components (F) after cooling. The inverse analysis described in Sect. 4.1 is used to determine the coefficients of the model based on the experimental data. The experiments were composed of dilatometric tests performed with a cooling rate in the range of 0.1 °C/s–100 °C/s. Two austenitization temperatures were used, in consequence, two different austenite grain sizes prior to transformations (17 µm and 24 µm) were obtained. The material used in the experiments was steel containing 0.12%C and 1.3%Mn [6, 19]. In the first approach, the experimental data provided information on the transformation temperatures, as well as average values of volume fractions for ferrite, pearlite, bainite and martensite. Thus, the primary objective of our work was the identification of the model coefficients for the average values of the output parameters. For this purpose, the objective function (22) was omitted and the function (23) was extended by including average volume fractions of phases, as follows:

$$\Phi = \sqrt {\frac{1}{Ne}\sum\limits_{i = 1}^{Ne} {\left[ {\frac{{w_{T} }}{{Nt_{i} }}\sum\limits_{j = 1}^{{Nt_{i} }} {\left( {\frac{{T_{ij}^{m} - T_{ij}^{c} }}{{T_{ij}^{m} }}} \right)^{2} + \frac{{w_{F} }}{{Nf_{i} }}\sum\limits_{k = 1}^{{Nf_{i} }} {\left( {\frac{{F_{ik}^{m} - F_{ik}^{c} }}{{F_{ik}^{m} }}} \right)^{2} } } } \right]} }$$
(24)

where Ne—number of the tests, Nti—number of the temperatures measured in the ith test, Nfi—number of the phase fractions measured in the ith test, T—start or end temperature of the phase transformation, F—phase fraction after cooling, wT, wF—weights for temperatures and phase fractions, respectively. Superscripts m and c refer to measurement and calculations, respectively.

Since the influence of temperatures and phase fractions on the objective is different, a selection of weights is extremely important. In the first approach, the following weights were used: wT = 0.5 and wF = 0.5. The results, however, definitely differed from the experimental values that were sought, and the objective function oscillated around 0.0424 (Fig. 5). It was then decided to increase the weights for volume fractions and decrease the weights for temperatures, as it was expected to improve the fit. This resulted in a significant decrease in the value of the objective function to values around 0.00552. However, in some of the tests, the values from the model still differed from the measurements.

We observed that the use of constant weights for volume fractions of all phases has the disadvantage that very small volume fractions generate large errors, even when the absolute difference between measurements and calculations is small. To eliminate this effect, we decided to test a solution with varying weights, which depended on the value of the parameter the weight is dedicated to. In consequence, a similar level of the error is generated regardless of the value of the volume fraction. In the case of temperatures, it was not so important and constant weights were used. This approach made it possible to find results that closely match the experimental data.

By using the objective function (24) in the inverse analysis, it was possible to determine the model coefficients for the analysed steel. The Self-adaptive Differential Evolution method [20] was used in the optimization. The target coefficients were divided into several categories: coefficients responsible for the ferrite start temperature (a1, a2, a3, a4), pearlite start temperature (a11, a12, a13, a14), bainite start temperature (a21, a22, a23, a24, a25), martensitic transformation start temperature (a31, a32), ferrite volume fraction (a6, a7, a8, a9, a10), pearlite volume fraction (a16, a17, a18, a19, a20) and bainite volume fraction (a26, a27, a28, a29, a30). It was decided to divide the optimization based on the measurements of average parameter values into several stages. In the first stage, the temperatures for each of the phase transitions were optimized in order to find appropriate ranges for the coefficients responsible for the temperatures. The next step was to perform similar optimizations in terms of finding the appropriate ranges for the coefficients responsible for the size of the phase fractions. These initial optimizations were performed multiple times to determine the possible ranges for the coefficients. The reason for such initial optimizations was the exclusion from the search area of the ranges for coefficients in which there were no good solutions.

Changes in the objective function in subsequent iterations of the optimization for various weights in the Eq. (24) are shown in Fig. 5. The justification for the selection of different weights has been described earlier. As expected, better results were obtained with the increase in the number of iterations. However, as it is seen in Fig. 5, the plot of the objective function flattens out significantly after around 100–300 iterations, depending on weights. The existence of a significant number of local minima allows for a slight improvement of the solution from time to time, but in the long run, it is difficult to have a significant decrease in the objective function. The quality of the experimental data is also of great importance. The measurement data could also contain deviated data resulting from incorrect sensor measurements, which translated into the quality of optimization.

Fig. 5
figure 5

Plot of the objective function versus the number of iterations during differential evolution optimization with the objective function (24) for various weights

The optimal coefficients obtained during optimization for the experimental data are presented in Table 4. The graphs showing a comparison of measured and calculated parameters are shown in Fig. 6.

Table 4 Optimal values of the coefficients in the model
Fig. 6
figure 6

Comparison of the measured (full symbols) and calculated for the optimal coefficients (open symbols with lines) temperatures of phase transformations (a) and volume fractions of structural components (b)

4.3 Numerical Tests of the Inverse Analysis for the Stochastic Experimental Data

Optimization of the microstructure parameters on the histograms allows for more accurate identification of the model coefficients by using the entire available frequency distribution. However, this also translates into a much higher computational effort, and thus a much longer optimization.

At this stage of the project, we do not have histogram measurements of the output parameters. The objective of the numerical tests described below was to evaluate the capability of the inverse analysis to determine coefficients in the model when such measurements of the histograms are available. Thus, we have calculated the histograms using the model with the coefficients in Table 4 and we considered these histograms as experimental data. Following this, the values of the coefficients were disturbed and optimization was performed. The hybrid objective function (20) was used, but it was reformulated having in mind the specifics of the dilatometric tests:

$$\Phi = \sqrt {\frac{1}{Ne}\sum\limits_{i = 1}^{Ne} {\left[ {\frac{{w_{T} }}{{Nt_{i} }}\sum\limits_{j = 1}^{{Nt_{i} }} {\left( {\frac{{T_{ij}^{m} - T_{ij}^{c} }}{{T_{ij}^{m} }}} \right)^{2} } + \frac{{w_{F} }}{{Nf_{i} }}\sum\limits_{k = 1}^{{Nf_{i} }} {{\text{EMD}}_{ik} } } \right]} }$$
(25)

Symbols in the Eq. (25) are explained below the Eq. (24). The objective function (25) combines measurements of the average temperatures of transformations with measurements of histograms of phase fractions. The earth mover’s distance is a metric of the distance between histograms, and it is defined in the Eq. (15) with H1 = Hm and H2 = Hc—measured and calculated histograms of phase fractions for the phase k in test i.

5 Results

The calculations in this section were carried out using the data obtained from optimization on average values of parameters for the investigated steel (Table 5). The number of 200 Monte Carlo points was used for the initial optimizations, which were performed using the differential evolution method. This method proved to be the most efficient in the optimization of the average values of the measured parameters, see Sect. 4.2. The generated solutions for 3 process parameters were placed in histograms containing 10 bins. In order to reduce the required number of calculations, it was decided to limit the number of the used cooling rates to 7, selecting those that are the most important, as they are located on the edges of phase transformations.

The change in the value of the objective function in subsequent iterations is shown in Fig. 7. As expected, the objective function decreases with successive optimization iterations. The computational costs of optimization are negligible, but generating subsequent results from the model with a high number of Monte Carlo points was cumbersome. It was decided to use a small population (10 individuals) and a number of iterations of the optimization method limited to at most 300 because increasing neither the population nor iterations brought significant benefits, which was confirmed also by other publications [5].

We used the same approach as in the case of the optimization with average values. As the first step, the ranges for the coefficients have been narrowed, and then, acceptable values for the coefficients of + -10% relative to the best point from the narrowing were adopted. The implemented optimizations allowed to achieve the value of the objective function at the level of 0.47. This value of the function enabled a good mapping between the measured data and the response from the model. There were no visual differences compared to the plots in Fig. 6. Therefore, these data are not presented.

Fig. 7
figure 7

Changes in the value of the objective function in subsequent iterations during optimization based on histograms with the objective function (25)

The conclusions drawn from the performed optimizations are that by performing subsequent optimizations, it is possible to find coefficients that match the experiment well. Differences in volume fractions are not significant for the newly found coefficients, even though they were different from the original ones. This fact raises questions about the uniqueness of the solution, which will be explored in our future works.

The key aspect in the optimization of histograms, as well as in the optimization of average values, was to narrow the ranges for the coefficients to the ranges in which acceptable results occurred. Subsequent optimizations for specific temperatures and fractions of volume allowed to find the best ranges for the coefficients. Such earlier examination of the ranges allowed perform a more focused search in the optimization leading to a significant reduction of the computational cost during the optimization itself.

Figure 8 shows an example of a comparison between the measured and calculated histograms for the volume fractions of ferrite, pearlite and bainite. The calculated histograms were obtained from the model with coefficients, which gave the lowest value of the objective function (25). Histograms were generated for 1000 Monte Carlo points.

Fig. 8
figure 8

Selected examples of comparison of measured and calculated histograms of the volume fractions of ferrite (a), pearlite (b) and bainite (c) for the cooling rate of 15 °C/s

The histograms obtained from the model coincide with those of the experiments. The differences in the histograms are negligible, which also translates into a lower value of the objective function. Through the applied approach, it was possible to find coefficients close to the experimental ones.

6 Conclusions

The stochastic phase transformations model, which accounts for a random character of phase transformations during the cooling of steels and calculates distributions (histograms) of microstructural features, was proposed. The tests of the model, with the objective of selecting the best numerical parameters, were performed and the following conclusions were drawn:

  1. 1.

    As expected, the use of a random factor results in generating diverse output histograms, which allows to characterize the heterogeneous microstructures. Also, due to an introduction of a random factor, the model reflects a stochastic nature of nucleation of a new phase in steels.

  2. 2.

    Differences between the results from the stochastic model obtained for various random number generators are negligible.

  3. 3.

    Setting the maximum temperature change per step to 0.1 °C and the maximum time change per step to 0.5 s results in a good balance between accuracy and computing costs.

  4. 4.

    Numerical tests have shown that simulations are stable above 10,000 Monte Carlo simulations of the individual trajectories. The application of more Monte Carlo simulations does not lead to much better results, but at the same time highly increases the computational cost.

  5. 5.

    Performed sensitivity analysis allowed to identify which coefficients are the most crucial for the model output as a whole and for the individual output parameters.

  6. 6.

    A number of optimization methods were analysed, of which genetic algorithms turned out to be the best in solving the investigated problem. The differential evolution method and its upgrades performed particularly well, decreasing the value of the objective function fastest and usually reaching the lowest value.

  7. 7.

    When defining the objective function, it was observed that proper selection of weights leads to better performance in optimizing the average values. Focusing on matching the weight values for volume fractions, they should have a correspondingly higher value in relation to temperatures. In the case of volume fractions, it was a good idea to use variable weights. This approach allowed a better fit to the experimental data because small fractions do not generate high values of the objective function. During the optimization of the histograms, the values of the weights were not so important anymore.

  8. 8.

    The optimization itself is not computationally expensive, but the numerical model of phase transformations requires considerable computational effort.

  9. 9.

    When optimizing histograms, a valuable approach turned out to be the use of a hybrid objective function, where differences between volume fractions were calculated using the Earth Movers Distance (EMD). This approach allowed to find coefficients that coincide with the experiments reasonably well. The calculated histograms sufficiently reflected the experimental data for volume fractions of all phases, which allowed to conclude that the adopted methodology is correct.

  10. 10.

    It turned out to be a good idea to initially narrow the ranges during global optimization for each temperature and volume fraction separately. This allowed for the initial determination of potential ranges for the coefficients, in which there were good solutions. This multi-stage approach to optimization proved to be the most valuable in terms of obtained results.