Skip to content

Commit

Permalink
Adding nlte solver (#2171)
Browse files Browse the repository at this point in the history
* adding solver part in the calculate method

* adding the objective function

* added the solution vector method

* final touches for the solver

* tests, attempt 1

* ran black

* fixed the issue with tests

* ran black

* added missing doctrings in the nlte_rate_equation_solver.py

* added doctrings to tests

* changed the test to explicitly calculate the lte solution ion number densities.

* ran black

* added the atom data file to download_reference_data.sh

* fixed download_reference_data.sh

* Revert "added the atom data file to download_reference_data.sh"

This reverts commit 58ce29e.

* got rid of index i, kept only shell

* switched DataFrame to pandas.DataFrame in the docstrings

* docstring bug fix

* got rid of the deepcopy of nlte atomic data file

* changed the number of shells to 5

* Update tardis/io/tests/data/tardis_configv1_nlte.yml

Co-authored-by: Christian Vogl <[email protected]>

* Update tardis/plasma/properties/nlte_rate_equation_solver.py

Co-authored-by: Christian Vogl <[email protected]>

* Update tardis/io/tests/data/tardis_configv1_nlte.yml

Co-authored-by: Christian Vogl <[email protected]>

* Update tardis/io/tests/data/tardis_configv1_nlte.yml

Co-authored-by: Christian Vogl <[email protected]>

* ran black

* Update tardis/plasma/properties/nlte_rate_equation_solver.py

Co-authored-by: Christian Vogl <[email protected]>

* Update tardis/plasma/tests/test_nlte_solver.py

Co-authored-by: Christian Vogl <[email protected]>

* restructured a summary in a docstring for the solution_vector_block

* ran black

* added the test for w=0 case

* Update tardis/plasma/properties/nlte_rate_equation_solver.py

Co-authored-by: Christian Vogl <[email protected]>

* Update tardis/plasma/properties/nlte_rate_equation_solver.py

Co-authored-by: Christian Vogl <[email protected]>

* Update tardis/plasma/tests/test_nlte_solver.py

Co-authored-by: Christian Vogl <[email protected]>

* fixed an issue in a docsting

* fixed an issue in a docsting

* removed a TODO comment

Co-authored-by: Christian Vogl <[email protected]>
  • Loading branch information
sonachitchyan and chvogl authored Jan 19, 2023
1 parent e962718 commit de91297
Show file tree
Hide file tree
Showing 4 changed files with 419 additions and 113 deletions.
100 changes: 58 additions & 42 deletions tardis/io/tests/data/tardis_configv1_nlte.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,70 @@
tardis_config_version: v1.0

supernova:
luminosity_requested: 2.8e9 solLum
time_explosion: 13 day
luminosity_requested: 9.05 log_lsun
time_explosion: 16 day

atom_data: kurucz_atom_pure_simple.h5
atom_data: TestNLTE_Ti.h5

model:
structure:
type: specific
velocity:
start: 1.1e4 km/s
stop: 2.0e4 km/s
num: 20
density:
type: branch85_w7
abundances:
type: uniform
H: 0.1
O: 0.09
Mg: 0.03
Si: 0.52
S: 0.19
Ar: 0.04
Ca: 0.03
structure:
type: specific
velocity:
start: 6395 km/s
stop: 12500 km/s
num: 5
density:
type : power_law
time_0: 16.0 day
rho_0: 1.948e-14 g/cm^3
v_0: 8000 km/s
exponent: -10

abundances:
type: uniform
H: 0.9
He: 0.099
Ti: 1e-3

plasma:
ionization: lte
excitation: lte
radiative_rates_type: dilute-blackbody
line_interaction_type: macroatom
continuum_interaction:
species:
- H I
nlte_ionization_species: [H I]
disable_electron_scattering: no
ionization: lte
excitation: lte
radiative_rates_type: dilute-blackbody
line_interaction_type: macroatom
initial_t_inner: 12000 K
link_t_rad_t_electron: 1.0
nlte_ionization_species: [H I, He II, Ti II]

continuum_interaction:
species:
- H I
- Ti II
- He II

enable_adiabatic_cooling: True



montecarlo:
seed: 23111963
no_of_packets : 2.0e+5
iterations: 5
last_no_of_packets: 5.0e+5
no_of_virtual_packets: 5
convergence_strategy:
type: damped
damping_constant: 0.5
threshold: 0.05
lock_t_inner_cycles: 1
t_inner_update_exponent: -0.5
seed: 23111963
no_of_packets: 100000
iterations: 1
nthreads: 1

last_no_of_packets: 1000
no_of_virtual_packets: 0

convergence_strategy:
type: damped
damping_constant: 0.5
threshold: 0.05
fraction: 0.8
hold_iterations: 3

spectrum:
start: 500 angstrom
stop: 20000 angstrom
num: 10000
start: 250 angstrom
stop: 10000 angstrom
num: 10000
method: integrated
compute: Automatic
Loading

0 comments on commit de91297

Please sign in to comment.