-
Notifications
You must be signed in to change notification settings - Fork 2
/
userdef_output_expT.c
67 lines (61 loc) · 1.96 KB
/
userdef_output_expT.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
#include "pluto.h"
/* *************************************************************** */
void ComputeUserVar (const Data *d, Grid *grid)
/*
*
* PURPOSE
*
* Define user-defined output variables
*
* EMA: la modifico per stamparmi la temperatura
*
***************************************************************** */
{
int i, j, k, nv;
double ***T, ***ioniz, ***mu, ***ne, ***knor;
int ***interBound;
double v[NVAR]; /*[Ema] I hope that NVAR as dimension is fine!*/
double ***phi, ***kpar;
T = GetUserVar("T");
mu = GetUserVar("mu");
interBound = GetUserVar("interBound");
// knor = GetUserVar("knor");
#if EOS==PVTE_LAW
ioniz = GetUserVar("ioniz");
ne = GetUserVar("ne");
#endif
DOM_LOOP(k,j,i){
#if EOS==IDEAL
mu[k][j][i] = MeanMolecularWeight(d->Vc);
T[k][j][i] = d->Vc[PRS][k][j][i]/d->Vc[RHO][k][j][i]*KELVIN*mu[k][j][i];
#elif EOS==PVTE_LAW
for (nv=NVAR; nv--;) v[nv] = d->Vc[nv][k][j][i];
if (GetPV_Temperature(v, &(T[k][j][i]) )!=0) {
print1("ComputeUserVar:[Ema]Err.comp.temp");
}
GetMu(T[k][j][i], v[RHO], &(mu[k][j][i]));
ioniz[k][j][i] = 1/mu[k][j][i] - 1;
ne[k][j][i] = ioniz[k][j][i] * v[RHO] / CONST_mp;
#endif
for (nv=NVAR; nv--;) v[nv] = d->Vc[nv][k][j][i];
// I am not sure I used correctly used the grid to get x1, x2 and x3.
// TC_kappa( v, *grid[IDIR].x, *grid[JDIR].x, *grid[KDIR].x,
// &(kpar[k][j][i]), &(knor[k][j][i]), &(phi[k][j][i]) );
interBound[k][j][i] = d->flag[k][j][i];
}
}
/* ************************************************************* */
void ChangeDumpVar ()
/*
*
*
*************************************************************** */
{
Image *image;
// SetDumpVar("bphi", VTK_OUTPUT, YES);
// SetDumpVar("r_coordI", VTK_OUTPUT, YES);
// SetDumpVar("r_coordJ", VTK_OUTPUT, YES);
// SetDumpVar("r_coordK", VTK_OUTPUT, YES);
// SetDumpVar("rho_ema", VTK_OUTPUT, YES);
// SetDumpVar("bx3", VTK_OUTPUT, YES);
}