Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
588d114
Updated mechanical stars implementation
azton Aug 9, 2019
0eefcb7
Corrected error in rates determination
azton Aug 10, 2019
ab507c5
edited make to include Mechstars
azton Aug 10, 2019
48e4eb3
forgot some file updates
azton Aug 10, 2019
c98f4a2
Hopefully all these files will help it work on frontera!
azton Aug 10, 2019
a15483f
Vast debugging from frontera. Get crashes with and without SMM. Is i…
azton Aug 14, 2019
a04fe5b
Merge branch 'mechstarsC' of https://github.com/azton/enzo-dev into m…
azton Aug 14, 2019
fa9a971
reverted energy deposition to as defined in Hopkins. Tests were failu…
azton Aug 17, 2019
d1cd108
Reworked momentum decision tree to cover different phases of SNR
azton Aug 18, 2019
81ca203
Enforced smooth momentum functional forms
azton Aug 19, 2019
574c766
Reverted deposition cloud to the grid-cloud from simpson 2015--works …
azton Aug 22, 2019
76fe2a3
Added seeding field for PIII stars; separately track SNII metal, SNIa…
azton Sep 18, 2019
d317031
timing prints and fixed typedefs.h
Sep 20, 2019
dc15e5b
Multiple optimization to try and make winds tractable. Theres just s…
azton Sep 23, 2019
d825fab
Refinements to continual formation routine in Grid_MechStarsDepositFe…
azton Sep 23, 2019
a239f47
forgot to account for metals in continual formation!
azton Sep 23, 2019
fffc0c9
Removed modification of SNII and SNIa fields at particle creation- th…
azton Sep 23, 2019
a03b77e
Added timing prints to star creation and accretion printout
azton Sep 23, 2019
7cef58a
Moved temperature calculation to calling routines and just pass pointers
azton Sep 23, 2019
6acf305
Again, moved total metals calculation to calling routines to save tim…
azton Sep 23, 2019
b9d664a
missed checks on metal field flags to prevent access when not using S…
azton Sep 26, 2019
643f476
Merge branch 'p3seed_field' of https://github.com/azton/enzo-dev into…
azton Sep 26, 2019
619f7cc
general debugging, implemented maximum velocity for created star part…
azton Sep 30, 2019
fd8d8b1
first commit to incorporate rad hydro with mechanical star maker
azton Oct 1, 2019
e8ec9f9
coupled mechanical stars to the ray-tracing solver
azton Oct 10, 2019
c0cc43c
forgot to add config for make
azton Oct 11, 2019
429feea
Re-incorporated teststar changes to allow cluster testing
Oct 14, 2019
d039490
debugged fringe case supernovae in low density by choosing energy as …
azton Oct 28, 2019
13ed171
removed max age on stars; put in resolution check to determine whethe…
azton Oct 28, 2019
b0324c1
Updating SS with minor enhancements
Oct 29, 2019
1ef7bcb
removed testing limitation that only 1 particle created per grid per …
azton Oct 31, 2019
5ee4379
Most recent updates from frontera
azton Oct 31, 2019
7be123c
Updates from frontera branch--to test on comet
azton Nov 1, 2019
2c70aee
updated
azton Nov 4, 2019
ea91e7a
debugging branch merged in. still has particles drifting out of grid
azton Nov 7, 2019
6ce49fd
Merge pull request #1 from azton/radiationStars
azton Nov 7, 2019
52dd8d1
removed debug sections that should exist on the debug branch only
azton Nov 7, 2019
d509b05
repurposed DepositUnresolvedEnergyAsThermal parameter; now controls w…
azton Nov 8, 2019
26b6361
edited bounds check of particle position to check against grid edge i…
azton Nov 8, 2019
fb93a2f
Removed enforced failure for stars being out of grid; this is resulti…
azton Nov 9, 2019
1619214
Corrected calculation of f_shielded
azton Nov 25, 2019
6eb6b04
Updating some minor SS parameters
Dec 2, 2019
384a762
Added new refinement criteria to refine PopIII stars; also added sect…
azton Dec 8, 2019
62b67f4
added parameter to control how long refinement persists after PopIII …
azton Dec 8, 2019
8dbb371
forgot to add updated make objects
azton Dec 8, 2019
828eace
Corrected type of refineregionlifetime parameter
azton Dec 12, 2019
4184611
added prints to verify number of particle issuing feedback
azton Dec 12, 2019
a616a6c
debugging--corrected the deposition for really low resolution cases; …
azton Dec 13, 2019
8b08cf8
more debug-- < 1% error on home PC now -\(oo)/-
azton Dec 13, 2019
20ed6f2
Runs wells on home--further testing on frontera
azton Dec 13, 2019
0a2f9f7
Moved conservation check into StarParticleAddFeedback so that it is c…
azton Dec 16, 2019
e23cc95
debugged colour evolution--seems to work on laptop; next testing on f…
azton Dec 21, 2019
a1b5ae6
attempted debugging on frontera; still have accumulating errors beyon…
azton Dec 30, 2019
0c8c54b
debugged on laptop; further testing on frontera
azton Dec 31, 2019
9164421
altered factor for deposting on higher grids
azton Dec 31, 2019
1eb8522
Added finest-level check to creation criteria!
azton Jan 3, 2020
f370421
Attemped to make PopII star formation conserve metal and mass
azton Jan 3, 2020
8b1337a
fixed metal deposition factors; removed some prints n such.
azton Jan 3, 2020
580fdfd
edited volume change criteria
azton Jan 4, 2020
77c0923
changes to make star formation conservative
azton Jan 5, 2020
d4e2c1a
edited upper limit of HN mass to be consistent with SN bins; over lim…
azton Jan 6, 2020
a39b354
added a projection after adding feedback
azton Jan 8, 2020
61bec1c
updates and debugs
azton Jan 8, 2020
8d3fa5f
Debugging, set finding sphere to 1.4x radius since many feedback use …
azton Jan 8, 2020
0b9806f
missed one
azton Jan 8, 2020
635434e
debugging deposition; error is <= 5.2% on laptop in nested simulation…
azton Jan 9, 2020
7c1bdaf
added less accurate but faster rescaling for PopII continuous superno…
azton Jan 9, 2020
b2b546f
Hopefully, thats all she wrote
azton Jan 9, 2020
5c0df62
limited prints to be less spammy
azton Jan 9, 2020
1886561
Reorganized MPI_Allreduce; was causing comm miss, now does reduce for…
azton Jan 10, 2020
2bd3ca2
Combined PopII/popIII behavior
azton Jan 11, 2020
2113d4b
excluded ghost zones from volume calculation and make addfeedback con…
azton Jan 11, 2020
eff2d11
adding uncommitted files
azton Mar 5, 2020
98488d5
resolved conflicts
azton Mar 5, 2020
882ca3b
Merge branch 'master' of https://github.com/fearmayo/enzo-dev into sm…
Apr 9, 2020
23e91ce
merging
Apr 9, 2020
b24b78c
updated default values of NumberOfTestStars and ClusterRadius
azton Apr 20, 2020
fb8b194
turned off various debugging flags for less printing
azton Apr 24, 2020
ad5cc80
put yet another print behind debug -- these shouldnt print with simpl…
azton Apr 24, 2020
3b5b1b7
adding tests for smartstar
May 20, 2020
f76821e
couple of minor updates
May 20, 2020
668a4a3
Committing the Burkert Bodenheimer parameter file
May 22, 2020
2bb0ae9
Merge branch 'master' into smartstar
Jul 9, 2020
b92e89f
interim commit
Nov 12, 2020
7cbf88e
first pass through adding SNae and PopII formation to SmartStars
Dec 8, 2020
f62a65e
many updates to MechStars, and its coupling to radiation modules. te…
azton Jan 12, 2021
5c16fd6
intermediate commit - switching clusters
Jan 21, 2021
ab4beb4
gamma version of low resolution smartstars
fearmayo Feb 5, 2021
d2c09c8
PopII support added to SS
fearmayo Mar 9, 2021
18fc520
Merge branch 'master' into smartstar
fearmayo Mar 9, 2021
62b0c9e
updating formation criteria
fearmayo Mar 16, 2021
4bcb979
Adding in ShuCollapse Test
fearmayo Mar 19, 2021
0e6de24
Added Collapse and Burkert-Bodenheimer Tests
fearmayo Mar 24, 2021
521b54c
Adding notes file for BB test
fearmayo Mar 24, 2021
693bd0e
Fixed minor bug in DetermineSEDParameters.C
fearmayo Apr 14, 2021
35f3f7b
compilation update for Kay
May 7, 2021
b3df234
Merge branch 'smartstar' of https://github.com/fearmayo/enzo-dev into…
May 7, 2021
a35c9d7
reverted default metallicity to 1e-20
azton May 14, 2021
72e3bbf
Disabled continuing star formation on prior particles
azton May 14, 2021
03f016e
failure on metals check; turned debug off; updated a couple prints
azton May 14, 2021
4b431af
removed prints
azton May 14, 2021
9688bc7
Merge branch 'master' into smartstar
fearmayo May 17, 2021
985b757
merging in Azton Wells updates
fearmayo May 17, 2021
fa4c573
merged with azton wells changes. Issues with compilations in differen…
fearmayo May 24, 2021
c0b7910
potential bug in deleting particles in RemoveMassFromGrid. Not able t…
fearmayo May 26, 2021
e0c7f02
manually added a commit from JHW to fix MPI errors
fearmayo Jun 22, 2021
e2e2b28
Revert "manually added a commit from JHW to fix MPI errors"
Jun 29, 2021
091e926
debugging seg fault on formation
Jul 1, 2021
00435b2
Adding fallback option to first order interpolation
fearmayo Jul 22, 2021
770e3c0
Debugging the MPI errors that cropped up
fearmayo Aug 24, 2021
053f403
fixing conflicts
fearmayo Aug 24, 2021
b449623
fixed memory leak - simone
fearmayo Oct 6, 2021
15d950b
Fixed memory leak in RT in runs with a large number of grids
fearmayo Dec 15, 2021
e6d1063
Very massive PopIII stars use thermal feedback
Apr 25, 2022
08447cc
merging with main and also weeding out Azton changes that are surplus
fearmayo Oct 11, 2022
4607036
Removing mechanical star code in Grid_FindAllStarParticles
fearmayo Oct 14, 2022
27d0781
Removing Grid_FlagCellsToBeRefinedByPopIII.C
fearmayo Oct 14, 2022
eff316e
Removing need to refine around PopIII particles
fearmayo Oct 14, 2022
4d0ba41
Removing mechanical star files
fearmayo Oct 14, 2022
a931f52
Removing more mech files from this branch
fearmayo Oct 14, 2022
16ab1ef
Removing mechanical star stuff out of this branch
fearmayo Oct 14, 2022
677b497
removing more mechanical star references
fearmayo Oct 14, 2022
64f9445
Fixing issue that prevented build on circle-ci
fearmayo Oct 14, 2022
b43a591
Removing MPI timing from EvolveLevel.C
fearmayo Oct 14, 2022
2cdedc9
Updates to Thermal Feedback routines
fearmayo Nov 29, 2022
269edd3
Above 500 Msolar radiation from PopIII stars is non-ionising and ther…
fearmayo Dec 8, 2022
61372b3
Updated ParticleSplitting to split only the particles read in from a …
fearmayo Mar 28, 2023
1958f31
Merge branch 'enzo-project:main' into smartstar
fearmayo Jun 19, 2023
e42e928
updated to particle splitter code to allow splitting only of particle…
fearmayo Jun 20, 2023
330356a
Merge branch 'smartstar' of github.com:fearmayo/enzo-dev into smartstar
fearmayo Jun 20, 2023
96b4854
Merge branch 'enzo-project:main' into smartstar
fearmayo Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions doc/manual/source/parameters/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2598,12 +2598,12 @@ SmartStar Feedback
Default: 0

