1 #include "../coordinates/coordinates.hpp"
2 #include "../globals.hpp"
3 #include "../particles/particles.hpp"
10 long_name =
"horizontally averaged gas density tendency,";
11 units =
"kg/(m^3.s),";
14 for (
int n = 1; n <= NVAPOR; ++n) {
15 varname +=
"vapor" + std::to_string(n) +
"_t,";
16 units +=
"kg/(kg.s),";
17 long_name +=
"horizontally averaged vapor mass mixing ratio tendency,";
19 for (
int n = 0; n < 3; ++n) {
21 varname +=
"vel" + std::to_string(n + 1) +
"_t,";
22 long_name +=
"horizontally averaged velocity tendency,";
26 long_name +=
"horizontally averaged pressure tendency,";
29 Particles *pp = pmb->ppart;
30 while (pp !=
nullptr) {
31 npart += pp->u.GetDim4();
32 for (
int n = 0; n < pp->u.GetDim4(); ++n) {
33 units +=
",kg/(m^3.s)";
34 varname +=
"," + pp->myname + std::to_string(n + 1) +
"_t";
36 ",horizontally averaged " + pp->myname +
" " + pp->CategoryName(n);
49 int is = pmb->is, js = pmb->js, ks = pmb->ks;
50 int ie = pmb->ie, je = pmb->je, ke = pmb->ke;
55 Particles *pp = pmb->ppart;
57 while (pp !=
nullptr) {
58 for (
int n = 0; n < pp->u.GetDim4(); ++n)
59 for (
int k = ks; k <= ke; ++k)
60 for (
int j = js;
j <= je; ++
j)
61 for (
int i = is; i <= ie; ++i)
62 up_(m + n, k,
j, i) = pp->u(n, k,
j, i);
71 for (
int k = ks; k <= ke; ++k)
72 for (
int j = js;
j <= je; ++
j) {
73 pmb->pcoord->CellVolume(k,
j, is, ie,
vol_);
74 for (
int n = 0; n < NHYDRO; ++n)
75 for (
int i = is; i <= ie; ++i)
80 Particles *pp = pmb->ppart;
82 while (pp !=
nullptr) {
83 for (
int k = ks; k <= ke; ++k)
84 for (
int j = js;
j <= je; ++
j) {
85 pmb->pcoord->CellVolume(k,
j, is, ie,
vol_);
86 for (
int n = 0; n < pp->u.GetDim4(); ++n)
87 for (
int i = is; i <= ie; ++i)
88 data(NHYDRO + m + n, i) +=
89 (pp->u(n, k,
j, i) -
up_(m + n, k,
j, i)) *
vol_(i);
99 for (
int n = 0; n < NHYDRO + m; ++n)
100 for (
int i = is; i <= ie; ++i)
void gatherAllData23_(AthenaArray< Real > &total_vol, AthenaArray< Real > &total_data)
AthenaArray< Real > total_vol_
void Finalize(AthenaArray< Real > const &w)