SearcharxivSearch

arXiv subjects

Johan Larsson

Publications and source records attributed to Johan Larsson.

At least 19 recordsLinked to original sources

Basin: Efficient and Extensible Numerical Optimization in Rust

Basin is a numerical optimization library for the Rust programming language. Numerical optimization is the task of finding the inputs that minimize a function, and it is a fundamental element across the sciences: fitting a model to data, calibrating a simulation, training a machine learning model, or choosing engineering parameters that minimize cost. Basin gives users a single, consistent way to both state and solve such problems, with a broad catalog of solvers and first-class support for constraints.

cs.LG

Effects of mean flow skew on turbulent shear layers. Part I. Numerical investigation

Skewed turbulent shear layers, formed by the interaction between two non-aligned turbulent boundary layers, are investigated using high-fidelity large eddy simulations in a temporally evolving framework. It is argued that a skewed shear layer of this form should be viewed, in the long-time limit, in a rotated reference frame as the superposition of a standard planar shear layer and an orthogonal jet-like component that decays in time. The skewed shear layer is found to have reduced vertical integral length scale, and the coherent pressure rollers characteristic of shear layers undergo transient realignment towards the direction orthogonal to mean shear, consistent with the long-time limiting planar shear layer. Numerical experiments using fictitious test cases indicate that these effects are primarily driven through misalignment in the mean flow, and that the two orthogonal flow components in the mean shear frame are only weakly coupled.

physics.flu-dyn

Effects of mean flow skew on turbulent shear layers. Part II. Experimental investigation

Planar turbulent mixing layers, formed by the interactions of two parallel streams with different velocities, have been studied far more than three dimensional (3D) turbulent mixing layers, in which the incoming streams are skewed, and not parallel. Yet many practical shear flows are 3D. Here, we develop and validate an experimental methodology to generate and characterize skewed turbulent mixing layers and to quantify how mean-flow skew modifies mixing layer dynamics. We introduce skew with a spanwise deflection of the mean flow using turning vanes mounted near the trailing edge of a splitter plate, and we use cross-wire anemometry to investigate the downstream evolution of the flow. Relative to the planar configuration, the skewed mixing layer exhibits systematic reductions in both mean and turbulent quantities, with deviations reaching approximately 40\%. Despite these quantitative differences, the fundamental characteristics of the mixing layer remain largely unchanged. Mean-velocity profiles collapse under similarity scaling, shear-layer thicknesses retain approximately linear downstream growth, and Reynolds-stress profiles preserve their characteristic near-Gaussian form. Townsend's structure parameter, which quantifies the efficiency of turbulent momentum transport, remains approximately invariant between the planar and skewed configurations, in contrast to skewed turbulent boundary layers, wherein comparable mean flow skewing reduces the parameter by approximately 30\%. These results indicate that mean flow skew modifies turbulent mixing layers quantitatively while exerting only a secondary influence on their underlying dynamics. This study establishes a controlled experimental framework and empirical benchmark for future investigations of three-dimensional free-shear turbulence.

physics.flu-dyn

Efficient Solvers for SLOPE in R, Python, Julia, and C++

We present a suite of packages in R, Python, Julia, and C++ that efficiently solve the Sorted L-One Penalized Estimation (SLOPE) problem. The packages feature a highly efficient hybrid coordinate descent algorithm that fits generalized linear models (GLMs) and supports a variety of loss functions, including Gaussian, binomial, Poisson, and multinomial logistic regression. Our implementation is designed to be fast, memory-efficient, and flexible. The packages support a variety of data structures (dense, sparse, and out-of-memory matrices) and are designed to efficiently fit the full SLOPE path as well as handle cross-validation of SLOPE models, including the relaxed SLOPE. We present examples of how to use the packages and benchmarks that demonstrate the performance of the packages on both real and simulated data and show that our packages outperform existing implementations of SLOPE in terms of speed.

stat.CO

SmartFlow: A CFD-solver-agnostic deep reinforcement learning framework for computational fluid dynamics on HPC platforms

