Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge homologouscollapse changes into main #185

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/pgen/progenitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) {
v(iye, k, j, i) = Ye_dev.interpToReal(r);
lambda[0] = v(iye, k, j, i);
}

const Real u = phoebus::energy_from_rho_P(eos, mass_density_dev.interpToReal(r),
pressure_dev.interpToReal(r), emin,
emax, lambda[0]);
Expand Down
22 changes: 21 additions & 1 deletion src/radiation/cooling_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,15 @@ TaskStatus CoolingFunctionCalculateFourForce(MeshBlockData<Real> *rc, const doub
});

// Light Bulb with Liebendorfer model
const bool is_monopole_cart =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlnotsagan the substantial change is here, but it has to do with spherical vs cartesian coords

(typeid(PHOEBUS_GEOMETRY) == typeid(Geometry::MonopoleCart));
const bool is_monopole_sph =
(typeid(PHOEBUS_GEOMETRY) == typeid(Geometry::MonopoleSph));

auto &coords = pmb->coords;
using Transformation_t = Geometry::SphericalToCartesian;
auto const &geom_pkg = pmb->packages.Get("geometry");
auto transform = Geometry::GetTransformation<Transformation_t>(geom_pkg.get());
const bool do_liebendorfer = rad->Param<bool>("do_liebendorfer");
const bool do_lightbulb = rad->Param<bool>("do_lightbulb");
if (do_lightbulb) {
Expand All @@ -181,7 +189,19 @@ TaskStatus CoolingFunctionCalculateFourForce(MeshBlockData<Real> *rc, const doub
DEFAULT_LOOP_PATTERN, "CoolingFunctionCalculateFourForce", DevExecSpace(), kb.s,
kb.e, jb.s, jb.e, ib.s, ib.e,
KOKKOS_LAMBDA(const int k, const int j, const int i) {
const Real r = std::abs(coords.Xc<1>(k, j, i)); // TODO(MG) coord transform game
const Real x1 = coords.Xc<1>(k, j, i);
const Real x2 = coords.Xc<2>(k, j, i);
const Real x3 = coords.Xc<3>(k, j, i);
Real Cart[3];
Real s2c[3][3], c2s[3][3];
Real r;

if (is_monopole_sph) {
r = std::abs(x1);
} else {
r = std::sqrt(x1 * x1 + x2 * x2 + x3 * x3);
transform(x1, x2, x3, Cart, c2s, s2c);
}
const Real rho =
v(prho, k, j, i) * unit_conv.GetMassDensityCodeToCGS(); // Density in CGS
const Real cdensity = v(crho, k, j, i); // conserved density
Expand Down
Loading