FluidScatteringPlot#

Examples using this class are:

Acoustofluidics 2022: Minimal Example Plotting Scattering Fields

Acoustofluidics 2022: Minimal Example Plotting Scattering Fields

Acoustofluidics 2022: Minimal Example Plotting Scattering Fields
Acoustofluidics 2022: Plotting the Scattering Field

Acoustofluidics 2022: Plotting the Scattering Field

Acoustofluidics 2022: Plotting the Scattering Field
Frontiers: Air Bubble in Water

Frontiers: Air Bubble in Water

Frontiers: Air Bubble in Water
Frontiers: Copper Particle in Viscous Oil

Frontiers: Copper Particle in Viscous Oil

Frontiers: Copper Particle in Viscous Oil
Pressure Plots for different theories

Pressure Plots for different theories

Pressure Plots for different theories
Pressure Plot

Pressure Plot

Pressure Plot
Fluid: Acoustic velocity plots with arrows

Fluid: Acoustic velocity plots with arrows

Fluid: Acoustic velocity plots with arrows
class osaft.plotting.scattering.fluid_plots.FluidScatteringPlot(sol, r_max, resolution=100, n_quiver_points=21, cmap='winter', div_cmap='coolwarm')[source]#

Bases: BaseScatteringPlots

Class for plotting scattering field of the fluid

Plots the acoustic field in the fluid around the scatterer using Matplotlib tricontourf or tripcolor plotting methods.

Parameters:
  • sol (BaseScattering) – solution to be plotted

  • r_max (float) – radial limit of plot range

  • resolution (int | tuple[int, int], optional) – if tuple (radial resolution, tangential resolution)

    Default: 100

  • n_quiver_points (int, optional) – anchor points along z for quiver

    Default: 21

  • cmap (str, optional) – color map

    Default: 'winter'

  • div_cmap (str, optional) – diverging color map

    Default: 'coolwarm'

Public Data Attributes:

cmap

Colormap for plotting

div_cmap

Diverging Colormap for plotting

Inherited from BaseScatteringPlots

data

Public Methods:

plot_velocity_potential([inst, phase, ...])

Tricontourf plot for acoustic velocity potential

plot_pressure([inst, phase, symmetric, ...])

Tricontourf plot for acoustic pressure

plot_velocity([inst, phase, mode, ...])

Tricontourf plot for acoustic velocity field of the fluid

animate_pressure([frames, interval, mode, ...])

Tricontourf animation for acoustic pressure of the fluid

animate_velocity_potential([frames, ...])

Tricontourf animation for acoustic velocity potential of the fluid

animate_velocity([frames, interval, mode, ...])

Tricontourf animation for acoustic velocity field of the fluid

plot_pressure_evolution([inst, mode, ...])

Tricontourf for acoustic pressure evolution of the fluid

plot_velocity_potential_evolution([inst, ...])

Tricontourf for acoustic velocity potential evolution of the fluid

plot_velocity_evolution([mode, scattered, ...])

Tricontourf for acoustic velocity field evolution of the fluid


animate_pressure(frames=64, interval=100.0, mode=None, scattered=True, incident=True, symmetric=True, tripcolor=False, ax=None, **kwargs)[source]#

Tricontourf animation for acoustic pressure of the fluid

Animates the pressure of the first-order acoustic velocity field of the fluid over one period using Matplotlib’s tricontourf or tripcolor if tripcolor = True

Parameters:
  • frames (int, optional) – number of frames for the animation

    Default: 64

  • interval (float, optional) – interval between frames in ms

    Default: 100.0

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (None | plt.Axes, optional) – if ax is passed, plot will be drawn on ax

    Default: None

  • kwargs – passed through to tricontourf()

Return type:

FuncAnimation

animate_velocity(frames=64, interval=100.0, mode=None, scattered=True, incident=True, symmetric=True, quiver_color=None, tripcolor=False, ax=None, **kwargs)[source]#

Tricontourf animation for acoustic velocity field of the fluid

Animates the velocity amplitude of the first-order acoustic velocity field of the fluid over one period using Matplotlib’s tricontourf or tripcolor if tripcolor = True

Parameters:
  • frames (int, optional) – number of frames for the animation

    Default: 64

  • interval (float, optional) – interval between frames in ms

    Default: 100.0

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • quiver_color (None | str, optional) – if not None, quiver plot

    Default: None

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (None | plt.Axes, optional) – if ax is passed, plot will be drawn on ax

    Default: None

  • kwargs – passed through to tricontourf()

Return type:

FuncAnimation

animate_velocity_potential(frames=64, interval=100.0, mode=None, scattered=True, incident=True, symmetric=True, tripcolor=False, ax=None, **kwargs)[source]#

Tricontourf animation for acoustic velocity potential of the fluid

Animates the velocity potential of the first-order acoustic velocity field of the fluid over one period using Matplotlib’s tricontourf or tripcolor if tripcolor = True

Parameters:
  • frames (int, optional) – number of frames for the animation

    Default: 64

  • interval (float, optional) – interval between frames in ms

    Default: 100.0

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (None | plt.Axes, optional) – if ax is passed, plot will be drawn on ax

    Default: None

  • kwargs – passed through to tricontourf()

Return type:

FuncAnimation