Deep reinforcement learning (DRL) is emerging as a powerful tool for fluid-dynamics research, encompassing active flow control, autonomous navigation, turbulence modeling and discovery of novel numerical schemes. We introduce SmartFlow, a CFD-solver-agnostic framework for both single- and multi-agent DRL algorithms that can easily integrate with MPI-parallel CPU and GPU-accelerated solvers. Built on Relexi and SmartSOD2D, SmartFlow uses the SmartSim infrastructure library and our newly developed SmartRedis-MPI library to enable asynchronous, low-latency, in-memory communication between CFD solvers and Python-based DRL algorithms. SmartFlow leverages PyTorch's Stable-Baselines3 for training, which provides a modular, Gym-like environment API. We demonstrate its versatility via three case studies: single-agent synthetic-jet control for drag reduction in a cylinder flow simulated by the high-order FLEXI solver, multi-agent cylinder wake control using the GPU-accelerated spectral-element code SOD2D, and multi-agent wall-model learning for large-eddy simulation with the finite-difference solver CaLES. SmartFlow's CFD-solver-agnostic design and seamless HPC integration is promising to accelerate RL-driven fluid-mechanics studies.

physics.flu-dyn

Scaling of wall pressure and the peak of streamwise turbulence intensity in compressible wall flows

This paper develops scaling laws for wall-pressure root-mean-square (r.m.s.) and the peak of streamwise turbulence intensity, accounting for both variable-property and intrinsic compressibility effects -- those associated with changes in fluid volume due to pressure variations. To develop such scaling laws, we express the target quantities as an expansion series in powers of an appropriately defined Mach number. The leading-order term is represented using the scaling relations developed for incompressible flows, but with an effective Reynolds number. Higher-order terms capture intrinsic compressibility effects and are modeled as constant coefficients, calibrated using flow cases specifically designed to isolate these effects. The resulting scaling relations are shown to be accurate for a wide range of turbulent channel flows and boundary layers.

physics.flu-dyn

The Choice of Normalization Influences Shrinkage in Regularized Regression

Regularized models are often sensitive to the scales of the features in the data and it has therefore become standard practice to normalize (center and scale) the features before fitting the model. But there are many different ways to normalize the features and the choice may have dramatic effects on the resulting model. In spite of this, there has so far been no research on this topic. In this paper, we begin to bridge this knowledge gap by studying normalization in the context of lasso, ridge, and elastic net regression. We focus on binary features and show that their class balances (proportions of ones) directly influences the regression coefficients and that this effect depends on the combination of normalization and regularization methods used. We demonstrate that this effect can be mitigated by scaling binary features with their variance in the case of the lasso and standard deviation in the case of ridge regression, but that this comes at the cost of increased variance of the coefficient estimates. For the elastic net, we show that scaling the penalty weights, rather than the features, can achieve the same effect. Finally, we also tackle mixes of binary and normal features as well as interactions and provide some initial results on how to normalize features in these cases.

stat.ML

CaLES: A GPU-accelerated solver for large-eddy simulation of wall-bounded flows

We introduce CaLES, a GPU-accelerated finite-difference solver designed for large-eddy simulations (LES) of incompressible wall-bounded flows in massively parallel environments. Built upon the existing direct numerical simulation (DNS) solver CaNS, CaLES relies on low-storage, third-order Runge-Kutta schemes for temporal discretization, with the option to treat viscous terms via an implicit Crank-Nicolson scheme in one or three directions. A fast direct solver, based on eigenfunction expansions, is used to solve the discretized Poisson/Helmholtz equations. For turbulence modeling, the classical Smagorinsky model with van Driest near-wall damping and the dynamic Smagorinsky model are implemented, along with a logarithmic law wall model. GPU acceleration is achieved through OpenACC directives, following CaNS-2.3.0. Performance assessments were conducted on the Leonardo cluster at CINECA, Italy. Each node is equipped with one Intel Xeon Platinum 8358 CPU (2.60 GHz, 32 cores) and four NVIDIA A100 GPUs (64 GB HBM2e), interconnected via NVLink 3.0 (200 GB/s). The inter-node communication bandwidth is 25 GB/s, supported by a DragonFly+ network architecture with NVIDIA Mellanox InfiniBand HDR. Results indicate that the computational speed on a single GPU is equivalent to approximately 15 CPU nodes, depending on the treatment of viscous terms and the subgrid-scale model, and that the solver efficiently scales across multiple GPUs. The predictive capability of CaLES has been tested using multiple flow cases, including decaying isotropic turbulence, turbulent channel flow, and turbulent duct flow. The high computational efficiency of the solver enables grid convergence studies on extremely fine grids, pinpointing non-monotonic grid convergence for wall-modeled LES.

