Transmission-reflection coefficients#

Fluid-solid interface#

  • Fluid to solid: arim.ut.fluid_solid()

  • Solid to fluid: arim.ut.solid_l_fluid() and arim.ut.solid_t_fluid()

References: [KK] and [Schmerr].

Example:

  1"""
  2Compute and plot the transmission and reflection coefficients.
  3
  4"""
  5
  6import warnings
  7
  8import matplotlib.pyplot as plt
  9import numpy as np
 10
 11from arim.model import snell_angles, solid_l_fluid
 12
 13# %% Parameters
 14
 15SAVEFIG = False
 16
 17# water:
 18c_fluid = 1480.0
 19rho_fluid = 1000.0
 20
 21# aluminium :
 22c_l = 6320.0
 23c_t = 3130.0
 24rho_solid = 2700.0
 25
 26# %% Computation of reflection and transmission coefficients
 27
 28# Remark: by using complex angles, complex reflection and transmission coefficients
 29# are computed.
 30alpha_l = np.asarray(np.linspace(0, np.pi / 2, 50000), dtype=float)
 31
 32alpha_fluid = snell_angles(alpha_l, c_l, c_fluid)
 33alpha_t = snell_angles(alpha_l, c_l, c_t)
 34
 35reflection_l, reflection_t, transmission = solid_l_fluid(
 36    alpha_l, rho_fluid, rho_solid, c_fluid, c_l, c_t, alpha_fluid, alpha_t
 37)
 38
 39alpha_fluid_deg = np.rad2deg(alpha_fluid.real)
 40alpha_l_deg = np.rad2deg(alpha_l.real)
 41alpha_t_deg = np.rad2deg(alpha_t.real)
 42
 43phase = lambda x: np.angle(x, deg=True)
 44
 45# %% Plot reflection and transmission coefficients (alpha_fluid axis)
 46
 47fig, axes = plt.subplots(nrows=2, sharex=True)
 48ax = axes[0]
 49ax.plot(alpha_l_deg, np.abs(transmission), label="transmission")
 50ax.plot(alpha_l_deg, np.abs(reflection_l), label="reflection L")
 51ax.plot(alpha_l_deg, np.abs(reflection_t), label="reflection T")
 52ax.set_title("Tranmission and reflection coefficients from solid L to liquid")
 53ax.set_ylabel("absolute value")
 54ax.legend(loc="best")
 55
 56ax = axes[1]
 57ax.plot(alpha_l_deg, phase(transmission), label="transmission", linewidth=2)
 58ax.plot(alpha_l_deg, phase(reflection_l), label="reflection L")
 59ax.plot(alpha_l_deg, phase(reflection_t), label="reflection T")
 60
 61ax.set_ylabel("phase (deg)")
 62ax.set_xlabel("angle of the incident L wave in solid (deg)")
 63
 64if SAVEFIG:
 65    fig.savefig("solid_l_to_liquid_alpha_fluid")
 66
 67# %% Computation of the repartition of energy
 68
 69# incident pressure (no effect because of normalisation, we keep it for clarity of the formulas)
 70pres_i = 1.0
 71
 72# cross section areas:
 73area_fluid = np.cos(alpha_fluid).real
 74area_l = np.cos(alpha_l).real
 75area_t = np.cos(alpha_t).real
 76
 77# Compute the energy incoming and outcoming: the principle of conservation of energy must be respected.
 78# Reference: Schmerr, §6.3.2
 79
 80# Incoming energy
 81inc_energy = 0.5 * pres_i**2 / (rho_solid * c_l) * area_l
 82
 83# Outgoing energy
 84energy_trans = (
 85    0.5 * (np.abs(transmission) * pres_i) ** 2 / (rho_fluid * c_fluid) * area_fluid
 86)
 87energy_refl_l = 0.5 * (np.abs(reflection_l) * pres_i) ** 2 / (rho_solid * c_l) * area_l
 88energy_refl_t = 0.5 * (np.abs(reflection_t) * pres_i) ** 2 / (rho_solid * c_t) * area_t
 89out_energy = energy_trans + energy_refl_l + energy_refl_t
 90
 91ratio_trans = energy_trans / inc_energy
 92ratio_refl_l = energy_refl_l / inc_energy
 93ratio_refl_t = energy_refl_t / inc_energy
 94
 95# Verify the conservation of energy:
 96if not (np.allclose(ratio_trans + ratio_refl_l + ratio_refl_t, 1.0)):
 97    warnings.warn("The conservation of energy is not respected.")
 98
 99# %% Plot energy
