|
| 1 | +# Turbulent inlet wind engineering twisted building problem |
| 2 | + |
| 3 | +**Author:** [Riccardo Tosi](https://riccardotosi.github.io) and [Marc Núñez](https://github.com/marcnunezc) |
| 4 | + |
| 5 | +**Kratos version:** 8.1 |
| 6 | + |
| 7 | +**XMC version:** Kratos default version |
| 8 | + |
| 9 | +**PyCOMPSs version:** Kratos default version to run in serial, >2.8 to run with `runcompss` |
| 10 | + |
| 11 | +**Source files:** [Asynchronous and Synchronous Monte Carlo](source) |
| 12 | + |
| 13 | +**Application dependencies:** `ConvectionDiffusionApplication`, `ExaquteSandboxApplication`, `FluidDynamicsApplication`, `LinearSolversApplications`, `MappingApplication`, `MeshingApplication`, `MultilevelMonteCarloApplication`, `StatisticsApplication` |
| 14 | + |
| 15 | +## Case Specification |
| 16 | +We solve the [fluid dynamics problem](https://github.com/KratosMultiphysics/Kratos/tree/master/applications/FluidDynamicsApplication) 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: |
| 17 | + |
| 18 | +* turbulent (wind gusts) and deterministic wind mean velocity profile inlet boundary conditions, |
| 19 | +* turbulent (wind gusts) and stochastic wind mean velocity profile inlet boundary conditions: reference velocity and/or roughness height are random. |
| 20 | + |
| 21 | +To reduce the time to solution, ensemble average (see [1]) can be applied to each realization with fixed boundary conditions. |
| 22 | + |
| 23 | +The problem can be solved by running two different algorithms [2]: |
| 24 | + |
| 25 | +* Synchronous Monte Carlo (SMC), |
| 26 | +* Asynchronous Monte Carlo (AMC), |
| 27 | + |
| 28 | +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](source/problem_settings/ProjectParameters.json) and [of the algorithm](source/problem_settings/parameters_xmc.json). |
| 29 | + |
| 30 | +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. |
| 31 | + |
| 32 | +Two different workflows are available: |
| 33 | + |
| 34 | +* workflow is MPI parallel, |
| 35 | +* workflow is serial, only Kratos tasks are MPI parallel and are scheduled by distributed environment scheduler. |
| 36 | + |
| 37 | +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`. |
| 38 | +In the latter case, the environment variable `EXAQUTE_BACKEND` has to be set to `pycompss`. |
| 39 | + |
| 40 | +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. |
| 41 | +<p align="center"> |
| 42 | + <img src="data/mesh.png" alt="mesh discretization" style="height: 175px;"/> |
| 43 | + <img src="data/mesh_zoom.png" alt="mesh discretization zoom" style="height: 175px;"/> |
| 44 | +</p> |
| 45 | +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 <a href="https://github.com/KratosMultiphysics/Kratos/tree/master/applications/MeshingApplication">MeshingApplication</a>. The results we report in the Results section are obtained with a finer mesh. |
| 46 | + |
| 47 | +## Results |
| 48 | + |
| 49 | +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 |
| 50 | +<p align="center"> |
| 51 | + <img src="data/animation_twisted_building_isometric_velocity_slow.gif" alt="velocity" style="width: 750px;"/> |
| 52 | +</p> |
| 53 | +and then from vertical and horizontal views. |
| 54 | +<p align="center"> |
| 55 | + <img src="data/animation_twisted_building_fromside_velocity_slow.gif" alt="velocity" style="height: 175px;"/> |
| 56 | + <img src="data/animation_twisted_building_fromtop_velocity_slow.gif" alt="velocity" style="height: 175px;"/> |
| 57 | +</p> |
| 58 | + |
| 59 | +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 |
| 60 | +<p align="center"> |
| 61 | + <img src="data/animation_twisted_building_isometric_pressure_slow.gif" alt="pressure" style="width: 750px;"/> |
| 62 | +</p> |
| 63 | +and then from vertical and horizontal views. |
| 64 | +<p align="center"> |
| 65 | + <img src="data/animation_twisted_building_fromside_pressure_slow.gif" alt="pressure" style="height: 175px;"/> |
| 66 | + <img src="data/animation_twisted_building_fromtop_pressure_slow.gif" alt="pressure" style="height: 175px;"/> |
| 67 | +</p> |
| 68 | + |
| 69 | +An example of power sums and h-statistics of drag force, base moment, pressure field and their time-averaged counterparts can be found [here](source/power_sums_outputs). |
| 70 | + |
| 71 | +## Refrences |
| 72 | + |
| 73 | +[1] Makarashvili, V., Merzari, E., Obabko, A., Siegel, A., & Fischer, P. (2017). A performance analysis of ensemble averaging for high fidelity turbulence simulations at the strong scaling limit. Computer Physics Communications. https://doi.org/10.1016/j.cpc.2017.05.023 |
| 74 | + |
| 75 | +[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 |
0 commit comments