physics.flu-dyn

Intrinsic compressibility effects in near-wall turbulence

The impact of intrinsic compressibility effects -- changes in fluid volume due to pressure variations -- on high-speed wall-bounded turbulence has often been overlooked or incorrectly attributed to mean property variations. To unambiguously quantify these intrinsic compressibility effects, we perform direct numerical simulations of compressible turbulent channel flows with nearly uniform mean properties. Our simulations reveal that intrinsic compressibility effects yield a significant upward shift in the logarithmic mean velocity profile that can be attributed to the reduction in the turbulent shear stress. This reduction stems from the weakening of the near-wall quasi-streamwise vortices. We in turn attribute this weakening to the spontaneous opposition of sweeps and ejections from the near-wall expansions and contractions of the fluid, and provide a theoretical explanation for this mechanism. Our results also demonstrate that intrinsic compressibility effects are responsible for the increase in the inner-scaled streamwise turbulence intensity in compressible flows compared to incompressible flows, previously regarded to be an effect of mean property variations.

physics.flu-dyn

Incorporating intrinsic compressibility effects in velocity transformations for wall-bounded turbulent flows

A transformation that relates a compressible wall-bounded turbulent flow with non-uniform fluid properties to an equivalent incompressible flow with uniform fluid properties is derived and validated. The transformation accounts for both variable-property and intrinsic compressibility effects, the latter being the key improvement over the current state-of-the-art. The importance of intrinsic compressibility effects contradicts the renowned Morkovin's hypothesis.

physics.flu-dyn

Estimating mean profiles and fluxes in high-speed turbulent boundary layers using inner/outer-layer transformations

Accurately predicting drag and heat transfer for compressible high-speed flows is of utmost importance for a range of engineering applications. This requires the precise knowledge of the entire velocity and temperature profiles. A common approach is to use compressible velocity scaling laws (transformation), that inverse transform the velocity profile of an incompressible flow, together with a temperature-velocity relation. In this Note, we use distinct velocity transformations for the inner and outer layers. In the inner layer, we utilize a recently proposed scaling law that appropriately incorporates variable property and intrinsic compressibility effects, while the outer layer profile is inverse-transformed with the well-known Van Driest transformation. The result is an analytical expression for the mean shear valid in the entire boundary layer, which combined with a temperature-velocity relationship, provides predictions of mean velocity and temperature profiles at unprecedented accuracy. Using these profiles, drag and heat transfer is evaluated with an accuracy of +/-4% and +/-8%, respectively, for a wide range of compressible turbulent boundary layers up to Mach numbers of 14.

physics.flu-dyn

Grid-Adaptation for Wall-Modeled Large Eddy Simulation Using Unstructured High-Order Methods

The accuracy and computational cost of a large eddy simulation are highly dependent on the computational grid. Building optimal grids manually from a priori knowledge is not feasible in most practical use cases; instead, solution-adaptive strategies can provide a robust and cost-efficient method to generate a grid with the desired accuracy. We adapt the grid-adaptation algorithm developed by Toosi and Larsson to a Discontinuous Galerkin Spectral Elements Method (DGSEM) and show its potential on fully unstructured grids. The core of the method is the computation of the estimated modeling residual using the polynomial basis functions used in DGSEM, and the averaging of the estimated residual over each element. The final method is assessed in multiple channel flow test cases and for the transonic flow over an airfoil, in both cases making use of mortar interfaces between elements with hanging nodes. The method is found to be robust and reliable, and to provide solutions at up to 50% lower cost at comparable accuracy compared to when using human-generated grids.

physics.flu-dyn

Benchopt: Reproducible, efficient and collaborative optimization benchmarks