100
101fig, ax = plt.subplots()
102ax.plot(alpha_l_deg, ratio_trans, label="transmission")
103ax.plot(alpha_l_deg, ratio_refl_l, label="reflection L")
104ax.plot(alpha_l_deg, ratio_refl_t, label="reflection T")
105ax.plot(alpha_l_deg, ratio_trans + ratio_refl_l + ratio_refl_t, "--", label="total")
106ax.set_title("Repartition of energy: solid to liquid interface")
107ax.set_xlabel("angle of the incident wave in liquid (deg)")
108ax.set_ylabel("normalised energy (1)")
109ax.set_xlabel("angle of the incident L wave in solid (deg)")
110ax.set_ylim([0, 1.05])
111ax.legend(loc="best")
112if SAVEFIG:
113    fig.savefig("solid_l_to_liquid_energy")
  1"""
  2Compute and plot the transmission and reflection coefficients.
  3
  4Case: an incident longitudinal in the fluid hits the wall of an solid part.
  5"""
  6
  7import warnings
  8
  9import matplotlib.pyplot as plt
 10import numpy as np
 11
 12from arim.model import fluid_solid, snell_angles
 13
 14# %% Parameters
 15
 16# Transmission coefficients above the critical angles corresponds to
 17# inhomogeneous surface waves instead of bulk waves
 18# Set to True to force the coefficients to zero.
 19NULL_TRANSMISSION_ABOVE_CRIT_ANGLES = False
 20SAVEFIG = False
 21
 22# water:
 23c_fluid = 1480.0
 24rho_fluid = 1000.0
 25
 26# aluminium :
 27c_l = 6320.0
 28c_t = 3130.0
 29rho_solid = 2700.0
 30
 31# %% Computation of reflection and transmission coefficients
 32
 33# Critical angles
 34critical_l = np.arcsin(c_fluid / c_l)
 35critical_t = np.arcsin(c_fluid / c_t)
 36print(f"Critical angle L: {np.rad2deg(critical_l):.3f}°")
 37print(f"Critical angle T: {np.rad2deg(critical_t):.3f}°")
 38
 39# Remark: by using complex angles, complex reflection and transmission coefficients
 40# are computed.
 41alpha_fluid = np.asarray(np.linspace(0, np.pi / 2, 50000), dtype=complex)
 42
 43alpha_l = snell_angles(alpha_fluid, c_fluid, c_l)
 44alpha_t = snell_angles(alpha_fluid, c_fluid, c_t)
 45
 46reflection, transmission_l, transmission_t = fluid_solid(
 47    alpha_fluid, rho_fluid, rho_solid, c_fluid, c_l, c_t, alpha_l, alpha_t
 48)
 49
 50alpha_fluid_deg = np.rad2deg(alpha_fluid.real)
 51alpha_l_deg = np.rad2deg(alpha_l.real)
 52alpha_t_deg = np.rad2deg(alpha_t.real)
 53
 54if NULL_TRANSMISSION_ABOVE_CRIT_ANGLES:
 55    transmission_l[alpha_fluid > critical_l] = 0
 56    transmission_t[alpha_fluid > critical_t] = 0
 57
 58# %% Plot reflection and transmission coefficients (alpha_fluid axis)
 59
 60fig, axes = plt.subplots(nrows=2, sharex=True)
 61ax = axes[0]
 62ax.plot(alpha_fluid_deg, np.abs(reflection), label="reflection")
 63ax.plot(alpha_fluid_deg, np.abs(transmission_l), label="transmission L")
 64ax.plot(alpha_fluid_deg, np.abs(transmission_t), label="transmission T")
 65ax.set_title("Tranmission and reflection coefficients from liquid to solid")
 66ax.axvline(
 67    x=np.rad2deg(critical_l), color="k", linestyle="--", label="critical angle L"
 68)
 69ax.axvline(x=np.rad2deg(critical_t), color="k", linestyle="-", label="critical angle T")
 70ax.set_ylabel("absolute value")
 71ax.legend(loc="best")
 72
 73ax = axes[1]
 74ax.plot(alpha_fluid_deg, np.angle(reflection, True), label="reflection")
 75ax.plot(alpha_fluid_deg, np.angle(transmission_l, True), label="transmission L")
 76ax.plot(alpha_fluid_deg, np.angle(transmission_t, True), label="transmission T")
 77ax.axvline(
 78    x=np.rad2deg(critical_l), color="k", linestyle="--", label="critical angle L"
 79)
 80ax.axvline(x=np.rad2deg(critical_t), color="k", linestyle="-", label="critical angle T")
 81
 82ax.set_ylabel("phase (deg)")
 83ax.set_xlabel("angle of the incident wave in liquid (deg)")
 84
 85if SAVEFIG:
 86    fig.savefig("liquid_to_solid_alpha_fluid")
 87
 88# %%Plot reflection and transmission coefficients (alpha_t axis)
 89
 90fig, axes = plt.subplots(nrows=2, sharex=True)
 91ax = axes[0]
 92ax.plot(alpha_t_deg, np.abs(reflection), label="reflection")
 93ax.plot(alpha_t_deg, np.abs(transmission_l), label="transmission L")
 94ax.plot(alpha_t_deg, np.abs(transmission_t), label="transmission T")
 95ax.set_title("Tranmission and reflection coefficients from liquid to solid")
 96ax.set_ylabel("absolute value")
 97ax.legend(loc="best")
 98
 99ax = axes[1]
