-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from lanl/blb/tracers
Add tracer particles to phoebus
- Loading branch information
Showing
42 changed files
with
775 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ Cv = 1.0 | |
<physics> | ||
hydro = true | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ hydro = false | |
he = false | ||
3t = false | ||
rad = true | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ he = false | |
3t = false | ||
rad = true | ||
mhd = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
mhd = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
mhd = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
mhd = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = true | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
mhd = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ he = false | |
3t = false | ||
rad = true | ||
mhd = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
bc_vars = primitive | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,7 @@ Cv = 1.0 | |
<physics> | ||
hydro = true | ||
rad = true | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,7 @@ hydro = true | |
he = false | ||
3t = false | ||
rad = false | ||
tracers = false | ||
|
||
<fluid> | ||
xorder = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// © 2021-2023. Triad National Security, LLC. All rights reserved. | ||
// This program was produced under U.S. Government contract | ||
// 89233218CNA000001 for Los Alamos National Laboratory (LANL), which | ||
// is operated by Triad National Security, LLC for the U.S. | ||
// Department of Energy/National Nuclear Security Administration. All | ||
// rights in the program are reserved by Triad National Security, LLC, | ||
// and the U.S. Department of Energy/National Nuclear Security | ||
// Administration. The Government is granted for itself and others | ||
// acting on its behalf a nonexclusive, paid-up, irrevocable worldwide | ||
// license in this material to reproduce, prepare derivative works, | ||
// distribute copies to the public, perform publicly and display | ||
// publicly, and to permit others to do so. | ||
|
||
#include <cmath> | ||
|
||
#include "fixup.hpp" | ||
|
||
#include "geometry/analytic_system.hpp" | ||
#include "geometry/cached_system.hpp" | ||
#include "geometry/geometry.hpp" | ||
#include "geometry/geometry_defaults.hpp" | ||
#include "geometry/geometry_utils.hpp" | ||
#include "geometry/mckinney_gammie_ryan.hpp" | ||
#include "geometry/modified_system.hpp" | ||
#include "geometry/spherical_kerr_schild.hpp" | ||
#include "phoebus_utils/cell_locations.hpp" | ||
#include "phoebus_utils/linear_algebra.hpp" | ||
#include "phoebus_utils/variables.hpp" | ||
|
||
namespace fixup { | ||
|
||
/** | ||
* PurgeParticles machinery to remove particles when criteria are met. | ||
* Current criteria: particle falls into event horizon. | ||
**/ | ||
TaskStatus PurgeParticles(MeshBlockData<Real> *rc, const std::string swarmName) { | ||
|
||
/* only do this when FMKS is used. */ | ||
if constexpr (std::is_same<PHOEBUS_GEOMETRY, Geometry::FMKS>::value) { | ||
auto *pmb = rc->GetParentPointer(); | ||
auto &swarm = pmb->swarm_data.Get()->Get(swarmName); | ||
|
||
auto &x = swarm->Get<Real>("x").Get(); | ||
auto &y = swarm->Get<Real>("y").Get(); | ||
auto &z = swarm->Get<Real>("z").Get(); | ||
|
||
auto swarm_d = swarm->GetDeviceContext(); | ||
|
||
auto &pars = pmb->packages.Get("geometry")->AllParams(); | ||
const Real Rh = pars.Get<Real>("Rh"); | ||
const Real xh = std::log(Rh); | ||
|
||
const int max_active_index = swarm->GetMaxActiveIndex(); | ||
pmb->par_for( | ||
"fixup::PurgeParticles", 0, max_active_index - 1, KOKKOS_LAMBDA(const int n) { | ||
if (swarm_d.IsActive(n)) { | ||
|
||
if (x(n) <= xh) { | ||
swarm_d.MarkParticleForRemoval(n); | ||
} | ||
|
||
bool on_current_mesh_block = true; | ||
swarm_d.GetNeighborBlockIndex(n, x(n), y(n), z(n), on_current_mesh_block); | ||
} | ||
}); // par for | ||
|
||
swarm->RemoveMarkedParticles(); | ||
} | ||
return TaskStatus::complete; | ||
} // PurgeParticles | ||
|
||
} // namespace fixup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.