< Back

Displaying Crank Angle for a Multi-cycle Simulation


Four stroke internal combustion engines have a cycle of 720 degrees. Many CONVERGE users want to see crank angle represented as values from 0-720. CONVERGE simulations may span multiple engine cycles, so you could easily end up with solution times from 0-3600 (for example).
The following PyTecplot code will create Zone Auxiliary data with the “true” crank angle. The user can then display the value on the plot using &(AUXZONE[ACTIVEOFFSET=1]:Crank_Angle)

import tecplot as tp
tp.session.connect()
dataset = tp.active_frame().dataset

degrees_per_cycle = 720
for z in dataset.zones():
  t = z.solution_time
  crank_angle = t - int(t/degrees_per_cycle)*degrees_per_cycle
  z.aux_data["Crank_Angle"] = crank_angle