Replies: 5 comments
-
This is the code now in Python: # Evaluate machine parameters at xv
self.caller.call_models(xv)
# Convergence loop to ensure burn time consistency
if sv.istell == 0:
for _ in range(10):
if abs((tv.tburn - tv.tburn0) / max(tv.tburn, 0.01)) <= 0.001:
break
self.caller.call_models(xv)
if gv.verbose == 1:
print("Internal tburn consistency check: ", tv.tburn, tv.tburn0) I changed the code for test only so the print statement happens immediately after each occasion
|
Beta Was this translation helpful? Give feedback.
-
It seems that the problem arises because the calculation of loop voltage physics.physics()
def physics()
tburn0 = tburn
tpulse = ... + tburn + ...
# Calculate Volt-second requirements
..., vsstt = vscalc(...tburn...)
def vscalc():
# Volt-second requirements
# Loop voltage during flat-top
vburn = plascur * rplas * facoh * csawth
vsbrn = vburn * (t_fusion_ramp + tburn)
vsstt = vsstt + vsbrn
pfcoil.run()
pfcoil.py
def run():
# Volt-second capability of PF coil set
self.vsec()
def vsec():
# Calculation of volt-second capability of PF system.
# vsbn = total flux swing available for burn (Wb)
pfv.vsbn = .....
pulse.run()
pulse.py
run()
burn()
# Routine to calculate the burn time for a pulsed reactor
if pulse_variables.lpulse != 1:
return
vsmax = -pfcoil_variables.vsbn
# Loop voltage during flat-top
vburn = plascur * rplas * facoh * csawth
tburn = vsmax / vburn - t_fusion_ramp |
Beta Was this translation helpful? Give feedback.
-
In principle I would like to eliminate the switch
|
Beta Was this translation helpful? Give feedback.
-
Proposal:
|
Beta Was this translation helpful? Give feedback.
-
No change needed. See Issue #3151. |
Beta Was this translation helpful? Give feedback.
-
In Power balance output and tburn consistency #17 I added an extra extra loop a long time ago in
fcnvm1
(evaluators.py
) to ensure thattburn
has reached a converged value. This will run all the physics and engineering functions up to 10 times, so it could be contributing to slow run times.If the verbose switch is on then it will print a message to the terminal each time. It would be worth setting
verbose=1
occasionally to see if this loop is running and how many times.Beta Was this translation helpful? Give feedback.
All reactions