10 #include "../coordinates/coordinates.hpp"
11 #include "../globals.hpp"
12 #include "../utils/utils.hpp"
23 long_name =
"eddy kinetic energy,mean kinetic energy";
24 units =
"J/m^3,J/m^3";
31 int is = pmb->is, js = pmb->js, ks = pmb->ks;
32 int ie = pmb->ie, je = pmb->je, ke = pmb->ke;
34 Real *data_sum =
new Real[4 *
ncells1_];
38 std::fill(data_sum, data_sum + 4 *
ncells1_, 0.);
40 for (
int k = ks; k <= ke; ++k)
41 for (
int j = js;
j <= je; ++
j) {
42 pmb->pcoord->CellVolume(k,
j, is, ie,
vol_);
43 for (
int i = is; i <= ie; ++i) {
71 for (
int n = 0; n < 3; ++n) {
72 if ((n == 1) && (!pmb->pmy_mesh->f2))
break;
73 if ((n == 2) && (!pmb->pmy_mesh->f3))
break;
74 for (
int k = ks; k <= ke; ++k)
75 for (
int j = js;
j <= je; ++
j)
76 for (
int i = is; i <= ie; ++i) {
79 Real eddy = w(IVX + n, k,
j, i) - mean;
80 data(0, i) += 0.5 * w(IDN, k,
j, i) * eddy * eddy;
81 data(1, i) += 0.5 * w(IDN, k,
j, i) * mean * mean;
EddyKineticEnergy(MeshBlock *pmb)
void Finalize(AthenaArray< Real > const &w)
void NewCArray(T **&a, int n1, int n2)