Changes between Version 12 and Version 13 of HydroStaticStar
- Timestamp:
- 11/01/12 16:22:45 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HydroStaticStar
v12 v13 3 3 == Purpose == 4 4 5 This module aims to reproduce a situation of hydrostatic equilibrium (HSE), a condition where a volume of a fluid is at rest or at constant velocity. This occurs when compression due to gravity is balanced by a pressure gradient force .5 This module aims to reproduce a situation of hydrostatic equilibrium (HSE), a condition where a volume of a fluid is at rest or at constant velocity. This occurs when compression due to gravity is balanced by a pressure gradient force: 6 6 7 7 [[Image(Hydrostatic_equilibrium2.png, 250px)]] … … 11 11 {{{ 12 12 #!latex 13 \frac{dP}{dh} + \rho \cdot g= 0\\13 \frac{dP}{dh} + \rho(r) \cdot g(r) = 0\\ 14 14 }}} 15 15 16 where dP/dh is the change in pressure with respect to height, ρ is density and g is thegravitational potential.16 where dP/dh is the change in pressure with respect to height, ρ(r) and g(r) are respectively density and gravitational potential. 17 17 18 18 = Implementation = 19 19 20 Two fundamental objects are used by this module: 20 First we determine a 1D profile in hydrostatic equilibrium, then the profile is ported to 2D/3D using interpolation. [[BR]][[BR]] 21 22 === Objects === 23 24 This module makes use of 3 objects: 21 25 - [wiki:AmbientObjects Ambients] 22 26 - [wiki:Profiles Profiles] 23 27 - PointGravity 24 28 25 For this module, the first step to recreate the solution is to determine a 1D profile in hydrostatic equilibrium, this profile can then be applied to a spherically symmetric 3D model using interpolation. [[BR]][[BR]] 26 We can think of a 1D column of gas as an array of values: 29 === Process === 30 31 We can think of a 1D column of gas as an array: 27 32 28 33 ||COLUMN TOP|| … … 40 45 41 46 {{{ 42 REAL(KIND=qPREC), DIMENSION(100,3) :: column !where the first indexing is the level 43 !2nd indexing determines the attribute (1 height, 2 rho, 3 pressure) 47 REAL(KIND=qPREC), DIMENSION(100,3) :: column !where 100 is the number of entries 48 !3 is the number of attributes for each entry 49 !(1 height or radius, 2 rho, 3 pressure) in this case 44 50 }}} 45 51 46 In this specific implementation, a density profile needs to be specified by the user, the module will be able to calculate the ideal pressure in order to create an HSE solution.52 This array need to be populated with a density profile, namely, the fields 1(height or radius) and 2(rho) for all 100 entries above. The module will be able to calculate the ideal pressure in order to create an HSE solution. 47 53 48 In order to calculate the ideal pressure,we need to interpret:54 To calculate a pressure profile we need to interpret: 49 55 50 56 {{{ 51 57 #!latex 52 \frac{dP}{dh} = - \rho \cdot g\\58 \frac{dP}{dh} + \rho(r) \cdot g(r) = 0\\ 53 59 }}} 60 54 61 55 62 in a discrete way, this gives: … … 60 67 }}} 61 68 62 this simpler form can be applied to our profile array, you can check the [wiki:Profiles Profiles] page to see how this is done. After creating this abstraction of a column of gas in hydrostatic equilibrium, we can use interpolation to port this 1D object to a 2D or 3D model. 69 The condition above determines the pressure profile starting from the top of the column until its base. This implies we specify the pressure at the highest distance from the point mass, ideally infinity. This value can be adjusted in problem.data : 70 {{{ 71 &ProblemData 72 mass=0.4d0 !PointGravity Mass 73 soft_radius=1d0 !Softening radius (in computational units) 74 soft_function=2 !Softening function (NOSOFT=0, SPLINESOFT=1, PLUMMERSOFT=2) 75 velocity=0,0,0 !PointGravity velocity 76 xloc=0,0,0 !PointGravity location 77 pressure_inf=1d0 !Ambient Pressure at infinity (cu) 78 / 79 }}} 63 80 81 You can check the [wiki:Profiles Profiles] page to familiarize with the code that handles these calculations. 82 [[BR]] 64 83 This model assumes that the effects of self gravity are relatively small compared to the gravitational attraction of a point mass. 65 84 66 == 2D, 3D and Softening ==85 == 2D, 3D and Softening == 67 86 68 Due to steep changes in density and gravitational potential close to the center of mass of a star, the point gravity in this model, so me softening of these two parametersis needed.[[BR]]87 Due to steep changes in density and gravitational potential close to the center of mass of a star, the point gravity in this model, softening is needed.[[BR]] 69 88 With !PlummerSoftening being used to soften the gravitational potential and force in this module, a difference in the pressure and temperature profile arise between 2D and 3D models.[[BR]] 70 You can see how the gravity force varies between 2D and 3D:[[BR]]71 2D: 89 Below is how gravitational acceleration is calculated for 2D and 3D respectively :[[BR]] 90 === 2D: === 72 91 {{{ 73 Gravity Force=-PlummerSoftening2D*mass*ScaleGrav92 GravityAcceleration=-PlummerSoftening2D*mass*ScaleGrav 74 93 PlummerSoftening2D=2d0*pos/(sum(pos(1:nDim)**2)+r_soft**2) 75 94 }}} 76 3D: 95 === 3D: === 77 96 {{{ 78 Gravity Force=-PlummerSoftening*mass*ScaleGrav97 GravityAcceleration=-PlummerSoftening*mass*ScaleGrav 79 98 PlummerSoftening=pos/((sum(pos**2)+r_soft**2)**(1.5d0)) 80 99 }}} 81 100 [[BR]] 82 Clearly, the 3D model shows a steeper gradient in pressure .[[BR]]83 The plot below indicates how the pressure gradient changes between 2D and 3D models and how it has important repercussions on the temperature profile as well.[[BR]]101 Clearly, the 3D model shows a steeper gradient in pressure, this has important repercussions on the temperature profile as well.[[BR]] 102 The plot below indicates how the pressure profile changes between 2D and 3D models.[[BR]] 84 103 [[Image(2Dvs3D.png, 400px)]] 85 104 86 105 == Refence model comparison and results == 87 106 88 We divided the checking of our model accuracy into two stages:89 1) comparing module profiles with reference models in the literature90 2) running the model107 Testing can be done in two ways: 108 1) by comparing model properties to analytic solutions 109 2) by running the model 91 110 92 111 For the first testing stage, the density profile of an AGB star (can be found [http://www.public.iastate.edu/~sdk/models/ here]) was loaded into the module, after calculating pressure and temperature profiles needed for an HSE condition, the generated profiles were compared with the reference model.[[BR]]