Skip to content

Output & Visualization

Output is split per-solver under code_base/result/<case_name>/:

result/<case>/
├── thermal_fluid_results/     # everything produced by the thermal-fluid solver (and species)
├── mechanical_results/        # everything produced by the mechanical solver
└── CA_results/
    ├── initial_grain/         # CA initial Voronoi grain structure
    └── scan_grain/            # CA Rosenthal remelt + resolidification

Output Files

Thermal-fluid (result/<case>/thermal_fluid_results/)

File Description When
<case>_output.txt Iteration-by-iteration text log Every time step
<case>_vtkmov{N}.vtk Binary VTK structured grid Every outputintervel steps
<case>_timing_report.txt CPU time breakdown by module End of simulation
<case>_memory_report.txt Peak memory usage (VmHWM, VmRSS) End of simulation
<case>_defect_report.txt Defect fraction summary End of simulation
<case>_maxtemp.vtk Max temperature field (VTK) End of simulation
<case>_defect.vtk Defect classification field (VTK) End of simulation
<case>_thermal_history.txt Temperature at 10 monitoring points Every time step
<case>_thermal_history.png Temperature evolution plot End of simulation
<case>_meltpool_history.txt Melt pool length, depth, width, volume, Tpeak Every time step
<case>_meltpool_history.png Melt pool geometry evolution plot End of simulation
<case>_species{N}.vtk Species concentration VTK Every outputintervel steps (species_flag=1)

Mechanical (result/<case>/mechanical_results/)

File Description When
<case>_mech_NNNNN.vtk Mechanical VTK (stress, displacement) Every mech_output_interval solves
<case>_mech_history.txt Stress/displacement at monitoring points Every mechanical solve
<case>_mech_history.png Stress/displacement evolution plot End of simulation
<case>_mech_timing_report.txt Mechanical solver timing breakdown End of simulation
<case>_mech_memory_report.txt Mechanical solver peak memory End of simulation
<case>_deformation.gif Von Mises stress animation (10x deformation) End of simulation
<case>_deformation_final.png Final stress state (high-res) End of simulation

CA (result/<case>/CA_results/{initial_grain,scan_grain}/)