``SmartStarStellarRadiativeFeedback`` (external)
This parameter controls whether stellar feedback is activated or not. For feedback from PopIII or SMSs then this needs to be on.
The stellar radiative feedback is divided up into 5 energy bins. The energy bins have energies of 2.0 eV, 12.8 eV, 14.0 eV, 25.0 eV
and 200 eV. The fraction of energy assigned to each bin is determined using the PopIII tables from Schaerer et. al 2002 Table 4.
The spectrum for a PopIII star and SMS are different. For a PopIII star a spectrum for a 40 Msolar star is assumed and
weighted accordingly. For a SMS a 1000 Msolar star is assumed and weighted accordingly.
Future improvements to the SEDs employed here are under active investigation.
This parameter controls whether stellar feedback is activated or not.
For feedback from PopII, PopIII or SMSs then this needs to be on.
The stellar radiative feedback is divided up into 5 energy bins. See `DetermineSEDParameters.C` for details.
For PopII stars the energy bins are: 2.0 eV, 12.8 eV, 21.62 eV, 30.0 eV and 60 eV.
For PopIII stars the energy bins are: 2.0 eV, 12.8 eV, 28.0 eV, 30.0 eV and 58 eV.
For SMS stars the energy bins are: 2.0 eV and 12.8 eV
Default: 0

