7 | | USE Histograms |
8 | | USE Fields |
| 7 | TYPE DiskDef |
| 8 | REAL(KIND=qPREC), DIMENSION(3) :: velocity= (/0,0,0/) !Disk velocity |
| 9 | REAL(KIND=qPREC), DIMENSION(3) :: position = (/0,0,0/) !Disk velocity |
| 10 | REAL(KIND=qPREC) :: density=10 !Disk peak density |
| 11 | REAL(KIND=qPREC) :: pressure=1 !External Disk Pressure |
| 12 | REAL(KIND=qPREC) :: radius=1 |
| 13 | REAL(KIND=qPREC) :: height=.25 |
| 14 | REAL(KIND=qPREC) :: thickness=.1 !thickness of disk smoothing region |
| 15 | REAL(KIND=qPREC) :: phi=0 |
| 16 | REAL(KIND=qPREC) :: theta=0 |
| 17 | REAL(KIND=qPREC) :: central_mass !Central Mass |
| 18 | REAL(KIND=qPREC) :: t0=0 !Last time velocity and position were updated. |
| 19 | REAL(KIND=qPREC) :: background_density=1 !Last time velocity and position were updated. |
| 20 | INTEGER :: soft_function !Gravitational softening function |
| 21 | REAL(KIND=qPREC) :: soft_length !Gravitational softening radius |
| 22 | INTEGER :: SubSample=1 !Subsample factor |
| 23 | INTEGER :: iTracer=0 !Disk Tracer |
| 24 | INTEGER :: type = UNIFORM |
| 25 | LOGICAL :: PersistInternal=.false. |
| 26 | LOGICAL :: PersistInBoundaries(3,2)=.false. !keep disk in each boundary |
| 27 | INTEGER :: id |
| 28 | TYPE(ShapeDef), POINTER :: Shape |
| 29 | INTEGER :: ObjId |
| 30 | END TYPE DiskDef |
13 | | TYPE(HistogramDef), POINTER :: Histogram |
| 35 | USE Disks |
| 36 | CALL CreateDisk(mydisk) |
| 37 | mydisk%soft_length=soft_radius*radius/lScale |
| 38 | mydisk%soft_function=soft_function |
| 39 | mydisk%pressure=ddensity*dtemp/rScale/TempScale !cu |
| 40 | mydisk%density=ddensity/rScale |
| 41 | mydisk%velocity=velocity |
| 42 | mydisk%theta=theta |
| 43 | mydisk%phi=phi |
| 44 | mydisk%position=xloc |
| 45 | mydisk%thickness=4d0*sink_dx |
| 46 | mydisk%radius=radius/lScale |
| 47 | mydisk%height=height/lScale |
| 48 | mydisk%central_mass=mass*mSolar/mScale |
| 49 | CALL UpdateDisk(mydisk) |
16 | | Then create the Histogram and set the various parameters as in the following example |
17 | | {{{ |
18 | | CALL CreateHistogram(Histogram) |
19 | | Histogram%Field%id=MixingRatio12_Field |
20 | | Histogram%Field%component=GASCOMP |
21 | | Histogram%Field%name='Mixing_Ratio' |
22 | | Histogram%minvalue0d0 |
23 | | Histogram%maxvalue=1d0 |
24 | | Histogram%nbins=100 |
25 | | Histogram%scale=LINEARSCALE |
26 | | Histogram%WeightField=MASS |
27 | | }}} |
28 | | [[Image(SampleHistogram.png, width=400)]] |
| 52 | Disks determine the keplerian rotation profile using the actual gravitational force from the central object's mass, gravitational softening length and distance. Currently the softening function can be NoSoft=0, SplineSoft=1, and PlummerSoft=2. |
33 | | Here is a full list of the various Histogram parameters with the default values in brackets: |
34 | | {{{ |
35 | | INTEGER :: Scale=[LINEARSCALE], LOGSCALE |
36 | | REAL(KIND=qPREC) :: minvalue=[MINOVERALL], or any real number |
37 | | REAL(KIND=qPREC) :: maxvalue=[MAXOVERALL], or any real number |
38 | | INTEGER :: nBins=[100], or any integer |
39 | | INTEGER :: WeightField=[VOLUME], MASS, or any valid FieldID |
40 | | }}} |
| 55 | Currently there are two disk models that are supported. Uniform=0, and Hydrostatic=1. |
42 | | Then at each process event (currently each frame) a curve file will be generated in the out directory ie. {{{out/Histogram00021.curve}}} that will contain all of the histograms for that frame. See CurveFiles for more information on plotting curve files in visit. |
| 57 | |
| 58 | The Uniform disk is just a rotating cylinder or radius Disk%radius [[latex($(s_0)$)]] and disk height Disk%height and uniform density Disk%density and pressure Disk%pressure. The disk is not in hydrostatic equilibrium in the 'z' direction. |
| 59 | |
| 60 | The Hydrostatic disk is has the following density profile for [[latex($s < s_0$)]] |
| 61 | |
| 62 | [[latex($\rho=\rho_0 \mbox{e}^{\left [ \frac{GM}{c_s^2 \left ( 1/r-1/s \right )} \right ] }$)]] |
| 63 | |
| 64 | and for [[latex($s > s_0$)]] |
| 65 | |
| 66 | [[latex($\rho=\rho_0 \mbox{e}^{\left [ \frac{GM}{c_s^2 \left ( 1/r-1/s_0 \right )} \right ] }$)]] |
| 67 | |
| 68 | where |
| 69 | |
| 70 | * [[latex($\rho$)]] is the Disk%density |
| 71 | * [[latex($M$)]] is the Disk%central_mass |
| 72 | * [[latex($c_s=\sqrt{\frac{\gamma P}{\rho}}$)]] is the sound speed associated with the Disk%pressure and Disk%density |
| 73 | * [[latex($s_0$)]] is the Disk%radius |
| 74 | * [[latex($r=\sqrt{s^2+z^2}$)]] is the distance from the origin |
| 75 | |
| 76 | Note that if the Disk%soft_function is Plummer Soft, then r, s_0, and s are all modified [[latex($x \rightarrow \sqrt{x^2+a^2}$)]] where [[latex($a$)]] is the softening length. |
| 77 | |
| 78 | Also if the derived density is below the Disk%Background_Density, then the density is set equal to the background density and the angular velocity is set to zero. |
| 79 | |
| 80 | In the hydrostatic case, the temperature is kept constant, so the pressure is just set from the density profile. |