Source code for tidy3d.components.tcad.source.heat
"""Defines heat-charge material specifications for 'HeatChargeSimulation'"""
from __future__ import annotations
from typing import Any, Union
from pydantic import Field, model_validator
from tidy3d.components.data.data_array import SpatialDataArray
from tidy3d.components.tcad.source.abstract import StructureBasedHeatChargeSource
from tidy3d.constants import VOLUMETRIC_HEAT_RATE
from tidy3d.log import log
[docs]
class HeatSource(StructureBasedHeatChargeSource):
"""Adds a volumetric heat source (heat sink if negative values
are provided) to specific structures in the scene.
Example
-------
>>> heat_source = HeatSource(rate=1, structures=["box"])
"""
rate: Union[float, SpatialDataArray] = Field(
title="Volumetric Heat Rate",
description="Volumetric rate of heating or cooling (if negative).",
json_schema_extra={"units": VOLUMETRIC_HEAT_RATE},
)