Skip to content

Commit

Permalink
Update paper
Browse files Browse the repository at this point in the history
  • Loading branch information
vavrines committed Jan 6, 2021
1 parent 93759cc commit ad63edd
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 90 deletions.
2 changes: 0 additions & 2 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,6 @@ version = "0.8.4"
[[KitBase]]
deps = ["CUDA", "Conda", "Dates", "Distributions", "FFTW", "FastGaussQuadrature", "FileIO", "JLD2", "LinearAlgebra", "OffsetArrays", "Plots", "ProgressMeter", "PyCall", "SpecialFunctions", "Test"]
git-tree-sha1 = "038edf1373543cc02f98eccf48f7acdae29f9f3c"
repo-rev = "main"
repo-url = "https://github.com/vavrines/KitBase.jl.git"
uuid = "86eed249-3a28-466f-8d3a-596821e1af9a"
version = "0.3.4"

Expand Down
55 changes: 55 additions & 0 deletions paper/paper.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@article{bezanson2017,
title={Julia: A fresh approach to numerical computing},
author={Bezanson, Jeff and Edelman, Alan and Karpinski, Stefan and Shah, Viral B},
journal={SIAM review},
volume={59},
number={1},
pages={65--98},
year={2017},
publisher={SIAM}
}
@inproceedings{jasak2007,
title={OpenFOAM: A C++ library for complex physics simulations},
author={Jasak, Hrvoje and Jemcov, Aleksandar and Tukovic, Zeljko and others},
booktitle={International workshop on coupled methods in numerical dynamics},
volume={1000},
pages={1--20},
year={2007},
organization={IUC Dubrovnik Croatia}
}
@misc{clawpack2020,
title={Clawpack software},
author={{Clawpack Development Team}},
url={http://www.clawpack.org},
note={Version 5.7.1},
doi={https://doi.org/10.5281/zenodo.4025432},
year={2020}}
@article{Flux2018,
author = {Michael Innes and
Elliot Saba and
Keno Fischer and
Dhairya Gandhi and
Marco Concetto Rudilosso and
Neethu Mariya Joy and
Tejan Karmali and
Avik Pal and
Viral Shah},
title = {Fashionable Modelling with Flux},
journal = {CoRR},
volume = {abs/1811.01457},
year = {2018},
url = {https://arxiv.org/abs/1811.01457},
archivePrefix = {arXiv},
eprint = {1811.01457},
timestamp = {Thu, 22 Nov 2018 17:58:30 +0100},
biburl = {https://dblp.org/rec/bib/journals/corr/abs-1811-01457},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
@misc{xiao2020,
title={Using neural networks to accelerate the solution of the Boltzmann equation},
author={Tianbai Xiao and Martin Frank},
year={2020},
eprint={2010.13649},
archivePrefix={arXiv},
primaryClass={physics.comp-ph}
}
107 changes: 19 additions & 88 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ bibliography: paper.bib

# Summary

``Kinetic.jl`` is a lightweight Julia toolbox for computational fluid dynamics and scientific machine learning. It focus on the theoretical and numerical studies of many-particle systems of gases, photons, plasmas, neutrons, etc. The finite volume method (FVM) is implemented to conduct 1-3 dimensional numerical simulations for any advection-diffusion type equations.
``Kinetic.jl`` is a lightweight toolbox for computational fluid dynamics and scientific machine learning. It focus on the theoretical and numerical studies of many-particle systems of gases, photons, plasmas, neutrons, etc. Under the hood, the finite volume method (FVM) is implemented with various flux functions and update algorithms. Therefore, 1-3 dimensional numerical simulations can be conducted for any advection-diffusion type equations. Special attentions have been paid on Hilbert's sixth problem, i.e. to build the numerical passage between kinetic theory of gases, e.g. the Boltzmann equation

The main module consists of ``KitBase.jl`` with basic physics and ``KitML.jl`` with neural dynamics. The high-performance Fortran library ``KitFort.jl`` is not included by default, but can be manually imported when the executing efficiency becomes the priority. A Python wrapper ``kineticpy`` has been built as well to locate the structs and methods through ``pyjulia``. The ecosystem is designed to balance the efficiency for scientific research and the simplicity for educational usage.
<img src="bz.png" width = "600" align=center />

and the Navier-Stokes equations.

<img src="ns.png" width = "150" align=center />

``Kinetic.jl`` is an open-source project hosted on GitHub and distributed under MIT license. The main module consists of ``KitBase.jl`` with basic physics and ``KitML.jl`` with neural dynamics. The high-performance Fortran library ``KitFort.jl`` is not included by default, but can be manually imported when the executing efficiency becomes the priority. A Python wrapper ``kineticpy`` has been built as well to locate the structures and methods through ``pyjulia``. It is easy to perform a subtask with the corresponding portable module.

`Kinetic.jl` leverages the Julia programming language [@bezanson2017] for its implementation. The motivation behind it is to balance the flexibility for scientific research, the efficiency for application, and the simplicity for educational usage. Most of the mature FVM libraries, e.g. the OpenFOAM [@jasak2007], are written in compiled languages (C/C++, Fortran), which enjoy the perfect execution efficiency and sacrifice the speed and flexibility for a second development. For example, it is cumbersome to introduce phase-field evolution in OpenFOAM or integrate it with scientific machine learning (SciML) packages. Regarding this situation, the compromise has been made [@clawpack2020], which split the high-level front-ends and the low-level computational back-ends. Usually the front-end is implemented with interpreted languages, e.g. Python, which is able to call the low-level APIs written by compiled languages. Basically it benefits general users, while researchers need to work on the back-end anyhow if a new feature is in desire. Besides, the two-language problem will introduce additional trade-off in development and execution.

An illustrative example of the shock tube problem
Julia programming language is dynamically typed and designed for high performance computing for broad devices. Based on type inference and multiple dispatch, it is an ideal choice to solve the two-language problem. In `Kinetic.jl`, we provide different hierarchies of abstraction. At the highest level, it is feasible to model and simulate a typical gas dynamic problem within 10 lines of code. At the lowest level, we design the methods for general `Number` and `AbstractArray` , so that it holds the perfect possibility to cooperate with existing packages in Julia ecosystem. As an example, `KitML.jl` depends `Flux.jl` [@Flux2018] to conduct scientific machine learning problems.

configuration file `config.txt`
In the following, we present an illustrative example of the shock tube problem in gas dynamics. With the configuration file `config.txt` set as below,


```
Expand Down Expand Up @@ -68,107 +72,34 @@ alphaRef = 1.0
omegaRef = 0.5
```

and execute the following codes
we execute the following codes

```julia
using Kinetic
ks, ctr, face, t = initialize("config.txt")
t = solve!(ks, ctr, face, t)
plot_line(ks, ctr)
set, ctr, face, t = initialize("config.txt")
t = solve!(set, ctr, face, t)
plot_line(set, ctr)
```

`solve!` is equivalent as the low-level solution algorithm
The computational setup is stored in `set` and the control volume solutions are stored in `ctr` and `face`. The high-level solver `solve!` is equivalent as the following solution algorithm.

```julia
dt = timestep(ks, ctr, t)
nt = Int(floor(ks.set.maxTime / dt))
res = zeros(3)
for iter = 1:nt
Kinetic.reconstruct!(ks, ctr)
Kinetic.evolve!(ks, ctr, face, dt)
Kinetic.update!(ks, ctr, face, dt, res)
reconstruct!(ks, ctr)
evolve!(ks, ctr, face, dt)
update!(ks, ctr, face, dt, res)
end
```

The result is visualized with built-in function `plot_line`, which presents the profiles of gas density, velocity and temperature inside the tube.


<img src="sod.png" width = "600" align=center />


``Kinetic.jl`` is interested in theoretical and numerical studies of many-particle systems of gases, photons, plasmas, neutrons, etc. It employs the finite volume method (FVM) to conduct 1-3 dimensional numerical simulations on CPUs and GPUs. Any advection-diffusion-type equation can be solved within the framework. Special attentions have been paid on Hilbert's sixth problem, i.e. to build the numerical passage between kinetic theory of gases, e.g. the Boltzmann equation



e.g. compressible gas dynamics.



Hilbert's sixth problem


cubersome
phase field



``Oceananigans.jl`` is designed for high-resolution simulations in idealized
geometries and supports direct numerical simulation, large eddy simulation,
arbitrary numbers of active and passive tracers, and linear and nonlinear
equations of state for seawater. Under the hood, ``Oceananigans.jl`` employs a
finite volume algorithm similar to that used by the Massachusetts Institute of
Technology general circulation model [@Marshall1997].

![Fig. 1](free_convection_and_baroclinic_instability.png)
Fig. 1: (Left) Large eddy simulation of small-scale oceanic boundary layer
turbulence forced by a surface cooling in a horizontally periodic domain using
$256^3$ grid points. The upper layer is well-mixed by turbulent convection and
bounded below by a strong buoyancy interface. (Right) Simulation of
instability of a horizontal density gradient in a rotating channel using
$256\times512\times128$ grid points. A similar process called baroclinic
instability acting on basin-scale temperature gradients fills the oceans with
eddies that stir carbon and heat. Plots made with `matplotlib` [@Hunter2007]
and `cmocean` [@Thyng2016].

``Oceananigans.jl`` leverages the Julia programming language [@Bezanson2017] to
implement high-level, low-cost abstractions, a friendly user interface, and a
high-performance model in one language and a common code base for execution on
the CPU or GPU with Julia’s native GPU compiler [@Besard2019]. Because Julia is
a high-level language, development is streamlined and users can flexibly specify
model configurations, set up arbitrary diagnostics and output, extend the code
base, and implement new features. Configuring a model with `architecture=CPU()`
or `architecture=GPU()` will execute the model on the CPU or GPU. By pinning a
simulation script against a specific version of Oceananigans, simulation results
are reproducible up to hardware differences.

Performance benchmarks show significant speedups when running on a GPU. Large
simulations on an Nvidia Tesla V100 GPU require ~1 nanosecond per grid point per
iteration. GPU simulations are therefore roughly 3x more cost-effective
than CPU simulations on cloud computing platforms such as Google Cloud. A GPU
with 32 GB of memory can time-step models with ~150 million grid points assuming
five fields are being evolved; for example, three velocity components and
tracers for temperature and salinity. These performance gains permit the
long-time integration of realistic simulations, such as large eddy simulation of
oceanic boundary layer turbulence over a seasonal cycle or the generation of
training data for turbulence parameterizations in Earth system models.

``Oceananigans.jl`` is continuously tested on CPUs and GPUs with unit tests,
integration tests, analytic solutions to the incompressible Navier-Stokes
equations, convergence tests, and verification experiments against published
scientific results. Future development plans include support for distributed
parallelism with CUDA-aware MPI as well as topography.

Ocean models that are similar to ``Oceananigans.jl`` include MITgcm
[@Marshall1997] and MOM6 [@Adcroft2019], both written in Fortran. However,
``Oceananigans.jl`` features a more efficient non-hydrostatic pressure solver
than MITgcm (and MOM6 is strictly hydrostatic). PALM [@Maronga2020] is Fortran
software for large eddy simulation of atmospheric and oceanic boundary layers
with complex boundaries on parallel CPU and GPU architectures. ``Oceananigans.jl``
is distinguished by its use of Julia which allows for a script-based interface as
opposed to a configuration-file-based interface used by MITgcm, MOM6, and PALM.
Dedalus [@Burns2020] is Python software with an intuitive script-based interface
that solves general partial differential equations, including the incompressible
Navier-Stokes equations, with spectral methods.

``Kinetic.jl`` is an open-source project hosted on GitHub and distributed under MIT license.
The examples of scientific machine learning are introduced systematically in the paper [@xiao2020] .

# Acknowledgements

Expand Down

2 comments on commit ad63edd

@vavrines
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/27441

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.0 -m "<description of version>" ad63eddd8986980807d21db8f8ec45dbef490df4
git push origin v0.7.0

Please sign in to comment.