Changes between Version 4 and Version 5 of ModulesOnAstroBear


Ignore:
Timestamp:
05/23/11 18:30:37 (14 years ago)
Author:
Brandon Shroyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ModulesOnAstroBear

    v4 v5  
    247247}}}
    248248
    249  The {{{.NOT. lRestart}}} conditional prevents AstroBEAR from creating a new cooling object on restarts; this is because the cooling objects will be read in from the restart files.
     249The {{{.NOT. lRestart}}} conditional prevents AstroBEAR from creating a new cooling object on restarts; this is because the cooling objects will be read in from the restart files.
    250250
    251251==== Self-Gravity ====
    252252
    253  AstroBEAR uses the [https://computation.llnl.gov/casc/hypre/software.html hypre] library to solve the self-gravity equations.  To use hypre, you must first make sure that you link to the hypre library when compiling AstroBEAR.  Look for the {{{HYPREFLAG}}} variable in {{{Makefile.inc}}} and make sure that it is set to {{{1}}}.
    254 
    255  Hypre will automatically initialize the potential field using the density.  The only caveat is that the initial density cannot be uniform.  When the density is uniform, hypre produces a [http://mathworld.wolfram.com/SingularMatrix.html singular matrix] that it can't solve.  Fortunately, a small density perturbation takes care of this problem without substantially affecting the dynamics of the domain.  AstroBEAR comes with a Perturbation object type that can be used for this.
     253AstroBEAR uses the [https://computation.llnl.gov/casc/hypre/software.html hypre] library to solve the self-gravity equations.  To use self-gravity:
     254
     2551.  Look for the {{{HYPREFLAG}}} variable in {{{Makefile.inc}}} and make sure that it is set to {{{1}}}.
     2562.  Set the {{{lSelfGravity}}} flag in your {{{physics.data}}} file and set it to {{{T}}}.
     257
     258Hypre will automatically initialize the potential field using the density.  The only caveat is that the initial density cannot be uniform.  When the density is uniform, hypre produces a [http://mathworld.wolfram.com/SingularMatrix.html singular matrix] that it can't solve.  Fortunately, a small density perturbation takes care of this problem without substantially affecting the dynamics of the domain.  AstroBEAR comes with a Perturbation object type that can be used for this.
     259
     260==== Sink Particles ====
     261
     262The ability to form [SinkParticles sink particles] in AstroBEAR is tied to self-gravity.  To simply enable sink particles:
     263
     2641.  Look for the {{{HYPREFLAG}}} variable in {{{Makefile.inc}}} and make sure that it is set to {{{1}}}.
     2652.  Set the {{{lSelfGravity}}} flag in your {{{physics.data}}} file and set it to {{{T}}}.
     266
     267If 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()}}}:
     268
     269{{{
     270      NAMELIST /ProblemData/ nParticles
     271      NAMELIST /ParticleData/ mass,xloc,vel
     272      OPEN(UNIT=PROBLEM_DATA_HANDLE, FILE='problem.data', STATUS="OLD")
     273      READ(PROBLEM_DATA_HANDLE,NML=ProblemData)
     274
     275      IF (.NOT. lRestart) THEN
     276
     277         DO i=1,nParticles
     278
     279            READ(PROBLEM_DATA_HANDLE,NML=ParticleData)
     280            NULLIFY(Particle)
     281            CALL CreateParticle(Particle)
     282            Particle%mass=mass
     283            Particle%xloc=xloc
     284            Particle%vel=vel         
     285            CALL AddSinkParticle(Particle)
     286 
     287         END DO
     288
     289         CLOSE(PROBLEM_DATA_HANDLE)     
     290         OPEN(UNIT=PROBLEM_DATA_HANDLE, FILE='restart.data', STATUS="UNKNOWN")
     291         WRITE(PROBLEM_DATA_HANDLE,NML=RestartData)
     292         CLOSE(PROBLEM_DATA_HANDLE)
     293
     294      END IF
     295}}}
     296
     297Depending on the features of your simulation, more [AstroBearObjects 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.
    256298
    257299==== Domain Objects ====