File Description When
Grains.vti.series + grainsTimeStates/Grains_*.vti Grain-ID time series (VTK XML ImageData + JSON index). Each frame carries grain_id (Int32) and grain_orientation (Float32×3), zlib-compressed (vtkZLibDataCompressor, 32 KB blocks, level 1) and stored with format="binary" inline base64. Typical on-disk size is ~25–30 % of the raw 16 B/cell payload (compression dominated by base64's 33 % overhead — the deflate step itself hits ~20× on grain_id). Dumps run in a forked child process so the CA main loop is never blocked on disk I/O; the child also calls fsync + posix_fadvise(DONTNEED) before exiting so the file is flushed and evicted from the page cache, keeping the dirty-page budget available for the concurrent thermal writer. ParaView opens .vti natively; no decompression step needed. Per CA output frequency
microstructureInfo.txt Final grain state (serial dump) End of step
grainSizeStatistics.txt, average_grain_size.txt, grain_size_histogram.png Post-processed grain-size stats Mid-run (every 20 VTK frames) + end
timeLog.dat, memoryLog.dat CA solver timing and memory Mid-run + end

output.txt Format

Each time step produces a 4-line block:

  time  iter  time/iter  tot_iter  res_enth  res_mass  res_u  res_v  res_w  [res_spec]
 2.10E-05   60    0.006        60   1.2E-04   5.0E-02  1.3E-02  ...

  Tmax        umax       vmax         wmax       length       depth     width
  1594.47   0.00E+00    0.00E+00    0.00E+00   ...

  north  south  top  toploss  bottom  west  east  hout  accu  hin  heatvol  ratio
    0.0    0.0    0.0    0.0    0.0    0.0    0.0   0.0   0.0   0.0   0.0   0.00

progress%  beam_posx  beam_posy  beam_posz  power  scanspeed  speedx  speedy
     0.70  5.258E-04  2.000E-03  7.000E-04  300.0    1.230    1.230    0.000
Field Description
res_enth Enthalpy equation residual
res_mass Mass conservation (pressure correction) residual
res_u/v/w Momentum residuals
res_spec Species residual (only when species_flag=1)
Tmax Peak temperature in domain (K)
umax/vmax/wmax Peak velocities (m/s)
length/depth/width Melt pool dimensions (m)
ratio Energy balance ratio (should be ~1.0)
progress% Simulation progress (%)

VTK Files

Binary structured-grid VTK files, viewable in ParaView.

Scalar Fields

Field Name Description Unit Always
T Temperature K Yes
vis Viscosity Pa*s Yes
diff Thermal diffusivity m^2/s Yes
den Density kg/m^3 Yes
solidID Solidification track ID - Yes
fracl Liquid fraction (0=solid, 1=liquid) - Yes
concentration Species mass fraction (C=1: primary) - species_flag=1
tsolid_field Composition-dependent solidus K species_flag=1

Vector Fields

Field Name Description Unit
Velocity Flow velocity (interpolated to cell centers) m/s

Opening in ParaView

  1. File → Open → select <case>_vtkmov*.vtk
  2. Click "Apply"
  3. Select scalar/vector field from dropdown
  4. Use animation controls to step through time

Useful ParaView Filters

  • Threshold: Show only melt pool (T > 1563)
  • Slice: Cut through domain to see cross-sections
  • Glyph: Visualize velocity vectors
  • Calculator: Compute derived quantities (e.g., T - 1563 for superheat)

Timing Report

============================================
  PHOENIX Module Timing Report
============================================
  Total iterations (itertot): 17055
  Total CPU time:     2513.425 s
  Total wall time:      765.089 s
--------------------------------------------
  Module              |   Time(s)   |   Ratio(%)
--------------------------------------------
             mod_prop |     440.355  |   17.52%
             mod_sour |     406.017  |   16.15%
             ...
           mod_species|       4.355  |    0.17%

Memory Report

============================================
  PHOENIX Memory Report
============================================
  VmPeak:  ...   (peak virtual memory)
  VmHWM:   ...   (peak physical RAM — use this to size your machine)
  VmRSS:   ...   (current physical RAM at report time)
  VmData:  ...   (heap + stack, excludes shared libraries)

Defect Report

  === Defect Analysis (maxtemp_determ) ===
  Defect fraction:           X.XXXXXX %
  Lack-of-fusion fraction:   X.XXXXXX %
  Keyhole porosity fraction: X.XXXXXX %

Spatial distribution available in thermal_fluid_results/<case>_defect.vtk and thermal_fluid_results/<case>_maxtemp.vtk.

Melt Pool History

Time-series log of melt pool geometry, recorded every timestep.

Column Description Unit
time Simulation time s
length Melt pool length (along scan) m
depth Melt pool depth (from surface) m
width Melt pool width (transverse) m
volume Melt pool volume (from liquid fraction)
Tpeak Peak temperature in domain K
laser_on Laser state (1=on, 0=off) -

Auto-generated plot: <case>_meltpool_history.png (4-panel: length, depth/width, volume, Tpeak).

Mechanical Output

When mechanical_flag=1, separate VTK files are written for mechanical results.

Mechanical VTK Fields (<case>_mech_NNNNN.vtk)

Field Type Unit Description
Temperature scalar K Temperature at FEM nodes
ux, uy, uz scalar m Displacement components
phase integer - 0=powder, 1=liquid, 2=solid
sxx, syy, szz scalar Pa Normal stress components
von_mises scalar Pa Von Mises equivalent stress
fplus scalar Pa Yield function (>0 = plastic)

Note

Mechanical VTK files use a coarsened FEM grid (controlled by mech_mesh_ratio), separate from the thermal VTK files which use the full simulation grid.

Mechanical History

Time-series log at 10 monitoring points (same as thermal history), recorded every mechanical solve.

Columns: time, T(1..10), ux(1..10), uy(1..10), uz(1..10), sxx(1..10), syy(1..10)

Auto-generated plots: <case>_mech_history.png (3-panel: temperature, displacement, stress).

Deformation Animation

<case>_deformation.gif shows von Mises stress with 10x deformation magnification. Uses matplotlib rendering with jet colormap. Final frame also saved as <case>_deformation_final.png at 200 DPI.