To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit ab009f79 authored by Cyrill Mast's avatar Cyrill Mast
Browse files

docs updated

parent c92ac300
Pipeline #90476 passed with stages
in 5 minutes and 54 seconds
......@@ -11,6 +11,7 @@ Solutions for the ARF
solutions/baseStreaming
solutions/king1934
solutions/gorkov1962
solutions/yosioka1955
Submodules
----------
......
......@@ -17,5 +17,5 @@ Yosioka (1955)
:nosignatures:
~baseclass.BaseYosioka
~arf.YosiokaARF
~scatteringfield.YosiokaScatteringfield
~arf.ARF
~scatteringfield.ScatteringField
......@@ -13,7 +13,9 @@ from gorkov import (
class BaseYosioka(BaseSphereFrequencyComposite):
"""
Baseclass for Yosioka's (1955) ARF solution
Baseclass for Yosioka's (1955) solution
In this class wrappers are formulated which are inherited to higher classes
"""
def __init__(self, frequency: Union[Frequency, float, int],
......@@ -47,7 +49,7 @@ class BaseYosioka(BaseSphereFrequencyComposite):
"""
# init of parent class
BaseSphereFrequencyComposite.__init__(self, frequency, radius)
self.BSF = BaseSphereFrequencyComposite(frequency, radius)
# Initialize Components
self.solid = InviscidFluid(self.frequency, rho_s, c_s)
......@@ -168,6 +170,18 @@ class BaseYosioka(BaseSphereFrequencyComposite):
def wave_type(self, value: str) -> None:
self.field.wave_type = value
@property
def frequency(self) -> float:
"""
Wraps to :attr:
`gorkov.core.basecomposite.BaseSphereFrequencyComposite.frequency`
"""
return self.BSF.frequency
@frequency.setter
def frequency(self, value) -> None:
self.BSF.frequency = value
# -------------------------------------------------------------------------
# Wrappers for Independent Solid Attributes
# -------------------------------------------------------------------------
......@@ -266,10 +280,15 @@ class BaseYosioka(BaseSphereFrequencyComposite):
@property
def R_0(self) -> float:
return self._R_0.value
"""
Wraps to :attr:
`gorkov.core.basecomposite.BaseSphereFrequencyComposite.R_0`
"""
return self.BSF.R_0
@R_0.setter
def R_0(self, value: float) -> None:
self.BSF.R_0 = value
self._R_0.value = value
# -------------------------------------------------------------------------
......
......@@ -11,6 +11,18 @@ from ..base_scattering import BaseScattering
class ScatteringField(BaseYosioka, BaseScattering):
"""Scatteringfield using coefficients from Yosioka 1955
The velocities are not explicitely calculated in the paper from 1955.
The velocities are concluded from lectures from Sasha Doinikov,
but with the coefficients from Yosioka
.. warning::
This model is based on the following assumptions:
- Inviscid fluid
- Spheres of finite compressibility
- plane progressive / standing wave field
"""
def __init__(self, frequency: Union[Frequency, float],
radius: Union[Sphere, float],
......@@ -19,13 +31,36 @@ class ScatteringField(BaseYosioka, BaseScattering):
particle_type: str,
position: Optional[float] = None,
n_max=None) -> None:
log.info('Create ScatteringField')
"""
Initializes the class and sets all parameter needed for the
computation.
:param frequency: Frequency [Hz]
:type frequency: Union[Frequency, float, int]
:param radius: Radius of the solid [m]
:type radius: Union[Sphere, float, int]
:param rho_s: Density of the fluid-like solid [kg/m^3]
:type rho_s: float
:param rho_f: Density of the fluid [kg/m^3]
:type rho_f: float
:param c_f: Speed of sound of the fluid [m/s]
:type c_f: float
:param p_0: Pressure amplitude of the field [Pa]
:type p_0: float
:param position: Position within the standing wave field [m]
:type position: float
:param wave_type: either standing or progressive wavefield
:type wave_type: str
:rtype: None
"""
BaseYosioka.__init__(self, frequency, radius,
rho_s, rho_f, c_f, c_s,
p_0, position,
particle_type, wave_type, n_max)
log.info('Create ScatteringField')
self._A_n = ActiveVariable(self._reset_coeff,
"Coefficient A_n"
" for scattered potential")
......@@ -59,8 +94,9 @@ class ScatteringField(BaseYosioka, BaseScattering):
# -------------------------------------------------------------------------
def Phi_1(self, r: float, theta: float, t: float) -> complex:
"""
Compute velocity potential outside the sphere
"""The velocity potential outside the sphere
Compute the velocity potential outside the sphere
according to (17)
:param r: radial coordinate [m]
......@@ -71,10 +107,12 @@ class ScatteringField(BaseYosioka, BaseScattering):
:type t: float
:rtype: complex
"""
return self.Phi_i(r, theta, t) + self.Phi_s(r, theta, t)
def Phi_i(self, r: float, theta: float, t: float) -> complex:
"""
"""The incident velocity potential
Compute the incident velocity potential
according to (16) for travelling waves
and (27) for standing waves.
......@@ -87,6 +125,7 @@ class ScatteringField(BaseYosioka, BaseScattering):
:type t: float
:rtype: complex
"""
coeff = self.legendre_coeffs(lambda n:
self.field.A_in(n)
* sp.besselj(n, self.k_f * r))
......@@ -96,7 +135,8 @@ class ScatteringField(BaseYosioka, BaseScattering):
return out
def Phi_s(self, r: float, theta: float, t: float) -> complex:
"""
"""The scattered velocity potential
Compute the scattered velocity potential
according to (18) for travelling waves
and (29) for standing waves
......@@ -118,7 +158,8 @@ class ScatteringField(BaseYosioka, BaseScattering):
return out
def Phi_star(self, r: float, theta: float, t: float) -> complex:
"""
"""The velocity potential inside the sphere
Compute the velocity potential inside the sphere
according to (19) for travelling waves
and (30) for standing waves
......@@ -145,7 +186,8 @@ class ScatteringField(BaseYosioka, BaseScattering):
def radial_acoustic_fluid_velocity(self, r: float, theta: float, t: float
) -> float:
"""
"""Radial acoustic velocity
Returns the value for the radial acoustic velocity in [m/s].
:param r: radial coordinate [m]
......@@ -177,7 +219,8 @@ class ScatteringField(BaseYosioka, BaseScattering):
def tangential_acoustic_fluid_velocity(self, r: float, theta: float,
t: float) -> float:
"""
"""Tangential acoustic velocity
Returns the value for the tangential acoustic velocity in [m/s].
:param r: radial coordinate [m]
......@@ -211,7 +254,8 @@ class ScatteringField(BaseYosioka, BaseScattering):
def radial_particle_velocity(self, r: float, theta: float,
t: float) -> float:
"""
"""Radial particle velocity
Returns the value for the radial particle velocity in [m/s].
:param r: radial coordinate [m]
......@@ -234,7 +278,8 @@ class ScatteringField(BaseYosioka, BaseScattering):
def tangential_particle_velocity(self, r: float, theta: float,
t: float) -> float:
"""
"""Tangential particle velocity
Returns the value for the tangential particle velocity in [m/s].
This method must be implemented by every theory to have a common
interface for other modules.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment