Skip to content

Commit

Permalink
Merge branch 'development' into chong/dual-container
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking authored Sep 27, 2024
2 parents 0f386b9 + f42de31 commit 097d4c1
Show file tree
Hide file tree
Showing 5 changed files with 291 additions and 222 deletions.
29 changes: 29 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# Email addresses or GitHub usernames can be used

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# these global owners will be requested for
# review when someone opens a pull request.
* @BenWibking @markkrumholz

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies any files listed below, only the user listed below
# and not the global owner(s) will be requested for a review.

# hydro
src/hydro/ @BenWibking @markkrumholz

# optically-thin radiative cooling (assuming ionization equilibrium)
src/cooling/ @BenWibking @markkrumholz

# particles -- CICParticles only
src/particles/CICParticles.hpp @BenWibking @markkrumholz

# chemistry (including chemical heating/cooling)
src/chemistry/ @psharda @BenWibking @markkrumholz

# radiation
src/radiation/ @chongchonghe @BenWibking @markkrumholz
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ Quokka also features advanced Adaptive Quokka Refinement:tm: technology:
## Dependencies
* C++ compiler (with C++17 support)
* CMake 3.16+
* Python 3.8+
* MPI library with GPU-aware support (OpenMPI, MPICH, or Cray MPI)
* HDF5 1.10+ (serial version)
* CUDA 11.7+ (optional, for NVIDIA GPUs)
* ROCm 5.2.0+ (optional, for AMD GPUs)
* Ninja (optional, for faster builds)
* Python 3.7+ (optional)
* ADIOS2 2.9+ with GPU-aware support (optional, for writing terabyte-sized or larger outputs)

## Problems?
Expand Down
14 changes: 11 additions & 3 deletions src/radiation/radiation_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@

#include <array>
#include <cmath>
#include <functional>

// library headers
#include "AMReX.H" // IWYU pragma: keep
#include "AMReX_Array.H"
#include "AMReX_BLassert.H"
#include "AMReX_GpuQualifiers.H"
#include "AMReX_IParser_Y.H"
#include "AMReX_IntVect.H"
#include "AMReX_REAL.H"

// internal headers
Expand Down Expand Up @@ -121,6 +118,14 @@ template <typename problem_t> struct JacobianResult {
quokka::valarray<double, Physics_Traits<problem_t>::nGroups> Fg; // (g) components of the residual, g = 1, 2, ..., nGroups
};

// A struct to hold the results of UpdateFlux(), containing the following elements:
// Erad, gasMomentum, Frad
template <typename problem_t> struct FluxUpdateResult {
quokka::valarray<double, Physics_Traits<problem_t>::nGroups> Erad; // radiation energy density
amrex::GpuArray<double, 3> gasMomentum; // gas momentum
amrex::GpuArray<amrex::GpuArray<amrex::Real, Physics_Traits<problem_t>::nGroups>, 3> Frad; // radiation flux
};

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static auto minmod_func(double a, double b) -> double
{
return 0.5 * (sgn(a) + sgn(b)) * std::min(std::abs(a), std::abs(b));
Expand Down Expand Up @@ -234,6 +239,9 @@ template <typename problem_t> class RadSystem : public HyperbolicSystem<problem_
amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const &prob_lo, amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const &prob_hi,
amrex::Real time);

AMREX_GPU_DEVICE static auto UpdateFlux(int i, int j, int k, arrayconst_t const &consPrev, NewtonIterationResult<problem_t> &energy, double dt,
double gas_update_factor, double Ekin0) -> FluxUpdateResult<problem_t>;

static void AddSourceTermsMultiGroup(array_t &consVar, arrayconst_t &radEnergySource, amrex::Box const &indexRange, amrex::Real dt, int stage,
double dustGasCoeff, int *p_iteration_counter, int *p_iteration_failure_counter);

Expand Down
Loading

0 comments on commit 097d4c1

Please sign in to comment.