wiki:SinkParticles

Version 2 (modified by Jonathan, 8 years ago) ( diff )

Sink Particles

The ability to form sink particles in AstroBEAR is tied to self-gravity. To simply enable sink particles:

  1. Look for the HYPREFLAG variable in Makefile.inc and make sure that it is set to 1.
  2. Set the lSelfGravity flag in your physics.data file and set it to T.

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.

Note: See TracWiki for help on using the wiki.