``SmartStarBHFeedback`` (external)
Expand Down Expand Up @@ -2637,13 +2637,9 @@ SmartStar Feedback

``SmartStarSpin`` (external)
The dimensionless spin of the SmartStar particle. This is a very unconstrained parameter and cannot be readily computed on the fly. This parameter
should be set if you want to have jet feedback. Setting this is zero and turning on jet feedback wouldn't make sense. The default is set to be 0.7 and
this is probably reasonable.
Default: 0.7

``SmartStarSMSLifetime`` (external)
This is the lifetime for a supermassive star in years. After this time has elapsed a SmartStar particle which is behaving like a SMS will collapse
directly into a black hole with no supernova event. Default: 1e6
should be set if you want to have jet feedback. Setting this is zero and turning on jet feedback wouldn't make sense. The default is set to be 0.674351 and
this leads to a radiative efficiency of 1.
Default: 0.674351

``SmartStarJetVelocity`` (external)
The velocity that the jets are ejected at. Typically jets are observed to travel at a substantial fraction of the speed of light -
Expand Down
3 changes: 2 additions & 1 deletion doc/manual/source/physics/active_particles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ ______________________________

The ``SmartStar`` particle is built on top of the ``AccretingParticle`` type with additional feedback and accretion protocols attached.
The ``SmartStar`` particle was designed to be a single particle type that could adjust to the environment
in which it finds itself. Currently it can represent a PopIII star,
in which it finds itself. ``SmartStar`` is designed to model resolved star formation.
Currently it can represent a PopII star, PopIII star,
a super-massive star or a black hole. However, there is no inherent limit to the physical object it can represent. In that sense
it may be suitable to augment the ``SmartStar`` particle with your required feature rather than implmenting a new feature. You
will also be able to build on ``SmartStar`` tests and documentation too rather than starting from scratch.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#
# AMR PROBLEM DEFINITION FILE: Non-cosmological Collapse test
# Description: a sphere collapses until becoming pressure supported.
#
# define problem
#
ProblemType = 27 // Collapse test
TopGridRank = 3
TopGridDimensions = 64 64 64
SelfGravity = 1 // gravity on
TopGridGravityBoundary = 0 // periodic
LeftFaceBoundaryCondition = 3 3 3 // periodic
RightFaceBoundaryCondition = 3 3 3

