diff --git a/dev/examples/README/index.html b/dev/examples/README/index.html index 7dc48c8e..5275cbe1 100644 --- a/dev/examples/README/index.html +++ b/dev/examples/README/index.html @@ -1,2 +1,2 @@ -- · EffectiveWaves.jl

demo.jl

Shows how to choose two species, vary the volume fraction of them both, and plot the resulting sound speed and attenuation.

Demonstrate the matching method

Compare the matched method with a purely numerical scheme. Both of these methods calculate the ensemble average wave in a particulate material.

+- · EffectiveWaves.jl

demo.jl

Shows how to choose two species, vary the volume fraction of them both, and plot the resulting sound speed and attenuation.

Demonstrate the matching method

Compare the matched method with a purely numerical scheme. Both of these methods calculate the ensemble average wave in a particulate material.

diff --git a/dev/examples/compare_two/README/index.html b/dev/examples/compare_two/README/index.html index 2b8a1e16..81c9f868 100644 --- a/dev/examples/compare_two/README/index.html +++ b/dev/examples/compare_two/README/index.html @@ -1,2 +1,2 @@ -- · EffectiveWaves.jl
+- · EffectiveWaves.jl
diff --git a/dev/examples/concrete/README/index.html b/dev/examples/concrete/README/index.html index 79bbe99d..f9bba1cc 100644 --- a/dev/examples/concrete/README/index.html +++ b/dev/examples/concrete/README/index.html @@ -1,4 +1,4 @@ - · EffectiveWaves.jl

Code to generate the figures below, which compare different approximations for the effective wavenumber in a 2D concrete. If you are new to Julia, please open the ipynb files above, which show how to run the code in your browser on JuliaBox.

The examples below only run for Julia 0.6 and the package tag v0.1.0. To obtain the version of this package to run these example run in julia:

Pkg.clone("https://github.com/arturgower/EffectiveWaves.jl.git") 
 Pkg.checkout("EffectiveWaves.jl", "master@v0.1.0")
-using EffectiveWaves

Code: concrete_species.ipynb Compare effective wavenumber for 2D concrete Compare effective wavenumber for 2D concrete

Code: concretespecies-largefreq.ipynb Compare effective wavenumber for 2D concrete

Code: concretespeciesvolfrac.ipynb Compare effective wavenumber for 2D concrete

+using EffectiveWaves

Code: concrete_species.ipynb Compare effective wavenumber for 2D concrete Compare effective wavenumber for 2D concrete

Code: concretespecies-largefreq.ipynb Compare effective wavenumber for 2D concrete

Code: concretespeciesvolfrac.ipynb Compare effective wavenumber for 2D concrete

diff --git a/dev/examples/emulsion/README/index.html b/dev/examples/emulsion/README/index.html index de537e5f..8fd23ce4 100644 --- a/dev/examples/emulsion/README/index.html +++ b/dev/examples/emulsion/README/index.html @@ -1,4 +1,4 @@ - · EffectiveWaves.jl

Code to generate the figures below, which compare different approximations for the effective wavenumber in a 2D emulsion. If you are new to Julia, please open the ipynb files above, which show how to run the code in your browser on JuliaBox.

The examples below only run for Julia 0.6 and the package tag v0.1.0. To obtain the version of this package to run these example run in julia:

Pkg.clone("https://github.com/arturgower/EffectiveWaves.jl.git") 
 Pkg.checkout("EffectiveWaves.jl", "master@v0.1.0")
-using EffectiveWaves

Code: fluid_species.ipynb Compare effective wavenumber for 2D emulsion Compare effective wavenumber for 2D emulsion

Code: fluidspecieslarge-freq.ipynb Compare effective wavenumber for 2D emulsion

Code: fluidspeciesvolfrac.ipynb Compare effective wavenumber for 2D emulsion

+using EffectiveWaves

Code: fluid_species.ipynb Compare effective wavenumber for 2D emulsion Compare effective wavenumber for 2D emulsion

Code: fluidspecieslarge-freq.ipynb Compare effective wavenumber for 2D emulsion

Code: fluidspeciesvolfrac.ipynb Compare effective wavenumber for 2D emulsion

diff --git a/dev/examples/equivalent-symmetries/README/index.html b/dev/examples/equivalent-symmetries/README/index.html index 2f18f0df..70aab42e 100644 --- a/dev/examples/equivalent-symmetries/README/index.html +++ b/dev/examples/equivalent-symmetries/README/index.html @@ -40,4 +40,4 @@ maximum(AP_det.(P_kps)) > tol maximum(P_det.(P_kps)) < tol maximum(AR_det.(P_kps)) < tol^2 -maximum(R_det.(P_kps)) < tol^3 +maximum(R_det.(P_kps)) < tol^3 diff --git a/dev/examples/matched_method/README/index.html b/dev/examples/matched_method/README/index.html index aad6d3cf..d78d0bbe 100644 --- a/dev/examples/matched_method/README/index.html +++ b/dev/examples/matched_method/README/index.html @@ -47,4 +47,4 @@ match_region=false, hankel_indexes=0:1 ) savefig("compare_match_wave.png")

The two fields perfectly overlap, as the matched method is an exact method. Below the line is from the matched method, while the scatter points are from the purely numerical method. Compare matched and discrete field

