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 b17c44d6 authored by Jonas Fankhauser's avatar Jonas Fankhauser
Browse files

particle type removed

parent 799b537b
Pipeline #97943 failed with stages
in 2 minutes and 5 seconds
......@@ -28,8 +28,8 @@ class ARF(ScatteringField, BaseARF):
radius: Union[Sphere, float, int],
rho_s: float, c_s: float, rho_f: float, c_f: float,
p_0: float, position: Optional[float],
wave_type: str = "traveling",
particle_type: str = "general", N_max: int = 10) -> None:
wave_type: str = "traveling", N_max: int = 10,
small_particle: str = False, bubble: str = False) -> None:
"""
Initializes the class and sets all parameter needed for the
computation.
......@@ -66,7 +66,6 @@ class ARF(ScatteringField, BaseARF):
p_0=p_0,
position=position,
wave_type=wave_type,
particle_type=particle_type,
N_max=N_max)
self._F = ActiveVariable(self._compute_F,
......@@ -104,17 +103,8 @@ class ARF(ScatteringField, BaseARF):
"""
# TODO: adapt to small particle and bubble
if self.particle_type == "general":
out = self._compute_general_arf()
elif self.particle_type == "bubble":
out = self._compute_bubble_arf()
elif self.particle_type == "sphere":
out = self._compute_sphere_arf()
else:
print(self.particle_type)
raise NotImplementedError('Solution is no implemented (yet).')
return out
return -1
# TODO rename
def _compute_general_arf(self) -> float:
......@@ -170,6 +160,7 @@ class ARF(ScatteringField, BaseARF):
therefore we need to introduce an opposite sign in the case
of the standing wave field
"""
# TODO correct this
if self.wave_type == "standing":
out *= -1
......
......@@ -25,7 +25,7 @@ class BaseYosioka(BaseSphereFrequencyComposite):
rho_f: float, c_f: float,
p_0: float, position: Optional[float],
wave_type: str = "traveling",
particle_type: str = "general", N_max: int = 10) -> None:
N_max: int = 10) -> None:
"""
Initializes the class and sets all parameter needed for the
......@@ -66,10 +66,6 @@ class BaseYosioka(BaseSphereFrequencyComposite):
# Independent variables
self.N_max = N_max
# TODO: remove particle_type
self._particle_type = PassiveVariable(
particle_type,
"Type of the particle")
self._R_0 = PassiveVariable(radius, "Particle-Radius")
# Dependent variables
......@@ -229,18 +225,6 @@ class BaseYosioka(BaseSphereFrequencyComposite):
def c_s(self, value: float) -> None:
self.particle.c_f = value
@property
def particle_type(self) -> str:
"""
Returns the type of the particle (either bubble or sphere)
:rtype: str
"""
return self._particle_type.value
@particle_type.setter
def particle_type(self, value: str) -> None:
self._particle_type.value = value
# -------------------------------------------------------------------------
# Wrappers for Independent Fluid Attributes
# -------------------------------------------------------------------------
......
......@@ -29,8 +29,7 @@ class ScatteringField(BaseYosioka, BaseScattering):
radius: Union[Sphere, float],
rho_s: float, c_s: float, rho_f: float, c_f: float,
p_0: float, position: Optional[float],
wave_type: str = "traveling",
particle_type: str = "general", N_max: int = 10) -> None:
wave_type: str = "traveling", N_max: int = 10) -> None:
"""
Initializes the class and sets all parameter needed for the
computation.
......@@ -51,12 +50,11 @@ class ScatteringField(BaseYosioka, BaseScattering):
:type p_0: float
:param position: Position within the standing wave field [m]
:type position: float
:param wave_type: either standing or progressive wavefield
:param wave_type: either standing or progressive wave
:type wave_type: str
:rtype: None
"""
# TODO: remove particle_type
BaseYosioka.__init__(self, frequency, radius,
rho_s, c_s, rho_f, c_f,
p_0, position,
......
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