#
# problem parameters
#

CollapseTestRefineAtStart = 1 // check refinement before running
CollapseTestNumberOfSpheres = 1
CollapseTestUseParticles = 0
CollapseTestInitialTemperature = 1e3 // temperature of the background gas
CollapseTestSpherePosition[0] = 0.5 0.5 0.5
CollapseTestSphereVelocity[0] = 0.0 0.0 0.0
CollapseTestSphereRadius[0] = 0.15625
CollapseTestSphereCoreRadius[0] = 0.05 // only used with sphere type 5
CollapseTestSphereDensity[0] = 1e2 //100 // sphere density, the background density is 1
CollapseTestSphereTemperature[0] = 10 // put sphere in pressure equilibrium (rho * T is constant)
CollapseTestSphereRotationPeriod[0] = 8.72734
CollapseTestFracKeplerianRot[0] = 0.7
CollapseTestSphereType[0] = 11 // constant density
// 1: uniform
// 2: r^-2 power-law
// 3: NFW
// 4: Gaussian
// 5: r^-2 power-law with a core
// 11: Burkert & Bodenheimer setup
#EOSType =
# no cosmology for this run
#
ComovingCoordinates = 0 // Expansion OFF
#
# units
#
DensityUnits = 3.82e-20 // 10^4 cm^-3
LengthUnits = 3.2e17 #5e17 // 1 pc in cm
TimeUnits = 1.0e12 // 10^4 yrs
GravitationalConstant = 0.0320327594 // 4*pi*G_{cgs}*DensityUnits*TimeUnits^2
#
# set I/O and stop/start parameters
#
StopTime = 1.45
dtDataDump = 0.01
#CycleSkipDataDump = 1
DataDumpDir = DD
DataDumpName = DD
OutputTemperature = 1 // Output temperature field.
#
# set hydro parameters
#
Gamma = 1.001
PPMDiffusionParameter = 0 // diffusion off
DualEnergyFormalism = 1 // use total & internal energy
InterpolationMethod = 1 // SecondOrderA
CourantSafetyNumber = 0.3
FluxCorrection = 1
ConservativeInterpolation = 0
RiemannSolver = 4
HydroMethod = 0 // PPM
SmallRho = 1e-8
SmallE = 1e-8
#
# chemistry/cooling
#
MultiSpecies = 0 // chemistry off
RadiativeCooling = 0 // cooling off
Mu = 3.0
#
# set grid refinement parameters
#
StaticHierarchy = 0 // dynamic hierarchy
MaximumRefinementLevel = 4 // use up to 4 levels
RefineBy = 2 // refinement factor
CellFlaggingMethod = 2 6 // refine on baryon mass and Jeans Length
MinimumEfficiency = 0.3
#OutputFirstTimeAtLevel = 4 // output when level 4, 5, 6, etc reached (commented out for now)
#StopFirstTimeAtLevel = 10 // stop if/when level 10 reached
RefineByJeansLengthSafetyFactor = 16 // resolve Jeans length by 16 cells (used with CellFlaggingMethod 6)


