Cell Centered vs Face Centered Potentials #640
Replies: 2 comments
-
The self-gravity potential is defined at cell centers. Regarding the shearing box, all I know is this is inherited from Athena, and its original paper is here: |
Beta Was this translation helpful? Give feedback.
-
I can't speak to self-gravity, but to add, the shearing box source is formulated in such a way as to conserve the total energy with cell centered-phi. As you posted the update to |
Beta Was this translation helpful? Give feedback.
-
I have some questions concerning the implementation of energy changes in Athena++.
When calculating energy changes associated with the movement of the fluid in some field, the work done is calculated by averaging over the faces of a cell. For self-gravity, I believe Athena++ uses Mullen et al in which the derivatives of the potential are evaluated at the faces, using the cell-centered potential values in both the parent cell$(i,j,k)$ and its neighbour $(i+1,k,j)$ .
These derivatives$g$ are then used along with the Riemann mass fluxes at the cell faces to calculate the work done. Below is the source term due to self-gravity in Mullen et al, where the last row indicates the source to energy.
See the use of$g$ evaluated at the cell faces throughout. This form appears to be supported by self_gravity.cpp, if it is the case that the array
phi
is defined at the cell centers (hard to confirm without better knowledge of the code).athena/src/hydro/srcterms/self_gravity.cpp
Lines 43 to 50 in a94f18f
What I am trying to work out is why the energy method in the shearing routine shearing_box.cpp appears to be different. Notably, the evaluation of the acceleration appears to be done not with the cell-centered potentials, but the face centered values.
athena/src/hydro/srcterms/shearing_box.cpp
Lines 56 to 62 in a94f18f
Here$\frac{1}{2}$ does not feature in this calculation, but did in the self-gravity method, as the points at which the potentials are being evaluated are only $\frac{1}{2}\Delta x$ apart, not $\Delta x$ . However this means that the derivative of the potential is being evaluated not at the cell faces, but at some intermediate point between the face and cell center.
phil
is not the potential evaluated in the center of the left-side neighbour (which would usex1v(i-1)
) but instead uses the left-face-centered value of the parent cell. This is why a factorIs there a reason for this change in evaluation location? Both methods should produce similar results, but as they are technically different it would be interesting to know why such differences are required.
Beta Was this translation helpful? Give feedback.
All reactions