Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
92ab940
Add files via upload
mehmeturkmen Jan 14, 2021
2b43d64
Update __init__.py
mehmeturkmen Jan 14, 2021
a3d6f00
Update app.py
mehmeturkmen Jan 14, 2021
6b5d159
Add files via upload
mehmeturkmen Jan 14, 2021
9a3ce39
Update sensitivity.py
mehmeturkmen Jan 14, 2021
9b8f696
Update sensitivity.py
mehmeturkmen Jan 14, 2021
3ec0508
Update sparging.py
mehmeturkmen Jan 14, 2021
2e93db7
Update app.py
mehmeturkmen Jan 14, 2021
2e10a5b
Update app.py
mehmeturkmen Jan 14, 2021
a2dc578
Update app.py
mehmeturkmen Jan 14, 2021
3c37af3
Update app.py
mehmeturkmen Jan 14, 2021
a0af09a
Update sensitivity.py
mehmeturkmen Jan 15, 2021
35fb22c
Update sensitivity.py
mehmeturkmen Jan 16, 2021
e9abd44
Update sensitivity.py
mehmeturkmen Jan 16, 2021
1ce3027
Update sensitivity.py
mehmeturkmen Jan 16, 2021
cba4db7
Update sensitivity.py
mehmeturkmen Jan 16, 2021
0e3c5fc
Update sensitivity.py
mehmeturkmen Jan 16, 2021
fe3625e
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
20c3484
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
5bb5e03
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
7564177
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
7d6be62
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
79b6384
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
7531850
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
3c6a2bf
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
a3fe698
Update sensitivity.py
mehmeturkmen Feb 19, 2021
9338eae
Update sensitivity.py
mehmeturkmen Feb 19, 2021
ac8ced8
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
7afc2ac
Update saltproc/sparging.py
mehmeturkmen Feb 19, 2021
db62d99
Update and rename sparging.py to separator.py
mehmeturkmen Feb 19, 2021
4618a25
Add files via upload
mehmeturkmen Feb 19, 2021
119bf76
Update separator.py
mehmeturkmen Feb 19, 2021
fff7237
Update sparger.py
mehmeturkmen Feb 19, 2021
3c53d52
Update __init__.py
mehmeturkmen Feb 19, 2021
0248a01
Update app.py
mehmeturkmen Feb 19, 2021
ba6d360
Update sparger.py
mehmeturkmen Feb 20, 2021
8e1b64f
Update separator.py
mehmeturkmen Feb 20, 2021
1cc7d36
Update separator.py
mehmeturkmen Feb 20, 2021
9e0c8b9
Update sparger.py
mehmeturkmen Feb 20, 2021
a2730d2
Update app.py
mehmeturkmen Feb 20, 2021
4e2dad9
Update app.py
mehmeturkmen Feb 20, 2021
37bece3
Update app.py
mehmeturkmen Feb 22, 2021
9517eb7
Update separator.py
mehmeturkmen Feb 22, 2021
f822af6
Update sparger.py
mehmeturkmen Feb 22, 2021
271c7a7
Add files via upload
mehmeturkmen Feb 22, 2021
b5ac34d
Update sparger.py
mehmeturkmen Feb 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions saltproc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
from .simulation import *
from .process import *
from .reactor import *
from .sparger import *
from .separator import *
13 changes: 11 additions & 2 deletions saltproc/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from saltproc import Materialflow
from saltproc import Process
from saltproc import Reactor
from saltproc import Sparger
from saltproc import Separator
# from depcode import Depcode
# from simulation import Simulation
# from materialflow import Materialflow
Expand Down Expand Up @@ -162,8 +164,15 @@ def read_processes_from_input():
for mat, value in j.items():
processes[mat] = OrderedDict()
for obj_name, obj_data in j[mat]['extraction_processes'].items():
print("Processs object data", obj_data)
processes[mat][obj_name] = Process(**obj_data)
print("Processs object data: ", obj_data)
st = obj_data['efficiency']
if obj_name == 'sparger' and st == "self":
processes[mat][obj_name] = Sparger(**obj_data)
elif obj_name == 'entrainment_separator' and st == "self":
processes[mat][obj_name] = Separator(**obj_data)
else:
processes[mat][obj_name] = Process(**obj_data)

gc.collect()
return processes

Expand Down
122 changes: 122 additions & 0 deletions saltproc/separator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
from saltproc import Process


class Separator(Process):
"""Class evaluates gas removal efficiency in separator (bubble separator).

Attributes
----------
qe : float
liquid flow rate (m^3/s)
default: same as the value in q_salt defined in sparger class
qg : float
gas flow rate (m^3/s)
default: same as the value in q_he defined in sparger class
pgamma : float
the pressure at the densitometer station
x : float
the gas injection rate
default: 5% of total flow

Methods
-------
eff()
Evaluates gas removal efficiency using Eq. 6 from Gabbard's report. [1]
description()
Contains a dictionary of plot properties.
calc_rem_efficiency(el_name)
Overrides exiting method in Parent class.

References
----------
[1] Gabbard, C. H. Development of an axial-flow centrifugal gas bubble
separator for use in MSR xenon removal system. United States: N. p.,
1974. Web. doi:10.2172/4324438.
"""

