Changes between Version 21 and Version 22 of AccretionDiskTutorial


Ignore:
Timestamp:
08/29/12 14:08:29 (12 years ago)
Author:
idilernia
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • AccretionDiskTutorial

    v21 v22  
    11= Setting up an accretion disk simulation in Astrobear 2.0 =
    22
    3 This tutorial is designed to teach you the essential knowledge needed to set up a Disk module in AstroBEAR 2.0
    4 [[BR]]
     3This tutorial is designed to teach you the essential knowledge needed to set up a Disk module in AstroBEAR 2.0 [[BR]][[BR]]
     4Assuming that you obtained a copy of AstroBEAR 2.0, every file referenced in this tutorial is contained in the folder scambler/modules/BasicDisk, namely, the directory of our disk module.
    55
    66== Modules and Files ==
     
    99
    1010In order to set up a simple accretion disk simulation proceed to select the !BasicDisk problem in the modules folder,
    11 this can be done by typing the following commands in the astrobear root directory:
     11this can be done by typing the following commands from the AstroBEAR root directory:
    1212{{{
    1313cd modules
    1414ln -s BasicDisk Problem
    1515}}}
     16
    1617After compilation, you need to be able to run the AstroBEAR executable, a tutorial for this procedure can be found at [https://clover.pas.rochester.edu/trac/astrobear/wiki/RunningAstroBear How to Run AstroBEAR 2.0] page.
    1718
    18 '''Warning: ''' It is good practice to delete ''profile.data'' from the problem folder before executing AstroBEAR for the first time, failure to do so will likely result in execution errors.
     19'''Warning: ''' It is good practice to delete ''profile.data'' from the problem folder before executing AstroBEAR for the first time, failure to do so will can result in execution errors.
    1920
    2021== Getting familiar with the module ==
    2122
    2223After checking that the disk module compiles and runs without any issues, you can examine the chombo files created by the first run of this module.[[BR]][[BR]]
    23 If you have no experience on visualization tools, the page [https://clover.pas.rochester.edu/trac/astrobear/wiki/VisItBasics VisIt Basics] is a good resource to learn the basics of it.[[BR]][[BR]]
    24 The following image is a density plot of the disk at time ''t=0'', a log scale has been applied to the perpendicular and parallel slices.
     24If you have no experience on visualization tools, the page [https://clover.pas.rochester.edu/trac/astrobear/wiki/VisItBasics VisIt Basics] is a good resource to learn the fundamentals of it.[[BR]][[BR]]
     25The following image is a density plot of the disk at time ''t=0'', a log scale has been applied to these perpendicular and parallel slices.
    2526
    2627[[Image(famil.png, 900px)]]
     
    3031- Radius: the radius of the disk
    3132- Height: the height of the disk
    32 - Ambient: the blue portion of the plot, it represents the area around the disk
     33- Ambient: the blue portion of the plot, it represents the space around the disk
    3334- !PointGravity: a point mass located at the center of the disk, not visible in this picture
    3435
     
    4041The default problem.data file contains a list of initial conditions that can be changed depending on the user's needs, let's analyze some of them
    4142
    42 || ddensity=1d0       || disk density (g/cc or particles/cc)||
     43|| ddensity=1d0       ||disk density (g/cc or particles/cc)||
    4344|| adensity=0.001d0   ||ambient density (g/cc or particles/cc)||
    4445|| dtemp=1d4          ||disk temperature (K)||
     
    4849|| mass=.6d-1         ||central particle mass (g)||
    4950
    50 '''Note:''' for this specific module, problem.data no scaling operation is required from the user
     51'''Note:''' for this specific module, all the values reported in ''problem.data'' are in physical units.
    5152
    5253Sometimes it can be useful to change the size of the physical boundaries of the simulation, this can be done by modifying the section below contained in ''global.data''
     
    6162
    6263[[CollapsibleStart(Setting pressure)]]
    63 By default, the accretion disk module lets you set the temperature for a problem, however, in the case you want to set pressure there are two options:
     64By default, the disk module lets you set the temperature for a problem, however, in the case you want to set pressure there are two options:
    6465- Use of the equation of state to calculate temperature depending on pressure and density
    6566- Manual modification of problem.f90 to initialize the problem using pressure parameters
     
    7172}}}
    7273
    73 the line above sets up the ambient pressure depending of density and temperature set in ''problem.data'', if we change it to
     74the line above sets the ambient pressure depending of density and temperature values in ''problem.data'', we can change it to
    7475
    7576{{{
     
    7778}}}
    7879
    79 the value contained in ''atemp'' will be interpreted as the pressure in physical units.[[BR]]
     80after this change the value contained in ''atemp'' will be interpreted as the pressure in physical units.[[BR]]
    8081'''Note:''' If are considering to make this change in the code, you are strongly advised to change variable names to avoid misleading nomenclature.
    8182
     
    8485== Scales ==
    8586
    86 AstroBEAR makes use of scales to adapt physical values to a numerical simulation, scales can affect the behavior of a model [[BR]]
    87 Physics.data contains a section dedicated to the setting of scales:
     87AstroBEAR makes use of scales to adapt physical values to a numerical simulation, [[BR]]
     88''Physics.data'' contains a section dedicated to the setting of scales:
    8889
    8990{{{
     
    9394pScale          =       0.0,    ! pressure scale [dynes/cm^2], TempScale is ignored !!! NOTE: if = 0 then TempScale is used to find pScale
    9495lScale          =       .5e10   ! length scale parameter [cm] (defines 1 computational unit!!!)
    95 
    9696}}}
    9797
     
    102102
    103103'''Length scale'''[[BR]]
    104 In the values listed above the disk radius is set to 2e10cm, with that, we set our length scale parameter (lScale) to be .5e10cm:[[BR]]
    105 the resulting ratio R,,disk,,/lScale is '''4'''.[[BR]][[BR]]
    106 For convenience purposes, a rule of thumb is to keep the R,,disk,,/lScale within about one order of magnitude from the value above:[[BR]]
    107 for example, if we had 2e15 as R,,disk,, an ideal lScale would be .5e15 or 1e15.
    108 
    109 '''Warning:''' Always make sure to check ''physics.data'' for
     104In this tutorial we set the disk radius to 2*10^10^cm, with that, the length scale parameter (lScale) is set to .5*10^10^cm. The resulting ratio R,,disk,,/lScale is '''4'''.[[BR]]
     105For convenience purposes, a rule of thumb is to keep R,,disk,,/lScale within one order of magnitude from the value above:[[BR]]
     106for example, an ideal length scale for R,,disk,, = 2*10^15^cm would be .5*10^15^cm or 1*10^15^cm.
     107
     108'''Warning:''' Always check ''physics.data'' for
    110109{{{
    111110MinTemp         =       1e-3,      ! minimum allowed temperature for the system, without cooling, this should be zero.
     
    117116== Softening ==
    118117
    119 Softening is a numerical trick commonly used in simulations to prevent divergences when a value comes close to another and the force of gravity goes to infinity.[[BR]]
    120 In our case, as the radius of the disk gets smaller, the force of gravity is approximated to a well defined value.[[BR]]
     118Softening is a numerical trick commonly used in simulations to prevent divergences when a particle comes close to another and the force of gravity goes to infinity.[[BR]]
     119In our case, as the disk radius gets smaller, the force of gravity is approximated to a well defined value.[[BR]]
    121120
    122121Problem.data provides a field in which the user can set the preferred softening parameter:
     
    131130[[Image(fgrav.png, 800px)]]
    132131
    133 - No Softening:  the force of gravity goes to infinity as the radius decreases
    134 - Softening enabled: the force of gravity has a well defined value at r=0
    135 - Increased softening radius: the force of gravity has a lower value at r=0 compared to the previous case
     132- No Softening (soft_function=0) :  the force of gravity goes to infinity as the radius decreases
     133- Softening enabled (soft_function=2, soft_radius=.1d0) : the force of gravity has a well defined value at r=0
     134- Increased softening radius, (soft_function=2, soft_radius=.1d3): softening starts at a greater radial distance, the force of gravity has a lower value at r=0 compared to the previous case
    136135
    137136Astrobear provides different softening techniques such as !SplineSoft and !PlummerSoft, the user can set the softening function depending on the simulation needs.
     
    143142The resolution of the simulation can be changed by modifying the following fields contained in [https://clover.pas.rochester.edu/trac/astrobear/wiki/GlobalDataExplained global.data]:
    144143{{{
    145 MaxLevel          = 2            ! Maximum level for this simulation.
     144MaxLevel          = 2            ! Maximum refinement level for this simulation.
    146145GmX               = 32,          ! number of cells in x direction
    147146                    32,          ! number of cells in y direction
     
    151150
    152151!MaxLevel regulates the maximum amount of AMR levels, while GmX sets the number of cells in a fixed grid array.[[BR]][[BR]]
    153 '''Warning:''' global.data contains another array entry, ''Domain%mGlobal'' which should usually be set to (1, 1, 1, GmX(1), GmX(2), GmX(3)), changing Gmx without modifying Domain%mGlobal as well could lead to instabilities.
    154 
    155 In this specific module refining is accomplished by defining a region around the disk that will always be marked for refinement. For more information how this is done please visit [https://clover.pas.rochester.edu/trac/astrobear/wiki/ControllingRefinement Controlling Refinement in AstroBEAR 2.0].[[BR]]
     152'''Warning:''' global.data contains another array entry, ''Domain%mGlobal'', which should be set to (1, 1, 1, GmX(1), GmX(2), GmX(3)), for the GmX values seen above, Domain%mGlobal should look like:
     153{{{
     154Domain%mGlobal=1,1,1,32,32,32
     155}}}
     156[[BR]]
     157In this specific module refining is accomplished by defining a region around the disk that will always be marked for refinement. For more information on how this is done please visit [https://clover.pas.rochester.edu/trac/astrobear/wiki/ControllingRefinement Controlling Refinement in AstroBEAR 2.0].[[BR]]
    156158
    157159Below is an image of what the mesh looks like in the default module:
     
    159161[[Image(visit0040.png, 400px)]]
    160162
    161 A subroutine named ''!ProblemSetErrFlag'' in ''problem.f90'' is responsible for marking the regions for refinement in our Disk module and giving the Mesh the pattern seen above. [[BR]]
    162 Depending on the initial conditions of a specific run it may be the case that a disk undergoes gravitational collapse and its boundaries can expand within reasonable limits. This event can cause a significant part of the disk to outflow the refined area, and a consequential loss of information.
    163 
    164 ''!ProblemSetErrFlag'' can be altered to address this issue, changing
     163A subroutine named ''!ProblemSetErrFlag'' in ''problem.f90'' is responsible for marking the regions for refinement and giving the mesh the pattern seen above. [[BR]][[BR]]
     164Depending on the initial conditions of a specific run it may be the case that a disk undergoes gravitational collapse and its boundaries can expand within reasonable limits. This event can cause a significant part of the disk to outflow the refined area.
     165
     166''!ProblemSetErrFlag'' can be altered to address this issue. By changing the following line
    165167
    166168{{{
     
    174176}}}
    175177
    176 the refined radius can be increased.
    177 
    178 Here is a comparison of what the mesh looks like before and after we made this change in problem.f90[[BR]]
     178we can increase the radius in which additional refinement in enabled.
     179
     180Here is a comparison of our mesh before and after the change above.[[BR]]
    179181[[Image(refinement.png, 800px)]]
    180182
     
    185187== Mach Number ==
    186188
    187 When setting up a new simulation it is good practice to check that the Mach values are below a certain threshold, in most of computational simulation this value is ~60. [[BR]][[BR]] Values above this threshold may create difficulties in evolving a model and therefore create computational errors.
     189When setting up a new simulation it is good practice to check that the Mach values are below a certain threshold, in most of numerical simulations this value is ~60. [[BR]]Values above this threshold may create difficulties in evolving a model and therefore create computational errors.
    188190[[BR]][[BR]]
    189 To plot the Mach numbers in Visit you can check the [https://clover.pas.rochester.edu/trac/astrobear/wiki/VisIt Visit page] and locate Mach in the Chombo expressions list [[BR]][[BR]]
     191To plot the Mach numbers in Visit you can check [https://clover.pas.rochester.edu/trac/astrobear/wiki/VisIt Chombo expressions] and locate Mach in the list. [[BR]][[BR]]
    190192The plot below represents a disk simulation that respects the limits stated above:[[BR]]
    191193[[Image(mach.png, 500px)]]
    192194
    193 == Other parameters  ==
    194 
    195 Now that you have acquired the essential knowledge to set up a disk module, you should be capable to change other aspects of a simulation such as:[[BR]]
     195== Additional parameters  ==
     196
     197Now that you have acquired the essential knowledge to set up your disk module, you should be capable to change other aspects of a simulation such as:[[BR]]
    196198- Equation of state
    197199- Solvers