Skip to content

13 - Energy Balance and Leaf Temperature Solving

Mixed Mesh, TurbidBoundary and dynamic terrain use the same three-backend native joint energy balance. Use stomatal_resistance (s/m) for fixed blades; joint solution for blades configured with Farquhar Ye Wen, An and Ball--Berry gs. Non-convergence throws ConvergenceError, partial status is not released.

Thermal infrared simulation requires ground object temperature. The temperature can either be specified directly by the user or determined by the energy balance Solve for light, air temperature, humidity and wind speed. This chapter introduces the second method.

What is the energy balance calculation?

For blades or surfaces that participate in the solution, LESS solves:

\[ R_n = H + LE + G \]

in:

  • \(R_n\) is net radiation, including short-wave absorption, long-wave absorption and own long-wave emission;
  • \(H\) is the sensible heat flux;
  • \(LE\) is the latent heat flux;
  • \(G\) is the surface heat flux. Blades are usually taken as 0.

The solution result is more than just an array of temperatures. It also contains the R_n, H, LE, G and closed residuals.

Required attributes

Components involved in energy balance require optical, thermal and biophysical properties:

leaves.set_property(
    "leaf",
    less.Fluspect(
        N=1.5, cab=45, car=10, cw=0.012, cm=0.006,
        fqe=0.012,
    ),
)
leaves.set_property(
    "leaf",
    less.ThermalProperty(
        temperature="air",
        emissivity=0.98,
    ),
)
leaves.set_property(
    "leaf",
    less.BiophysicalProperty(
        leaf_width=0.05,
        stomata_side="bottom",
        stomatal_resistance=150.0,
    ),
)

There are two commonly used ways to write ThermalProperty.temperature:

  • "air": Use the current air temperature as the initial temperature;
  • Kelvin value, such as 298.15: use the specified temperature as the initial value.

This is also the fixed temperature used by thermal infrared simulations when energy balance has not been run. After the energy balance converges, The thermal infrared simulation automatically uses the current state after solving.

Set microclimate

microclimate = less.Microclimate(
    air_temperature=25.0,  # degrees celsius
    humidity=60.0,         # Relative humidity, percent
    wind_speed=2.0,        # m/s
    pressure=101325.0,     # Pa
    ca=400.0,              # CO2,ppm
)

Note: air_temperature uses degrees Celsius, humidity uses percentages from 0–100.

state = scene.solve(
    microclimate=microclimate,
    modules=["energy_balance"],
)

print(state.energy_balance.result.summary())

thermal = scene.simulate(
    less.ThermalImager(
        less.Orthographic(image_size=512),
        bands=[10600.0],
        quality=128,
    )
)
thermal.save("leaf_temperature.tif")

ThermalImager reads the current energy balance status of the scene by default, so there is no need to state.energy_balance is then passed to the imager.

Check energy closure

eb = state.energy_balance.result
active = eb.active_mask

residual = eb.residual[active]
print("Maximum closed residual:", abs(residual).max(), "W/m2")
print("Mean closed residual:", abs(residual).mean(), "W/m2")
print("Number of iterations:", eb.n_iterations)
print("Is convergence:", eb.converged)

Release level calculations should not just check converged. Also check the temperature range and R_n - H - LE - G residual.

Mesh and TurbidBoundary

Both geometry representations use the same user flow:

  • Mesh results are saved as triangle patches;
  • The scene containing TurbidBoundary is saved as the component after placement;
  • The statistical medium internally calculates the conditional sun leaf and shade leaf temperatures separately, and then summarizes them according to the leaf area ratio;
  • All three backends support energy balancing.
eb = state.energy_balance
print(eb.spatial_mode)  # "primitive" or "component"

When does the status expire?

After modifying the following inputs, the old solution status will automatically become invalid:

  • lighting;
  • Microclimate;
  • component attribute;
  • Scene geometry or instances.

At this time, call scene.solve(...) again. If old results are explicitly passed to the imager, LESS will report The status has expired without continuing to generate potentially erroneous images.

Next step

  • less.EnergyBalanceProcessless.RadiationFieldProcess
  • less.Microclimateless.BiophysicalProperty
  • less.ThermalPropertyless.Farquhar
  • less.ThermalImagerless.EnergyBalanceProduct