def __init__(self, qe=0.1, qg=0.005, pgamma=10, x=0.05,
*initial_data, **kwargs):
""" Initializes the Separator object.

Parameters
----------
qe : float
liquid flow rate (m^3/s)
default: same as the value in q_salt defined in sparger class
qg : float
gas flow rate (m^3/s)
default: same as the value in q_he defined in sparger class
pgamma : float
the pressure at the densitometer station
default: from Gabbard's report [1]
x : float
the gas injection rate
default: 5% of total flow
"""
super().__init__(*initial_data, **kwargs)
self.qe = qe
self.qg = qg
self.pgamma = pgamma
self.x = x
self.efficiency = self.eff()

def calc_rem_efficiency(self, el_name):
"""Overrides the existing method in Process class to provide
efficiency values of target isotopes calculated in eff() function.

Parameters
----------
el_name : str
Name of target element to be removed.

Returns
-------
efficiency : float
Extraction efficiency for el_name element.

"""
efficiency = self.eff()[el_name]

return efficiency

def description(self):
"""Class attributes' descriptions for plotting purpose in
sensitivity analysis

Returns
------
pltdict: dict
contains instances' information
"""
plt_dict = {'qe': {'xaxis': 'liquid flow rate ${(m^3/s)}$',
'fname': 'liquid_flow_rate'},
'qg': {'xaxis': 'gas flow rate ${(m^3/s)}$',
'fname': 'gas_flow_rate'},
'pgamma': {'xaxis': 'densitometer pressure ${(Pa)}$',
'fname': 'densitometer_pressure'},
'x': {'xaxis': 'the gas injection rate ${(m)}$',
'fname': 'the gas_injection_rate'},
}

return plt_dict

def eff(self):
""" Evaluates gas removal efficiency using Equation 6
from Gabbard's report. [1]

Returns
-------
rem_eff : dict
Dictionary that contains removal efficiency of each target
element.

``key``
Name of target isotope.
``value``
removal efficiency.
"""
sep_eff = (2116.8 * self.qg) /\
(self.x * self.qe * self.pgamma + 2116.8 * self.qg)
rem_eff = {'Xe': sep_eff, 'Kr': sep_eff, 'H': sep_eff}

return rem_eff
224 changes: 224 additions & 0 deletions saltproc/sparger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
import numpy as np
from saltproc import Process


class Sparger(Process):
"""Class evaluates gas removal efficiency in sparger (bubble generator).

Attributes
----------
h_const : dict
``key``
Name of target isotope.
``value``
Henry's law constant.
gas_const : real
universal gas constant (Pa.m^3/mol-K)
diffusivity : real
liquid phase diffusivity (cm^2/s)
temp_room: real
room temperature (Kelvin)
exp_const: dict
``key``
Name of target isotope.
``value``
exponential constant from following reference
q_salt : float
volumetric salt flow rate (m^3/s)
q_he : float
volumetric helium flow rate (m^3/s)
length : float
sparger/contractor length (m)
ds : float
sparger/contractor (pipe) diameter (m)
db : float
bubble diameter (m) for bubble generator/separator
temp_salt: float
salt temperature (K)
area : float
contactor cross-section (m^2)

Methods
-------
eps(h_const, kl_const)
Defines gas removal efficiency for sparger (bubble generator)
using Eq. 4 from Peebles report (ORNL-TM-2245). [2]
eff()
Evaluates gas removal efficiencies for target isotopes.
sherwood()
Contains Sherwood number correlations from different sources.
description()
Contains a dictionary of plot properties.
calc_rem_efficiency(el_name)
Overrides exiting method in Parent class.

References
----------
[1] Henry's law constants (Pa.m3/mol) for Xe, Kr, H from
Sander, R.: Compilation of Henry's law constants (version 4.0)
for water as solvent, Atmos. Chem. Phys., 15, 4399–4981,
https://doi.org/10.5194/acp-15-4399-2015, 2015.
[2] Peebles, F. , 1968, “ Removal of Xenon-135 From Circulating
Fuel Salt of the MSBR by Mass Transfer to Helium Bubbles,” Oak Ridge
National Laboratory, Oak Ridge, TN, Report No. ORNL-TM-2245.
[3] Jiaqi Chen and Caleb S. Brooks. Milestone 1.2 Report: CFD
Sensitivity Analysis. In preparation
"""

diffusivity = 2.5E-9
gas_const = 8.314
h_const = {'Xe': 4.3e-5, 'Kr': 2.5e-5, 'H': 2.6e-6}
temp_room = 298.15
exp_const = {'Xe': 2300, 'Kr': 1900, 'H': 0}