plot_pressure(inst=True, phase=0, symmetric=True, mode=None, scattered=True, incident=True, tripcolor=False, ax=None, **kwargs)[source]#

Tricontourf plot for acoustic pressure

Plots the velocity amplitude of the first-order acoustic velocity field of the fluid using Matplotlib’s tricontourf or tripcolor if tripcolor = True

Parameters:
  • inst (bool, optional) – if True instantaneous amplitude is plotted

    Default: True

  • phase (float, optional) – phase \([0, 2\pi]\)

    Default: 0

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (None | plt.Axes, optional) – if ax is passed, plot will be drawn on ax

    Default: None

  • kwargs – passed through to tricontourf()

Return type:

tuple[plt.Figure, plt.Axes]

plot_pressure_evolution(inst=True, mode=None, scattered=True, incident=True, symmetric=True, tripcolor=False, layout=(3, 3), **kwargs)[source]#

Tricontourf for acoustic pressure evolution of the fluid

Plots the pressure amplitude of the first-order acoustic pressure field of the fluid over one period at different phases using Matplotlib’s tricontourf or tripcolor if tripcolor = True.

The first phase value is always \(0\pi\) and the last one \(2\pi\). The total number of plots and, hence, also the steps between the different phase values is the defined by the product of the layout tuple.

Parameters:
  • inst (bool, optional) – if True instantaneous amplitude is plotted

    Default: True

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • layout (tuple[int, int], optional) – number of rows and columns for plotting

    Default: (3, 3)

  • kwargs – passed through to the parent subplots command

Return type:

tuple[plt.Figure, plt.Axes]

plot_velocity(inst=True, phase=0, mode=None, scattered=True, incident=True, symmetric=True, quiver_color=None, tripcolor=False, ax=None, **kwargs)[source]#

Tricontourf plot for acoustic velocity field of the fluid

Plots the velocity amplitude of the first-order acoustic velocity field of the fluid using Matplotlib’s tricontourf or tripcolor if tripcolor = True

Parameters:
  • inst (bool, optional) – if True instantaneous amplitude is plotted

    Default: True

  • phase (float, optional) – phase [0, 2 * pi]

    Default: 0

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (None | plt.Axes, optional) – if ax is passed, plot will be drawn on ax

    Default: None

  • kwargs – passed through to tricontourf()

  • quiver_color (None | str, optional) –

    Default: None

Return type:

tuple[plt.Figure, plt.Axes]

plot_velocity_evolution(mode=None, scattered=True, incident=True, symmetric=True, quiver_color=None, tripcolor=False, layout=(3, 3), **kwargs)[source]#

Tricontourf for acoustic velocity field evolution of the fluid

Plots the velocity amplitude of the first-order acoustic velocity field of the fluid over one period at different phases using Matplotlib’s tricontourf or tripcolor if tripcolor = True.

The first phase value is always \(0\pi\) and the last one \(2\pi\). The total number of plots and, hence, also the steps between the different phase values is the defined by the product of the layout tuple.

Parameters:
  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • quiver_color (None | str, optional) – color of the quiver arrows, if None: no arrows

    Default: None

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • layout (tuple[int, int], optional) – number of rows and columns for plotting

    Default: (3, 3)

  • kwargs – passed through to the parent subplots command

Return type:

tuple[plt.Figure, plt.Axes]

plot_velocity_potential(inst=True, phase=0, symmetric=True, mode=None, scattered=True, incident=True, tripcolor=False, ax=None, **kwargs)[source]#

Tricontourf plot for acoustic velocity potential

Plots the velocity amplitude of the first-order acoustic velocity field of the fluid using Matplotlib’s tricontourf or tripcolor if tripcolor = True

Parameters:
  • inst (bool, optional) – if True instantaneous amplitude is plotted

    Default: True

  • phase (float, optional) – phase \([0, 2\pi]\)

    Default: 0

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (None | plt.Axes, optional) – if ax is passed, plot will be drawn on ax

    Default: None

  • kwargs – passed through to tricontourf()

Return type:

tuple[plt.Figure, plt.Axes]

plot_velocity_potential_evolution(inst=True, mode=None, scattered=True, incident=True, symmetric=True, tripcolor=False, layout=(3, 3), **kwargs)[source]#

Tricontourf for acoustic velocity potential evolution of the fluid

Plots the velocity potential amplitude of the first-order acoustic velocity potential field of the fluid over one period at different phases using Matplotlib’s tricontourf or tripcolor if tripcolor = True.

The first phase value is always \(0\pi\) and the last one \(2\pi\). The total number of plots and, hence, also the steps between the different phase values is the defined by the product of the layout tuple.

Parameters:
  • inst (bool, optional) – if True instantaneous amplitude is plotted

    Default: True

  • mode (None | int, optional) – mode of oscillation

    Default: None

  • scattered (bool, optional) – if True scattering field is plotted

    Default: True

  • incident (bool, optional) – if True incident field is plotted

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • layout (tuple[int, int], optional) – number of rows and columns for plotting

    Default: (3, 3)

  • kwargs – passed through to the parent subplots command

Return type:

tuple[plt.Figure, plt.Axes]

property cmap: str#

Colormap for plotting

Getter:

return the colormap choice

Setter:

sets the colormap choice

property div_cmap: str#

Diverging Colormap for plotting

Getter:

return the diverging colormap choice

Setter:

sets the diverging colormap choice