Skip to content

Commit de332d6

Browse files
committed
minor editing
1 parent ad64275 commit de332d6

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

examples/sparging_standard.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@
4141
)
4242

4343
if __name__ == "__main__":
44+
# my_simulation.exports = ["pressure", "J_T2"]
4445
output = my_simulation.solve(fast_solve=True)
4546
# save output to file
4647
output.to_json(FOLDER / "params.json")
4748

49+
# P = output.exported_fields["pressure"]
50+
# plt.plot(output.x_ct, P)
51+
# output.exports_to_csv(FOLDER)
52+
4853
output.profiles_to_csv(FOLDER)
4954
output.profiles_to_cdf(FOLDER)
5055

src/sparging/correlations.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,17 @@ def get_list(self, corr_type: CorrelationType) -> list[Correlation]:
424424
)
425425
all_correlations.append(source_T_integral)
426426

427+
# P_hydrostatic = Profile(
428+
# identifier="P_l",
429+
# function=lambda P_bottom, rho_l: (
430+
# lambda z: P_bottom - rho_l * const_g * z
431+
# ), # source term for tritium generation calculated from TBR and neutron generation rate
432+
# corr_type=CorrelationType.TRITIUM_SOURCE,
433+
# input_units=["triton/neutron", "neutron/s"],
434+
# output_units="molT/s",
435+
# )
436+
# all_correlations.append(source_T_integral)
437+
427438

428439
def get_d_b(
429440
flow_g_vol: pint.Quantity, nozzle_diameter: pint.Quantity, nb_nozzle: pint.Quantity

src/sparging/model.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@
2626

2727
logger = logging.getLogger(__name__)
2828

29-
hours_to_seconds = 3600
30-
days_to_seconds = 24 * hours_to_seconds
31-
T2_to_T = 2
32-
T_to_T2 = 1 / T2_to_T
33-
3429
EPS = 1e-26
35-
SEPARATOR_KEYWORD = "from"
3630

3731
# log.set_log_level(log.LogLevel.INFO)
3832

@@ -275,7 +269,9 @@ class Simulation:
275269
profile_pressure_hydrostatic: bool = True
276270
dispersion_on: bool = True
277271

278-
def hydrostatic_pressure(self, z: pint.Quantity) -> pint.Quantity:
272+
def hydrostatic_pressure(
273+
self, z: pint.Quantity
274+
) -> pint.Quantity: # TODO should be in correlations
279275
"""returns the hydrostatic pressure at a given height z in the tank given P_bottom"""
280276
rho = self.sim_input.rho_l
281277
g = const_g
@@ -547,7 +543,6 @@ def post_process(t):
547543
inventory_T2_salt *= tank_area # get total amount of T2 in [mol]
548544
inventories_T2_salt.append(inventory_T2_salt)
549545

550-
# TODO Initialize results storage with zeros -> there's an inconsistency: times[0] = 0 but inventories[0] != 0 -> screws comparison with analytical solutions
551546
t = 0
552547
times = []
553548
c_T2_solutions = []
@@ -556,6 +551,7 @@ def post_process(t):
556551
sources_T2 = []
557552
fluxes_T2 = []
558553
inventories_T2_salt = []
554+
# initialize (t=0)
559555
post_process(t)
560556

561557
# SOLVE

0 commit comments

Comments
 (0)