SearcharxivSearch

arXiv subjects

Sylwester Arabas

Publications and source records attributed to Sylwester Arabas.

18 recordsLinked to original sources

Adaptive time-stepping for the Super-Droplet Method Monte Carlo collision-coalescence scheme

We present an analysis of an adaptive time-stepping scheme for the Super-Droplet Method (SDM), a Monte Carlo algorithm for simulating particle coagulation. SDM represents cloud droplets as weighted superdroplets, enabling high-fidelity representations of microphysical processes such as collision-coalescence. However, the algorithm can undercount collisions when the expected number of events is not realizable given the superdroplet configuration, introducing a biased error referred here as the collision deficit. While SDM exhibits statistical spread inherent to Monte Carlo schemes, the deficit is a systematic underestimation of collision events. This error can be addressed with adaptive time-stepping, which dynamically adjusts simulation time steps to eliminate this deficit. We analyze the behavior of the deficit across a wide range of timesteps, superdroplet counts, and initialization strategies, and explore trade-offs between accuracy and efficiency. Using the classical Safranov-Golovin test case, we show that the deficit increases with timestep and superdroplet count, and that adaptive time-stepping effectively removes the associated error without significant cost. We test a smooth continuum of initial distributions with extrema representing two different initialization methods, and find that while the deficit is sensitive to the choice of attribute-space sampling strategies, adaptive time-stepping substantially reduces the difference, allowing for users to choose initialization methods optimized for other processes. We also propose a method of visualization, capturing both the attribute sampling, droplet interactions over multiple timesteps, and the deficit using network connectivity graphs. In 2-D flow-coupled simulations, we find the deficit can have a stronger effect on convergence than previously shown, with uncorrected deficit delaying the onset of precipitation.

physics.ao-ph

Path-dependent option pricing with two-dimensional PDE using MPDATA

In this paper, we discuss a simple yet robust PDE method for evaluating path-dependent Asian-style options using the non-oscillatory forward-in-time second-order MPDATA finite-difference scheme. The valuation methodology involves casting the Black-Merton-Scholes equation as a transport problem by first transforming it into a homogeneous advection-diffusion PDE via variable substitution, and then expressing the diffusion term as an advective flux using the pseudo-velocity technique. As a result, all terms of the Black-Merton-Sholes equation are consistently represented using a single high-order numerical scheme for the advection operator. We detail the additional steps required to solve the two-dimensional valuation problem compared to MPDATA valuations of vanilla instruments documented in a prior study. Using test cases employing fixed-strike instruments, we validate the solutions against Monte Carlo valuations, as well as against an approximate analytical solution in which geometric instead of arithmetic averaging is used. The analysis highlights the critical importance of the MPDATA corrective steps that improve the solution over the underlying first-order "upwind" step. The introduced valuation scheme is robust: conservative, non-oscillatory, and positive-definite; yet lucid: explicit in time, engendering intuitive stability-condition interpretation and inflow/outflow boundary-condition heuristics. MPDATA is particularly well suited for two-dimensional problems as it is not a dimensionally split scheme. The documented valuation workflow also constitutes a useful two-dimensional case for testing advection schemes featuring both Monte Carlo solutions and analytic bounds. An implementation of the introduced valuation workflow, based on the PyMPDATA package and the Numba Just-In-Time compiler for Python, is provided as free and open source software.

q-fin.CP

10 quick tips for making your software outlive your job

Loss of key personnel has always been a risk for research software projects. Key members of the team may have to step away due to illness or burnout, to care for a family member, from a loss of financial support, or because their career is going in a new direction. Today, though, political and financial changes are putting large numbers of researchers out of work simultaneously, potentially leaving large amounts of research software abandoned. This article presents ten tips to help researchers ensure that the software they have built will continue to be usable after they have left their present job -- whether in the course of voluntary career moves or researcher mobility, but particularly in cases of involuntary departure due to political or institutional changes.

cs.SE

Enabling MPI communication within Numba/LLVM JIT-compiled Python code using numba-mpi v1.0