Numerical validation is at the core of machine learning research as it allows to assess the actual impact of new methods, and to confirm the agreement between theory and practice. Yet, the rapid development of the field poses several challenges: researchers are confronted with a profusion of methods to compare, limited transparency and consensus on best practices, as well as tedious re-implementation work. As a result, validation is often very partial, which can lead to wrong conclusions that slow down the progress of research. We propose Benchopt, a collaborative framework to automate, reproduce and publish optimization benchmarks in machine learning across programming languages and hardware architectures. Benchopt simplifies benchmarking for the community by providing an off-the-shelf tool for running, sharing and extending experiments. To demonstrate its broad usability, we showcase benchmarks on three standard learning tasks: $\ell_2$-regularized logistic regression, Lasso, and ResNet18 training for image classification. These benchmarks highlight key practical findings that give a more nuanced view of the state-of-the-art for these problems, showing that for practical evaluation, the devil is in the details. We hope that Benchopt will foster collaborative work in the community hence improving the reproducibility of research findings.

cs.LG

Coordinate Descent for SLOPE

The lasso is the most famous sparse regression and feature selection method. One reason for its popularity is the speed at which the underlying optimization problem can be solved. Sorted L-One Penalized Estimation (SLOPE) is a generalization of the lasso with appealing statistical properties. In spite of this, the method has not yet reached widespread interest. A major reason for this is that current software packages that fit SLOPE rely on algorithms that perform poorly in high dimensions. To tackle this issue, we propose a new fast algorithm to solve the SLOPE optimization problem, which combines proximal gradient descent and proximal coordinate descent steps. We provide new results on the directional derivative of the SLOPE penalty and its related SLOPE thresholding operator, as well as provide convergence guarantees for our proposed solver. In extensive benchmarks on simulated and real data, we show that our method outperforms a long list of competing algorithms.

math.OC

The Hessian Screening Rule

Predictor screening rules, which discard predictors before fitting a model, have had considerable impact on the speed with which sparse regression problems, such as the lasso, can be solved. In this paper we present a new screening rule for solving the lasso path: the Hessian Screening Rule. The rule uses second-order information from the model to provide both effective screening, particularly in the case of high correlation, as well as accurate warm starts. The proposed rule outperforms all alternatives we study on simulated data sets with both low and high correlation for $\ell_1$-regularized least-squares (the lasso) and logistic regression. It also performs best in general on the real data sets that we examine.

stat.ML

The Strong Screening Rule for SLOPE

Extracting relevant features from data sets where the number of observations ($n$) is much smaller then the number of predictors ($p$) is a major challenge in modern statistics. Sorted L-One Penalized Estimation (SLOPE), a generalization of the lasso, is a promising method within this setting. Current numerical procedures for SLOPE, however, lack the efficiency that respective tools for the lasso enjoy, particularly in the context of estimating a complete regularization path. A key component in the efficiency of the lasso is predictor screening rules: rules that allow predictors to be discarded before estimating the model. This is the first paper to establish such a rule for SLOPE. We develop a screening rule for SLOPE by examining its subdifferential and show that this rule is a generalization of the strong rule for the lasso. Our rule is heuristic, which means that it may discard predictors erroneously. We present conditions under which this may happen and show that such situations are rare and easily safeguarded against by a simple check of the optimality conditions. Our numerical experiments show that the rule performs well in practice, leading to improvements by orders of magnitude for data in the $p \gg n$ domain, as well as incurring no additional computational overhead when $n \gg p$. We also examine the effect of correlation structures in the design matrix on the rule and discuss algorithmic strategies for employing the rule. Finally, we provide an efficient implementation of the rule in our R package SLOPE.

stat.ML

Look-Ahead Screening Rules for the Lasso

The lasso is a popular method to induce shrinkage and sparsity in the solution vector (coefficients) of regression problems, particularly when there are many predictors relative to the number of observations. Solving the lasso in this high-dimensional setting can, however, be computationally demanding. Fortunately, this demand can be alleviated via the use of screening rules that discard predictors prior to fitting the model, leading to a reduced problem to be solved. In this paper, we present a new screening strategy: look-ahead screening. Our method uses safe screening rules to find a range of penalty values for which a given predictor cannot enter the model, thereby screening predictors along the remainder of the path. In experiments we show that these look-ahead screening rules outperform the active warm-start version of the Gap Safe rules.

stat.ML

An alternative derivation of the Germano identity as the residual of the LES equation

The Note presents an alternative derivation and interpretation of the Germano identity and its error, showing that the Germano identity error directly estimates the residual of the LES equation, i.e., the misfit when evaluating the inexact equation for the exact solution, and therefore represents the source of errors in LES. This has many applications, including for optimal output-based grid/filter-adaptation and uncertainty quantification in LES.

physics.flu-dyn