Coder Social home page Coder Social logo

kaschau / peregrine Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 1.0 7.65 MB

3D Multiblock multiphysics finite volume reacting flow solver. Implemented in Python, Kokkos, and MPI for inter- and intra-node performant parallelism.

Home Page: https://kaschau.github.io/PEREGRINE/

License: BSD 3-Clause "New" or "Revised" License

CMake 0.32% Python 32.81% C++ 59.41% Fortran 7.46%
python cfd gpu-computing kokkos parallel-computing paraview scientific-computing hdf5

peregrine's People

Contributors

kaschau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

peregrine's Issues

Add protections to extrapolated bc values

Should we be protecting against non-physical boundary conditions extrapolations?

i.e.

negative pressure, rho, T, Y, etc.

Maybe even summing species mass fractions to one?

Undesirable behavior in consistify

If we have a single block with no communication, just 6 walls, and we enter consistify routine with only good values in the interior, the first thing that happens is communication of Q, but since we just walls, nothing happens.

The next thing we do is update the EOS for the ENTIRE block, including the potentially bogus halos for the walls, which havent been touched.

This is likely only a problem at startup or user initialization in which they may not have populated the halos with anything.

Build RHS and consistify.... consistently

We need to set the consistify and RHS operators in a generic manner so that neither of those two routines call specific function, but instead call generic function names that are defined in the
generate_multiblock_solver

def generate_multiblock_solver(nblks, config, myblocks=None):

routine. We already do this with eos, chem, but need to do it with ALL operators and routines for extend-ability. i.e. transport, dqdxyz, even diffusive and advective fluxes. Even though we only have one option for now.

If we class out consistify and RHS as can also clean up the generate_multiblock_solver routine and move the setting of all the routines to those class init()s.

can we catch random settings in bcType

We do not catch random settings for bcType, i.e. accidentally setting

bcType = "bq" instead of = "b1"

There should be a check somewhere to determine if bcType is not a known type.

implement simpler splitting method

See

Efficient time-stepping techniques for simulating turbulent reactive flows with stiff chemistry,
Computer Physics Communications, Volume 243, 2019, Pages 81-96,
https://doi.org/10.1016/j.cpc.2019.04.016.

implement ROW (or regular Rosenbrock) semi-implicit integration.

Implement a Rosenbrock type method for chemistry integration.

Advantages: Single step, non iterative. "Looks like" RK schemes.

Disadvantages (/ really advantages) : Requires jacobian.

See

https://encyclopediaofmath.org/wiki/Rosenbrock_methods
http://www.hysafe.org/science/eAcademy/docs/ACMTransactionsOnMathematicalSoftware_v8_p93to113.pdf
https://www.sciencedirect.com/science/article/pii/S0377042715001569
https://www.epfl.ch/labs/anchp/wp-content/uploads/2018/05/part2-1.pdf

Then further implemented with the simpler operator splitting detailed in #32

Could be a massive speedup, and would be done in Kokkos spaces rather than on the python side.

Cantera 2.6+ is changing a lot

Starting with 2.6+:

DeprecationWarning: GasKinetics::getFwdRateConstants: Behavior to change after Cantera 2.6;
results will no longer include third-body concentrations for three-body reactions.

wrangling mpi4py

It seems like the

from mpi4py import MPI

in mpiUtils is initializing MPI on peregrinepy module import (say in ipython)

This is not desirable as it makes a functional MPI a prereq just to use peregrinepy, even in preprocessing.

On HPC cluster head nodes, the MPI may not be ready to go, only on compute nodes or with an appropriate mpiexec like command.

So we need to NOT initialize upon import of MPI on the module level.

This means we need to initialize elsewhere, a good place seems to be in runPeregrine.py (just my importing MPI before importing peregrinepy.

This will in turn mess up all pytests.

There seems to be a really good pytest tool https://github.com/NOhs/pytest-easyMPI

that makes running pytest in parallel next to serial very easy. It slows it way down, but makes peregrinepy much more portable and light in terms of dependency on import.

npOrKokkos method doesnt make sense for GPUs

the npOrKokkos method doesn't make sense on a GPU as we are wrapping the blk.array around a GPU kokkos view not a host view. so any attempt to access this blk.array will results in a segfault.

compiling using CUDA

Currently there are several issues when compiling using cuda.

1.) There are variable sized arrays that gfortran is allowing, but CUDA does not. see eos and transport computes for things like

Y[ns]

2.) Seems like the does not like accessing the thtrdat struct data, in particular std::vectors, in device code. So we need to make the thtrdat_ attributes KokkosViews.

Plan for more intuitive array extents for the topo->grid->restart->solver structure

I say that only solver blocks should have access to halos of any sort.

So we will specify a ng for a solver mb creation, but anything upstream just gets the regular old grid. This will make scripting restarts much cleaner.

Particularly bc we have bcFams for boundary conditions and there is no need to noOp a boundary condition. We can just specify it trivially. So never need to set halos in a restart and just let it be.

We can also clean up all init(XXXX)Arrays routines as well by setting a temporary ng variable.

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.