Sink Particles
The ability to form sink particles in AstroBEAR is tied to self-gravity. To simply enable sink particles:
- Look for the
HYPREFLAGvariable inMakefile.incand make sure that it is set to1. - Set the
lSelfGravityflag in yourphysics.datafile and set it toT.
If you just want your simulation to have the option of forming sink particles, no further action is required. If you want to start your simulation off with sink particles, then you will have to create one in problem.f90::ProblemModuleInit():
NAMELIST /ProblemData/ nParticles
NAMELIST /ParticleData/ mass,xloc,vel
OPEN(UNIT=PROBLEM_DATA_HANDLE, FILE='problem.data', STATUS="OLD")
READ(PROBLEM_DATA_HANDLE,NML=ProblemData)
IF (.NOT. lRestart) THEN
DO i=1,nParticles
READ(PROBLEM_DATA_HANDLE,NML=ParticleData)
NULLIFY(Particle)
CALL CreateParticle(Particle)
Particle%mass=mass
Particle%xloc=xloc
Particle%vel=vel
CALL AddSinkParticle(Particle)
END DO
CLOSE(PROBLEM_DATA_HANDLE)
OPEN(UNIT=PROBLEM_DATA_HANDLE, FILE='restart.data', STATUS="UNKNOWN")
WRITE(PROBLEM_DATA_HANDLE,NML=RestartData)
CLOSE(PROBLEM_DATA_HANDLE)
END IF
Depending on the features of your simulation, more objects might have to be declared in conjunction with the sink particle. The .NOT. lRestart conditional is important, as it prevents AstroBEAR from adding the same particle again on a restart.
For more information, see SinkParticlesDevel.