{'fraction_non_alphanumeric': 0.028174981463827985, 'fraction_numerical': 0.0085266391272111, 'mean_word_length': 4.869754429592788, 'pattern_counts': {'":': 0, '<': 0, '<?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}}
TOWARDS AUTOMATED COMPUTATION WITH UNCERTAINTY ESTIMATION FOR INDUSTRIAL SIMULATION OF SHIP FLOW

. Adaptive grid reﬁnement is tested for routine, automated simulations of ship resistance in calm water. A simulation protocol for these computations is ﬁne-tuned on one test case and then applied unchanged to three different cases. The solutions are numerically accurate and compare well with experiments. Effective numerical uncertainty estimation increases the trustworthiness of the solutions.


INTRODUCTION
Today, mesh generation is a bottleneck for the continuing growth of CFD for realistic simulation in research and industry [9]. Meshing requires more expert user knowledge than any other aspect of numerical simulation, while the trend towards more complex simulations implies that even experts cannot determine beforehand what mesh fineness, in what positions, is needed to resolve the main flow features correctly. Thus, computations may need to be repeated several times, leading to unpredictable costs and turnaround times, which is an obstacle for large-scale use in industry.
Adaptive mesh refinement, which locally refines the mesh during the simulation according to the requirements of the flow, is a natural solution to these problems. However, for general use of adaptive refinement, it should simplify computations, rather than only increase their accuracy. Mesh adaptation is only acceptable in an industrial context if it can be performed automatically, with little or no user intervention, and if it is robust enough to produce reliable solutions for a large range of test cases.
In the recent paper [13], we show that adaptive refinement for the simulation of free-surface water flows around ships, using the ISIS-CFD flow solver which we develop, is mature enough to envisage industrial application. In [13], the reliability of the adaptive simulations is ensured by two means. First, standardised guidelines [12] are introduced to automatically set the simulation parameters correctly for each simulation, independent of the flow conditions and the geometry. And second, adaptation is used to produce series of coarse to fine meshes, which are combined with classical uncertainty estimations to predict the accuracy of the results [11]. The grid convergence obtained is remarkably smooth for unstructured meshes, which implies that the estimated uncertainty bounds are sharp and accurate.
This paper provides a summary of [13]. After an introduction of the flow solver ISIS-CFD and its mesh adaptation (section 2), the approach for defining universal user guidelines is presented in section 3. These guidelines are then applied to three ships, ranging from a destroyer to a supertanker (section 4). To conclude, the range of applications for the simulation protocol and the wider implications of the tests are discussed in section 5.

Flow solver
The CFD simulations are performed with the Navier-Stokes solver ISIS-CFD developed at ECN -CNRS, available in the FINE TM /Marine computing suite from Cadence Design Systems. ISIS-CFD is an incompressible unstructured finite-volume solver for multifluid flow. The velocity field is obtained from the momentum conservation equations and the pressure field is extracted from the mass conservation constraint transformed into a pressure equation. These equations are similar to the Rhie and Chow SIMPLE method, but have been adapted for flows with discontinuous density fields. Free-surface flow is simulated with a conservation equation for the volume fraction of water, discretized with specific compressive discretization schemes. The method features sophisticated turbulence models, such as an anisotropic EASM model and hybrid RANS/LES models of the DES family.
The unstructured discretization is face-based. While all unknown state variables are cell-centered, the systems of equations used in the implicit time stepping procedure are constructed face by face. Therefore, cells with an arbitrary number of arbitrarily-shaped constitutive faces are accepted, which enables for example adaptive mesh refinement. The code is fully parallel using the message passing interface (MPI) protocol. A detailed description of the solver is given by [8].

Mesh adaptation
Adaptive grid refinement in ISIS-CFD is performed by local division of unstructured hexahedral meshes [10,11]. The decision where to refine is based on a metric refinement criterion [4,1], a tensor field C (x, y, z) computed from the flow. The tensor is based on the water surface position and on second derivatives of the flow variables, which give a crude indication of the local truncation errors. The grid is refined until the dimensions d i, j ( j = 1, 2, 3) of each hexahedral cell i satisfy: The refinement criterion based on the second derivatives of the flow is not very sensitive to grid refinement [11], so the cell sizes everywhere are proportional to the constant threshold T r .
The adaptation is included in the flow solver and fully parallelised. Computations are started from a coarse initial grid created with the mesher Hexpress (figure 2) and the refinement procedure is called repeatedly during the simulation, until the flow has converged and the mesh is no longer changed by successive adaptation steps.

Refinement criterion
To create the fine meshes entirely using adaptive refinement, the refinement criterion must react to all the flow features which are relevant for ship resistance. This implies a combination of a free-surface capturing criterion and the Hessian of the pressure, which is a suitable indicator of the orbital flow fields in the waves [10]. Also the accurate resolution of the boundary layer and wake is needed to correctly predict both viscous and pressure forces, which suggests refinement based on the velocity Hessians. The combined free-surface and flux-component Hessian criterion of [11] is therefore adopted. Figure 1 shows a mesh generated with the combined refinement criterion: combined refinement at and below the surface can be seen in waves, while the mesh around the hull is refined at the bow and in the boundary layer. Jeroen Wackers et al.

MESH REFINEMENT PROTOCOL
For routine simulation, default values for the simulation parameters are needed, which must be straightforward and correct, without a need for trial and error. These guidelines have to be valid over a range of ship lengths, velocities, hull shapes, etc. Our approach to defining guidelines [12] is to use physical arguments, notably dimensional analysis, to reduce the number of input variables that have to be considered and then to use experience to find sensible guidelines for the remaining parameters. Without repeating the full protocol stated in [13], we provide two examples here of how the guidelines are defined.
Thresholds The appropriate mesh density is specified here by the threshold T r of equation (1). Many authors adjust such mesh density parameters to obtain a specified number of cells, for example by normalising the metric in such a way that the threshold directly specifies the target number of cells [1].
To capture free-surface waves, we prefer a different approach. For non-adapted meshes, we specify target cell sizes at the free surface in terms of the ship length L. To obtain the same behaviour for adaptive refinement, the free-surface refinement criterion is defined with unit vectors in equation (1), so its threshold T rS equals the desired cell size normal to the free surface, which is chosen as L/1000 following established ISIS-CFD guidelines.
To keep the criteria compatible, a similar behaviour is sought for the Hessian refinement criterion: the mesh density on the hull should be proportional to the threshold value, independent of the case parameters. Therefore, the criterion is non-dimensionalized using the reference length and velocity. As a result, the choice for T rH no longer depends on the ship length and velocity; only a (weak) dependence on Fr, Re, and the hull shape remains, which can be ignored for a specific class of ship hulls (such as displacement hulls). The tests in [13] suggest the range T rH ∈ [0.2L, 0.025L] for coarse to fine grids.
Refinement cutoff filter and limiting box Adaptive refinement based on the combined refinement criterion captures flow details in the entire domain. However, for the accurate evaluation of ship resistance, not all these details may be required. Thus, the criterion is modified in two ways. The resolution can be controlled by specifying a minimum cell size, below which cells are no longer refined. A large minimum cell size works like a cutoff filter: while the adaptive refinement still captures  figure 3a shows the dependence of the resistance on the minimum cell size. This parameter (chosen small in earlier tests, around 10 −4 L) has a pronounced influence: for a larger minimum cell size, the number of cells is strongly reduced, for only a modest loss of precision. Also, the solutions for all minimum cell sizes converge to the same value when T rH is reduced. Thus, for resistance simulations, the largest minimum cell size tested, i.e. L/1000 like the free-surface threshold, is preferable. Furthermore, resolving the ship wake and the wave field behind the ship may not be needed for resistance computations. Therefore, limiting boxes were tested which forbid horizontal refinement from a given distance behind the stern. Preventing refinement aft of 0.3L behind the stern removes the entire far wake field, but does not significantly alter the forces while reducing the number of cells by up to 40% (figure 3b). An even shorter box (0.1L behind the stern) changes the converged resistance, so it is not adopted. The box at 0.3L is the best compromise.

TESTS OF THE PROTOCOL
The protocol was developed using the KCS test case. To test its generality, it was then applied blindly to other cases with varying hull forms (figure 5); the results are compared with experiments and simulations on non-adapted meshes. This section presents an extract of these tests which illustrates the main results.

KRISO Container Ship
A modern fast cargo ship, the KRISO Container Ship (KCS) [6] is simulated in model-scale towed condition at Re = 1.257 · 10 7 and Fr = 0.260. The k − ω SST turbulence model with a wall law is used. The full setup for this case is given in [13]. Figure 6a shows the convergence of the resistance with the Hessian threshold T rH , as well as the numerical uncertainty evaluated with the grid-convergence based method of Eça and Hoekstra [3] (where T rH is used as the measure for the grid size, instead of an averaged cell size). A power-law like convergence is obtained and the uncertainty estimations, which overlap for the finer grids, make sense. Figure 7 shows that the free surface is visually converged at T rH = 0.05, since the difference with the finest threshold is negligible. This shows that varying T rH is an effective way to obtain grid convergence and that the selected range for T rH is appropriate. The results are compared with simulations on Hexpress meshes created with the C-Wizard automatic setup tool, which provides uniform cell sizes over the hull. Also, a combined Hexpress and systematic grid refinement (SGR) approach is shown, where the three coarsest grids are generated by Hexpress, using manual refinement at the bow and stern. The finest grids are created from these coarser grids by refining all cells once, using the adaptive refinement algorithm. Figure 6b compares the three results. The adapted series converges much faster to its final value than the other two. A given numerical accuracy is therefore obtained on coarser grids: the same distance from the converged value is typically obtained with 1.5 to 2 times fewer cells than the C-Wizard series. Furthermore, the MS-FCH and SGR series converge to roughly the same values for the resistance, which underlines the reliability of both series. The meshes of the C-Wizard series are not similar: in Hexpress, the boundary layer meshes become thinner as the outer mesh is refined. Therefore, the series converges to a lower value than the other two.

DTMB 5415
The protocol developed for the KCS is applied unchanged to the DTMB 5415 model in towed condition at Fr = 0.41 and Re = 1.74 · 10 7 following the measurements of [7]. This case represents a slender military vessel at full speed, where heavy wave breaking occurs both at the bow and the stern (figure 8b).
The adapted-grid resistance is again compared with C-Wizard uniform grids and meshes with manual refinement and SGR (figure 8a). The adapted series converges quickly and produces good uncertainty estimations; however, the experimental results are underestimated, likely due to the difficulty of modelling the breaking wave behaviour. The non-adapted series seem to agree better with the experiments, but they converge to the same underestimated solution -albeit more slowly. Thus, the faster convergence and smaller uncertainty mean that the adapted-mesh results are the most reliable.

KVLCC2
A slow bulky ship, the KVLCC2 tanker, is simulated at Fr = 0.14232 and Re = 4.6 · 10 6 , following the experiments of [6]. To test the influence of the turbulence modelling, the anisotropic EASM model, which is recommended to resolve the KVLCC2 wake [2], is used. Furthermore, both wall-law and wallresolved boundary conditions are tested. All other settings are the same as for the KCS.
For the wall-law results (figure 9a), the convergence of the resistance for the adapted meshes is nearly perfect with a very low final uncertainty of 0.2%. This shows that the refinement protocol is applicable to the EASM model without modifications. The C-Wizard series is in better agreement with the experiments, but this is an artefact of the wall-law boundary condition: for the more accurate wall-resolved boundary layers (figure 9b), the adapted series gives the best agreement. The difference between the solutions is caused by the aft-body flow. The experiments show a characteristic 'hook' shape in the axial velocity (figure 10c), due to a strong longitudinal vortex. This vortex is well represented by the adapted solution (figure 10a), but underestimated for the uniform grids (figure 10b). Since the creation of a vortex costs energy, this explains the lower resistance for the C-Wizard series.

KCS in self-propulsion
To test the versatility of the refinement protocol, it is finally applied to a case for which it was never intended: the KCS in self-propulsion condition [5] with a body-force model to represent the propeller. This is a challenge since the mesh refinement has never been tested for a force field before. Also, a ship propeller is tiny with respect to the ship itself. Can something so small be captured by mesh adaptation that is configured for the flow around the ship?
The initial Hexpress mesh is equal to the one from section 4.1; no particular refinement is applied around the actuator disk. Still, the adapted grid (figure 11b) captures the propeller flow well, even at the coarse threshold T rH = 0.1L. Thus, refinement based on the ship length scale is appropriate for a detail like the actuator disk. However, the mesh size throughout the actuator disk region is equal to the minimum cell size. While this mesh is fine enough for the actuator disk, it is possible that the minimum cell size prevents the convergence to a mesh-independent solution. All resistance results (figure 11a) agree well with the experiments; the difference between the series is similar to the KVLCC2 for example. These force results confirm that the mesh adaptation protocol can be used for self-propulsion.

CONCLUSIONS AND DISCUSSION
This paper, based on [13], presents a mesh adaptation protocol intended for the evaluation of calmwater resistance for displacement hulls. How general is this protocol? The tests show that it can be applied unmodified to hull shapes ranging from slender to full, and to speeds from slow steaming to military top speeds. Also, different RANS turbulence models and wall models were tested. Furthermore, the protocol is suitable for body-force propeller models. Larger variations of the test case, such as fullscale vessels or fast planing hulls, were not tried. However, [12] shows that adaptation with the same criterion and similar thresholds is even applicable to wings and hydrofoils. Most calm-water ship flow cases cases are probably close enough to what was tested here, that even if the protocol in section 3 has to be adapted for them, it is likely that a similar protocol exists. Thus, routine mesh adaptation for resistance simulations is realistic today.
Does Hessian-based adaptation offer advantages with respect to existing meshing approaches? First, the tests show that adapted meshes provide excellent grid convergence, often obtaining 1% difference with the converged resistance on grids of about 1M cells, which is much faster than on non-adapted meshes. Furthermore, mesh adaptation makes the simulation more reliable, since it automatically ensures that the mesh is suitable for the flow. This was observed for the KVLCC2, where only the adapted meshes capture the hook-shaped wake. Finally, the grid convergence in all cases presented here is smooth, which leads to reliable convergence-based uncertainty estimations; this was also observed by [11] for mono-fluid flows and by [1] for wings and aircraft using compressible flow and tetrahedral mesh adaptation. Thus, the good uncertainty estimations are likely a property of the metric-based refinement. For unstructured meshes, this is an important advantage.
The correspondence of the resistance with experiments is often worse than for non-adapted meshes. However, wherever this was tested, the differences were traced to problems with the non-adapted meshes, such as insufficient resolution of breaking waves and wakes. The reason for this is that industrial-standard turbulence models (like k − ω SST with wall laws) are approximate, while fixed meshes lead to nonnegligible numerical errors. Therefore, successful existing simulation methods rely to some extent on error compensation to get optimal accuracy: over the years, the turbulence modelling has been tuned to work well on industrial-standard meshes. Adaptive grid refinement however reduces numerical errors by an order of magnitude with respect to fixed grids. This is likely to upset the equilibrium of error compensation, leading to overall larger errors. Maybe the turbulence modelling has to be specifically adjusted for adaptively refined grids? Therefore, open questions remain and the simulation protocol will probably be improved and extended. Still, it has proved its generality and the potential advantages are obvious. The current results show that the technique is mature enough to start gaining experience with large-scale practical application.