PLUTO  4.4-patch2
Functions
particles_lp_tools.c File Reference

Collection of tools for the LAGRANGIAN particle module at particle positions. More...

#include "pluto.h"

Functions

void Particles_LP_ExchangeFlag (char ***, int, Grid *)
 
void Particles_LP_FixValue (Particle *pl, particleProbe *probe, Data *d, Grid *grid)
 
void Particles_LP_IntegrateSpectra (Particle *pl, double density, double *totE)
 
void Particles_LP_FlagShock (Data *d, char ***flag2, Grid *grid)
 

Detailed Description

Authors
B. Vaidya (bvaid.nosp@m.ya@u.nosp@m.nito..nosp@m.it)
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it) D. Mukherjee
Date
July 4, 2019

Function Documentation

◆ Particles_LP_ExchangeFlag()

void Particles_LP_ExchangeFlag ( char ***  flag,
int  nbuf,
Grid grid 
)

Exchange nbuf zones in the ghost zones during the shock detection process. Since the number of buffer zones can exceed the number of ghost zones, one needs to do this exchange. If An and Dn are values in the ghost zones, the process can be sketched as follows:

Rank #0 A0|B0------C0|D0
(+)^ |
| v(+)
Rank #1 A1|B1------C1|D1
(+)^ |
| v(+)
Rank #2 A2|B2------C2|D2

where the (+) sign means the received buffer is added to pre-existing values.

Seen from rank # 1, we have

  • A1 = snd_bufL
  • D1 = snd_bufR
  • D0 = rcv_bufL
  • A2 = rcv_bufR

Here 'L' or 'R' refer to the processor to the left (rank #0) and to the right (rank #2), respectively. In 2D or 3D we loop over dimensions.

◆ Particles_LP_FixValue()

void Particles_LP_FixValue ( Particle *  pl,
particleProbe *  probe,
Data d,
Grid grid 
)

This function finds the cell of the particles and fix all the phisical variables, interpolating them on the particle coordinates. Call this routine only after pl->coor have been correctly initialized or calculated.

Parameters
[in]plPointer to the Particle.
[in]dPointer to the Data structure.
[in]gridPointer to the PLUTO grid structure.

◆ Particles_LP_FlagShock()

void Particles_LP_FlagShock ( Data d,
char ***  flag2,
Grid grid 
)

Flag cells that are shocked. The condition used is same as that used for the fluid. i.e., divV < 0.0, |GradP|/P > Threshold.

Parameters
[in]dPointer to the data structure
[in]gridPointer to the grid structure
[out]flag23D Array of the flagged zones.

◆ Particles_LP_IntegrateSpectra()

void Particles_LP_IntegrateSpectra ( Particle *  pl,
double  density,
double *  totE 
)

Integrate particle spectrum to give total energy.

Parameters
[in]dPointer to the Particle structure
[in]densityThe fluid density interpolated on the particle. This must be provided even in pl->density is present, because IntegrateSpectra is called before LP_FIX at one time.
[out]totEIntegration of N(e)*e*de.