Skip to content

Sink density tasks

Jonathan Davies requested to merge sink_density_iact into master

This is a draft PR for adding density interaction tasks to the sinks. At the time of writing, the tasks have been implemented and tested with the two sink examples, PlummerSphere and HomogeneousBox. See below for the new dependency graph for a timestep in the HomogeneousBox example.

cc @matthieu @Roduit

New functions for sink models

All sink models now have a runner_iact_nonsym_sink_gas_density function in sink_iact.h for running in the new density tasks. For the Default and GEAR models, these are empty.

The sink density ghost is based on that of the BH particles. It implements two functions that need to be adopted in sink implementations - sink_end_density and sink_prepare_swallow.The first mirrors the BHs, and is where we finish the density calculation once the contributions from all neighbours have been added up. The second is adapted from black_holes_prepare_feedback, and is there for any calculations that you'd want to do before doing the swallowing step. The BHs work out what their mass deficit is, and hence how much gas they should swallow, in a step like this - they calculate the accretion rate here and set the deficit to accr_rate * dt. For the sinks to do Bondi-Hoyle accretion, we'd want to do the same here.

Both of these functions aren't necessary for the GEAR and Default models, so I've added empty versions of these functions to them.

Extra info

Right now this branch also includes a new sink model called GearBondiHoyle, which I'm going to use to test the new density tasks. As the name suggests, it will be equivalent to the GEAR model but I will replace the swallowing code with a basic Bondi-Hoyle scheme. This model will be removed before we merge these changes - it's just for testing.

This branch also includes commits from !2007 (merged), which overhauled the sink interaction code.

dependency_graph_858

Edited by Jonathan Davies

Merge request reports