Changes between Version 2 and Version 3 of HydroStaticStar


Ignore:
Timestamp:
10/16/12 14:34:39 (12 years ago)
Author:
idilernia
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • HydroStaticStar

    v2 v3  
    1313\frac{dP}{dh} + \rho \cdot g = 0\\
    1414}}}
     15
     16where dP/dh is the change in pressure with respect to height, ρ is density and g is the gravitational potential.
    1517
    1618= Implementation =
     
    3537||COLUMN BASE||
    3638
    37 We can relate each level of the column to an position in an array which contains height (h), density(ρ) and pressure(P).
     39We can relate each level of the column to an position in an array which contains height (h), density(ρ) and pressure(P), that is:
     40
     41{{{
     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)
     44}}}
     45
     46In 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.
     47
     48In order to calculate the ideal pressure, we need to interpret:
     49
     50{{{
     51#!latex
     52\frac{dP}{dh} = - \rho \cdot g\\
     53}}}
     54
     55in a discrete way, this gives:
     56
     57{{{
     58#!latex
     59P(h) = P(h+\Delta h) + g(h)\cdot\rho(h)\cdot\Delta h
     60}}}
     61
     62let's translate this condition under the form of the array specified above:
     63
     64{{{
     65#!latex
     66
     67P(h) \rightarrow col(i,3)\\
     68P(h+Δh) \rightarrow col(i+1,3)\\
     69g(h) \rightarrow GravityForce \\
     70\rho(h) \rightarrow half*(col(i,2)+col(i+1,2))\\
     71Δh \rightarrow col(i+1,1)-col(i,1)\\
     72}}}