Skip to content

Commit

Permalink
add massive particles to SphericalCollapse problem
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking committed Jan 18, 2024
1 parent 5128936 commit d484364
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/SphericalCollapse/spherical_collapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ template <> void RadhydroSimulation<CollapseProblem>::setInitialConditionsOnGrid

template <> void RadhydroSimulation<CollapseProblem>::createInitialParticles()
{
// note: an implementation is only required if particles are used
// add particles at random positions in the box
bool generate_on_root_rank = true;
int iseed = 42;
int num_particles = 1000;
double particle_mass = 0.5 / static_cast<double>(num_particles);

quokka::CICParticleContainer::ParticleInitData pdata = {{particle_mass}, {0}, {0}, {0}}; // mass vx vy vz
CICParticles->InitRandom(num_particles, iseed, pdata, generate_on_root_rank);
}

template <> void RadhydroSimulation<CollapseProblem>::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/)
Expand Down
3 changes: 2 additions & 1 deletion tests/SphericalCollapse.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ gravity.Gconst = 1.0 # gravitational constant

do_reflux = 1
do_subcycle = 0
do_tracers = 1 # turn on tracer particles
do_tracers = 0 # turn on tracer particles
do_cic_particles = 1 # turns on CIC particles

ascent_interval = 100
plotfile_interval = 200
Expand Down

0 comments on commit d484364

Please sign in to comment.