#
# set some global parameters
#
GreensFunctionMaxNumber = 10 // # of greens function at any one time
PotentialIterations = 100
ComputePotential = 1
WritePotential = 0
#
# active particle parameters
#
AppendActiveParticleType = SmartStar
ActiveParticleDensityThreshold = 1e+30 //Jeans density criteria + others
SmartStarFeedback = 0

33 changes: 33 additions & 0 deletions run/Hydro/Hydro-3D/BurkertBodenheimerActiveParticles/notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Burkert-Bodenheimer Test
#This is based off the initial conditions given in Fedderath et al. 2010. It shows the collapse of a
#rotating sphere. Particles should form in the bar at the centre. The test is not part of the test
#infrastrure because it is, at the moment, difficult to automate



# To run the test
# There is a bit of a palaver to get this running as the mechanism for
# running enzo with the gravitational potential (GP) turned on is a little
# difficult - in particular I don't think there is a currently a way to get
# enzo to run with the GP calculation from the start. So here is how I do it:

1. ./enzo.exe -d BBCollapseTestSmartStarParticle.enzo
2. This will die after a couple of seconds - that's ok
3. ./enzo.exe -d -g DD0000/DD0000 #this turns on the gravitational potential
4. mpirun -np X ./enzo.exe -d -r GravPotential/DD0000/DD0000

