All benchmarks, examples and applications cases to be run by Kratos. Note that unit tests are in Kratos repository and NOT here
Author: Riccardo Tosi and Marc Núñez
Kratos version: 9.0
XMC version: Kratos default version
PyCOMPSs version: Kratos default version to run in serial, >2.8 to run with runcompss
Source files: Asynchronous and Synchronous Monte Carlo
Application dependencies: ConvectionDiffusionApplication
, ExaquteSandboxApplication
, FluidDynamicsApplication
, LinearSolversApplications
, MappingApplication
, MeshingApplication
, MultilevelMonteCarloApplication
, StatisticsApplication
We solve the fluid dynamics problem of a fluid passing through a building, namely the twisted building. The problem is characterized by a realistic wind inlet, where the mean velocity follows a logarithmic profile and wind gusts are considered. Two different problems can be solved, since two boundary conditions are considered:
To reduce the time to solution, ensemble average (see [1]) can be applied to each realization with fixed boundary conditions.
The problem can be solved by running two different algorithms [2]:
and by default AMC is selected. If one is interested in running SMC, it is needed to select asynchronous = false
in the XMC settings (in problem_settings/parameters_xmc.json
). To change the inlet boundary condition, you can set true or false the keys random_reference_velocity
and random_roughness_height
of Kratos settings (in problem_settings/ProjectParameters.json
). Please observe that for running you may want to increase the number of realizations per level, the time horizon of each realization and the burn-in time (initial transient we discard when computing statistics to discard dependencies from initial conditions). All settings can be observed in the corresponding configuration file of the problem and of the algorithm.
The quantities of interest of the problem are the drag force, the base moment and the pressure field on the building surface and their time-averaged counterparts. Statistical convergence is assessed for the time-averaged drag force. Statistics are estimated using h-statistics, which are computed using power sums. Power sums are updated on the fly, and we refer to [2] for details. The statistics we estimate are the expected value and the variance of all quantities of interest.
Two different workflows are available:
To run the first scenario execute mpirun -n $number_processes python3 run_mc_Kratos.py
, while to run with runcompss the second scenario execute sh run.sh
.
In the latter case, the environment variable EXAQUTE_BACKEND
has to be set to pycompss
.
We remark that the mesh discretization we upload in this repository is rather coarse, since only 300000 elements are used to discretize the domain. The discretization can be observed next. The whole domain is reported in the left figure and a zoom close to the building is reported in the right figure.
We recommend using more accurate meshes for solving the problem, if results of engineering interest are required. For example, finer discretizations can be obtained remeshing the current mesh using the MeshingApplication. The results we report in the Results section are obtained with a finer mesh.
The velocity field of the problem is shown next, where a time window of 50 seconds is considered and the output frequency is 0.5 seconds. We first show the velocity field from an isometric view
and then from vertical and horizontal views.
The pressure field of the problem is shown next, where a time window of 50 seconds is considered and the output frequency is 0.5 seconds. We first show the pressure field from an isometric view
and then from vertical and horizontal views.
An example of power sums and h-statistics of drag force, base moment, pressure field and their time-averaged counterparts can be found here.
[1] Tosi, R., Núñez, M., Pons-Prats, J., Principe, J. & Rossi, R. (2022). On the use of ensemble averaging techniques to accelerate the Uncertainty Quantification of CFD predictions in wind engineering. Journal of Wind Engineering and Industrial Aerodynamics. https://doi.org/10.1016/j.jweia.2022.105105
[2] Tosi, R., Amela, R., Badia, R., & Rossi, R. (2021). A parallel dynamic asynchronous framework for Uncertainty Quantification by hierarchical Monte Carlo algorithms. Journal of Scientific Computing, 89(28), 25. https://doi.org/10.1007/s10915-021-01598-6