Code Monkey home page Code Monkey logo

vulcan's People

Contributors

iancrossfield avatar shami-eeg avatar smsaladi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vulcan's Issues

use_water_relax not found when running Earth config file with condensation

Running VULCAN using the sample Earth vulcan_cfg file and condensation set to "True" leads to the following error message:

File "vulcan.py", line 178, in <module>
    integ(data_var, data_atm, data_para, make_atm)
  File "/home/tessa/Downloads/VULCAN-master/op.py", line 694, in __call__
    if vulcan_cfg.use_condense == True and vulcan_cfg.use_relax_water == True and var.t > vulcan_cfg.start_conden_time:
AttributeError: module 'vulcan_cfg' has no attribute 'use_relax_water'

As the error message says, the current vulcan_cfg file doesn't include a setting called "use_relax_water" (which I'm assuming has to do with relaxing boundary conditions with respect to condensation). Is this a relic of an earlier version of VULCAN? And what's the best work-around for it?

crash: "ValueError: zero-size array to reduction operation fmax which has no identity"

In a number of runs I've encountered the following error, which crashes the VULCAN run. Will try to diagnose.

...
Equilibrium calculation (Fastchem) finished.
S8_l_s not included in fastchem.
/home/exolab/vulcan/build_atm.py:533: RuntimeWarning: divide by zero encountered in double_scalars
  Hp[i] = kb*Tco[i]/(mu[i]/Navo*gz[i])
Input stellar spectrum from 2.0 to 700.0
Photodissociation threshold: 655.5
Using wavelength bins from 2.0 to 655.5
The stellar flux is interpolated onto uniform grid of 0.1 (<240.0 nm) and 2.0 (>=240.0 nm) and conserving 100.11 % energy.
/home/exolab/vulcan/op.py:2162: RuntimeWarning: invalid value encountered in multiply
  var.tau[j] += var.y[j,species.index(sp)] * atm.dz[j] * var.cross[sp] # only the j-th laye
Traceback (most recent call last):
  File "/home/exolab/vulcan/vulcan.py", line 177, in <module>
    solver.compute_flux(data_var, data_atm)
  File "/home/exolab/vulcan/op.py", line 2305, in compute_flux
    var.aflux_change = np.nanmax( np.abs(var.aflux-var.prev_aflux)[var.aflux>vulcan_cfg.flux_atol]/var.aflux[var.aflux>vulcan_cfg.flux_atol] )
  File "<__array_function__ internals>", line 180, in nanmax
  File "/home/exolab/anaconda3/lib/python3.9/site-packages/numpy/lib/nanfunctions.py", line 476, in nanmax
    res = np.fmax.reduce(a, axis=axis, out=out, **kwargs)
ValueError: zero-size array to reduction operation fmax which has no identity

"python plot_vulcan.py output/test.vul CH4,CO,CO2,H2O,C2H2 hd189" does not work

I ran vulcan with "python vulcan.py" and it ran successfully, producing output/test.vul. Then I tried
"python plot_vulcan.py output/test.vul CH4,CO,CO2,H2O,C2H2 hd189" in the same folder and I get:

Traceback (most recent call last):
File "plot_vulcan.py", line 34, in
data = pickle.load(handle)
File "/usr/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 864, in load
dispatchkey
KeyError: '{'

I got someone else to run these two commands on their computer and they ran into exactly the same error.
What are we doing wrong, or is this a bug?

NaOH

Hey Shami,

The NaOH thermodynamic file does not agree with the nasa9 file.

File location:

https://github.com/exoclime/VULCAN/blob/e4781148db388f8d9e8db64d262ac7347d4ae448/thermo/NASA9/NaOH.txt

Expected content:

3.442036740E+04 -7.923218180E+02 8.997932300E+00 -4.079844520E-03 3.065783937E-06
-5.119189340E-10 -1.541016409E-13 0.000000000E+00 -2.086951091E+04 -2.510590090E+01
8.753787760E+05 -2.342514649E+03 7.978469890E+00 1.016451512E-04 -6.268531950E-08
1.022715136E-11 -5.713286410E-16 0.000000000E+00 -9.509901710E+03 -2.202310401E+01

NaOH gas Sodium Hydroxide HF298=-191.0+/-8.kJ Gurvich et al JPCRD 25(1996)1211

Cheers,
Noah

trouble running VULCAN in batches on slurm

Hi,

I've set up VULCAN to run on my university's supercomputing cluster in batches via slurm--essentially, I run an sbatch script that tells slurm to run VULCAN using a set of parameters (const_kzz, para_warm, out_name, and out_dir) read from a text input file; each run in a particular batch is read from a different input file.

