Version 2 (modified by 12 years ago) ( diff ) | ,
---|
Back to BearclawOutline
Bondi Module
Description
The Bondi module was originally designed to be used by the accretion module to enable sink particles to accrete. It has since been expanded to include the ability to initialize the domain with a Bondi solution, as well as impose the Bondi solution at the inner radius of the particle, or at the outer edge of the domain. It is a good module to use as a basis for other modules that want to include the use of particles. For the details of the Bondi solution see Bondi's 1952 paper (1952MNRAS.112..195B)
Initializing the Bondi Particle
The Bondi.data file contains the following:
BondiData
mass:
The mass of the particle in solar massesxloc:
The location of the particle in computational unitsvel:
The velocity of the particle in computational unitsrho_inf:
The asymptotic density for the Bondi Solutionc_inf:
The asymptotic sound speed for the Bondi Solutionradius:
The radius of the particle region in computational unitslCircular_Boundary:
Enforce a circular boundary?iRoutine:
Which routine does the particle use to update its surrounding region. (0 = Accretion, 1 = Free Inflow, -1= nothing but user module updates)
After reading in the information on the Bondi particle and the surrounding region, the routine initializes a Bondi Particle with type PData. (The PData data type is a simplified particle data type - it contains all of the pertinent information without any pointers etc.)
TYPE(PData) Bondi_Particle Bondi_Particle%mass=mass Bondi_Particle%xloc=xloc Bondi_Particle%vel=vel and so on...
The routine then calls the AddSinkParticle subroutine which creates a new particle in the grid of type Sink_Particles,
CALL !AddSinkParticle(Bondi_Particle, iBondi_Particle)
This call also returns the index of the newly created particle in iBondi_Particle so that subsequent calls to Bondi routines can reference the Bondi's particle position etc via Sink_Particle(iBondi_Particle)%xloc, etc…
For restarts, the Bondi Module does NOT call the AddSinkParticle routine again, since the Bondi Particle will already be in the grid - however, the Bondi module still needs to know which particle is the Bondi Particle, so it stores iBondi_Particle in Bondi_restart.data
Initializing the computational domain
The qinitBondi routine initializes the grid with the analytic Bondi solution.
Updating the region around the Bondi Particle
The Bondi Module uses the JetLaunch module's inflow routine to enforce the bondi solution at the outer radius, while keeping things non-singular inside. The JetLaunch module ramps up the velocity from the inner radius to the outer radius keeping the density and temperature constant all within a given half_angle. It returns changes in mass and momentum to the particle keeping mass and momentum conserved which are then passed back out by the BondiInflow routine
SUBROUTINE BondiInflow(iSink,dt,dM,dP) INTEGER :: iSink REAL(KIND=qPREC) :: dt, dM, dP(:) TYPE(NodeInfo), POINTER :: Info CALL Inflow(iSink, dt, dM, dP, rho,v_r,temperature, half_angle,sink_dx(1)*r_inner_cells, radius) END SUBROUTINE BondiInflow