Skip to content

Commit a96a2dc

Browse files
committed
eps_g definition changed, now consistent with u_g and v_g0
1 parent ab5c303 commit a96a2dc

3 files changed

Lines changed: 6 additions & 35 deletions

File tree

examples/sparging_standard.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
print(f"Pi = {standard_input.get_Pi_number():.2f}")
2525
print(f"steady state c_T2 = {standard_input.get_c_T2_SS():.2e}")
2626
print(f"Bo = {standard_input.get_Bo():.2e}")
27-
standard_input.test_eps_g()
2827

2928
standard_input.c_T2_init = 3e-11 * ureg.molT2 / ureg.m**3
3029

@@ -46,14 +45,16 @@
4645
"n_T2_salt",
4746
"ndot_T2",
4847
"J_T2",
48+
"eps_g",
49+
"u_g",
4950
]
5051
output = my_simulation.solve(fast_solve=True)
5152

5253
# save output to file
5354
output.exports_to_csv(FOLDER)
5455
output.to_json(
5556
FOLDER / "summary.json",
56-
["analytical_quantities", "fit_summary"],
57+
["analytical_quantities", "fit_summary", "intermediate_params"],
5758
)
5859

5960
animation.create_animation(output, show_activity=False)

src/sparging/correlations.py

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -462,22 +462,6 @@ def get_v_g0(Eo, Mo, mu_l, rho_l, d_b) -> float: # TODO move inside class ?
462462
return v_g0
463463

464464

465-
def get_eps_g(T, P_g, ndot_g, area, v_g) -> float:
466-
gamma = ndot_g * const_R * T / (P_g * area * v_g)
467-
468-
eps_g = gamma / (1 + gamma)
469-
470-
if np.max(eps_g) > 1 * ureg("dimensionless") or np.min(eps_g) < 0 * ureg(
471-
"dimensionless"
472-
):
473-
warnings.warn(f"Warning: unphysical gas fraction: {eps_g}")
474-
elif np.max(eps_g) > 0.1 * ureg("dimensionless"):
475-
warnings.warn(
476-
f"Warning: high gas fraction: {eps_g}, model assumptions may not hold"
477-
)
478-
return eps_g
479-
480-
481465
def get_h_higbie(D_l: float, v_g: float, d_b: float) -> float:
482466
"""
483467
Higbie penetration model average mass transfer coefficient [m/s]-> suited for large mobile interfaces
@@ -530,19 +514,12 @@ def get_h_briggs(Re: float, Sc: float, D_l: float, d_b: float) -> float:
530514
)
531515
all_correlations.append(d_b)
532516

517+
533518
eps_g = Profile(
534519
identifier="eps_g",
535-
function=lambda temperature, P_g, ndot_g0, area, v_g0: (
536-
lambda z: get_eps_g(
537-
T=temperature,
538-
P_g=P_g(z),
539-
ndot_g=ndot_g0,
540-
area=area,
541-
v_g=v_g0,
542-
)
543-
),
520+
function=lambda u_g, v_g0: lambda z: u_g(z) / v_g0,
544521
corr_type=CorrelationType.GAS_VOID_FRACTION,
545-
input_units=["kelvin", PROFILE, "mol/s", "m^2", "m/s"],
522+
input_units=[PROFILE, "m/s"],
546523
output_units="dimensionless",
547524
description="gas void fraction profile (local P and d_b)",
548525
)

src/sparging/inputs.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,6 @@ def get_Bo(self) -> pint.Quantity:
203203
"""
204204
return (self.u_g0 * self.height / self.E_g).to("dimensionless")
205205

206-
def test_eps_g(
207-
self,
208-
): # to see if the two definitions of superficial velocity are consistent -> TODO remove
209-
print(
210-
f"{self.eps_g0 * self.graph.nodes['v_g0']['value']} vs {self.graph.nodes['Vdot_g0']['value'] / self.area} vs {self.u_g0}"
211-
)
212-
213206
def __post_init__(self):
214207
# make sure there are only pint.Quantity or callables in the input, otherwise raise an error
215208
for key in self.required_scalars:

0 commit comments

Comments
 (0)