From c36e8ec041fdd941b63051b2c3f7e5c560d1e49b Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 7 Jan 2025 16:03:09 -0700 Subject: [PATCH 01/14] Test latex formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f24b2a..3462133 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ Performance Portable Opacity and Emissivity library for simulation codes ## API singularity-opac provides a uniform API for all opacity models. The following functions are provided -(here, `\sigma` is the frequency- and angle-dependent cross section in units of `cm^2`): +(here, $\sigma$ is the frequency- and angle-dependent cross section in units of `cm^2`): | Function | Expression | Description | Units | | --------------------- | ---------- | --------------------- | ------- | -| AbsorptionCoefficient | `n \sigma` | Absorption coefficient | `cm^{-1}` | +| AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | `cm^{-1}` | | AngleAveragedAbsorptionCoefficient | `\frac{1}{4 \pi}\int n \sigma d\Omega` | Absorption coefficient averaged over solid angle | `cm^{-1}` | | EmissivityPerNuOmega | `j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}` | Frequency- and angle-dependent emissivity | `erg cm^{-3} s^{-1} Sr^{-1} Hz^{-1}` | | EmissivityPerNu | `\int j_{\nu} d\Omega` | Frequency-dependent emissivity | `erg cm^{-3} s^{-1} Hz^{-1}` | From 1d935db2fa07b24bf8c133a71939bf17c73506b4 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 7 Jan 2025 16:05:12 -0700 Subject: [PATCH 02/14] one more test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3462133..c16ed2a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Performance Portable Opacity and Emissivity library for simulation codes ## API singularity-opac provides a uniform API for all opacity models. The following functions are provided -(here, $\sigma$ is the frequency- and angle-dependent cross section in units of `cm^2`): +(here, $\sigma$ is the frequency- and angle-dependent cross section in units of ${\rm cm}^2$): | Function | Expression | Description | Units | | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | `cm^{-1}` | From 573a4bf570772929df01c24d62e24dc8ddb77d7b Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 7 Jan 2025 20:07:20 -0700 Subject: [PATCH 03/14] test this --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c16ed2a..61ec67c 100644 --- a/README.md +++ b/README.md @@ -11,20 +11,21 @@ singularity-opac provides a uniform API for all opacity models. The following fu (here, $\sigma$ is the frequency- and angle-dependent cross section in units of ${\rm cm}^2$): | Function | Expression | Description | Units | | --------------------- | ---------- | --------------------- | ------- | -| AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | `cm^{-1}` | -| AngleAveragedAbsorptionCoefficient | `\frac{1}{4 \pi}\int n \sigma d\Omega` | Absorption coefficient averaged over solid angle | `cm^{-1}` | -| EmissivityPerNuOmega | `j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}` | Frequency- and angle-dependent emissivity | `erg cm^{-3} s^{-1} Sr^{-1} Hz^{-1}` | -| EmissivityPerNu | `\int j_{\nu} d\Omega` | Frequency-dependent emissivity | `erg cm^{-3} s^{-1} Hz^{-1}` | -| Emissivity | `\int j_{\nu} d\nu d\Omega` | Total emissivity | `erg cm^{-3} s^{-1}` | -| NumberEmissivity | `\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu` | Total number emissivity | `cm^{-3} s^{-1}` | -| ThermalDistributionOfTNu | `B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}` | Specific intensity of thermal distribution | `erg cm^{-2} s^{-1} Sr^{-1} Hz^{-1}` | -| DThermalDistributionOfTNuDT | `dB_{\nu}/dT` | Temperature derivative of specific intensity of thermal distribution | `erg cm^{-2} s^{-1} Sr^{-1} Hz^{-1} K^{-1}` | -| ThermalDistributionOfT | `B = \int B_{\nu} d\Omega d\nu` | Frequency- and angle-integrated intensity of thermal distribution | `erg cm^{-2} s^{-1}` | -| ThermalNumberDistributionOfT | `B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu` | Frequency- and angle-integrated intensity of thermal distribution | `erg cm^{-2} s^{-1}` | +| AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | $cm^{-1}$ | +| AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg~cm}^{-3} {\rm s}^{-1} {\rm Sr}^{-1} {\rm Hz}^{-1}$ | +| EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg~cm}^{-3} {\rm s}^{-1} {\rm Hz}^{-1}$ | +| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg~cm}^{-3} {\rm s}^{-1}$ | +| NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3} {\rm s}^{-1}$ | +| ThermalDistributionOfTNu | $B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}$ | Specific intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1} {\rm Sr}^{-1} {\rm Hz}^{-1}$ | +| DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1} {\rm Sr}^{-1} {\rm Hz}^{-1} {\rm K}^{-1}$ | +| ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1}$ | +| ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1}$ | Note that the thermal radiation energy density `u = 1/c ThermalDistributionOfT` and the thermal radiation number density `n = 1/c ThermalNumberDistributionOfT`. -Internally singularity-opac always uses CGS units, as in the above table. However, arbitrary units are supported through the units modifier. +Internally singularity-opac always uses CGS units, as in the above table. However, arbitrary units are supported through the units modifier, which accepts +function argument inputs in the arbitrary unit system, and returns the result from the function in those same arbitrary units. ## To Build From 03cd1e87a3aaa7b5eb84576133788d243948c1c8 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 7 Jan 2025 20:12:03 -0700 Subject: [PATCH 04/14] still working --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 61ec67c..39eec5d 100644 --- a/README.md +++ b/README.md @@ -7,20 +7,21 @@ Performance Portable Opacity and Emissivity library for simulation codes ## API -singularity-opac provides a uniform API for all opacity models. The following functions are provided +singularity-opac provides a uniform API for all opacity models, in two forms: frequency-averaged +(Plank or Rosseland means) and frewquency-dependent. The following functions are provided (here, $\sigma$ is the frequency- and angle-dependent cross section in units of ${\rm cm}^2$): | Function | Expression | Description | Units | | --------------------- | ---------- | --------------------- | ------- | -| AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | $cm^{-1}$ | +| AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg~cm}^{-3} {\rm s}^{-1} {\rm Sr}^{-1} {\rm Hz}^{-1}$ | -| EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg~cm}^{-3} {\rm s}^{-1} {\rm Hz}^{-1}$ | -| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg~cm}^{-3} {\rm s}^{-1}$ | -| NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3} {\rm s}^{-1}$ | -| ThermalDistributionOfTNu | $B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}$ | Specific intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1} {\rm Sr}^{-1} {\rm Hz}^{-1}$ | -| DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1} {\rm Sr}^{-1} {\rm Hz}^{-1} {\rm K}^{-1}$ | -| ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1}$ | -| ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2} {\rm s}^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | +| EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | +| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}$ | +| NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | +| ThermalDistributionOfTNu | $B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}$ | Specific intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | +| DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}~{\rm K}^{-1}$ | +| ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}$ | +| ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}$ | Note that the thermal radiation energy density `u = 1/c ThermalDistributionOfT` and the thermal radiation number density `n = 1/c ThermalNumberDistributionOfT`. From 59bbb5f37039161982ddcea8a0f0a4d9b4436114 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:41:21 -0700 Subject: [PATCH 05/14] Flesh out docs --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 39eec5d..d2ae82a 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,9 @@ Performance Portable Opacity and Emissivity library for simulation codes ## API -singularity-opac provides a uniform API for all opacity models, in two forms: frequency-averaged -(Plank or Rosseland means) and frewquency-dependent. The following functions are provided +singularity-opac provides a uniform API for all opacity models, in two forms: frequency-dependent, and frequency-averaged (Plank or Rosseland means), and separately for absorption and scattering opacities. + +For frequency-dependent absorption opacities, the following functions are provided (here, $\sigma$ is the frequency- and angle-dependent cross section in units of ${\rm cm}^2$): | Function | Expression | Description | Units | | --------------------- | ---------- | --------------------- | ------- | @@ -22,12 +23,73 @@ singularity-opac provides a uniform API for all opacity models, in two forms: fr | DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}~{\rm K}^{-1}$ | | ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}$ | | ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}$ | +| EnergyDensityFromTemperature | $E_{\rm R}$ | Radiation energy density | ${\rm erg~cm}^{-3}$ | +| TemperatureFromEnergyDensity | $T_{\rm R}$ | Radiation temperature | ${\rm K}$ | +| NumberDensityFromTemperature | $n_{\rm R}$ | Radiation number density | ${\rm cm}^{-3}$ | + +with the following function signatures: + AbsorptionCoefficient(density, temperature, frequency) + AngleAveragedAbsorptionCoefficient(density, temperature, frequency) + EmissivityPerNuOmega(density, temperature, frequency) + EmissivityPerNu(density, temperature, frequency) + Emissivity(density, temperature) + NumberEmissivity(density, temperature) + ThermalDistributionOfTNu(temperature, frequency) + DThermalDistribtuionOfTNuDT(temperature, frequency) + ThermalDistributionOfT(temperature) + ThermalNumberDistributionOfT(temperature) + EnergyDensityFromTemperature(temperature) + TemperatureFromEnergyDensity(radiation energy density) + NumberDensityFromTemperature(temperature) + +For mean absorption opacities, the following functions are provided: +| Function | Expression | Description | Units | +| --------------------- | ---------- | --------------------- | ------- | +| PlankMeanAbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | +| RosselandMeanAbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | +| AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | +| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}$ | + +with the following function signatures: + PlanckMeanAbsorptionCoefficient(density, temperature) + RosselandMeanAbsorptionCoefficient(density, temperature) + AbsorptionCoefficient(density, temperature, gmode [Planck, Rosseland]) + Emissivity(density, temperature) + +For frequency-dependent scattering opacities, the following functions are provided +| Function | Expression | Description | Units | +| --------------------- | ---------- | --------------------- | ------- | +| TotalCrossSection | $ \sigma$ | Scattering cross section | ${\rm cm}^{2}$ | +| DifferentialCrossSection | $ d\sigma / d \Omega $ | Differential scattering cross section | ${\rm cm}^{2}~{\rm Sr}^{-1}$ | +| TotalScatteringCoefficient | $ n \sigma $ | Scattering coefficient | ${\rm cm}^{-1}$ | + +with the following function signatures: + TotalCrossSection(density, temperature, frequency) + DifferentialCrossSection(density, temperature, frequency, cos(theta)) + TotalScatteringCoefficient(density, temperature, frequency) + +For mean scattering opacities, the following functions are provided: +| Function | Expression | Description | Units | +| --------------------- | ---------- | --------------------- | ------- | +| PlanckMeanScatteringCoefficient | $n \sigma$ | Planck mean scattering coefficient | ${\rm cm}^{-1}$ | +| RosselandMeanScatteringCoefficient | $n \sigma$ | Rosseland mean scattering coefficient | ${\rm cm}^{-1}$ | + +with the following function signatures: + PlanckMeanScatteringCoefficient(density, temperature) + RosselandMeanScatteringCoefficient(density, temperature) Note that the thermal radiation energy density `u = 1/c ThermalDistributionOfT` and the thermal radiation number density `n = 1/c ThermalNumberDistributionOfT`. Internally singularity-opac always uses CGS units, as in the above table. However, arbitrary units are supported through the units modifier, which accepts function argument inputs in the arbitrary unit system, and returns the result from the function in those same arbitrary units. +Note that neutrino opacity functions also include electron fraction and RadiationType species arguments. + +Frequency-dependent emissition and absorption functions do not currently support angle dependence. + +A struct of runtime physical constants is provided for optional consistency with internal operations by the +`GetRuntimePhysicalConstants()` method. + ## To Build At its most basic: From d73ae558238c05a5364af5ff67cc156f3f07d800 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:43:52 -0700 Subject: [PATCH 06/14] oops --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d2ae82a..561d26e 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,20 @@ For frequency-dependent absorption opacities, the following functions are provid | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | -| EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | -| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | +| EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | +| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | | NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | -| ThermalDistributionOfTNu | $B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}$ | Specific intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | -| DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}~{\rm K}^{-1}$ | -| ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}$ | -| ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg~cm}^{-2}~{\rm s}^{-1}$ | -| EnergyDensityFromTemperature | $E_{\rm R}$ | Radiation energy density | ${\rm erg~cm}^{-3}$ | +| ThermalDistributionOfTNu | $B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}$ | Specific intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | +| DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}~{\rm K}^{-1}$ | +| ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}$ | +| ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}$ | +| EnergyDensityFromTemperature | $E_{\rm R}$ | Radiation energy density | ${\rm erg}~{\rm cm}^{-3}$ | | TemperatureFromEnergyDensity | $T_{\rm R}$ | Radiation temperature | ${\rm K}$ | | NumberDensityFromTemperature | $n_{\rm R}$ | Radiation number density | ${\rm cm}^{-3}$ | with the following function signatures: + AbsorptionCoefficient(density, temperature, frequency) AngleAveragedAbsorptionCoefficient(density, temperature, frequency) EmissivityPerNuOmega(density, temperature, frequency) @@ -48,9 +49,10 @@ For mean absorption opacities, the following functions are provided: | PlankMeanAbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | RosselandMeanAbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | -| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg~cm}^{-3}~{\rm s}^{-1}$ | +| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | with the following function signatures: + PlanckMeanAbsorptionCoefficient(density, temperature) RosselandMeanAbsorptionCoefficient(density, temperature) AbsorptionCoefficient(density, temperature, gmode [Planck, Rosseland]) @@ -64,6 +66,7 @@ For frequency-dependent scattering opacities, the following functions are provid | TotalScatteringCoefficient | $ n \sigma $ | Scattering coefficient | ${\rm cm}^{-1}$ | with the following function signatures: + TotalCrossSection(density, temperature, frequency) DifferentialCrossSection(density, temperature, frequency, cos(theta)) TotalScatteringCoefficient(density, temperature, frequency) @@ -75,6 +78,7 @@ For mean scattering opacities, the following functions are provided: | RosselandMeanScatteringCoefficient | $n \sigma$ | Rosseland mean scattering coefficient | ${\rm cm}^{-1}$ | with the following function signatures: + PlanckMeanScatteringCoefficient(density, temperature) RosselandMeanScatteringCoefficient(density, temperature) From 27ca19a3707de80c013baa061a483b1d93dc54a6 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:46:38 -0700 Subject: [PATCH 07/14] test different whitespace command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 561d26e..ab5236a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For frequency-dependent absorption opacities, the following functions are provid | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg}\,{\rm cm}^{-3}\,{\rm s}^{-1}\,{\rm Sr}^{-1}\,{\rm Hz}^{-1}$ | | EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | | Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | | NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | From 970c1ebe1908ae5841ab6ed9a9ce9f64ada88746 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:47:28 -0700 Subject: [PATCH 08/14] semicolon? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab5236a..7a0332a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For frequency-dependent absorption opacities, the following functions are provid | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg}\,{\rm cm}^{-3}\,{\rm s}^{-1}\,{\rm Sr}^{-1}\,{\rm Hz}^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg}\;{\rm cm}^{-3}\,{\rm s}^{-1}\,{\rm Sr}^{-1}\,{\rm Hz}^{-1}$ | | EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | | Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | | NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | From 009f0249bd5b8039e86a03eddda8285cf814fbaa Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:48:22 -0700 Subject: [PATCH 09/14] just use $ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a0332a..600039a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For frequency-dependent absorption opacities, the following functions are provid | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg}\;{\rm cm}^{-3}\,{\rm s}^{-1}\,{\rm Sr}^{-1}\,{\rm Hz}^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | erg cm$^{-3}$ s$^{-1}$ Sr$^{-1}$ Hz$^{-1}$ | | EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | | Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | | NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | From db532e38625533fb481a61251ec669059c4f586f Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:51:20 -0700 Subject: [PATCH 10/14] will space help with interpreter? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 600039a..62396e6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For frequency-dependent absorption opacities, the following functions are provid | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | erg cm$^{-3}$ s$^{-1}$ Sr$^{-1}$ Hz$^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | $\rm erg \, cm^{-3} \, s^{-1} \, Sr^{-1} \, Hz^{-1}$ | | EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | | Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | | NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | From 2cc569846f4ea75fe384b466233c6b429139963d Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:52:52 -0700 Subject: [PATCH 11/14] unicode... --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62396e6..775292b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For frequency-dependent absorption opacities, the following functions are provid | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | $\rm erg \, cm^{-3} \, s^{-1} \, Sr^{-1} \, Hz^{-1}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | erg cm⁻³ s⁻¹ Sr⁻¹ Hz⁻¹ | | EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | | Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | | NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | From ed41ad96284372beb7afe191945d8b36895c7329 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:56:46 -0700 Subject: [PATCH 12/14] OK spaces dont work --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 775292b..c4f678c 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,15 @@ For frequency-dependent absorption opacities, the following functions are provid | --------------------- | ---------- | --------------------- | ------- | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AngleAveragedAbsorptionCoefficient | $\frac{1}{4 \pi}\int n \sigma d\Omega$ | Absorption coefficient averaged over solid angle | ${\rm cm}^{-1}$ | -| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | erg cm⁻³ s⁻¹ Sr⁻¹ Hz⁻¹ | -| EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}~{\rm Hz}^{-1}$ | -| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | -| NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}~{\rm s}^{-1}$ | -| ThermalDistributionOfTNu | $B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}$ | Specific intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}$ | -| DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}~{\rm Sr}^{-1}~{\rm Hz}^{-1}~{\rm K}^{-1}$ | -| ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}$ | -| ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg}~{\rm cm}^{-2}~{\rm s}^{-1}$ | -| EnergyDensityFromTemperature | $E_{\rm R}$ | Radiation energy density | ${\rm erg}~{\rm cm}^{-3}$ | +| EmissivityPerNuOmega | $j_{\nu} = \frac{dE}{d^3x dt d\Omega d\nu}$ | Frequency- and angle-dependent emissivity | ${\rm erg}{\rm cm}^{-3}{\rm s}^{-1}{\rm Hz}^{-1}{\rm Sr}^{-1}$ | +| EmissivityPerNu | $\int j_{\nu} d\Omega$ | Frequency-dependent emissivity | ${\rm erg}{\rm cm}^{-3}{\rm s}^{-1}{\rm Hz}^{-1}$ | +| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}{\rm cm}^{-3}{\rm s}^{-1}$ | +| NumberEmissivity | $\int \frac{1}{h \nu} j_{\nu} d\Omega d\nu$ | Total number emissivity | ${\rm cm}^{-3}{\rm s}^{-1}$ | +| ThermalDistributionOfTNu | $B_{\nu} = \frac{dE}{dA dt d\Omega d\nu}$ | Specific intensity of thermal distribution | ${\rm erg}{\rm cm}^{-2}{\rm s}^{-1}{\rm Sr}^{-1}{\rm Hz}^{-1}$ | +| DThermalDistributionOfTNuDT | $dB_{\nu}/dT$ | Temperature derivative of specific intensity of thermal distribution | ${\rm erg}{\rm cm}^{-2}{\rm s}^{-1}{\rm Sr}^{-1}{\rm Hz}^{-1}{\rm K}^{-1}$ | +| ThermalDistributionOfT | $B = \int B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg}{\rm cm}^{-2}{\rm s}^{-1}$ | +| ThermalNumberDistributionOfT | $B = \int \frac{1}{h \nu} B_{\nu} d\Omega d\nu$ | Frequency- and angle-integrated intensity of thermal distribution | ${\rm erg}{\rm cm}^{-2}{\rm s}^{-1}$ | +| EnergyDensityFromTemperature | $E_{\rm R}$ | Radiation energy density | ${\rm erg}{\rm cm}^{-3}$ | | TemperatureFromEnergyDensity | $T_{\rm R}$ | Radiation temperature | ${\rm K}$ | | NumberDensityFromTemperature | $n_{\rm R}$ | Radiation number density | ${\rm cm}^{-3}$ | @@ -49,7 +49,7 @@ For mean absorption opacities, the following functions are provided: | PlankMeanAbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | RosselandMeanAbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | | AbsorptionCoefficient | $n \sigma$ | Absorption coefficient | ${\rm cm}^{-1}$ | -| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}~{\rm cm}^{-3}~{\rm s}^{-1}$ | +| Emissivity | $\int j_{\nu} d\nu d\Omega$ | Total emissivity | ${\rm erg}{\rm cm}^{-3}{\rm s}^{-1}$ | with the following function signatures: @@ -62,7 +62,7 @@ For frequency-dependent scattering opacities, the following functions are provid | Function | Expression | Description | Units | | --------------------- | ---------- | --------------------- | ------- | | TotalCrossSection | $ \sigma$ | Scattering cross section | ${\rm cm}^{2}$ | -| DifferentialCrossSection | $ d\sigma / d \Omega $ | Differential scattering cross section | ${\rm cm}^{2}~{\rm Sr}^{-1}$ | +| DifferentialCrossSection | $ d\sigma / d \Omega $ | Differential scattering cross section | ${\rm cm}^{2}{\rm Sr}^{-1}$ | | TotalScatteringCoefficient | $ n \sigma $ | Scattering coefficient | ${\rm cm}^{-1}$ | with the following function signatures: From 138aabb53ef549958787032ee263c8b9b46ca5b0 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 10:57:49 -0700 Subject: [PATCH 13/14] One more latex issue --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c4f678c..45cabf6 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ with the following function signatures: For frequency-dependent scattering opacities, the following functions are provided | Function | Expression | Description | Units | | --------------------- | ---------- | --------------------- | ------- | -| TotalCrossSection | $ \sigma$ | Scattering cross section | ${\rm cm}^{2}$ | -| DifferentialCrossSection | $ d\sigma / d \Omega $ | Differential scattering cross section | ${\rm cm}^{2}{\rm Sr}^{-1}$ | -| TotalScatteringCoefficient | $ n \sigma $ | Scattering coefficient | ${\rm cm}^{-1}$ | +| TotalCrossSection | $\sigma$ | Scattering cross section | ${\rm cm}^{2}$ | +| DifferentialCrossSection | $d\sigma / d \Omega $ | Differential scattering cross section | ${\rm cm}^{2}{\rm Sr}^{-1}$ | +| TotalScatteringCoefficient | $n \sigma $ | Scattering coefficient | ${\rm cm}^{-1}$ | with the following function signatures: From fc620a9649a58713e5e5dfeb903d6cd7b651d70f Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Wed, 8 Jan 2025 11:01:06 -0700 Subject: [PATCH 14/14] Add non-cgs discussion --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45cabf6..88c137d 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,15 @@ with the following function signatures: Note that the thermal radiation energy density `u = 1/c ThermalDistributionOfT` and the thermal radiation number density `n = 1/c ThermalNumberDistributionOfT`. +Opacity variant constructors are specific to the opacity model being requested; consult the source code for +individual opacities. + Internally singularity-opac always uses CGS units, as in the above table. However, arbitrary units are supported through the units modifier, which accepts -function argument inputs in the arbitrary unit system, and returns the result from the function in those same arbitrary units. +function argument inputs in the arbitrary unit system, and returns the result from the function in those same arbitrary units. For example, a gray absorption opacity in non-cgs units specified by `time_unit`, `mass_unit`, `length_unit`, and `temp_unit` conversion factors from code to CGS units (e.g. `mass_cgs = mass_unit * mass_code`) +is created as + + photons::Opacity noncgs_opacity = photons::NonCGSUnits( + photons::Gray(kappa), time_unit, mass_unit, length_unit, temp_unit); Note that neutrino opacity functions also include electron fraction and RadiationType species arguments.