The numba-mpi package offers access to the Message Passing Interface (MPI) routines from Python code that uses the Numba just-in-time (JIT) compiler. As a result, high-performance and multi-threaded Python code may utilize MPI communication facilities without leaving the JIT-compiled code blocks, which is not possible with the mpi4py package, a higher-level Python interface to MPI. For debugging purposes, numba-mpi retains full functionality of the code even if the JIT compilation is disabled. The numba-mpi API constitutes a thin wrapper around the C API of MPI and is built around Numpy arrays including handling of non-contiguous views over array slices. Project development is hosted at GitHub leveraging the mpi4py/setup-mpi workflow enabling continuous integration tests on Linux (MPICH, OpenMPI & Intel MPI), macOS (MPICH & OpenMPI) and Windows (MS MPI). The paper covers an overview of the package features, architecture and performance. As of v1.0, the following MPI routines are exposed and covered by unit tests: size/rank, [i]send/[i]recv, wait[all|any], test[all|any], allreduce, bcast, barrier, scatter/[all]gather & wtime. The package is implemented in pure Python and depends on numpy, numba and mpi4py (the latter used at initialization and as a source of utility routines only). The performance advantage of using numba-mpi compared to mpi4py is depicted with a simple example, with entirety of the code included in listings discussed in the text. Application of numba-mpi for handling domain decomposition in numerical solvers for partial differential equations is presented using two external packages that depend on numba-mpi: py-pde and PyMPDATA-MPI.

cs.DC

Immersion freezing in particle-based aerosol-cloud microphysics: a probabilistic perspective on singular and time-dependent models

Cloud droplets containing ice-nucleating particles (INPs) may freeze at temperatures above the homogeneous freezing threshold temperature. This process, referred to as immersion freezing, is one of the modulators of aerosol-cloud interactions in the Earth's atmosphere. In modeling studies, immersion freezing is often described using either so-called "singular" or "time-dependent" parameterizations. Here, we juxtapose both approaches and discuss them in the context of probabilistic particle-based cloud microphysics modeling. First, using a box model, we contrast how both parameterizations respond to different idealized ambient cooling rate profiles and quantify the impact of the polydispersity of the immersed surface spectrum on the frozen fraction evolution. Second, using a prescribed-flow two-dimensional cloud model, we illustrate the implications of applying the singular model in simulations with flow regimes relevant to ambient cloud conditions rather than to the cloud-chamber experiments on which these parameterizations are built upon. We discuss the critical role of the attribute-space sampling strategy for particle-based model simulations in modeling heterogeneous ice nucleation which is contingent on the presence of relatively sparse immersed INPs. The key takeaways include: (i) The singular approach, constituting a time-integrated form of a more general time-dependent approach, is only applicable under a limited range of ambient cooling rates. (ii) The time-dependent approach, especially when based on water-activity, is suitable for integration with particle-based model components of detailed aerosol composition and collisional growth/breakup. (iii) A flow-coupled aerosol-budget-resolving simulation shows the benefits and challenges of modeling cloud condensation nuclei activation and immersion freezing on insoluble ice nuclei with super-particle methods.

physics.flu-dyn

PyPartMC: A Pythonic interface to a particle-resolved, Monte Carlo aerosol simulation framework

PyPartMC is a Pythonic interface to PartMC, a stochastic, particle-resolved aerosol model implemented in Fortran. Both PyPartMC and PartMC are free, libre, and open-source. PyPartMC reduces the number of steps and mitigates the effort necessary to install and utilize the resources of PartMC. Without PyPartMC, setting up PartMC requires: working with UNIX shell, providing Fortran and C libraries, and performing standard Fortran and C source code configuration, compilation and linking. This can be challenging for those less experienced with computational research or those intending to use PartMC in environments where provision of UNIX tools is less straightforward (e.g., on Windows). PyPartMC offers a single-step installation/upgrade process of PartMC and all dependencies through the pip Python package manager on Linux, macOS, and Windows. This allows streamlined access to the unmodified and versioned Fortran internals of the PartMC codebase from both Python and other interoperable environments (e.g., Julia through PyCall). Consequently, users of PyPartMC can setup, run, process and visualize output of PartMC simulations using a single general-purpose programming language.

cs.MS

On numerical broadening of particle size spectra: a condensational growth study using PyMPDATA

