• Keine Ergebnisse gefunden

3. Methodology

3.5. Efficient usage of multi-parameter equation of state

et al. [34] and further improved as presented by Hoffmann et al. [57]. A detailed de-scription is provided by the latter [57], however, to keep this work self-contained a brief description is given in the following.

3.5.1. Choice of Equation of state approximation

For every type of modeling and approximation it is relevant to find the correct balance between computational costs and accuracy. Hence, the choice of EOS approximation is discussed in the following. A brief summery of different EOS approximations is given in Section 2.2.

First, it is important to analyze what type of fluid is used and under which conditions it occurs within the simulations. In the present work, two different fluids are assessed, e.g., methane at high pressures and water in different states of matter. For both cases an ideal gas approximation is unfeasible and a more complex EOS is required. Whilst cubic equations offer satisfactory accuracy for the gaseous phase, their approximation within the two-phase region is incorrect and cannot be used for cavitational simulations. Hence, it is desirable to use the Helmholtz formulations. The evaluation of such a high-accuracy multiparameter EOS, however is computationally very expensive and cannot be applied directly for CFD simulations in its analytical form. Therefore, EOS data is tabulated as part of the pre-processing.

Here, the evaluation time is very important. The evaluation times of a ideal gas law, a cubic equation, i.e., the Peng-Robinson was chosen as an example, and a Helmholtz equations formulation are compared with each other. The Helmholtz equations are both assessed as direct evaluation and in the proposed tabulated form. For the Helmholtz equations the Open Source library CoolProp version 4.2.6 is used. Later the imple-mentation of the tabulated EOS is discussed in further detail. For the table evaluation different depths or levels of the table are evaluated, i.e., depending on the fluid proper-ties different table levels are required to reach a certain accuracy. The evaluation is in all cases from the variables densityρand inner energyeto pressure. To obtain the pressure, in the context of a density based solver, the temperature needs be calculated iteratively, i.e,eis guessed, for both the cubic equations and the Helmholtz formulation. Table 3.1 summarizes the evaluation times of each approach. The computational cost for the direct evaluation for ideal gas, Peng-Robinson and the Helmholtz equation increases with their complexity. It is interesting to notice, that with the table approach the computational costs can be reduced significantly even compared to the cubic equation. These findings allow it to use the higher accuracy EOS and reduce the simulation costs compared to cubic real gas approximation. Of course, the computational costs are increased to the direct evaluation of ideal gas, which is unavoidable.

3.5. Efficient usage of multi-parameter equation of state

Table 3.1.:Evaluation times for the different EOS approaches. Data for ideal gas and Helmholtz (direct) are take from Hoffmann et al. [57].

EOS type Time [1×10−6s]

Ideal gas 0.01712

Peng-Robinson 3.200

Helmholtz (direct) 232.0

Helmholtz (tabulated with level 6) 0.1953 Helmholtz (tabulated with level 15) 0.2868

3.5.2. Implementation of tabulated Equation of State

Having motivated the choice of tabulated Helmholtz equation as an EOS approximation, the used implementation is introduced. The interested reader is referred to Hoffmann et al. [57] for a more detailed discussion. The provided EOS from CoolProp is coupled with the currently used CFD code, which is based on the conservative form (Equation (2.1)).

From density and inner energy the other variables are calculated, i.e., pressure, ture, speed of sound, viscosity and thermal conductivity and from pressure and tempera-ture the density and inner energy. These variables are needed for the flux calculation. In the implementation, CoolProp is evaluated prior to the simulation and the calculated val-ues are stored in a table. In the present work depending on the application, three or four different conversion tables are required. For fluids with high gradients at small densities, e.g., water, it was found beneficial to split the conversion from density and inner energy to temperature into two tables,ρ≥1 kg m−3andρ <1 kg m−3. The conversion from the conservative to the primitive variables is split into two steps. First, the temperature is evaluated fromρande, afterwardsρandT are used to evaluate the other primitive variables. The main reason for this split is in the pre-processing and the total table size, the evaluation ofTis very expensive. Therefore, the table refinement is done separately, which increases the pre-processing speed significantly and reduces the overall memory requirement of the tables in the simulation. An overview of the different tables is given in Table 3.2.

The table approach is based on a quad-tree domain decomposition strategy. The prim-itive variables are represented by polynomials within each cell. The solution is discon-tinuous across the cell interfaces. For each cell for the thermodynamic variable,Φ, the approximation error

=

Φtable−ΦCoolProp

Φtable

, (3.20)

to the CoolProp solution is calculated. Based on the error the table is locally refined.

Table 3.2.:Conversion tables for the EOS approximation.

Input varibles Output varibles Usage criteria

ρ e T ρ≥1 kg m−3

v e T ρ <1 kg m−3

ρ T p a λ µ

T p ρ e

The process is illustrated in Figure 3.4. In the domain, e.g.,(ρ, e), the approximation error is compared to the error thresholdth(Figure 3.4a). For > tha sub quad-tree is generated, i.e., the domain is refined, and the approximation error is again compared in the sub quad-tree to the threshold (Figure 3.4b). This process is repeated until the criteria is satisfied in the whole table or the maximum level is reached.

The error threshold,thfor the table strongly depends on the application. For real gas approximation an <10−4 is sufficient, however when phase changes are involved it might be necessary to decrease the threshold further. For the present study, this level of accuracy for the entire variable range was achieved with a maximal refinement-cell level of 19. Of course, the accuracy of the tabulated EOS is always limited by the accuracy of the original formulation, here the Helmholtz formulation.

The construction process of the table is completely parallelized and can run on an arbitrary number of processors. For the tables used in Chapter 4, methane is tabulated for

> th

(a)

> th < th

> th

< th

(b)

>th <th

<th >th

>th <th

<th >th

(c)

Figure 3.4.:Schematic of the building process of an EOS table with the quad-tree ap-proach (hatched box: no further action), a) initial domain b) check after refinement, c) check the refined sub quad-tree.