100ax.plot(alpha_t_deg, np.angle(reflection, True), label="reflection")
101ax.plot(alpha_t_deg, np.angle(transmission_l, True), label="transmission L")
102ax.plot(alpha_t_deg, np.angle(transmission_t, True), label="transmission T")
103
104ax.set_ylabel("phase (deg)")
105ax.set_xlabel("angle of the transmitted wave T (deg)")
106
107if SAVEFIG:
108    fig.savefig("liquid_to_solid_alpha_t")
109
110# %%Plot reflection and transmission coefficients (alpha_l axis)
111
112fig, axes = plt.subplots(nrows=2, sharex=True)
113ax = axes[0]
114ax.plot(alpha_l_deg, np.abs(reflection), label="reflection")
115ax.plot(alpha_l_deg, np.abs(transmission_l), label="transmission L")
116ax.plot(alpha_l_deg, np.abs(transmission_t), label="transmission T")
117ax.set_title("Tranmission and reflection coefficients from liquid to solid")
118ax.set_ylabel("absolute value")
119ax.legend(loc="best")
120
121ax = axes[1]
122ax.plot(alpha_l_deg, np.angle(reflection, True), label="reflection")
123ax.plot(alpha_l_deg, np.angle(transmission_l, True), label="transmission L")
124ax.plot(alpha_l_deg, np.angle(transmission_t, True), label="transmission T")
125
126ax.set_ylabel("phase (deg)")
127ax.set_xlabel("angle of the transmitted wave L (deg)")
128
129if SAVEFIG:
130    fig.savefig("liquid_to_solid_alpha_l")
131
132# %% Computation of the repartition of energy
133
134# incident pressure (no effect because of normalisation, we keep it for clarity of the formulas)
135pres_i = 10000.0
136
137# cross section areas:
138area_r = np.cos(alpha_fluid).real
139area_l = np.cos(alpha_l).real
140area_t = np.cos(alpha_t).real
141
142# Compute the energy incoming and outcoming: the principle of conservation of
143# energy must be respected.
144# Reference: Schmerr, §6.3.2
145# See also Schmerr, §6.2.5 for the considerations on the inhomogeneous waves
146# which propagate after the critical angle.
147
148# Incoming energy
149inc_energy = 0.5 * pres_i**2 / (rho_fluid * c_fluid) * area_r
150
151# Outgoing energy
152energy_refl = 0.5 * (np.abs(reflection) * pres_i) ** 2 / (rho_fluid * c_fluid) * area_r
153energy_l = 0.5 * (np.abs(transmission_l) * pres_i) ** 2 / (rho_solid * c_l) * area_l
154energy_t = 0.5 * (np.abs(transmission_t) * pres_i) ** 2 / (rho_solid * c_t) * area_t
155out_energy = energy_refl + energy_l + energy_t
156
157ratio_refl = energy_refl / inc_energy
158ratio_l = energy_l / inc_energy
159ratio_t = energy_t / inc_energy
160
161# Verify the conservation of energy:
162if not (np.allclose(ratio_refl + ratio_l + ratio_t, 1.0)):
163    warnings.warn("The conservation of energy is not respected.")
164
165# %% Plot energy
166
167fig, ax = plt.subplots()
168ax.plot(alpha_fluid_deg, ratio_refl, label="reflection")
169ax.plot(alpha_fluid_deg, ratio_l, label="transmission L")
170ax.plot(alpha_fluid_deg, ratio_t, label="transmission T")
171ax.plot(alpha_fluid_deg, ratio_refl + ratio_l + ratio_t, "--", label="total")
172ax.axvline(
173    x=np.rad2deg(critical_l), color="k", linestyle="--", label="critical angle L"
174)
175ax.axvline(x=np.rad2deg(critical_t), color="k", linestyle="-", label="critical angle T")
176ax.set_title("Repartition of energy of the bulk waves: liquid to solid interface")
177ax.set_xlabel("angle of the incident wave in liquid (deg)")
178ax.set_ylabel("normalised energy (1)")
179# ylim([0, 1.05])
180ax.legend(loc="best")
181if SAVEFIG:
182    fig.savefig("liquid_to_solid_energy")

See also

Full reference: arim.model, arim.ut