This work discusses the numerical aspects of representing the diffusional (condensational) growth in particulate systems such as atmospheric clouds. It focuses on the Eulerian modeling approach, in which the evolution of the particle size spectrum is carried out using a fixed-bin discretization associated with inherent numerical diffusion. Focus is on the applications of MPDATA numerical schemes (variants explored include: infinite-gauge, non-oscillatory, third-order-terms and recursive antidiffusive correction). Methodology for handling coordinate transformations associated with both particle size distribution variable choice and numerical grid layout are expounded. Analysis of the performance of the scheme is performed using: (i) an analytically solvable box-model test case, and (ii) the single-column "KiD" test case in which the size-spectral advection due to condensation is solved simultaneously with the spatial advection in the vertical physical coordinate, and in which the supersaturation evolution is coupled with the droplet growth through water mass budget. The single-column problem involves numerical solution of a two-dimensional advection problem (spectral and spatial dimensions). The box-model simulations demonstrate that, for the problem considered, even a tenfold decrease of the spurious numerical spectral broadening can be obtained by a proper choice of the MPDATA variant (maintaining the same spatial and temporal resolution), yet at an increased computational cost. Analyses using the single-column test case reveal that the width of the droplet size spectrum is affected by numerical diffusion pertinent to both spatial and spectral advection. Application of even a single corrective iteration of MPDATA robustly decreases the relative dispersion of the droplet spectrum, roughly by a factor of two at the levels of maximal liquid water content.

physics.comp-ph

PySDM v1: particle-based cloud modelling package for warm-rain microphysics and aqueous chemistry

PySDM is an open-source Python package for simulating the dynamics of particles undergoing condensational and collisional growth, interacting with a fluid flow and subject to chemical composition changes. It is intended to serve as a building block for process-level as well as computational-fluid-dynamics simulation systems involving representation of a continuous phase (air) and a dispersed phase (aerosol), with PySDM being responsible for representation of the dispersed phase. The PySDM package core is a Pythonic high-performance implementation of the Super-Droplet Method (SDM) Monte-Carlo algorithm for representing collisional growth, hence the name. PySDM has two alternative parallel number-crunching backends available: multi-threaded CPU backend based on Numba and GPU-resident backend built on top of ThrustRTC. The usage examples are built on top of four simple atmospheric cloud modelling frameworks: box, adiabatic parcel, single-column and 2D prescribed flow kinematic models. In addition, the package ships with tutorial code depicting how PySDM can be used from Julia and Matlab.

physics.ao-ph

On the design of Monte-Carlo particle coagulation solver interface: a CPU/GPU Super-Droplet Method case study with PySDM

Super-Droplet Method (SDM) is a probabilistic Monte-Carlo-type model of particle coagulation process, an alternative to the mean-field formulation of Smoluchowski. SDM as an algorithm has linear computational complexity with respect to the state vector length, the state vector length is constant throughout simulation, and most of the algorithm steps are readily parallelizable. This paper discusses the design and implementation of two number-crunching backends for SDM implemented in PySDM, a new free and open-source Python package for simulating the dynamics of atmospheric aerosol, cloud and rain particles. The two backends share their application programming interface (API) but leverage distinct parallelism paradigms, target different hardware, and are built on top of different lower-level routine sets. First offers multi-threaded CPU computations and is based on Numba (using Numpy arrays). Second offers GPU computations and is built on top of ThrustRTC and CURandRTC (and does not use Numpy arrays). In the paper, the API is discussed focusing on: data dependencies across steps, parallelisation opportunities, CPU and GPU implementation nuances, and algorithm workflow. Example simulations suitable for validating implementations of the API are presented.

physics.comp-ph

Derivative pricing as a transport problem: MPDATA solutions to Black-Scholes-type equations

We discuss in this note applications of the Multidimensional Positive Definite Advection Transport Algorithm (MPDATA) to numerical solutions of partial differential equations arising from stochastic models in quantitative finance. In particular, we develop a framework for solving Black-Scholes-type equations by first transforming them into advection-diffusion problems, and numerically integrating using an iterative explicit finite-difference approach, in which the Fickian term is represented as an additional advective term. We discuss the correspondence between transport phenomena and financial models, uncovering the possibility of expressing the no-arbitrage principle as a conservation law. We depict second-order accuracy in time and space of the embraced numerical scheme. This is done in a convergence analysis comparing MPDATA numerical solutions with classic Black-Scholes analytical formulae for the valuation of European options. We demonstrate in addition a way of applying MPDATA to solve the free boundary problem (leading to a linear complementarity problem) for the valuation of American options. We finally comment on the potential the MPDATA framework has with respect to being applied in tandem with more complex models typically used in quantitive finance.