Previously, I'd been running atm_profile set to 'isothermal'--however, we've recently discovered that isn't producing as accurate a representation of the systems we're modeling at lower temperatures, so we've since switched it to 'analytical'.

However, since that switch, whenever I run the batches, I get one of the two following error messages:

rm: cannot remove ‘vulcan_EQ.dat’: No such file or directory

or

Traceback (most recent call last):
File "vulcan_batch.py", line 142, in
data_var = ini_abun.ini_y(data_var, data_atm)
File "/home/tfisher4/VULCAN-master/build_atm.py", line 129, in ini_y
fc = np.genfromtxt('fastchem_vulcan/output/vulcan_EQ.dat', names=True, dtype=None, skip_header=0)
File "/usr/lib64/python2.7/site-packages/numpy/lib/npyio.py", line 1317, in genfromtxt
fhd = iter(np.lib._datasource.open(fname, 'rbU'))
File "/usr/lib64/python2.7/site-packages/numpy/lib/_datasource.py", line 145, in open
return ds.open(path, mode)
File "/usr/lib64/python2.7/site-packages/numpy/lib/_datasource.py", line 479, in open
raise IOError("%s not found." % path)
IOError: fastchem_vulcan/output/vulcan_EQ.dat not found.

Any idea what might be causing these problems, and how to resolve them?

