Skip to content

Commit

Permalink
bug in cooling function and potential bug in history.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mari2895 committed Mar 28, 2024
1 parent 273bdeb commit 9f1507c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/analysis/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Real CalculateMdot(MeshData<Real> *md, Real rc, bool gain) {
const auto &coords = v.GetCoordinates(b);
const Real vol = coords.CellVolume(k, j, i);

Real C[NDFULL];
Real C[Geometry::NDFULL];
geom.Coords(CellLocation::Cent, b, k, j, i, C);
Real r = std::sqrt(C[1] * C[1] + C[2] * C[2] + C[3] * C[3]);
if (r <= rc) {
Expand Down
5 changes: 4 additions & 1 deletion src/radiation/cooling_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// publicly, and to permit others to do so.

#include "geometry/geometry.hpp"
#include "geometry/geometry_utils.hpp"
#include "light_bulb_constants.hpp"
#include "phoebus_utils/variables.hpp"
#include "radiation.hpp"
Expand Down Expand Up @@ -193,7 +194,9 @@ TaskStatus CoolingFunctionCalculateFourForce(MeshData<Real> *rc, const double dt
nblocks - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e,
KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) {
auto &coords = v.GetCoordinates(b);
const Real r = std::abs(coords.Xc<1>(k, j, i));
Real A[Geometry::NDFULL];
geom.Coords(CellLocation::Cent, b, k, j, i, A);
Real r = std::sqrt(A[1] * A[1] + A[2] * A[2] + A[3] * A[3]);
const Real rho =
v(b, p::density(), k, j, i) * density_conversion_factor; // Density in CGS
const Real cdensity = v(b, c::density(), k, j, i); // conserved density
Expand Down

0 comments on commit 9f1507c

Please sign in to comment.