This will run relatively slowly i.e. tens of minutes on around 32 cores. This is another reason
why this is currently not part of the test infrastructure. With the current setup the first particles
should appears in output DD0133.


#Results
The test should form 2 particles initially at the ends of a bar that forms in the middle of the
collapsing sphere. Several particles will subsequently form along the bar as the bar fragments.

#Plots
Plots can be made of the collapse using sinkslices.py




141 changes: 141 additions & 0 deletions run/Hydro/Hydro-3D/BurkertBodenheimerActiveParticles/sinkslices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import matplotlib
matplotlib.use('Agg')
import yt
import numpy as np
import sys
import glob
import matplotlib.pyplot as plt
from yt.units import G, kboltz, mh
from yt.units.yt_array import YTQuantity, YTArray
yt.enable_parallelism()
Mu = 3.0
CENTRE = [0.5, 0.5, 0.5]
#CENTRE = [0.50231934, 0.49035645, 0.49865723]
AccretionRadius = 4
BASE = "./GravPotential/"
fns = glob.glob(BASE + "DD014?/DD????.hierarchy")
fns.sort()
#print fns
WIDTH = 8000

ActiveParticle = "SmartStar"


for f in fns:
ff = f
ds = yt.load(ff)
print("Stats = ", ds.index.get_smallest_dx().in_units("au"))
dx = ds.index.get_smallest_dx().in_units("au")
print("dx = ", dx.d)
dd = ds.all_data()
centre = CENTRE
print("Time = ", ds.current_time.in_units("kyr"))
#Now create a slice of the density field through the sink particle
#slc = yt.SlicePlot(ds, "x", "density", center='c', width=(0.1, 'pc'))
#slc.set_zlim('density', 1e-17, 1e-20)
#slc.save("Slice_x_%s.png" % (ds))
NumAPs = 0
flist = dir(ds.fields)
ap = flist[0]
try:
NumAPs = len(dd[ap, "level"])
print("Number of %s active particles = %d" % (flist[0], NumAPs))
except:
print("No active particles found")

#v,c = ds.find_max("velocity_magnitude")
#print "Max Vel = ", v.in_units("km/s")
#print "Loc = ", c
#centre = CENTRE
#v,c = ds.find_min("velocity_magnitude")
#print "Min Vel = ", v.in_units("km/s")
#print "Loc = ", c
#prj = yt.ProjectionPlot(ds, "x", 'density', center='c',width=(WIDTH, 'au'),
# weight_field=None)
#prj.set_zlim('density', 1e-1, 1e2)
#prj.annotate_scale(corner='upper_right')
#prj.annotate_timestamp(corner='upper_left', redshift=False, draw_inset_box=True)

#prj.save("Proj_x_%s.png" % (ds))

#slc = yt.SlicePlot(ds, "y", "density", center='c', width=(0.25, 'pc'))
#slc.set_zlim('density', 1e-17, 1e-20)
#slc.save("Slice_y_%s.png" % (ds))
#prj = yt.ProjectionPlot(ds, "y", 'density', center='c',width=(WIDTH, 'au'),
# weight_field=None)
#prj.set_zlim('density', 1e-1, 1e2)
#prj.annotate_timestamp(corner='upper_left', redshift=False, draw_inset_box=True)
#prj.annotate_scale(corner='upper_right')
#prj.save("Proj_y_%s.png" % (ds))


