Skip to content

Commit

Permalink
adjusted time input for heat() to accept relative time
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelyndunnell committed Nov 1, 2024
1 parent 8de5ae1 commit 76d0aca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mb_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ def T_surface(t: dolfinx.fem.Constant) -> float:
monoblock surface temperature in K
"""
pulse_type = my_scenario.get_pulse_type(float(t))
return 1.1e-4 * heat(pulse_type, t=t) + COOLANT_TEMP
pulse_row = my_scenario.get_row(float(t))
time_elapsed = my_scenario.get_time_till_row(pulse_row)
return 1.1e-4 * heat(pulse_type, t=t-time_elapsed) + COOLANT_TEMP

def T_rear(t: dolfinx.fem.Constant):
"""Monoblock surface temperature
Expand All @@ -282,7 +284,9 @@ def T_rear(t: dolfinx.fem.Constant):
monoblock surface temperature in K
"""
pulse_type = my_scenario.get_pulse_type(float(t))
return 2.2e-5 * heat(pulse_type, t=t) + COOLANT_TEMP
pulse_row = my_scenario.get_row(float(t))
time_elapsed = my_scenario.get_time_till_row(pulse_row)
return 2.2e-5 * heat(pulse_type, t=t-time_elapsed) + COOLANT_TEMP

def T_function(x, t: Constant):
"""Monoblock temperature function
Expand Down

0 comments on commit 76d0aca

Please sign in to comment.