PLUTO  4.4-patch2
Functions
particles_cr_feedback.c File Reference

File containing functions for feedback from CR to the fluid. More...

#include "pluto.h"

Functions

void Particles_CR_ConservativeFeedback (Data_Arr U, Data_Arr Fcr, double dt, RBox *box)
 
void Particles_CR_Flux (const State *state, int beg, int end)
 
void Particles_CR_States1DCopy (const Data *d, const Sweep *sweep, int beg, int end)
 
void Particles_CR_StatesSource (const Sweep *sweep, double dt, int beg, int end, Grid *grid)
 

Detailed Description

Authors
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
References
  • "MAGNETOHYDRODYNAMIC-PARTICLE-IN-CELL METHOD FOR COUPLING COSMIC RAYS WITH A THERMAL PLASMA: APPLICATION TO NON-RELATIVISTIC SHOCKS"
    Bai et al., ApJ (2015) 809, 55
Date
June 15, 2017

Function Documentation

◆ Particles_CR_ConservativeFeedback()

void Particles_CR_ConservativeFeedback ( Data_Arr  U,
Data_Arr  Fcr,
double  dt,
RBox box 
)

Add source term to the right hand side of the conservative MHD equations.

Parameters
[out]UAn array of conserved quantities, U[k][j][i][nv]
[in]FcrAn array containing the CR feedback, Fcr[4][k][j][i]
[in]dtThe time step increment
[in]boxA pointer to a RBox structure.

◆ Particles_CR_Flux()

void Particles_CR_Flux ( const State state,
int  beg,
int  end 
)

Add CR flux contribution to MHD fluxes. On input, it requires state->Fcr to be already computed. On output, it returns state->fluxCR.

◆ Particles_CR_States1DCopy()

void Particles_CR_States1DCopy ( const Data d,
const Sweep sweep,
int  beg,
int  end 
)

Load Fcr from 3D data into 1D state structures. This is needed later to compute the flux (Particles_CR_Flux).

◆ Particles_CR_StatesSource()

void Particles_CR_StatesSource ( const Sweep sweep,
double  dt,
int  beg,
int  end,
Grid grid 
)

Add CR flux-difference and source term contributions to L/R primitive states during the predictor step of CTU algorithm. Note that, although the update should be done in conservative variables, we choose to directly update primitive variables by performing, in place, a conservative-to-primitive recovery so that:

\[ \left\{\begin{array}{lcl} \vec{m}_\pm &\leftarrow& \DS \vec{m}_\pm - \frac{\Delta t}{2}\vec{F}_{CR} \\ \noalign{\medskip} \vec{B}_\pm &\leftarrow& \DS \vec{B}_\pm + \frac{\Delta t}{2}\nabla_x\times \left(\frac{\vec{F}_{CR}}{q_g}\right) \\ \noalign{\medskip} {\cal E}_\pm &\leftarrow& \DS {\cal E}_\pm - \frac{\Delta t}{2}\nabla_x\cdot \left(\frac{\vec{F}_{CR}\times\vec{B}}{q_g} + \vec{F}_{CR}\cdot\vec{v}\right) \end{array}\right. \quad\Longrightarrow\quad \left\{\begin{array}{lcl} \vec{v}_1 &=& \vec{v}_0 + \Delta\vec{v} \\ \noalign{\medskip} \vec{B}_1 &=& \vec{B}_0 + \Delta\vec{B} \\ \noalign{\medskip} (\rho e)_1 &=& \DS (\rho e)_0 + \frac{\rho}{2}(\vec{v}_0^2 - \vec{v}_1^2) + \frac{1}{2}\left(\vec{B}_0^2-\vec{B}_1^2\right) + \Delta {\cal E}; \end{array}\right. \]

Note that curl and divergence operators are discretized using finite differences of fluxCR computed in Particles_CR_Flux().

This step is done only for the primitive Hancock / Char. Trac. schemes since these are carried out in primitive variables. This step is not needed for the conservative Hancock scheme since these terms are included during the predictor.

For source terms not involving derivatives, we include ALL of the components here since no other partcles-related source term will be added during the transverse predictors. For source terms involving derivatives, we include only the normal components since the transverse predictor will add the other components through Riemann solver.