Calculate the reflection coefficient


-R = reflection_coefficient(ω, match_wave, source, material)
+R = reflection_coefficient(ω, match_wave, source, material) diff --git a/dev/examples/vary_two_species/README/index.html b/dev/examples/vary_two_species/README/index.html index a61549b9..d023139d 100644 --- a/dev/examples/vary_two_species/README/index.html +++ b/dev/examples/vary_two_species/README/index.html @@ -26,4 +26,4 @@ ); p2 = plot(ωs, attenuations, labels=labs, xlabel="frequency", ylabel="attenuation (1/m)"); -plot(p1,p2,layout=(2,1))

vary_volfrac.png

+plot(p1,p2,layout=(2,1))

vary_volfrac.png

diff --git a/dev/index.html b/dev/index.html index 6886a969..94830f09 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,3 +1,3 @@ Home · EffectiveWaves.jl

EffectiveWaves.jl Documentation

A Julia package for calculating, processing and plotting waves travelling in heterogeneous materials. The focus is on ensemble averaged waves.

At present, the package focuses on materails filled with randomly placed particles. You can calculate effective wavenumbers for 2D [1] and 3D [4] acoustics, wave transimission and wave reflection in 2D [1,2,3] and 3D [4], and scattering from an inhomogenious sphere [4]. See these notes for brief formulas on effective wavenumbers.

Together with MultipleScattering.jl, this package has been setup to easily extend to other dimensions, materials, and types of waves, such as elastic and electromagnetic waves.

Note

First install Julia v1.0.5 or later, then run in the Julia REPL:

using Pkg
-Pkg.add EffectiveWaves

Alternatively, use the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and then run

pkg> add EffectiveWaves

Manual

You can learn to use this package through examples or through our manual, which starts with a Quick introduction.

References

[1] Gower AL, Smith MJ, Parnell WJ, Abrahams ID. Reflection from a multi-species material and its transmitted effective wavenumber. Proc. R. Soc. A. 2018 Apr 1;474(2212):20170864.

[2] Gower, Artur L., William J. Parnell, and I. David Abrahams. "Multiple waves propagate in random particulate materials." SIAM Journal on Applied Mathematics 79.6 (2019): 2569-2592.

[3] Gower, Artur L., I. David Abrahams, and William J. Parnell. "A proof that multiple waves propagate in ensemble-averaged particulate materials." Proceedings of the Royal Society A 475.2229 (2019): 20190344.

[4] Gower, Artur Lewis, and Gerhard Kristensson. "Effective Waves for Random Three-dimensional Particulate Materials." arXiv preprint arXiv:2010.00934 (2020).

Contents

+Pkg.add EffectiveWaves

Alternatively, use the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and then run

pkg> add EffectiveWaves

Manual

You can learn to use this package through examples or through our manual, which starts with a Quick introduction.

References

[1] Gower AL, Smith MJ, Parnell WJ, Abrahams ID. Reflection from a multi-species material and its transmitted effective wavenumber. Proc. R. Soc. A. 2018 Apr 1;474(2212):20170864.

[2] Gower, Artur L., William J. Parnell, and I. David Abrahams. "Multiple waves propagate in random particulate materials." SIAM Journal on Applied Mathematics 79.6 (2019): 2569-2592.

[3] Gower, Artur L., I. David Abrahams, and William J. Parnell. "A proof that multiple waves propagate in ensemble-averaged particulate materials." Proceedings of the Royal Society A 475.2229 (2019): 20190344.

[4] Gower, Artur Lewis, and Gerhard Kristensson. "Effective Waves for Random Three-dimensional Particulate Materials." arXiv preprint arXiv:2010.00934 (2020).

Contents

diff --git a/dev/library/library/index.html b/dev/library/library/index.html index 72f9242c..bb0625a0 100644 --- a/dev/library/library/index.html +++ b/dev/library/library/index.html @@ -1,9 +1,9 @@ Library · EffectiveWaves.jl