q-fin.CP

A State-Space Model for Assimilating Passenger and Vehicle Flow Data with User Feedback in a Transit Network

This note explores the idea of utilising a state-space model, congruent with the underlying equations of the Kalman filter with control input, for reconstructing the state of crowdedness in a transit network. The envisaged role of the proposed scheme is twofold: first, to provide an estimate of the state of crowdedness given input data on vehicle movement, on passenger inflow/outflow at stations and on measured crowdedness; second, to trigger localised requests for feedback based on the estimated system state as well as on the data assimilation performance indices. The latter is applicable to a scenario where the crowdedness is measured through passenger feedback. The feedback loop is conceptualised to be realised with a participatory crowd-sensing smartphone-based system in which reported perceived levels of crowdedness are assimilated in near-real-time with the aim of improving the estimation of the model state. Presented model is also applicable for assimilating other relevant measurements, for instance, vehicle weighing, automatic passenger counting, aggregated smartcard data or passive wireless device monitoring data.

eess.SY

On the CCN [de]activation nonlinearities

We take into consideration the evolution of particle size in a monodisperse aerosol population during activation and deactivation of cloud condensation nuclei (CCN). The phase portrait of the system derived through a weakly-nonlinear analysis reveals a saddle-node bifurcation and a cusp catastrophe. An analytical estimate of the activation timescale is derived through estimation of the time spent in the saddle-node bifurcation bottleneck. Numerical integration of the system portrays two types of activation/deactivation hystereses: one associated with the kinetic limitations on droplet growth when the system is far from equilibrium, and one occurring close to equilibrium and associated with the cusp catastrophe. The hysteretic behaviour close to equilibrium imposes stringent time-resolution constraints on numerical integration, particularly during deactivation.

physics.ao-ph

Python bindings for libcloudph++

This technical note introduces the Python bindings for libcloudph++. The libcloudph++ is a C++ library of algorithms for representing atmospheric cloud microphysics in numerical models. The bindings expose the complete functionality of the library to the Python users. The bindings are implemented using the Boost.Python C++ library and use NumPy arrays. This note includes listings with Python scripts exemplifying the use of selected library components. An example solution for using the Python bindings to access libcloudph++ from Fortran is presented.

physics.comp-ph

Case Studies and Challenges in Reproducibility in the Computational Sciences

