Skip to content

Commit 0afa892

Browse files
committed
Replacing integers with floats in the settling velocity kernel
1 parent 2d0f9ea commit 0afa892

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

plasticparcels/kernels.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ def SettlingVelocity(particle, fieldset, time):
166166
particle_density = particle.plastic_density
167167

168168
# Compute the kinematic viscosity of seawater
169-
water_dynamic_viscosity = 4.2844E-5 + (1 / ((0.156 * (temperature + 64.993) ** 2) - 91.296)) # Eq. (26) from [2]
169+
water_dynamic_viscosity = 4.2844E-5 + (1. / ((0.156 * (temperature + 64.993) ** 2) - 91.296)) # Eq. (26) from [2]
170170
A = 1.541 + 1.998E-2 * temperature - 9.52E-5 * temperature ** 2 # Eq. (28) from [2]
171171
B = 7.974 - 7.561E-2 * temperature + 4.724E-4 * temperature ** 2 # Eq. (29) from [2]
172-
seawater_dynamic_viscosity = water_dynamic_viscosity * (1 + A * seawater_salinity + B * seawater_salinity ** 2) # Eq. (27) from [2]
172+
seawater_dynamic_viscosity = water_dynamic_viscosity * (1. + A * seawater_salinity + B * seawater_salinity ** 2) # Eq. (27) from [2]
173173
seawater_kinematic_viscosity = seawater_dynamic_viscosity / seawater_density # Eq. (25) from [2]
174174

175175
# Compute the density difference of the particle
@@ -182,7 +182,7 @@ def SettlingVelocity(particle, fieldset, time):
182182
if dimensionless_diameter > 5E9: # "The boundary layer around the sphere becomes fully turbulent, causing a reduction in drag and an increase in settling velocity" - [1]
183183
dimensionless_velocity = 265000. # Set a maximum dimensionless settling velocity
184184
elif dimensionless_diameter < 0.05: # "At values of D_* less than 0.05, (9) deviates signficantly ... from Stokes' law and (8) should be used." - [1]
185-
dimensionless_velocity = (dimensionless_diameter ** 2.) / 5832 # Using Eq. (8) in [1]
185+
dimensionless_velocity = (dimensionless_diameter ** 2.) / 5832. # Using Eq. (8) in [1]
186186
else:
187187
dimensionless_velocity = 10. ** (-3.76715 + (1.92944 * math.log10(dimensionless_diameter)) - (0.09815 * math.log10(dimensionless_diameter) ** 2.) - (
188188
0.00575 * math.log10(dimensionless_diameter) ** 3.) + (0.00056 * math.log10(dimensionless_diameter) ** 4.)) # Using Eq. (9) in [1]

0 commit comments

Comments
 (0)