tidy3d.HeatSimulation#
- class HeatSimulation[source]#
Bases:
AbstractSimulationContains all information about heat simulation.
- Parameters:
center (Attribute:
center) –TypeTuple[float, float, float]
Default= (0.0, 0.0, 0.0)
Unitsum
DescriptionCenter of object in x, y, and z.
size (Attribute:
size) –TypeTuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]
DefaultUnitsum
DescriptionSize in x, y, and z directions.
medium (Attribute:
medium) –TypeUnion[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue]
Default= Medium(nameNone, frequency_rangeNone, allow_gainFalse, nonlinear_specNone, modulation_specNone, heat_specNone, type’Medium’, permittivity1.0, conductivity0.0)
DescriptionBackground medium of simulation, defaults to vacuum if not specified.
structures (Attribute:
structures) –TypeTuple[Structure, …]
Default= ()
DescriptionTuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.
symmetry (Attribute:
symmetry) –TypeTuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]]
Default= (0, 0, 0)
DescriptionTuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be
0(symmetry off) or1(symmetry on).sources (Attribute:
sources) –TypeTuple[UniformHeatSource, …]
Default= ()
DescriptionList of heat sources.
boundary_spec (Attribute:
boundary_spec) –TypeTuple[HeatBoundarySpec, …]
Default= ()
DescriptionList of boundary condition specifications.
monitors (Attribute:
monitors) –TypeTuple[TemperatureMonitor, …]
Default= ()
DescriptionMonitors in the simulation.
grid_spec (Attribute:
grid_spec) –TypeUnion[UniformUnstructuredGrid, DistanceUnstructuredGrid]
DefaultDescriptionGrid specification for heat simulation.
version (Attribute:
version) –Typestr
Default= 2.6.0rc1
DescriptionString specifying the front end version number.
Example
>>> from tidy3d import Medium, SolidSpec, FluidSpec, UniformUnstructuredGrid, TemperatureMonitor >>> heat_sim = HeatSimulation( ... size=(3.0, 3.0, 3.0), ... structures=[ ... Structure( ... geometry=Box(size=(1, 1, 1), center=(0, 0, 0)), ... medium=Medium( ... permittivity=2.0, heat_spec=SolidSpec( ... conductivity=1, ... capacity=1, ... ) ... ), ... name="box", ... ), ... ], ... medium=Medium(permittivity=3.0, heat_spec=FluidSpec()), ... grid_spec=UniformUnstructuredGrid(dl=0.1), ... sources=[UniformHeatSource(rate=1, structures=["box"])], ... boundary_spec=[ ... HeatBoundarySpec( ... placement=StructureBoundary(structure="box"), ... condition=TemperatureBC(temperature=500), ... ) ... ], ... monitors=[TemperatureMonitor(size=(1, 2, 3), name="sample")], ... )
Attributes
Compute range of heat sources present in the simulation.
versionDefines the front end version of tidy3d
Methods
Error if structures contain unsupported yet geometries.
check_zero_dim_domain(val, values)Error if heat domain have zero dimensions.
from_scene(scene, **kwargs)Create a simulation from a :class:.`Scene` instance.
names_exist_bcs(val, values)Error if boundary conditions point to non-existing structures/media.
names_exist_grid_spec(val, values)Warn if UniformUnstructuredGrid points at a non-existing structure.
names_exist_sources(val, values)Error if a heat source point to non-existing structures.
plot_boundaries([x, y, z, ax])Plot each of simulation's boundary conditions on a plane defined by one nonzero x,y,z coordinate.
plot_heat_conductivity([x, y, z, ax, alpha, ...])Plot each of simulation's components on a plane defined by one nonzero x,y,z coordinate.
plot_sources([x, y, z, hlim, vlim, alpha, ax])Plot each of simulation's sources on a plane defined by one nonzero x,y,z coordinate.
- boundary_spec#
- sources#
- monitors#
- grid_spec#
- symmetry#
You should set the
symmetryparameter in yourSimulationobject using a tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis. Each element can be 0 (no symmetry), 1 (even, i.e.PMCsymmetry) or -1 (odd, i.e.PECsymmetry). Note that the vectorial nature of the fields must be considered to determine the symmetry value correctly.The figure below illustrates how the electric and magnetic field components transform under
PEC- andPMC-like symmetry planes. You can refer to this figure when considering whether a source field conforms to aPEC- orPMC-like symmetry axis. This would be helpful, especially when dealing with optical waveguide modes.
- classmethod check_unsupported_geometries(val)[source]#
Error if structures contain unsupported yet geometries.
- classmethod names_exist_bcs(val, values)[source]#
Error if boundary conditions point to non-existing structures/media.
- classmethod names_exist_grid_spec(val, values)[source]#
Warn if UniformUnstructuredGrid points at a non-existing structure.
- classmethod names_exist_sources(val, values)[source]#
Error if a heat source point to non-existing structures.
- plot_heat_conductivity(x=None, y=None, z=None, ax=None, alpha=None, source_alpha=None, monitor_alpha=None, colorbar='conductivity', hlim=None, vlim=None)[source]#
Plot each of simulation’s components on a plane defined by one nonzero x,y,z coordinate.
- Parameters:
x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.
y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.
z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.
ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.
alpha (float = None) – Opacity of the structures being plotted. Defaults to the structure default alpha.
source_alpha (float = None) – Opacity of the sources. If
None, uses Tidy3d default.monitor_alpha (float = None) – Opacity of the monitors. If
None, uses Tidy3d default.colorbar (str = "conductivity") – Display colorbar for thermal conductivity (“conductivity”) or heat source rate (“source”).
hlim (Tuple[float, float] = None) – The x range if plotting on xy or xz planes, y range if plotting on yz plane.
vlim (Tuple[float, float] = None) – The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
- Returns:
The supplied or created matplotlib axes.
- Return type:
matplotlib.axes._subplots.Axes
- plot_boundaries(x=None, y=None, z=None, ax=None)[source]#
Plot each of simulation’s boundary conditions on a plane defined by one nonzero x,y,z coordinate.
- Parameters:
x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.
y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.
z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.
ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.
- Returns:
The supplied or created matplotlib axes.
- Return type:
matplotlib.axes._subplots.Axes
- plot_sources(x=None, y=None, z=None, hlim=None, vlim=None, alpha=None, ax=None)[source]#
Plot each of simulation’s sources on a plane defined by one nonzero x,y,z coordinate.
- Parameters:
x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.
y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.
z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.
hlim (Tuple[float, float] = None) – The x range if plotting on xy or xz planes, y range if plotting on yz plane.
vlim (Tuple[float, float] = None) – The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
alpha (float = None) – Opacity of the sources, If
Noneuses Tidy3d default.ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.
- Returns:
The supplied or created matplotlib axes.
- Return type:
matplotlib.axes._subplots.Axes
- property source_bounds#
Compute range of heat sources present in the simulation.
- classmethod from_scene(scene, **kwargs)[source]#
Create a simulation from a :class:.`Scene` instance. Must provide additional parameters to define a valid simulation (for example,
size,grid_spec, etc).- Parameters:
scene (:class:.`Scene`) – Scene containing structures information.
**kwargs – Other arguments
Example
>>> from tidy3d import Scene, Medium, Box, Structure, UniformUnstructuredGrid >>> box = Structure( ... geometry=Box(center=(0, 0, 0), size=(1, 2, 3)), ... medium=Medium(permittivity=5), ... ) >>> scene = Scene( ... structures=[box], ... medium=Medium(permittivity=3), ... ) >>> sim = HeatSimulation.from_scene( ... scene=scene, ... center=(0, 0, 0), ... size=(5, 6, 7), ... grid_spec=UniformUnstructuredGrid(dl=0.4), ... )
- __hash__()#
Hash method.