def __init__(self, q_salt=0.1, q_he=0.005, length=10,
ds=0.1, db=0.001, temp_salt=900, corr='Jiaqi',
*initial_data, **kwargs):
""" Initializes the Sparger object.

Parameters
----------
q_salt : float
volumetric salt flow rate (m^3/s)
q_he : float
volumetric helium flow rate (m^3/s)
length : float
sparger/contractor length (m)
ds : float
sparger/contractor (pipe) diameter (m)
db : float
bubble diameter (m) for bubble generator/separator
temp_salt: float
salt temperature (K)
area : float
contactor cross-section (m^2)
corr: string
Sherwood correlations: ORNL-TM-2245 or Jaiqi's
(1) milestone report from Jiaqi [3]
(2) ORNL-TM-2245 Eq.36 [2]
default: Sherwood correlation from ORNL-TM-2245 Eq.36

Notes
-----
Default values comes from Jiaqi's simulation
"""
super().__init__(*initial_data, **kwargs)
self.q_salt = q_salt
self.q_he = q_he
self.length = length
self.ds = ds
self.db = db
self.temp_salt = temp_salt
self.area = np.pi * (self.ds / 2) ** 2
self.corr = corr
self.efficiency = self.eff()

def calc_rem_efficiency(self, el_name):
"""Overrides the existing method in Process class to provide
efficiency values of target isotopes calculated in eff() function.

Parameters
----------
el_name : str
Name of target element to be removed.

Returns
-------
efficiency : float
Extraction efficiency for el_name element.

"""
efficiency = self.eff()[el_name]

return efficiency

def description(self):
"""Class attributes' descriptions for plotting purpose in sensitivity
analysis
Return
------
pltdict: dict
contains instances' information
"""
plt_dict = {'q_salt': {'xaxis': 'salt flow rate ${(m^3/s)}$',
'fname': 'salt_flow_rate'},
'q_he': {'xaxis': 'helium flow rate ${(m^3/s)}$',
'fname': 'helium_flow_rate'},
'length': {'xaxis': 'sparger pipe length ${(m)}$',
'fname': 'sparger_pipe_length'},
'ds': {'xaxis': 'sparger pipe diameter ${(m)}$',
'fname': 'sparger_pipe_diameter'},
'db': {'xaxis': 'bubble diameter ${(m)}$',
'fname': 'bubble_diameter'},
'temp_salt': {'xaxis': 'average salt temperature ${(K)}$',
'fname': 'average_salt_temperature'}
}

return plt_dict

def eps(self, h_const, kl_const):
"""Evaluates gas removal efficiency using Eq. 4
from Peebles report (ORNL-TM-2245).

Returns
-------
efficiency : float
removal efficiency of a specific chemical element.

"""
a = (6/self.db) * (self.q_he / (self.q_he + self.q_salt))
alpha = (self.gas_const * self.temp_salt / h_const) *\
(self.q_salt / self.q_he)
beta = (kl_const * a * self.area *
self.length * (1 + alpha)) / self.q_salt

return (1-np.exp(-beta))/(1+alpha)

def sherwood(self):
""" Contains Sherwood number correlations.
Sherwood correlations: ORNL-TM-2245 or Jaiqi
(1) Jaiqi Ph.D. dissertation
(2) ORNL-TM-2245 Eq.36
default: Sherwood correlation from ORNL-TM-2245 Eq.36
"""
sh_corr = {
'ORNL-TM-2245': '0.0096 * (number_re**0.913) * (number_sc**0.346)',
'Jiaqi': '2.06972 * (number_re ** 0.555) * (number_sc ** 0.5)'}

return sh_corr

def eff(self):
"""Evaluates gas removal efficiencies for target isotopes.
In this function, vl, mu, rho, number_sh, number_sc, number_re and kl
are average liquid velocity (m/s), kinematic viscosity (Pa.s),
density (kg/m^3), sherwood number from slide 8 developed by Jiaqi,
schmidt number, reynold number and liquid phase mass transfer
coefficient (m/s), respectively.

Returns
-------
rem_eff : dict
Dictionary containing removal efficiency of each target isotope.
``key``
Name of target isotope.
``value``
removal efficiency.
"""
hh = {}
for key in self.h_const:
hh[key] = 1 / (self.h_const[key] *
np.exp(self.exp_const[key] * (1/self.temp_salt -
1/self.temp_room)))

mu = 1.076111581e-2 * (self.temp_salt / 1000)**(-4.833549134)
rho = (6.105 - 0.001272 * self.temp_salt) * 1000
nu = mu / rho
vl = self.q_salt / self.area
number_re = self.ds * vl / nu
number_sc = nu / self.diffusivity
number_sh = eval(self.sherwood()[self.corr],
{'number_sc': number_sc, 'number_re': number_re})
kl = number_sh * self.diffusivity / self.ds
rem_eff = {key: self.eps(hh[key], kl) for key in self.h_const}

return rem_eff
Loading