Skip to content

Commit

Permalink
Saturn model + heat flux balance
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitBarik committed Jan 18, 2024
1 parent 969d0c4 commit 43c321e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
17 changes: 16 additions & 1 deletion bin/autocompute.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,32 @@
import radial_profiles as rap


def balance_heat_flux():

bc_val_bot = par.bci_thermal_val
bc_val_top = par.bco_thermal_val

tol = 1e-9

cd_eps = ut.chebco_f(rap.epsilon_h,par.N,par.ricb,ut.rcmb,tol)
epsInt = ch.chebint(cd_eps)

return eps0, bc_val_top, bc_val_bot

def get_equilibrium_entropy():
'''
Function to compute equilibrium entropy gradient profile by solving
Div(rho T kappa grad S) = Q
'''

# Balance heat fluxes
eps0, bc_val_top, bc_val_bot = balance_heat_flux()

tol = 1e-9

r0 = ut.chebco(0, par.N, tol, par.ricb, ut.rcmb)
r1 = ut.chebco(1, par.N, tol, par.ricb, ut.rcmb)
cd_eps = ut.chebco_f(rap.epsilon_h,par.N,par.ricb,ut.rcmb,tol)
cd_eps = ut.chebco_f(rap.epsilon_h,par.N,par.ricb,ut.rcmb,tol,args=eps0)

D1 = ut.Dlam(1, par.N)
D2 = ut.Dlam(2, par.N)
Expand Down
24 changes: 18 additions & 6 deletions bin/radial_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,17 @@ def getEOSparams():
coeffGrav = [ 359.26949772994396, -1647.4951402273955, 3114.971302818801,
-3121.9995586185805, 1768.8806269264637, -552.869900057094,
78.85393983296116, 1.8991569550910268, -0.5216321175523105]

elif par.interior_model == 'saturn':
coeffTemp= [ 2746322.598433222, -12819667.849508610, 24913613.036177561,
-26159709.956658602, 16027297.768664116, -5718555.197998112,
1089237.928095523, -77880.376328818 ]
coeffDens= [ 2746322.598433222, -12819667.849508610, 24913613.036177561,
-26159709.956658602, 16027297.768664116, -5718555.197998112]
coeffGrav= [ 2746322.598433222, -12819667.849508610, 24913613.036177561,
1089237.928095523, -77880.376328818 ]
coeffAlpha= [ 2746322.598433222, -12819667.849508610, 24913613.036177561,
-26159709.956658602, 16027297.768664116, -5718555.197998112,
1089237.928095523, -77880.376328818 ]
# elif par.interior_model == 'pns': # To be implemented
# pass

Expand Down Expand Up @@ -202,12 +212,14 @@ def kappa_rho(r):
out = thermal_diffusivity(r)*density(r)
return out

def heat_source(r):
out = 1
def heat_source(r,eps0=0):
out = eps0
return out

def epsilon_h(r):
out = r*heat_source(r)/(density(r)*temperature(r)*thermal_diffusivity(r))
def epsilon_h(r,eps0=0):
out = (eps0*r*heat_source(r,eps0)/
(density(r)*temperature(r)*
thermal_diffusivity(r)))
return out


Expand Down Expand Up @@ -286,4 +298,4 @@ def write_profiles():
# np.savetxt('profiles.dat',X,fmt='%.4f',header=' '.join(header),delimiter=' ')

np.savetxt('profiles.dat',X,fmt='%.4f',header=' '.join(header),delimiter=' ')
#------------------------------------------
#------------------------------------------

0 comments on commit 43c321e

Please sign in to comment.