Base

    Defining the material

    MultipleScattering.PhysicalMediumType
    PhysicalMedium{Dim,FieldDim}

    An abstract type used to represent the physical medium, the dimension of the field, and the number of spatial dimensions.

    MultipleScattering.AcousticType
    Acoustic{T<:AbstractFloat,Dim}(ρ::T, c::Complex{T})
    -Acoustic(ρ::T, c::Union{T,Complex{AbstractFloat}}, Dim::Integer)

    Physical properties for a homogenous isotropic acoustic medium with wavespeed (c) and density (ρ)

    Simulations in this medium produce scalar (1D) fields in Dim dimensions.

    ParticleCorrelations.SpecieType

    Specie

    Represents a set of particles which are all the same. The type of particle is given by Specie.particle and the volume fraction this specie occupies is given by Specie.volume_fraction.

    We can use Specie.numberofparticles to specify the number of particles, otherwise for an infinite Specie.numberofparticles = Inf.

    The minimum distance between any two particles will equal outer_radius(Specie) * Specie.separation_ratio.

    MultipleScattering.PlaneSourceType
    PlaneSource(medium::P, amplitude::SVector, direction::SVector)

    Is a struct type which describes a plane-wave source that drives/forces the whole system. It has three fields: a physical medium, an amplitude of the source, and the direction the propagate in direction.

    For any given angular frequency ω, the PlaneSource has the value $e^{i ω/c \mathbf v \cdot \mathbf x }$ at the point $\mathbf x$, where $c$ is the medium wavespeed and $\mathbf v$ is the direction.

    MultipleScattering.RegularSourceType
    RegularSource(medium::P, field::Function, coef::Function)

    Is a struct type which describes the source field that drives/forces the whole system. It is also known as an incident wave. It has three fields RegularSource.medium, RegularSource.field, and RegularSource.coef.

    The source field at the position 'x' and angular frequency 'ω' is given by

    x = [1.0,0.0]
    +Acoustic(ρ::T, c::Union{T,Complex{AbstractFloat}}, Dim::Integer)

    Physical properties for a homogenous isotropic acoustic medium with wavespeed (c) and density (ρ)

    Simulations in this medium produce scalar (1D) fields in Dim dimensions.

    ParticleCorrelations.SpecieType

    Specie

    Represents a set of particles which are all the same. The type of particle is given by Specie.particle and the volume fraction this specie occupies is given by Specie.volume_fraction.

    We can use Specie.numberofparticles to specify the number of particles, otherwise for an infinite Specie.numberofparticles = Inf.

    The minimum distance between any two particles will equal outer_radius(Specie) * Specie.separation_ratio.

    MultipleScattering.PlaneSourceType
    PlaneSource(medium::P, amplitude::SVector, direction::SVector)

    Is a struct type which describes a plane-wave source that drives/forces the whole system. It has three fields: a physical medium, an amplitude of the source, and the direction the propagate in direction.

    For any given angular frequency ω, the PlaneSource has the value $e^{i ω/c \mathbf v \cdot \mathbf x }$ at the point $\mathbf x$, where $c$ is the medium wavespeed and $\mathbf v$ is the direction.

    MultipleScattering.RegularSourceType
    RegularSource(medium::P, field::Function, coef::Function)

    Is a struct type which describes the source field that drives/forces the whole system. It is also known as an incident wave. It has three fields RegularSource.medium, RegularSource.field, and RegularSource.coef.

    The source field at the position 'x' and angular frequency 'ω' is given by

    x = [1.0,0.0]
     ω = 1.0
    -RegularSource.field(x,ω)

    The field RegularSource.coef regularbasisfunction(medium::Acoustic{T,2}, ω::T)

    Currently the physical medium can be Acoustics. Both Acoustic, PlaneSource, and RegularSource are all imported from the package MultipleScattering. In the future these will be moved to a new package WaveScatteringBase. Much of the code is dispatched based on the underlying symmetries of the problem

    The symmetry of the material and source

    The symmetry shared between the material shape and source are used to specialise the form of the wavemode, see Theoretical background.

    MultipleScattering.WithoutSymmetryType
    WithoutSymmetry

    A type used to describe materials and incident waves which share no common symmetry. This will lead to the most general regular wave expansion for the eignvectors.

    MultipleScattering.RadialSymmetryType
    RadialSymmetry

    A type used to describe materials and incident waves in that are both radially symmetric. That is, the material is a sphere, and the incident wave is radially symmetric around the center of this spherical material.

    Types of waves

    There are two main types used.

    EffectiveWaves.EffectivePlaneWaveModeType
    EffectivePlaneWaveMode{T<:AbstractFloat,Dim} <: AbstractWaveMode

    Is a struct that represents a mode of the average scattering coefficients for plane wave symmetry. That is, when using an incident plane wave and a plate or halfspace for the material geometry.

    This wave mode has frequency $\omega$ and has has the value $A e^{i k \mathbf v \cdot \mathbf x }$ at the point $\mathbf x$, where $A$ are the eigenvectors, $\mathbf v$ is the direction and $k$ is the effective wavenumber. We represent these quantities as

    • $\omega =$ EffectivePlaneWaveMode.ω
    • $k =$ EffectivePlaneWaveMode.wavenumber
    • $v =$ EffectivePlaneWaveMode.direction
    • $A =$ EffectivePlaneWaveMode.eigenvectors
    • $M =$ EffectivePlaneWaveMode.basis_order

    To recover the average scattering coefficients $F$ from a particle use:

    $F_{ns} = i^m A_{n s} e^{-i n θ}$

    where $n$ is multi-index for 3 dimensions and $s$ ranges from 1 to the number of species.

    In 2D, inconvieniently, an extra factor of $e^{i k \mathbf v \cdot \mathbf x}$ needs to be multiplied on the right of the above equation where θ is calculated from transmission_angle.

    source
    EffectiveWaves.EffectiveRegularWaveModeType
    EffectiveRegularWaveMode{T,P<:PhysicalMedium,S<:AbstractSymmetry} <: AbstractRegularWaveMode

    Is a struct that represents a mode of the average scattering coefficients $F$ in the form

    $F_{n s} (\mathbf r) = \sum_{n_1 p} A_{p n n_1 s} \mathrm v_{n_1}(k \mathbf r)$

    where $\mathbf r$ is a position vector in space, $k$ the wavenumber, $p$ is used to count the number of eigenvectors, $s$ the number of species, $n$ and $n_1$ are multi-indices, and $\mathrm v_{n_1}$ is a regular spherical wave of order $n_1$ which in 3D is given by

    $\mathrm v_{n_1}(\mathbf r) = \mathrm j_{\ell_1} (k r) \mathrm Y_{\ell_1 m_1}(\hat{\mathbf r})$

    and $\mathrm Y_{\ell_1 m_1}$ is a spherical harmonic, $n_1 = (\ell_1,m_1)$ where we always have that $\ell_1 \geq 0$ and $\ell_1 \geq |m_1|$ according to the conventions of spherical harmonics.

    To translate the mathematics to Julia code we use

    • $\omega =$ EffectiveRegularWaveMode.ω
    • $k =$ EffectiveRegularWaveMode.wavenumber
    • $A =$ EffectiveRegularWaveMode.eigenvectors
    • $n =$ EffectiveRegularWaveMode.basis_order
    • $n_1 =$ EffectiveRegularWaveMode.basis_field_order
    source

    Effective wavenumbers and wavemodes

    EffectiveWaves.wavenumbersFunction
    wavenumbers(ω, medium, specie; kws...)

    Returns all the possible effective wavenumbers with positive imaginary part when using a single type of particle called specie.

    source
    wavenumbers(ω, medium::PhysicalMedium, micro::Microstructure; kws...)

    Returns all the possible effective wavenumbers with positive imaginary part. This function requires significantly numerical optimisation and so can be slow.

    source
    EffectiveWaves.wavenumber_low_volumefractionFunction
    wavenumber_low_volumefraction(ω::T, medium::Acoustic{T,Dim}, micro::Microstructure{Dim}; basis_order::Int = 2)

    Explicit formula for one effective wavenumber based on a low particle volume fraction expansion.

    source

    Effective wavemodes and eignvectors

    EffectiveWaves.WaveModeFunction
    WaveMode(ω::T, wavenumber::Complex{T}, eigenvectors::Array{Complex{T}}, ::SetupSymmetry; kws...)

    Returns a concrete subtype of AbstractWaveMode depending on the SetupSymmetry. The returned type should have all the necessary fields to calculate scattered waves (currently not true for EffectivePlanarWaves).

    source

    Reflection coefficients

    EffectiveWaves.reflection_coefficientFunction

    Calculates the reflection coefficient from each wave in waves and then sums the results.

    source

    reflection_coefficient(PlaneSource, Acoustic[, Halfspace = Halfspace(-psource.direction)])

    calculates the reflection coefficient from a homogenious halfspace (assumed to direct incidence if not given), which is also the low frequency reflection from a particulate material when using the effective_medium.

    source
    reflection_coefficient(ω::T, wave_eff::EffectivePlaneWaveMode, psource::PlaneSource{T,2,1,Acoustic}, material::Material{Halfspace}; [x::T = zero(T)])

    The reflection coefficient in 2D for acoustics for just one EffectivePlaneWaveMode"

    source
    reflection_coefficient(ω::T, m_wave::MatchPlaneWaveMode,
    -    source::PlaneSource, material::Material{Halfspace{T,2}};

    Calculate the reflection coefficient from a matched wave. This requires using both the discrete part and effective wavemode of the matched wave.

    source

    Transmission

    EffectiveWaves.transmission_directionFunction
    transmission_direction(k_eff::Complex, incident_wavevector::AbstractArray, surface_normal::AbstractArray)

    Gives the effective direction direction where sum(direction .^ 2) = 1.0 and the components of k_eff .* direction and incident_wavevector which are orthogonal to the surface are the same. Note surface_normal is the outward pointing normal and the incident medium's wavenumber k = sqrt(sum(incident_wavevector .^2)). Below we deduce the result.

    Assume that dot(v,w) = conj(v[i])w[i] and surface_normal[i]*surface_normal[i] = 1. Let wnp be orthogonal to surface_normal

    wnp =  incident_wavevector -  dot(surface_normal,incident_wavevector) .* surface_normal

    Then we know that the effective transmission wavevector has to equal

    k_eff_vec = wnp + α .* surface_normal

    where α is determined so that

    sum(x^2 for x in wnp) + α^2  = sum(x^2 for x in k_eff_vec) = k_eff^2
    source
    EffectiveWaves.transmission_angleMethod
    transmission_angle(wavevector, surface_normal)

    Calculates the transmission angle for a wave propagting inside a material which has the outward normal surface_normal. The wave propagates in the direction of wavevector with a wavenumber given by k = sqrt(sum(wavevector .^2)), where k should have a positive imaginary part.

    source
    EffectiveWaves.transmission_angleMethod
    transmission_angle(wavevector::StaticVector{3}, surface_normal::StaticVector{3})

    Some care is needed when wavevector is a complex vector in 3 dimensions.

    The maths

    Let's define the normal projection vn:

    n = - surface_normal
    +RegularSource.field(x,ω)

    The field RegularSource.coef regularbasisfunction(medium::Acoustic{T,2}, ω::T)

    Currently the physical medium can be Acoustics. Both Acoustic, PlaneSource, and RegularSource are all imported from the package MultipleScattering. In the future these will be moved to a new package WaveScatteringBase. Much of the code is dispatched based on the underlying symmetries of the problem

    The symmetry of the material and source

    The symmetry shared between the material shape and source are used to specialise the form of the wavemode, see Theoretical background.

    MultipleScattering.WithoutSymmetryType
    WithoutSymmetry

    A type used to describe materials and incident waves which share no common symmetry. This will lead to the most general regular wave expansion for the eignvectors.

    MultipleScattering.RadialSymmetryType
    RadialSymmetry

    A type used to describe materials and incident waves in that are both radially symmetric. That is, the material is a sphere, and the incident wave is radially symmetric around the center of this spherical material.

    Types of waves

    There are two main types used.

    EffectiveWaves.EffectivePlaneWaveModeType
    EffectivePlaneWaveMode{T<:AbstractFloat,Dim} <: AbstractWaveMode

    Is a struct that represents a mode of the average scattering coefficients for plane wave symmetry. That is, when using an incident plane wave and a plate or halfspace for the material geometry.

    This wave mode has frequency $\omega$ and has has the value $A e^{i k \mathbf v \cdot \mathbf x }$ at the point $\mathbf x$, where $A$ are the eigenvectors, $\mathbf v$ is the direction and $k$ is the effective wavenumber. We represent these quantities as

    • $\omega =$ EffectivePlaneWaveMode.ω
    • $k =$ EffectivePlaneWaveMode.wavenumber
    • $v =$ EffectivePlaneWaveMode.direction
    • $A =$ EffectivePlaneWaveMode.eigenvectors
    • $M =$ EffectivePlaneWaveMode.basis_order

    To recover the average scattering coefficients $F$ from a particle use:

    $F_{ns} = i^m A_{n s} e^{-i n θ}$

    where $n$ is multi-index for 3 dimensions and $s$ ranges from 1 to the number of species.

    In 2D, inconvieniently, an extra factor of $e^{i k \mathbf v \cdot \mathbf x}$ needs to be multiplied on the right of the above equation where θ is calculated from transmission_angle.

    source
    EffectiveWaves.EffectiveRegularWaveModeType
    EffectiveRegularWaveMode{T,P<:PhysicalMedium,S<:AbstractSymmetry} <: AbstractRegularWaveMode

    Is a struct that represents a mode of the average scattering coefficients $F$ in the form

    $F_{n s} (\mathbf r) = \sum_{n_1 p} A_{p n n_1 s} \mathrm v_{n_1}(k \mathbf r)$

    where $\mathbf r$ is a position vector in space, $k$ the wavenumber, $p$ is used to count the number of eigenvectors, $s$ the number of species, $n$ and $n_1$ are multi-indices, and $\mathrm v_{n_1}$ is a regular spherical wave of order $n_1$ which in 3D is given by

    $\mathrm v_{n_1}(\mathbf r) = \mathrm j_{\ell_1} (k r) \mathrm Y_{\ell_1 m_1}(\hat{\mathbf r})$

    and $\mathrm Y_{\ell_1 m_1}$ is a spherical harmonic, $n_1 = (\ell_1,m_1)$ where we always have that $\ell_1 \geq 0$ and $\ell_1 \geq |m_1|$ according to the conventions of spherical harmonics.

    To translate the mathematics to Julia code we use

    • $\omega =$ EffectiveRegularWaveMode.ω
    • $k =$ EffectiveRegularWaveMode.wavenumber
    • $A =$ EffectiveRegularWaveMode.eigenvectors
    • $n =$ EffectiveRegularWaveMode.basis_order
    • $n_1 =$ EffectiveRegularWaveMode.basis_field_order
    source

    Effective wavenumbers and wavemodes

    EffectiveWaves.wavenumbersFunction
    wavenumbers(ω, medium, specie; kws...)

    Returns all the possible effective wavenumbers with positive imaginary part when using a single type of particle called specie.

    source
    wavenumbers(ω, medium::PhysicalMedium, micro::Microstructure; kws...)

    Returns all the possible effective wavenumbers with positive imaginary part. This function requires significantly numerical optimisation and so can be slow.

    source
    EffectiveWaves.wavenumber_low_volumefractionFunction
    wavenumber_low_volumefraction(ω::T, medium::Acoustic{T,Dim}, micro::Microstructure{Dim}; basis_order::Int = 2)

    Explicit formula for one effective wavenumber based on a low particle volume fraction expansion.

    source

    Effective wavemodes and eignvectors

    EffectiveWaves.WaveModeFunction
    WaveMode(ω::T, wavenumber::Complex{T}, eigenvectors::Array{Complex{T}}, ::SetupSymmetry; kws...)

    Returns a concrete subtype of AbstractWaveMode depending on the SetupSymmetry. The returned type should have all the necessary fields to calculate scattered waves (currently not true for EffectivePlanarWaves).

    source

    Reflection coefficients

    EffectiveWaves.reflection_coefficientFunction

    Calculates the reflection coefficient from each wave in waves and then sums the results.

    source

    reflection_coefficient(PlaneSource, Acoustic[, Halfspace = Halfspace(-psource.direction)])

    calculates the reflection coefficient from a homogenious halfspace (assumed to direct incidence if not given), which is also the low frequency reflection from a particulate material when using the effective_medium.

    source
    reflection_coefficient(ω::T, wave_eff::EffectivePlaneWaveMode, psource::PlaneSource{T,2,1,Acoustic}, material::Material{Halfspace}; [x::T = zero(T)])

    The reflection coefficient in 2D for acoustics for just one EffectivePlaneWaveMode"

    source
    reflection_coefficient(ω::T, m_wave::MatchPlaneWaveMode,
    +    source::PlaneSource, material::Material{Halfspace{T,2}};

    Calculate the reflection coefficient from a matched wave. This requires using both the discrete part and effective wavemode of the matched wave.

    source

    Transmission

    EffectiveWaves.transmission_directionFunction
    transmission_direction(k_eff::Complex, incident_wavevector::AbstractArray, surface_normal::AbstractArray)

    Gives the effective direction direction where sum(direction .^ 2) = 1.0 and the components of k_eff .* direction and incident_wavevector which are orthogonal to the surface are the same. Note surface_normal is the outward pointing normal and the incident medium's wavenumber k = sqrt(sum(incident_wavevector .^2)). Below we deduce the result.

    Assume that dot(v,w) = conj(v[i])w[i] and surface_normal[i]*surface_normal[i] = 1. Let wnp be orthogonal to surface_normal

    wnp =  incident_wavevector -  dot(surface_normal,incident_wavevector) .* surface_normal

    Then we know that the effective transmission wavevector has to equal

    k_eff_vec = wnp + α .* surface_normal

    where α is determined so that

    sum(x^2 for x in wnp) + α^2  = sum(x^2 for x in k_eff_vec) = k_eff^2
    source
    EffectiveWaves.transmission_angleMethod
    transmission_angle(wavevector, surface_normal)

    Calculates the transmission angle for a wave propagting inside a material which has the outward normal surface_normal. The wave propagates in the direction of wavevector with a wavenumber given by k = sqrt(sum(wavevector .^2)), where k should have a positive imaginary part.

    source
    EffectiveWaves.transmission_angleMethod
    transmission_angle(wavevector::StaticVector{3}, surface_normal::StaticVector{3})

    Some care is needed when wavevector is a complex vector in 3 dimensions.

    The maths

    Let's define the normal projection vn:

    n = - surface_normal
     vn = dot(n,wavevector) .* n

    remembering that in Julia, and mathematics, dot(v,w) = sum(conj(v[i])*w[i] for i in eachindex(v)).

    We now define the orthogonal component vo and its direction no:

    vo = wavevector - vn
     no = vo / sqrt(sum(vo.^2))

    Note this assumes that vo is a real vector, which it should be due to symmetry.

    To determine the transmission angle θT we calculate the wavenumber

    k = ± sqrt(sum(wavevector .^2))

    where we choose the sign in ± such that imag(k) >= 0.

    From the above we can write the wavevector in the form

    wavevector = k .* (n .* cos(θ) + no .* sin(θ))

    which implies that

    k * cos(θ) = dot(conj(n), wavevector)
    -k * sin(θ) = dot(conj(no),wavevector) = dot(conj(no),vo) = sqrt(sum(vo.^2))

    From these two we can robustly calculate θT as

    θT = atan(sqrt(sum(vo.^2)),dot(n,wavevector))
    source

    Statistics

    All types

    EffectiveWaves.MicrostructureMethod
    Microstructure(medium::PhysicalMedium, sps::Vector{Specie})

    When no pair-correlation is specified for the species, the microstructure will use the default that assumes that particles can not overlap, but, otherwise, their positions are uncorrelated. This is often called "Hole Correction"

    source
    EffectiveWaves.ParticulateMicrostructureType
    ParticulateMicrostructure

    Represents a microstructure filled with multiply species of particles. ParticulateMicrostructure.paircorrelations specifies the pair correlation between each of the species. That is, how the particles are distributed on average.

    source
    EffectiveWaves.EffectivePlaneWaveModeMethod
    EffectivePlaneWaveMode(ω, wavenumber::Complex, direction::Array{Complex}, eigenvectors::Array{Complex})

    A convienient way to form the type EffectivePlaneWaveMode.

    source
    EffectiveWaves.ScatteringCoefficientsFieldMethod
    ScatteringCoefficientsField(ω::T, medium::P, material::Material, coefficient_field::Function; symmetry::AbstractSymmetry{Dim} = WithoutSymmetry{Dim})

    A type to hold the results of methods which produce a function of the scattering field

    source
    +k * sin(θ) = dot(conj(no),wavevector) = dot(conj(no),vo) = sqrt(sum(vo.^2))

    From these two we can robustly calculate θT as

    θT = atan(sqrt(sum(vo.^2)),dot(n,wavevector))
    source

    Statistics

    All types

    EffectiveWaves.MicrostructureType
    Microstructure{Dim}

    Every Material has a shape and has a microstructure. Currently ParticulateMicrostructure is the only example microstructure.

    source
    EffectiveWaves.MicrostructureMethod
    Microstructure(medium::PhysicalMedium, sps::Vector{Specie})

    When no pair-correlation is specified for the species, the microstructure will use the default that assumes that particles can not overlap, but, otherwise, their positions are uncorrelated. This is often called "Hole Correction"

    source
    EffectiveWaves.ParticulateMicrostructureType
    ParticulateMicrostructure

    Represents a microstructure filled with multiply species of particles. ParticulateMicrostructure.paircorrelations specifies the pair correlation between each of the species. That is, how the particles are distributed on average.

    source
    EffectiveWaves.EffectivePlaneWaveModeMethod
    EffectivePlaneWaveMode(ω, wavenumber::Complex, direction::Array{Complex}, eigenvectors::Array{Complex})

    A convienient way to form the type EffectivePlaneWaveMode.

    source
    EffectiveWaves.ScatteringCoefficientsFieldMethod
    ScatteringCoefficientsField(ω::T, medium::P, material::Material, coefficient_field::Function; symmetry::AbstractSymmetry{Dim} = WithoutSymmetry{Dim})

    A type to hold the results of methods which produce a function of the scattering field

    source
    diff --git a/dev/manual/background/index.html b/dev/manual/background/index.html index 650ecd13..db61a020 100644 --- a/dev/manual/background/index.html +++ b/dev/manual/background/index.html @@ -1,2 +1,2 @@ -Theoretical background · EffectiveWaves.jl

    Theoretical background

    Assume that $u(x)$ represents some field governed by a Helmholtz equation, such as a pressure field for acoustics. If $u(x)$ is the transmitted field through a material filled with randomly placed particles, or inhomogeneities, then $u(x)$ will be depend on the exact positions and types of particles. This makes $u(x)$ difficult to calculate and to experimentally measure exactly. For these reasons we focus on calculating the ensemble average $\langle u(x)\rangle$ over all possible configurations of the inhomogeneities.

    This ensemble average can be written in a series of the form

    \[\langle u(x) \rangle = \sum_p \phi_p(x)\]

    where each $\phi_p$ satisfies a Helmholtz equation $\nabla^2 \phi_p(x) + k_p \phi_p(x) = 0$. The $k_p$ are the effective wavenumbers, and the $\phi_p$ depend on the geometry of the problem. We refer to each $\phi_p$ as a wavemode. For details see Gower & Kristensson 2020.

    An important consequence of the theory, is that the wavenumbers $k_p$ depend only on the statistics and microstructure of the material. The $k_p$ do not depend on the shape of the material or the specific form of $\phi_p$. We give an example of this in Equivalent symmetries.

    Plane waves

    The simplest case is when using an incident plane wave and material in the shape of a plate or halfspace. This combination is an example of plannar symmetry (see PlanarSymmetry). In this case, $\phi_p$ has to be a plane wave. We use this case to calculate the $k_p$, as the wavenumbers are the same for every symmetry.

    In more detail, the package actually solves for the average scattering coefficient $\langle f_n\rangle (\mathbf r_1)$, of order $n$ and for a particle centred at $\mathbf r_1$, which is then used to calculate the average field $\langle u(x) \rangle$.

    For planar symmetry, the $\langle f_n\rangle$ also have to be plane waves, which allows us to represent

    \[\langle f_n\rangle (\mathbf r_1) = \sum_p F_{p,n} \mathrm e^{i \mathbf k_p \cdot \mathbf r_1}\]

    We refer to the $F_{p,n}$ as the plane wave eigenvector of the wavenumber $k_p = \|\mathbf k_p \|$.

    +Theoretical background · EffectiveWaves.jl

    Theoretical background

    Assume that $u(x)$ represents some field governed by a Helmholtz equation, such as a pressure field for acoustics. If $u(x)$ is the transmitted field through a material filled with randomly placed particles, or inhomogeneities, then $u(x)$ will be depend on the exact positions and types of particles. This makes $u(x)$ difficult to calculate and to experimentally measure exactly. For these reasons we focus on calculating the ensemble average $\langle u(x)\rangle$ over all possible configurations of the inhomogeneities.

    This ensemble average can be written in a series of the form

    \[\langle u(x) \rangle = \sum_p \phi_p(x)\]

    where each $\phi_p$ satisfies a Helmholtz equation $\nabla^2 \phi_p(x) + k_p \phi_p(x) = 0$. The $k_p$ are the effective wavenumbers, and the $\phi_p$ depend on the geometry of the problem. We refer to each $\phi_p$ as a wavemode. For details see Gower & Kristensson 2020.

    An important consequence of the theory, is that the wavenumbers $k_p$ depend only on the statistics and microstructure of the material. The $k_p$ do not depend on the shape of the material or the specific form of $\phi_p$. We give an example of this in Equivalent symmetries.

    Plane waves

    The simplest case is when using an incident plane wave and material in the shape of a plate or halfspace. This combination is an example of plannar symmetry (see PlanarSymmetry). In this case, $\phi_p$ has to be a plane wave. We use this case to calculate the $k_p$, as the wavenumbers are the same for every symmetry.

    In more detail, the package actually solves for the average scattering coefficient $\langle f_n\rangle (\mathbf r_1)$, of order $n$ and for a particle centred at $\mathbf r_1$, which is then used to calculate the average field $\langle u(x) \rangle$.

    For planar symmetry, the $\langle f_n\rangle$ also have to be plane waves, which allows us to represent

    \[\langle f_n\rangle (\mathbf r_1) = \sum_p F_{p,n} \mathrm e^{i \mathbf k_p \cdot \mathbf r_1}\]

    We refer to the $F_{p,n}$ as the plane wave eigenvector of the wavenumber $k_p = \|\mathbf k_p \|$.

    diff --git a/dev/manual/introduction/index.html b/dev/manual/introduction/index.html index fa2344c8..978aeb38 100644 --- a/dev/manual/introduction/index.html +++ b/dev/manual/introduction/index.html @@ -30,4 +30,4 @@ p1 = scatter(ωs, speeds, lab = "", ylabel = "wave speed (m/s)", xlabel = "frequency"); p2 = scatter(ωs, attenuations, lab = "", ylabel = "attenuation (1/m)", xlabel = "frequency"); -plot(p1,p2, layout = (2,1))

    ../speed_and_atten.png

    +plot(p1,p2, layout = (2,1))

    ../speed_and_atten.png

    diff --git a/dev/manual/pair-correlation/index.html b/dev/manual/pair-correlation/index.html index 5cf6cfa0..67308381 100644 --- a/dev/manual/pair-correlation/index.html +++ b/dev/manual/pair-correlation/index.html @@ -69,4 +69,4 @@ RTeff = reflection_transmission_coefficients(wavemodes, source, material) -abs.(RTeff)

    References

    [1] Kong, Jin Au, Leung Tsang, Kung-Hau Ding, and Chi On Ao. Scattering of electromagnetic waves: numerical simulations. John Wiley & Sons, 2004.

    [2] Gerhard Kristensson. "The Percus-Yevick approximation". github.com/JuliaWaveScattering/EffectiveWaves.jl (2022).

    [3] Gower, Artur L., and Gerhard Kristensson. "Effective waves for random three-dimensional particulate materials." New Journal of Physics 23.6 (2021): 063083.

    +abs.(RTeff)

    References

    [1] Kong, Jin Au, Leung Tsang, Kung-Hau Ding, and Chi On Ao. Scattering of electromagnetic waves: numerical simulations. John Wiley & Sons, 2004.

    [2] Gerhard Kristensson. "The Percus-Yevick approximation". github.com/JuliaWaveScattering/EffectiveWaves.jl (2022).

    [3] Gower, Artur L., and Gerhard Kristensson. "Effective waves for random three-dimensional particulate materials." New Journal of Physics 23.6 (2021): 063083.

    diff --git a/dev/manual/reflection/index.html b/dev/manual/reflection/index.html index 8f754abd..3de656a2 100644 --- a/dev/manual/reflection/index.html +++ b/dev/manual/reflection/index.html @@ -121,4 +121,4 @@ # Note that summing the reflection and transmission from the homogeneous low frequency medium gives 1 sum(abs.([Ramp,Tamp]).^2) ≈ 1.0 -sum(abs.(RTeff).^2)

    Formulas from Gower & Kristensson 2020.

    +sum(abs.(RTeff).^2)

    Formulas from Gower & Kristensson 2020.

    diff --git a/dev/manual/sphere/index.html b/dev/manual/sphere/index.html index 868a3918..df3cbef1 100644 --- a/dev/manual/sphere/index.html +++ b/dev/manual/sphere/index.html @@ -248,4 +248,4 @@ u∞_discrete = (1/k) * Ys[1] * scattering_coefficients_discrete[1] * exp(-(pi*im/2)) abs(u∞ - u∞_discrete) / abs(u∞) < 1e-3 -abs(u∞2 - u∞_discrete) / abs(u∞) < 3e-4 +abs(u∞2 - u∞_discrete) / abs(u∞) < 3e-4 diff --git a/dev/manual/wavenumbers/index.html b/dev/manual/wavenumbers/index.html index d8779244..007762c2 100644 --- a/dev/manual/wavenumbers/index.html +++ b/dev/manual/wavenumbers/index.html @@ -83,4 +83,4 @@ scatter(kps, xlab = "Im kp", ylab = "Re kp", lab = "" - , title = "Effective wavenumbers")

    multiple-wavenumbers.png

    + , title = "Effective wavenumbers")

    multiple-wavenumbers.png

    diff --git a/dev/search/index.html b/dev/search/index.html index b7237680..681ef7d1 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · EffectiveWaves.jl

    Loading search...

      +Search · EffectiveWaves.jl

      Loading search...

        diff --git a/dev/theory/README/index.html b/dev/theory/README/index.html index a58824e7..3611a78a 100644 --- a/dev/theory/README/index.html +++ b/dev/theory/README/index.html @@ -1,2 +1,2 @@ -Theory · EffectiveWaves.jl

        Theory

        Below are paper and notes that explain the theory behind this package.

        Waves in multi-species

        A summary on the equations to calculate effective wavenumbers in 2D and 3D acoustics in medium filled with many different types of randomly placed particles. These notes assume only whole-correction for the pair-correlation.

        Low frequency limit for multi-species

        These notes deduce the effective properties and reflection coefficient for a plane wave in the limit of low frequency.

        Percus-Yevick hard spheres

        These notes show how to efficiently calculate the Percus-Yevick pair-correlation for 2D hard spheres. That is, sphere which do not attract of repel each other.

        +Theory · EffectiveWaves.jl

        Theory

        Below are paper and notes that explain the theory behind this package.

        Waves in multi-species

        A summary on the equations to calculate effective wavenumbers in 2D and 3D acoustics in medium filled with many different types of randomly placed particles. These notes assume only whole-correction for the pair-correlation.

        Low frequency limit for multi-species

        These notes deduce the effective properties and reflection coefficient for a plane wave in the limit of low frequency.

        Percus-Yevick hard spheres

        These notes show how to efficiently calculate the Percus-Yevick pair-correlation for 2D hard spheres. That is, sphere which do not attract of repel each other.