Changes between Version 21 and Version 22 of AccretionDiskTutorial
- Timestamp:
- 08/29/12 14:08:29 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AccretionDiskTutorial
v21 v22 1 1 = Setting up an accretion disk simulation in Astrobear 2.0 = 2 2 3 This tutorial is designed to teach you the essential knowledge needed to set up a Disk module in AstroBEAR 2.0 4 [[BR]] 3 This tutorial is designed to teach you the essential knowledge needed to set up a Disk module in AstroBEAR 2.0 [[BR]][[BR]] 4 Assuming 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. 5 5 6 6 == Modules and Files == … … 9 9 10 10 In 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 astrobearroot directory:11 this can be done by typing the following commands from the AstroBEAR root directory: 12 12 {{{ 13 13 cd modules 14 14 ln -s BasicDisk Problem 15 15 }}} 16 16 17 After 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. 17 18 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 likelyresult 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. 19 20 20 21 == Getting familiar with the module == 21 22 22 23 After 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.24 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 fundamentals of it.[[BR]][[BR]] 25 The 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. 25 26 26 27 [[Image(famil.png, 900px)]] … … 30 31 - Radius: the radius of the disk 31 32 - Height: the height of the disk 32 - Ambient: the blue portion of the plot, it represents the areaaround the disk33 - Ambient: the blue portion of the plot, it represents the space around the disk 33 34 - !PointGravity: a point mass located at the center of the disk, not visible in this picture 34 35 … … 40 41 The 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 41 42 42 || ddensity=1d0 || 43 || ddensity=1d0 ||disk density (g/cc or particles/cc)|| 43 44 || adensity=0.001d0 ||ambient density (g/cc or particles/cc)|| 44 45 || dtemp=1d4 ||disk temperature (K)|| … … 48 49 || mass=.6d-1 ||central particle mass (g)|| 49 50 50 '''Note:''' for this specific module, problem.data no scaling operation is required from the user51 '''Note:''' for this specific module, all the values reported in ''problem.data'' are in physical units. 51 52 52 53 Sometimes 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'' … … 61 62 62 63 [[CollapsibleStart(Setting pressure)]] 63 By default, the accretiondisk module lets you set the temperature for a problem, however, in the case you want to set pressure there are two options:64 By 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: 64 65 - Use of the equation of state to calculate temperature depending on pressure and density 65 66 - Manual modification of problem.f90 to initialize the problem using pressure parameters … … 71 72 }}} 72 73 73 the line above sets up the ambient pressure depending of density and temperature set in ''problem.data'', if wechange it to74 the line above sets the ambient pressure depending of density and temperature values in ''problem.data'', we can change it to 74 75 75 76 {{{ … … 77 78 }}} 78 79 79 the value contained in ''atemp'' will be interpreted as the pressure in physical units.[[BR]]80 after this change the value contained in ''atemp'' will be interpreted as the pressure in physical units.[[BR]] 80 81 '''Note:''' If are considering to make this change in the code, you are strongly advised to change variable names to avoid misleading nomenclature. 81 82 … … 84 85 == Scales == 85 86 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.datacontains a section dedicated to the setting of scales:87 AstroBEAR 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: 88 89 89 90 {{{ … … 93 94 pScale = 0.0, ! pressure scale [dynes/cm^2], TempScale is ignored !!! NOTE: if = 0 then TempScale is used to find pScale 94 95 lScale = .5e10 ! length scale parameter [cm] (defines 1 computational unit!!!) 95 96 96 }}} 97 97 … … 102 102 103 103 '''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 104 In 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]] 105 For convenience purposes, a rule of thumb is to keep R,,disk,,/lScale within one order of magnitude from the value above:[[BR]] 106 for 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 110 109 {{{ 111 110 MinTemp = 1e-3, ! minimum allowed temperature for the system, without cooling, this should be zero. … … 117 116 == Softening == 118 117 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 diskgets smaller, the force of gravity is approximated to a well defined value.[[BR]]118 Softening 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]] 119 In our case, as the disk radius gets smaller, the force of gravity is approximated to a well defined value.[[BR]] 121 120 122 121 Problem.data provides a field in which the user can set the preferred softening parameter: … … 131 130 [[Image(fgrav.png, 800px)]] 132 131 133 - No Softening : the force of gravity goes to infinity as the radius decreases134 - Softening enabled : the force of gravity has a well defined value at r=0135 - Increased softening radius :the force of gravity has a lower value at r=0 compared to the previous case132 - 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 136 135 137 136 Astrobear provides different softening techniques such as !SplineSoft and !PlummerSoft, the user can set the softening function depending on the simulation needs. … … 143 142 The 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]: 144 143 {{{ 145 MaxLevel = 2 ! Maximum level for this simulation.144 MaxLevel = 2 ! Maximum refinement level for this simulation. 146 145 GmX = 32, ! number of cells in x direction 147 146 32, ! number of cells in y direction … … 151 150 152 151 !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 {{{ 154 Domain%mGlobal=1,1,1,32,32,32 155 }}} 156 [[BR]] 157 In 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]] 156 158 157 159 Below is an image of what the mesh looks like in the default module: … … 159 161 [[Image(visit0040.png, 400px)]] 160 162 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 , changing163 A subroutine named ''!ProblemSetErrFlag'' in ''problem.f90'' is responsible for marking the regions for refinement and giving the mesh the pattern seen above. [[BR]][[BR]] 164 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. 165 166 ''!ProblemSetErrFlag'' can be altered to address this issue. By changing the following line 165 167 166 168 {{{ … … 174 176 }}} 175 177 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]]178 we can increase the radius in which additional refinement in enabled. 179 180 Here is a comparison of our mesh before and after the change above.[[BR]] 179 181 [[Image(refinement.png, 800px)]] 180 182 … … 185 187 == Mach Number == 186 188 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.189 When 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. 188 190 [[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]]191 To 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]] 190 192 The plot below represents a disk simulation that respects the limits stated above:[[BR]] 191 193 [[Image(mach.png, 500px)]] 192 194 193 == Otherparameters ==194 195 Now that you have acquired the essential knowledge to set up adisk module, you should be capable to change other aspects of a simulation such as:[[BR]]195 == Additional parameters == 196 197 Now 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]] 196 198 - Equation of state 197 199 - Solvers