|
Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
|
Functions to calculate cooling rate for a given rho, P, dt. More...
#include <math.h>#include "../cooling/cool_components.h"#include "../cooling/cooling_cuda.h"#include "../cooling/load_cloudy_texture.h"#include "../global/global.h"#include "../global/global_cuda.h"#include "../utils/error_handling.h"#include "../utils/gpu.hpp"
Classes | |
| class | CoolingUpdateExecutor< CoolingRecipe > |
| Instances of this class template are callables that serve as callback functions for applying cooling to the grid. More... | |
| struct | CoolRecipeCIE |
| Analytic fit to a solar metallicity CIE cooling curve calculated using Cloudy. More... | |
| class | CoolRecipeCloudy |
| Uses texture mapping to interpolate Cloudy cooling/heating tables at z = 0 with solar metallicity and an HM05 UV background. More... | |
| class | CoolRecipeCloudyAndPhotoHeating |
| class | CoolRecipeTIAndCIE |
| Analytic cooling/heating recipe that roughly matches the "TI" cooling runs shown in Kim & Ostriker 2015 More... | |
| class | CoolRecipeTIAndCIEAndPhotoHeating |
| Analytic cooling/heating recipe that roughly matches the "TI" cooling runs shown in in Kim & Ostriker 2015 And that includes constributions from photoelectric Heating. More... | |
Functions | |
| template<typename CoolingRecipe > | |
| __global__ void | cooling_kernel (Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int n_fields, Real dt, Real gamma, CoolingRecipe recipe) |
| std::function< void(Grid3D &)> | configure_cooling_callback (std::string kind, ParameterMap &pmap) |
Functions to calculate cooling rate for a given rho, P, dt.
Nearly all of the functionality implemented in this file follow a common strategy. At this time of writing, there is essentially 1 functions that deviates from the strategy (primordial_cool), which are is left over from earlier implementations.
In detail, the configure_cooling_callback function produces a std::function, which serves as a callback that performs cooling
std::function instance acts a more generalized function-pointer that is able to wrap ordinary functions OR a struct that can act like a function (sometimes known as a "functor" or "callable")grid object. The actual implementation of the callback is opaque to the rest of cholla.At this time of writing, we implement cooling functionality with some basic template-machinery
Our idea revolves around the concept of a CoolingRecipe.
CoolingRecipe as any type that implements a __device__ member-function with the Real cool_rate(Real n, Real T) function signature (i.e. it computes the cooling rate per unit volume at a given number density and temperature)To perform cooling with a given recipe, we an instance of the cooling_recipe to the global function, cooling_kernel. The concrete type of the CoolingRecipe is a template parameter, cooling_kernel, so that invocations of kernels are effectively specialized for each type of recipe.
The CoolingUpdateExecutor class template simply serves as a nice way to package the particular kind of CoolingRecipe (and and cooling-recipe-specific parameters) with the logic for launching cooling_kernel.
| std::function< void(Grid3D &)> configure_cooling_callback | ( | std::string | kind, |
| ParameterMap & | pmap | ||
| ) |
construct a callback that performs heating/cooling (to approximate the impact of chemistry).
The returned callback can be used as the chemistry_callback