CherenkovMediumBase provides abstract types and functions for calculating various optical properties of different media. It provides functionalities to compute properties such as refractive index, scattering length, absorption length, and more, based on the medium's characteristics.
- Calculation of phase and group refractive indices
- Scattering and absorption length computations
- Cherenkov angle and group velocity calculations
- Support for different scattering functions including Henyey-Greenstein and Simplified-Liu models
To install the package, use the Julia package manager:
using Pkg
Pkg.add("CherenkovMediumBase")
To implement a concrete subtype of MediumProperties
, you need to define a new type and implement the required methods. Here is an example:
using CherenkovMediumBase
struct Water <: MediumProperties
salinity::Float64
temperature::Float64
pressure::Float64
vol_conc_small_part::Float64
vol_conc_large_part::Float64
mean_scattering_angle::Float64
dispersion_model::QuanFryDispersion
scattering_model::KopelevichScatteringModel
function Water(salinity, temperature, pressure, vol_conc_small_part, vol_conc_large_part, mean_scattering_angle)
return new(
salinity,
temperature,
pressure,
vol_conc_small_part,
vol_conc_large_part,
mean_scattering_angle,
QuanFryDispersion(salinity, temperature, pressure),
KopelevichScatteringModel(HenyeyGreenStein(mean_scattering_angle), vol_conc_small_part, vol_conc_large_part)
)
end
end
CherenkovMediumBase.get_scattering_model(medium::Water) = medium.scattering_model
CherenkovMediumBase.get_dispersion_model(medium::Water) = medium.dispersion_model
CherenkovMediumBase.pressure(medium::Water) = medium.pressure
CherenkovMediumBase.temperature(medium::Water) = medium.temperature
CherenkovMediumBase.material_density(medium::Water) = 1.
# Implement other required methods similarly
# Define a medium (example)
medium = Water(34.82, 4, 100, 0.005, 0.005, 0.95)
# Calculate phase refractive index at a given wavelength
wavelength = 500.0 # nm
n_phase = phase_refractive_index(medium, wavelength)
println("Phase refractive index at $wavelength nm: $n_phase")
For more detailed usage and examples, please refer to the documentation.