Code Monkey home page Code Monkey logo

collapso1d's People

Contributors

pikarpov avatar pikarpov-lanl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

collapso1d's Issues

Replace Binary with HDF5 output

Problem

Currently, COLLAPSO1D output the checkpoints in unformatted binary, which then need to be converted to human-readable text files with readout.f90.

  1. This works only if both the code output and readout have the exact same structure as how the checkpoint files are structured. If a user adds or removes observables, they also need to edit the readout.f90. As a result, there is a lot of potential for older binary checkpoints to become unusable and impossible to read and process. No internal organization or metadata.
  2. Impossible to manipulate the binary, e.g., cannot be appended to - every restart is a separate file
  3. The binary and readable redundancy is completely unnecessary, clogging up disk space.
  4. Cannot run in parallel, which can be useful during debugging with frequent dumps.
  5. ifort is having a lot of trouble processing unformatted binary files.

Solution

Convert readini and printout subroutines to write and load checkpoints with HDF5. It addresses all of the issues pointed out above, and the format is widely accepted in the CFD community. In addition, COLLAPSO1D already requires HDF5 installation to read the EOS Tables, e.g., SFHo, so there won't be new package dependencies.

Adaptive Grid

Problem

The 1D grid in COLLAPSO1D is non-uniform:

Region Resolution Behavior
PNS Medium linearly decreasing deltam
Convection High constant
Outer Low exponentially growing

It is often useful to resolve such features as shocks in high resolution. Considering the dynamic nature of CCSN with a lot of material falling in, this would require a very large mass region at a high resolution if the static grid is used. This means that the total grid has to be very large, significantly increasing computing time.

Solution

Construct an adaptive grid to follow the needed feature, i.e., shock front. As a result, you would only need a few hundred cells (instead of thousands) to track and adapt. I have done a significant amount of work in this regard, which can be found in subroutine resize_grid(). It already calculates the new linear decay and exponential growth rates for the inner and outer regions via bisection to keep the number of grid cells in those regions the same. The subroutine also includes the full interface to shift the convective high-resolution region, done with piecewise_linear interpolation for testing.

The current simplistic high-res interpolators fail to adjust the shock position correctly, causing oscillatory behavior near that region. This is to be expected and has been well documented in the CFD literature. I believe that the best way to address this is to implement an interpolation method based on the WENO5 for a non-uniform grid. In COLLAPSO1D, I coded up the most common implementation of WENO5 where all coefficients for adjusting the grid by 1/2 of a cell, but it won't work for us since an adjustment, in our case, can be by an arbitrary fraction of a cell. I believe that the implementation of the method from the following paper would work instead; there are detailed derivations for all coefficients - the grid adjustment can be arbitrary and non-uniform.

The WENO Method for Non-Equidistant Meshes" by Philip Rupp 2012

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.