slc = yt.SlicePlot(ds, "z", "density", center=centre, width=(WIDTH, 'au'))
#slc.set_zlim('density', 1e-13, 1e-19)
if(NumAPs > 0):
for i in range(NumAPs):
pos = dd[ActiveParticle, "particle_position"][i]
slc.annotate_sphere(pos, radius=(dx.d*AccretionRadius, 'au'),
circle_args={'color':'black', 'fill':True})
slc.save("Slice_z_%s.png" % (ds))

prj = yt.ProjectionPlot(ds, "z", 'number_density', center=centre, width=(WIDTH, 'au'),
weight_field='density')
#prj.set_zlim('density', 1e-1, 1e2)
prj.annotate_timestamp(corner='upper_left', redshift=False, draw_inset_box=True)
#prj.annotate_scale(corner='upper_right')
if(NumAPs > 0):
for i in range(NumAPs):
pos = dd[ActiveParticle, "particle_position"][i]
prj.annotate_sphere(pos, radius=(dx.d*AccretionRadius,'au'),
circle_args={'color':'black', 'fill':True})
prj.save("Proj_z_%s.png" % (ds))

slc = yt.SlicePlot(ds, "z", "velocity_magnitude", center=centre, width=(WIDTH, 'au'))
slc.set_unit("velocity_magnitude", "km/s")
#slc.set_zlim('velocity_magnitude', 0.01, 100)
if(NumAPs > 0):
for i in range(NumAPs):
pos = dd[ActiveParticle, "particle_position"][i]
slc.annotate_sphere(pos, radius=(dx.d*AccretionRadius, 'au'),
circle_args={'color':'black', 'fill':True})
slc.save("Slice_z_Vel_%s.png" % (ds))

prj = yt.ProjectionPlot(ds, "z", 'velocity_magnitude', center=centre,width=(WIDTH, 'au'),
weight_field="velocity_magnitude")
prj.set_unit("velocity_magnitude", "km/s")
#prj.set_zlim('velocity_magnitude', 0.9, 2)
prj.annotate_timestamp(corner='upper_left', redshift=False, draw_inset_box=True)
#prj.annotate_scale(corner='upper_right')
if(NumAPs > 0):
for i in range(NumAPs):
pos = dd[ActiveParticle, "particle_position"][i]
prj.annotate_sphere(pos, radius = (dx.d*AccretionRadius, 'au'),
circle_args={'color':'black', 'fill':True})
prj.save("Proj_z_Vel_%s.png" % (ds))
#print dir(plt)
#
# Save the image.
# Optionally, give a string as an argument
# to name files with a keyword.
#slc = yt.SlicePlot(ds, "z", "PotentialField", center='c', width=(WIDTH, 'au'))
#print "Min/Max = ", np.nanmin(dd["PotentialField"]), np.nanmax(dd["PotentialField"])
#slc.set_log('PotentialField', False)
#if(NumAPs > 0):
# for i in range(NumAPs):
# pos = dd["SmartStar", "particle_position"][i]
# slc.annotate_sphere(pos, radius=(5, 'au'),
# circle_args={'color':'black', 'fill':True})
#slc.save("PotentialSlice_z_%s.png" % (ds))


#prj = yt.ProjectionPlot(ds, "z", 'PotentialField', center='c',width=(WIDTH, 'au'),
# weight_field=None)
#prj.set_zlim('density', 1e-1, 1e2)
#prj.annotate_timestamp(corner='upper_left', redshift=False, draw_inset_box=True)
#prj.annotate_scale(corner='upper_right')
#if(NumAPs > 0):
# for i in range(NumAPs):
# pos = dd["SmartStar", "particle_position"][i]
# prj.annotate_sphere(pos, radius=(5, 'au'),
# circle_args={'color':'black', 'fill':True})
#prj.save("Proj_z_%s.png" % (ds))
Loading