forked from dutta-alankar/cloud-crushing_PLUTO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
split_source.c
71 lines (60 loc) · 2.14 KB
/
split_source.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* ///////////////////////////////////////////////////////////////////// */
/*!
\file
\brief Include source terms using operator splitting.
The SplitSource() function handles source terms in a separate
step using operator splitting.
It is called from Integrate() between standard hydro advances.
At present these source terms are one or more of the following:
- optically thin radiative losses (cooling)
- Diffusion operators:
- resistivity
- Thermal conduction
- Viscosity
- additional user-defined terms may also be included here.
\authors A. Mignone (mignone@ph.unito.it)
\date Oct 26, 2016
*/
/* ///////////////////////////////////////////////////////////////////// */
#include "pluto.h"
#include "local_pluto.h"
/* ********************************************************************* */
void SplitSource (const Data *d, double dt, timeStep *Dts, Grid *grid)
/*!
* Take one step on operator-split source terms.
*
* \param [in,out] d pointer to PLUTO Data structure containing
* the solution array updated from the most
* recent call
* \param[in] dt the time step used to integrate the source
* terms
* \param[in] Dts pointer to the time step structure
* \param[in] grid pointer to an array of grid structures
*
*********************************************************************** */
{
/* ---------------------------------------------
Cooling/Heating losses
--------------------------------------------- */
#if COOLING != NO
#if COOLING == POWER_LAW /* -- solve exactly -- */
PowerLawCooling (d->Vc, dt, Dts, grid);
#elif COOLING == KROME /* -- Interfaced krome solvers -- */
KromeCooling (d, dt, Dts, grid);
#else
CoolingSource (d, dt, Dts, grid);
#endif
#endif
/* ----------------------------------------------
Parabolic terms using STS:
- resistivity
- thermal conduction
- viscosity
---------------------------------------------- */
#if (PARABOLIC_FLUX & SUPER_TIME_STEPPING)
STS (d, dt, Dts, grid);
#endif
#if (PARABOLIC_FLUX & RK_LEGENDRE)
RKL (d, dt, Dts, grid);
#endif
}