DL_MG
Functions/Subroutines | Variables
dl_mg_neutralisation_with_ions Module Reference

this is essentially a submodule of dl_mg_nonlinear_model which handles the computation of neutralisation ratios. More details are in Details of concentration shifts computation . More...

Functions/Subroutines

subroutine, public init_counterion_neutralisation (ntrl_ratios, ierr)
 
subroutine, public compute_shifted_ion_concentrations (ierr)
 
pure real(wp) function func (x, emu, imin)
 
pure real(wp) function der_func (x, emu, imin)
 
subroutine, public free_neutralisation
 free module arrays More...
 

Variables

real(wp), parameter chrg_tol =1.e-14
 
real(wp), save nwt_tol_res = 1.e-3
 Parameters for the Newton solution of Eq 15 from Bhandari2020. More...
 
real(wp), save nwt_tol_err_rel = 1.e-3
 
real(wp), save nwt_tol_err_abs = 1.e-3
 
real(wp), save nwt_min_jac = 1.e-8
 
logical, save nwt_start_from_lin_approx = .true.
 
real(wp), save nwt_start_x
 
logical, save use_linear_approx = .false.
 
logical, save use_qint = .false.
 
logical, save debug_print = .false.
 
real(wp), dimension(:), allocatable, save, public counterion_ratios
 the algoritm does not need this array to be shared but it is useful for returning the ratios at the end of calculation More...
 
integer, dimension(:), allocatable, save qi
 integer ion charges set up when use_qint is true More...
 
logical, save use_quadratic_eq = .true.
 Use quadratic solution for nion=2 and q(1)+q(2)=0. More...
 
real(wp), save cqs
 

Detailed Description

this is essentially a submodule of dl_mg_nonlinear_model which handles the computation of neutralisation ratios. More details are in Details of concentration shifts computation .

Todo:
Add a debug print switch that enables printing Newton solver iteration details.

Function/Subroutine Documentation

◆ compute_shifted_ion_concentrations()

subroutine, public dl_mg_neutralisation_with_ions::compute_shifted_ion_concentrations ( integer, intent(inout), optional  ierr)

◆ der_func()

pure real(wp) function dl_mg_neutralisation_with_ions::der_func ( real(wp), intent(in)  x,
real(wp), dimension(:), intent(in)  emu,
integer, intent(in)  imin 
)

◆ free_neutralisation()

subroutine, public dl_mg_neutralisation_with_ions::free_neutralisation

free module arrays

◆ func()

pure real(wp) function dl_mg_neutralisation_with_ions::func ( real(wp), intent(in)  x,
real(wp), dimension(:), intent(in)  emu,
integer, intent(in)  imin 
)
private

◆ init_counterion_neutralisation()

subroutine, public dl_mg_neutralisation_with_ions::init_counterion_neutralisation ( real(wp), dimension(:), intent(in), optional  ntrl_ratios,
integer, intent(inout), optional  ierr 
)

Variable Documentation

◆ chrg_tol

real(wp), parameter dl_mg_neutralisation_with_ions::chrg_tol =1.e-14

◆ counterion_ratios

real(wp), dimension(:), allocatable, save, public dl_mg_neutralisation_with_ions::counterion_ratios

the algoritm does not need this array to be shared but it is useful for returning the ratios at the end of calculation

◆ cqs

real(wp), save dl_mg_neutralisation_with_ions::cqs

◆ debug_print

logical, save dl_mg_neutralisation_with_ions::debug_print = .false.

◆ nwt_min_jac

real(wp), save dl_mg_neutralisation_with_ions::nwt_min_jac = 1.e-8

◆ nwt_start_from_lin_approx

logical, save dl_mg_neutralisation_with_ions::nwt_start_from_lin_approx = .true.

◆ nwt_start_x

real(wp), save dl_mg_neutralisation_with_ions::nwt_start_x

◆ nwt_tol_err_abs

real(wp), save dl_mg_neutralisation_with_ions::nwt_tol_err_abs = 1.e-3

◆ nwt_tol_err_rel

real(wp), save dl_mg_neutralisation_with_ions::nwt_tol_err_rel = 1.e-3

◆ nwt_tol_res

real(wp), save dl_mg_neutralisation_with_ions::nwt_tol_res = 1.e-3

Parameters for the Newton solution of Eq 15 from Bhandari2020.

◆ qi

integer, dimension(:), allocatable, save dl_mg_neutralisation_with_ions::qi

integer ion charges set up when use_qint is true

◆ use_linear_approx

logical, save dl_mg_neutralisation_with_ions::use_linear_approx = .false.

◆ use_qint

logical, save dl_mg_neutralisation_with_ions::use_qint = .false.

◆ use_quadratic_eq

logical, save dl_mg_neutralisation_with_ions::use_quadratic_eq = .true.

Use quadratic solution for nion=2 and q(1)+q(2)=0.