(Weirdly, the code still runs for ~5 minutes, and sometimes even produces .vul output files--but I can't say I particularly trust them, given the frequency of the error messages)

Thanks!

AttributeError: 'AtmData' object has no attribute 'Hpi'

Hi!

I'm running VULCAN via Python3 on Linux Mint using Geany. for reasons of expediency, I have photochemistry, molecular diffusion, and topflux/bottomflux off, and use_kzz on (set to const)-see the attached config file for full details. However, when I run it, I get the following error message:

  File "vulcan.py", line 171, in <module>
    integ(data_var, data_atm, data_para, make_atm)
  File "/home/tessa/Downloads/VULCAN-master/op.py", line 583, in __call__
    while not self.stop(var, para, atm): # Looping until the stop condition is satisfied
  File "/home/tessa/Downloads/VULCAN-master/op.py", line 753, in stop
    if var.t > vulcan_cfg.trun_min and para.count > vulcan_cfg.count_min and self.conv(var, para, atm):
  File "/home/tessa/Downloads/VULCAN-master/op.py", line 720, in conv
    slope_min = min( np.amin(atm.Kzz/(0.1*atm.Hpi)**2) , 1.e-8)```

And I'm not sure what's causing it? Hpi seems pretty clearly defined in op.py as far as I can tell.


```# ============================================================================= 
# Configuration file of VULCAN:  
# ============================================================================= 

# ====== Setting up the elements included in the network ======
atom_list = ['H', 'O', 'C', 'He', 'N']
# ====== Setting up paths and filenames for the input and output files  ======
# input:
network = 'thermo/NCHO_photo_network.txt'
gibbs_text = 'thermo/gibbs_text.txt' # (all the nasa9 files must be placed in the folder: thermo/NASA9/)
cross_folder = 'thermo/photo_cross/'
com_file = 'thermo/all_compose.txt'
atm_file = 'atm/atm_HD189_Kzz.txt'
sflux_file = 'atm/stellar_flux/sflux-HD189_Moses11.txt' # This is the flux density at the stellar surface
top_BC_flux_file = 'atm/BC_top.txt'
bot_BC_flux_file = 'atm/BC_bot.txt'
vul_ini = 'output/moses_HD189.vul'
# output:
output_dir = 'output/'
plot_dir = 'plot/'
movie_dir = 'plot/movie/new-HD189/'
out_name =  'HD189.vul'

met=0.1

# ====== Setting up the elemental abundance ======
use_solar = False # True: using the solar abundance from Table 10. K.Lodders 2009; False: using the customized elemental abundance. 
# customized elemental abundance (only reads when use_solar = False)
O_H = 6.0618E-4 *(0.793)
C_H = 2.7761E-4
N_H = 8.1853E-5
He_H = 0.09691
ini_mix = 'EQ' # Options: 'EQ', 'const_mix', 'vulcan_ini' (for 'vulcan_ini, the T-P grids have to be exactly the same)
# Initialsing uniform (constant with pressure) mixing ratios (only reads when ini_mix = const_mix)
const_mix = {'CH4':2.7761E-4*2, 'O2':4.807e-4, 'He':0.09691, 'N2':8.1853E-5, 'H2':1. -2.7761E-4*2*4/2} 

# ====== Setting up photochemistry ======
use_photo = False
# astronomy input
r_star = 0.752 # stellar radius in solar radius
orbit_radius = 0.03142 # planet-star distance in A.U.
sl_angle = 48 /180.*3.14159 # the zenith angle of the star in degree
# radiation parameters 
excit_sp = ['O_1', 'CH2_1'] # N_D not included due to lack of NASA9 Gibbs energy
scat_sp = ['H2', 'He'] # the bulk compositions that contribute to Rayleigh scattering
edd = 0.669 #(cos(48 deg) ) # the Eddington coefficient 
dbin = 0.2  # the uniform bin width
# frequency to update the flux and optical depth
ini_update_photo_frq = 100
final_update_photo_frq = 10

# ====== Setting up parameters for the atmosphere ======
atm_base = 'H2' #Options: 'H2', 'N2', 'O2', 'CO2 -- the bulk gas of the atmosphere: affects molecular diffsion
nz = 120   # number of vertical layers
P_b = 1.E9 # pressure at the bottom (dyne/cm^2)
P_t = 1.e-2 # pressure at the top (dyne/cm^2)
use_Kzz = True
use_moldiff = False
use_vz = False
atm_type = 'isothermal' # Options: 'isothermal', 'analytical', or 'file'
Kzz_prof = 'const' # Options: 'const' or 'file'
vz_prof = 'const' # Options: 'const' or 'file'
g = 2140.         # gravity (cm/s^2)  (HD189:2140  HD209:936)
Tiso = 500. # only reads when atm_type = 'isothermal'
# setting the parameters for the analytical T-P from (126)in Heng et al. 2014. Only reads when atm_type = 'analytical' 
# T_int, T_irr, ka_L, ka_S, beta_S, beta_L
para_warm = [120., 1500., 0.1, 0.02, 1., 1.]
para_anaTP = para_warm
const_Kzz = 1e9 # (cm^2/s) Only reads when use_Kzz = True and Kzz_prof = 'const'
const_vz = 0 # (cm/s) Only reads when use_vz = True and vz_prof = 'const'

# frequency for updating dz and dzi due to change of mu
update_frq = 100 

# ====== Setting up the boundary conditions ======
# Boundary Conditions:
use_topflux = False
use_botflux = False
#use_fix_all_bot = True
use_fix_sp_bot = False 

# ====== Reactions to be switched off  ======
remove_list = [] # in pairs e.g. [1,2]

# == Condensation (Ongoing testing!)  ======
use_condense = False
use_settling = False
#start_conden_time = 1e10
condesne_sp = ["H2O"]    # , 'NH3'
non_gas_sp = ["H2O_l_s"]

# ====== steady state check ======
st_factor = 0.5

# ====== Setting up numerical parameters for the ODE solver ====== 
ode_solver = 'Ros2' # case sensitive
use_print_prog = True
print_prog_num = 500  # every x steps to print progress
dttry = 1.E-10
trun_min = 1e2
runtime = 1.E22
dt_min = 1.E-14
dt_max = runtime*1e-5
dt_var_max = 2.
dt_var_min = 0.5
count_min = 120
count_max = int(2E5)
atol = 1.E-2 # Try decreasing this if the solutions are not stable
mtol = 1.E-24
mtol_conv = 1.E-20
pos_cut = 0
nega_cut = -1.
loss_eps = 1e-1
yconv_cri = 0.01 # for checking steady-state
slope_cri = 1.e-4
yconv_min = 0.1
flux_cri = 5.e-2 
flux_atol = 1. # the tol for actinc flux (# photons cm-2 s-1 nm-1)
# ====== Setting up numerical parameters for Ros2 ODE solver ====== 
rtol = 0.1
# ====== Setting up numerical parameters for SemiEu/SparSemiEU ODE solver (Not used) ====== 
PItol = 0.1

# ====== Setting up for output and plotting ======
# plotting:
plot_TP = True
use_live_plot = False
use_live_flux = False
use_plot_end = True
use_plot_evo = True
use_save_movie = False
use_flux_movie = False
plot_height = False
use_PIL = True 
live_plot_frq = 10
save_movie_rate = live_plot_frq
y_time_freq = 1  #  storing data for every 'y_time_freq' step
plot_spec = ['H', 'CH4', 'CO', 'CO2','C2H2', 'NH3', 'HCN']  
# output:
output_humanread = False
use_shark = False
save_evolution = False
save_evo_frq = 10

No data on Fe, Mg, Ca etc. in photo_network files.

I had noticed that within the photochemical network files there is no listing for any reactions with Iron, Magnesium, Calsium etc. that are otherwise listed in the all_compose file. I was wondering whether this is to be implemented, and if not where one could source more such networks. There is also no specifics as to what equation in what form is being used for said network files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.