How Can I Define the Simulation Grid?#
Date |
Category |
|---|---|
2025-08-26 10:06:59 |
Charge |
There are two classes available for defining the grid specification:
-
This class implements a simple uniform unstructured grid, with the grid size defined by the
dlargument. For an application example, see this example.
heat_grid = UniformUnstructuredGrid(dl=0.1)
-
This class specifies the mesh size based on the distance from material interfaces. The finer grid near interfaces is defined by the
dl_interfaceargument, while the coarser bulk grid size is set usingdl_bulk. The distances over whichdl_interfaceanddl_bulkare enforced can be controlled with thedistance_interfaceanddistance_bulkarguments, respectively. For an application example, see this example notebook.
heat_grid = DistanceUnstructuredGrid(
dl_interface=0.1,
dl_bulk=1,
distance_interface=0.3,
distance_bulk=2,
)
The user can also add refinement regions to enforce a minimum grid size in a given region using the GridRefinementRegion object, or along a line using the GridRefinementLine object. An example of this can be found in our charge solver example.