HaomingLuo's picture
Add runnable heat-source and temperature-field plotting recipe
e2dc0ac verified
|
Raw History Blame Contribute Delete
6.85 kB
metadata
license: cc-by-4.0
language:
  - en
tags:
  - agentfem
  - finite-element-method
  - scientific-machine-learning
  - physics-ai
  - simulation
  - heat-transfer
  - thermal-conduction
  - temperature-field
pretty_name: AgentFEM Multi-Source Heat Conduction
size_categories:
  - n<1K
configs:
  - config_name: default
    data_files:
      - split: train
        path: train.jsonl
      - split: validation
        path: validation.jsonl
      - split: test
        path: test.jsonl

AgentFEM · Multi-source heat conduction

Two smooth volumetric heat sources in a rectangular conducting plate. Learn how source placement, spread, intensity, geometry and conductivity shape the temperature field.

AgentFEM finite-element examples

256 independently solved parameter sets · full meshes and fields · 192 / 32 / 32 split · CC BY 4.0

Built with AgentFEM. A small, reproducible engineering dataset for surrogate learning, field prediction and numerical-method experiments.

A first experiment

Predict peak temperature rise from the source and material parameters, then compare with the supplied held-out scalar baselines. For a full-field study, use the HDF5 mesh and nodal temperatures rather than treating the JSONL rows as images.

Load the test split · Inspect baseline results · Practice heat conduction with AgentFEM

See the source and temperature together

Run plot_heat.py to draw one recorded sample: heat generation on the left, temperature rise on the right. It downloads only the pinned test split (about 1.9 MB), uses the actual triangular mesh, and prints the peak temperature and its coordinates. No FEM installation or GPU is needed.

pip install numpy h5py matplotlib huggingface_hub
python plot_heat.py
# Or use a file you already downloaded:
python plot_heat.py --data test.h5 --sample 00016 --output heat.png

Heat-generation input beside the recorded finite-element temperature rise

The circle marks the hottest mesh node. Compare the two source locations with that point: source strength alone does not determine the temperature, because heat spreads through the plate and escapes at the cooled edges. This figure reads a stored solution; changing a source parameter requires a new solve, not recolouring this image.

Physical problem

Steady isotropic conduction: -div(k grad(T)) = q. All four edges are held at 300 K. The two Gaussian sources are uniform through the unit out-of-plane thickness. No air flow, contact resistance, radiation, or convection is solved.

Linear triangular temperature elements; 48 by 32 structured subdivisions (3,072 triangles).

An idealized heat-spreading plate with isothermal cooled edges, not a complete electronic cooling system. Positive Gaussian heat sources may overlap. Sampling confines source 1 to the lower-left and source 2 to the upper-right part of the plate.

What is included

  • train.h5, validation.h5, test.h5: one group per sample ID, geometry, connectivity, point fields and cell fields. Gzip-compressed without floating-point downcasting.
  • HDF5 inputs/: boundary-node masks and, for heat, the prescribed Gaussian source evaluated at mesh nodes. These are model inputs, not predicted fields or integrated nodal loads.
  • Corresponding JSONL files: browsable parameters and engineering observables; they point to HDF5 groups, not serialized full fields.
  • quality.json: checks, dependency versions, convergence evidence.
  • baselines.json, baseline.py: held-out scalar mean/nearest-neighbor baselines with train-only normalization; no neural-model claims.
  • generate.py, quality.py, load_example.py: generation, audit and minimal loading workflows.

SI units: coordinates and U in m; stress S and MISES in Pa; strain E dimensionless; temperature in K. coordinates are undeformed reference nodes. Connectivity follows the AgentFEM XDMF export order: Triangle (heat), Triangle_6 (notch), or Quadrilateral_9 (cylinder). Cell stress is projected and unsmoothed. See generated XDMF for native export semantics.

Tensor components are flattened row-major: 2×2 for plane stress (x,y), 3×3 for axisymmetry (r,theta,z). Displacement U uses padded three-component storage; active components are (x,y) for the plate and (r,z) for the cylinder. The HDF5 files contain mesh connectivity, not an assumed common image grid.

Parameters, in generator order: length_m, height_m, conductivity_w_m_k, source1_x_fraction, source1_y_fraction, source2_x_fraction, source2_y_fraction, source1_sigma_m, source2_sigma_m, source1_peak_w_m3, source2_peak_w_m3.

Observed sample ranges (exact values are in JSONL; intended sampling bounds are in generate.py):

Parameter Minimum Maximum
length_m 0.0801395 0.159853
height_m 0.0501502 0.0998562
conductivity_w_m_k 15.6592 199.899
source1_x_fraction 0.150413 0.449133
source1_y_fraction 0.151047 0.449245
source2_x_fraction 0.550528 0.849329
source2_y_fraction 0.550023 0.849833
source1_sigma_m 0.00402783 0.0119955
source2_sigma_m 0.00402299 0.0119821
source1_peak_w_m3 1.01861e+06 7.97658e+06
source2_peak_w_m3 1.0042e+06 7.97922e+06

Quality evidence

Eight mesh-refinement audits: maximum relative change in peak_temperature_rise_k = 0.44%. This is an observable convergence check, not a bound on full-field error.

All published field arrays are finite; all parameter sets and geometry/source-layout parameter tuples are unique. Splits use one fixed random permutation after scrambled Sobol sampling (seed 20260923; split seed 20260924). All splits are in-distribution; no claim of unseen-family generalization. One row is one independently solved case, not a frame or a rescaled duplicate.

Generic continuous material ranges are synthetic, not calibrated material grades. Dataset generation does not imply experimental validation. These are original parameterized examples, not certified NAFEMS benchmarks or copies of commercial solver datasets.

Load and reproduce

python load_example.py --repo HaomingLuo/AgentFEM-MultiSource-Heat-2D --split test
# In the pinned AgentFEM/FEniCSx environment:
python generate.py heat --count 256

Loading requires only h5py, numpy and huggingface_hub; FEniCSx is needed only to regenerate FEM results. Generation writes a local generated/ directory and uses one MPI rank. The heat manufactured-solution check is available via python generate.py heat --validate.

Attribution

Haoming Luo, Multi-source heat conduction — AgentFEM parametric FEM dataset, 2026. Please cite this repository URL and the commit revision used. Data: CC BY 4.0. Example code: Apache-2.0.