|
| 1 | +import math |
| 2 | +import openmc |
| 3 | + |
| 4 | + |
| 5 | +def get_exp_cllif_density(temp, LiCl_frac=0.695): |
| 6 | + """Calculates density of ClLiF [g/cc] from temperature in Celsius |
| 7 | + and molar concentration of LiCl. Valid for 660 C - 1000 C. |
| 8 | + Source: |
| 9 | + G. J. Janz, R. P. T. Tomkins, C. B. Allen; |
| 10 | + Molten Salts: Volume 4, Part 4 |
| 11 | + Mixed Halide Melts Electrical Conductance, Density, Viscosity, and Surface Tension Data. |
| 12 | + J. Phys. Chem. Ref. Data 1 January 1979; 8 (1): 125–302. |
| 13 | + https://doi.org/10.1063/1.555590 |
| 14 | + """ |
| 15 | + temp = temp + 273.15 # Convert temperature from Celsius to Kelvin |
| 16 | + C = LiCl_frac * 100 # Convert molar concentration to molar percent |
| 17 | + |
| 18 | + a = 2.25621 |
| 19 | + b = -8.20475e-3 |
| 20 | + c = -4.09235e-4 |
| 21 | + d = 6.37250e-5 |
| 22 | + e = -2.52846e-7 |
| 23 | + f = 8.73570e-9 |
| 24 | + g = -5.11184e-10 |
| 25 | + |
| 26 | + rho = a + b * C + c * temp + d * C**2 + e * C**3 + f * temp * C**2 + g * C * temp**2 |
| 27 | + |
| 28 | + return rho |
| 29 | + |
| 30 | + |
| 31 | +def calculate_cylinder_volume(radius, height): |
| 32 | + volume = math.pi * radius**2 * height |
| 33 | + return volume |
| 34 | + |
| 35 | + |
| 36 | +def translate_surface( |
| 37 | + surface: ( |
| 38 | + openmc.XPlane | openmc.YPlane | openmc.ZPlane | openmc.Plane | openmc.Sphere |
| 39 | + ), |
| 40 | + dx: float, |
| 41 | + dy: float, |
| 42 | + dz: float, |
| 43 | +) -> openmc.Surface: |
| 44 | + """Translate an OpenMC surface by dx, dy, dz.""" |
| 45 | + if isinstance(surface, openmc.XPlane): |
| 46 | + surface.x0 += dx |
| 47 | + elif isinstance(surface, openmc.YPlane): |
| 48 | + surface.y0 += dy |
| 49 | + elif isinstance(surface, openmc.ZPlane): |
| 50 | + surface.z0 += dz |
| 51 | + elif isinstance(surface, openmc.Plane): |
| 52 | + surface.d += surface.a * dx + surface.b * dy + surface.c * dz |
| 53 | + elif isinstance(surface, openmc.Sphere): |
| 54 | + surface.x0 += dx |
| 55 | + surface.y0 += dy |
| 56 | + surface.z0 += dz |
| 57 | + else: |
| 58 | + raise TypeError(f"Unsupported surface type: {type(surface)}") |
| 59 | + return surface |
0 commit comments