This paper investigates the reproducibility of computational science research and identifies key challenges facing the community today. It is the result of the First Summer School on Experimental Methodology in Computational Science Research (https://blogs.cs.st-andrews.ac.uk/emcsr2014/). First, we consider how to reproduce experiments that involve human subjects, and in particular how to deal with different ethics requirements at different institutions. Second, we look at whether parallel and distributed computational experiments are more or less reproducible than serial ones. Third, we consider reproducible computational experiments from fields outside computer science. Our final case study looks at whether reproducibility for one researcher is the same as for another, by having an author attempt to have others reproduce their own, reproducible, paper. This paper is open, executable and reproducible: the whole process of writing this paper is captured in the source control repository hosting both the source of the paper, supplementary codes and data; we are providing setup for several experiments on which we were working; finally, we try to describe what we have achieved during the week of the school in a way that others may reproduce (and hopefully improve) our experiments.

cs.CE

libmpdata++ 0.1: a library of parallel MPDATA solvers for systems of generalised transport equations

This paper accompanies first release of libmpdata++, a C++ library implementing the Multidimensional Positive-Definite Advection Transport Algorithm (MPDATA). The library offers basic numerical solvers for systems of generalised transport equations. The solvers are forward-in-time, conservative and non-linearly stable. The libmpdata++ library covers the basic second-order-accurate formulation of MPDATA, its third-order variant, the infinite-gauge option for variable-sign fields and a flux-corrected transport extension to guarantee non-oscillatory solutions. The library is equipped with a non-symmetric variational elliptic solver for implicit evaluation of pressure gradient terms. All solvers offer parallelisation through domain decomposition using shared-memory parallelisation. The paper describes the library programming interface, and serves as a user guide. Supported options are illustrated with benchmarks discussed in the MPDATA literature. Benchmark descriptions include code snippets as well as quantitative representations of simulation results. Examples of applications include: homogeneous transport in one, two and three dimensions in Cartesian and spherical domains; shallow-water system compared with analytical solution (originally derived for a 2D case); and a buoyant convection problem in an incompressible Boussinesq fluid with interfacial instability. All the examples are implemented out of the library tree. Regardless of the differences in the problem dimensionality, right-hand-side terms, boundary conditions and parallelisation approach, all the examples use the same unmodified library, which is a key goal of libmpdata++ design. The libmpdata++ library is implemented in C++, making use of the Blitz++ multi-dimensioanl array containers, and is released as free/libre and open-source software.

physics.comp-ph

libcloudph++ 0.2: single-moment bulk, double-moment bulk, and particle-based warm-rain microphysics library in C++

This paper introduces a library of algorithms for representing cloud microphysics in numerical models. The library is written in C++, hence the name libcloudph++. In the current release, the library covers three warm-rain schemes: the single- and double-moment bulk schemes, and the particle-based scheme with Monte-Carlo coalescence. The three schemes are intended for modelling frameworks of different dimensionality and complexity ranging from parcel models to multi-dimensional cloud-resolving (e.g. large-eddy) simulations. A two-dimensional prescribed-flow framework is used in example simulations presented in the paper with the aim of highlighting the library features. The libcloudph++ and all its mandatory dependencies are free and open-source software. The Boost.units library is used for zero-overhead dimensional analysis of the code at compile time. The particle-based scheme is implemented using the Thrust library that allows to leverage the power of graphics processing units (GPU), retaining the possibility to compile the unchanged code for execution on single or multiple standard processors (CPUs). The paper includes complete description of the programming interface (API) of the library and a performance analysis including comparison of GPU and CPU setups.

physics.ao-ph

Object-oriented implementations of the MPDATA advection equation solver in C++, Python and Fortran

Three object-oriented implementations of a prototype solver of the advection equation are introduced. The presented programs are based on Blitz++ (C++), NumPy (Python), and Fortran's built-in array containers. The solvers include an implementation of the Multidimensional Positive-Definite Advective Transport Algorithm (MPDATA). The introduced codes exemplify how the application of object-oriented programming (OOP) techniques allows to reproduce the mathematical notation used in the literature within the program code. A discussion on the tradeoffs of the programming language choice is presented. The main angles of comparison are code brevity and syntax clarity (and hence maintainability and auditability) as well as performance. In the case of Python, a significant performance gain is observed when switching from the standard interpreter (CPython) to the PyPy implementation of Python. Entire source code of all three implementations is embedded in the text and is licensed under the terms of the GNU GPL license.

physics.comp-ph

Super-Droplet Approach to Simulate Precipitating Trade-Wind Cumuli - Comparison of Model Results with RICO Aircraft Observations

In this study we present a series of LES simulations employing the Super-Droplet Method (SDM) for representing aerosol, cloud and rain microphysics. SDM is a particle-based and probabilistic approach in which a Monte-Carlo type algorithm is used for solving the particle collisions and coalescence process. The model does not differentiate between aerosol particles, cloud droplets, drizzle or rain drops. Consequently, it covers representation of such cloud-microphysical processes as: CCN activation, drizzle formation by autoconversion, accretion of cloud droplets, self-collection of raindrops and precipitation including aerosol wet deposition. Among the salient features of the SDM, there are: (i) the robustness of the model formulation (i.e. employment of basic principles rather than parametrisations) and (ii) the ease of comparison of the model results with experimental data obtained with particle-counting instruments. The model set-up used in the study is based on observations from the Rain In Cumulus over Ocean (RICO) field project (the GEWEX Cloud System Study Boundary Layer Cloud Working Group RICO case). Cloud and rain droplet size spectrum features obtained in the simulations are compared with previously published aircraft observations carried out during the RICO field project. The analysis covers height-resolved statistics of simulated cloud microphysical parameters such as droplet number concentration, effective radius, and the width of the cloud droplet size spectrum. The sensitivity of the results to the grid resolution of the LES, as well as to the sampling density of the probabilistic (Monte-Carlo type) model is discussed.

physics.ao-ph