Skip to content

Output & Visualization

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

result/<case>/
├── thermal_fluid_results/     # thermal-fluid solver
├── species_results/           # species transport solver (own uniform grid)
├── mechanical_results/        # mechanical solver
├── coupling/                  # thermal → CA per-step bbox frames (binary)
└── CA_results/
    ├── initial_grain/         # CA initial Voronoi grain structure
    └── scan_grain/            # CA thermal-fluid coupled 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}.vts + <case>_vtkmov.pvd XML StructuredGrid + zlib-compressed base64 payload (~7-8× smaller than legacy .vtk). Open the .pvd for time-aware playback. Every outputintervel steps
<case>_timing_report.txt CPU time breakdown by module End of simulation
<case>_memory_report.txt Peak memory usage (VmHWM headlined; see below) 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

Species (result/<case>/species_results/)

Written only when species_flag=1. Lives in its own folder because the species solver runs on its own uniform X/Y grid, decoupled from the thermal AMR grid.

File Description When
<case>_species{N}.vts + <case>_species.pvd XML StructuredGrid + zlib-compressed base64. Fields: Velocity, T, concentration. Open the .pvd for time-aware playback. Every outputintervel steps

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

XML StructuredGrid (.vts) files with zlib-compressed base64 payloads, indexed by a .pvd Collection for time-aware playback. Native ParaView open, no plugins.

Thermal .vts fields (vtkmov*.vts)

Field Name Description Unit
Velocity Flow velocity (cell-centred, zeroed below solidus) m/s
T Temperature K
vis Viscosity Pa·s
diff Thermal diffusivity m²/s
den Density kg/m³
fracl Liquid fraction (0=solid, 1=liquid) -

Species fields (concentration) are NOT written here — they live in their own species_results/<case>_species{N}.vts series so the two solvers' output streams stay decoupled. See Species Transport › Output.

Opening in ParaView

  1. File → Open → select <case>_vtkmov.pvd (the time-series index)
  2. Click "Apply"
  3. Select scalar / vector field from dropdown
  4. Use animation controls to step through time

The same workflow applies to species_results/<case>_species.pvd and CA's Grains.vti.series.

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

All three solvers' memory reports (*_memory_report.txt, *_mech_memory_report.txt, CA_results/*/memoryLog.dat) lead with VmHWM — the only number that should drive machine-sizing decisions.

============================================
  PHOENIX Memory Report
============================================

  *** VmHWM is THE number to look at ***
  Use it to size the machine; the others are diagnostic only.

  VmHWM:   ...   peak PHYSICAL RAM (RSS) ever used during the run.

  --- diagnostic / less important ---

  VmPeak:  ...   peak VIRTUAL memory size (much larger than VmHWM)
  VmRSS:   ...   physical RAM at the MOMENT this report was written
  VmData:  ...   heap + stack, excludes shared libraries
Metric What it tells you Use for sizing?
VmHWM Peak physical RAM ever used Yes
VmPeak Peak virtual memory ever requested No (VM ≠ RAM)
VmRSS Physical RAM at exit-time snapshot No (could be < peak after frees)
VmData Allocated heap + stack Detail only

The mechanical subprocess writes its own *_mech_memory_report.txt with the same VmHWM-headlined block plus a static breakdown of FEM-array allocations (sig_gp + eps_gp, displacement, stress output) — useful for understanding which mech array dominates the peak.

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.