Git Product home page Git Product logo

conservationlaws's Introduction

Conservation Laws

License

This is a set of tools for numerically solving different kinds of conservation or balance laws with OpenCL. Currently implemented are:

  • linear transport with constant and variable coefficients,
  • the nonlinear magnetic induction equation,
  • ideal MHD.

The code is generalised in a form that allows to easily implement and switch between different systems of conservation or balance laws. All numerical aspects are encapsulated in OpenCL kernels. The OpenCL host side is abstracted with the help of MatCL, an OpenCL interface for MathWorks Matlab. This provides the user with an intuitive and easy way of handling and processing input and output data without any intricate knowledge of OpenCL and allows for interactive development. Usage of the OpenCL kernels is not limited to Matlab.

Exemplary testcases can be found in the examples folder. Additional comments are provided in the source files.

This is work in progress. If you have any questions or want to contribute feel free to contact us.

Prerequisites & Setup

To run the examples the following must be installed:

  • OpenCL Driver (CPU or GPU)
  • OpenCL C++ Headers (e.g. provided by the OpenCL vendors SDKs)
  • Mathworks Matlab
  • MatCL

For ease of use you can add MatCL to the search path of Matlab.

License

This project is licensed under the terms of the Creative Commons CC BY-NC-ND 4.0 license.

Disclaimer

Product and company names may be trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them or their affiliates. Everything is provided as is and without warranty. Use at your own risk!

conservationlaws's People

Contributors

kostaszki avatar philipheinisch avatar ranocha avatar simonius avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

conservationlaws's Issues

Should we include MatCL?

Currently, the compiled binaries cl_get_devices.mexa64 and cl_run_kernel.mexa64 are included in matlab/. There may be several options:

  • We leave it as it is.
  • We use MatCL and tell the user to add this dependency to Matlab's load path (as currently described in the README).
  • We ship binaries for Linux and other systems such as Windows. However, adding binaries to git is not really optimal.

Any thoughts, @Kostaszki, @philipheinisch?

Euler Equations for Ideal Gases

Additional numerical fluxes:

  • Ducros et al.
    @article{ducros2000high,
      title={High-Order Fluxes for Conservative Skew-Symmetric-Like Schemes in
            Structured Meshes: {A}pplication to Compressible Flows},
      author={Ducros, F and Laporte, F and Souleres, T and Guinot, V and Moinat, P
              and Caruelle, B},
      journal={Journal of Computational Physics},
      volume={161},
      number={1},
      pages={114--139},
      year={2000},
      publisher={Elsevier},
      doi={10.1006/jcph.2000.6492}
    }
    
  • Morinishi
    @article{morinishi2010skew,
      title={Skew-symmetric form of convective terms and fully conservative finite
            difference schemes for variable density low-{M}ach number flows},
      author={Morinishi, Yohei},
      journal={Journal of Computational Physics},
      volume={229},
      number={2},
      pages={276--300},
      year={2010},
      publisher={Elsevier},
      doi={10.1016/j.jcp.2009.09.021}
    }
    
  • Kennedy and Gruber
    @article{kennedy2008reduced,
      title={Reduced aliasing formulations of the convective terms within the
            {N}avier--{S}tokes equations for a compressible fluid},
      author={Kennedy, Christopher A and Gruber, Andrea},
      journal={Journal of Computational Physics},
      volume={227},
      number={3},
      pages={1676--1700},
      year={2008},
      publisher={Elsevier},
      doi={10.1016/j.jcp.2007.09.020}
    }
    
  • Pirozzoli
    @article{pirozzoli2011numerical,
      title={Numerical Methods for High-Speed Flows},
      author={Pirozzoli, Sergio},
      journal={Annual Review of Fluid Mechanics},
      volume={43},
      pages={163--194},
      year={2011},
      publisher={Annual Reviews},
      doi={10.1146/annurev-fluid-122109-160718}
    }
    
  • Kuya, Totani, and Kawai
    @article{kuya2018kinetic,
      title={Kinetic energy and entropy preserving schemes for compressible flows
            by split convective forms},
      author={Kuya, Yuichi and Totani, Kosuke and Kawai, Soshi},
      journal={Journal of Computational Physics},
      volume={375},
      pages={823--853},
      year={2018},
      publisher={Elsevier},
      doi={10.1016/j.jcp.2018.08.058}
    }
    
  • Ismail and Roe
    @article{ismail2009affordable,
      title={Affordable, entropy-consistent {E}uler flux functions {II}:
            {E}ntropy production at shocks},
      author={Ismail, Farzad and Roe, Philip L},
      journal={Journal of Computational Physics},
      volume={228},
      number={15},
      pages={5410--5436},
      year={2009},
      publisher={Elsevier},
      doi={10.1016/j.jcp.2009.04.021}
    }
    
  • Chandrashekar
    @article{chandrashekar2013kinetic,
      title={Kinetic Energy Preserving and Entropy Stable Finite Volume Schemes for
            Compressible {E}uler and {N}avier-{S}tokes Equations},
      author={Chandrashekar, Praveen},
      journal={Communications in Computational Physics},
      volume={14},
      number={5},
      pages={1252--1286},
      year={2013},
      doi={10.4208/cicp.170712.010313a}
    }
    
  • Ranocha

Additional numerical fluxes for surface terms:

  • HLL: One choice of the speeds is implemented.
  • Suliciu

See e.g.

Additional test cases:

  • Some form of an isentropic vortex

Since the Euler equations are one of the basic examples of hyperbolic conservation laws, we should probably add the to this repository.

Separate files for testcases

We should probably use separate files for testcase definitions so that we can easily switch between testcases for specific system of conservation laws.

Periodic Boundary Conditions per Direction

Up to now, we only have the possibility to use periodic boundaries everywhere or nowhere. For many tests cases such as 2D Alfvén waves, having the possibility to use periodic boundaries in z direction and other boundaries for x and y can be really helpful.

False Language Detection

Why is this project now classified as C and not C++/OpenCL? Do we want to force classification as OpenCL?

Additional Possibilities for `I_RunOps('save_integrals_over_time')`

Sometimes, secondary integral quantities such as the total kinetic energy or entropy can be of interest, e.g. in https://arxiv.org/abs/1604.06618. It would be nice to add a possibility to compute them, depending on the model and test case at hand.

As far as I know, the integral quantities of interest depend mostly on the physical model, e.g. ideal_gas_Euler or induction_equation. Should we split I_RunOps('save_integrals_over_time') into I_RunOps('save_integrals_over_time') (energy, entropy, ...) and I_RunOps('save_errors_over_time') (as it is now)? Then, I_RunOps('save_integrals_over_time') can depend on the physical model.

What do you think, @philipheinisch, @Kostaszki?

Error calculation

For the testcases with an analytical solution the possibility to calculate the error after every N timesteps should be added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.