Implement SIBC (Leontovich boundary condition) for good conductors #46
Implement SIBC (Leontovich boundary condition) for good conductors #46elenafuengar wants to merge 15 commits intomainfrom
Conversation
…nly contains numerical values and not str. Update plot_solids to use 0.3 opacity for vacuum-like values
…logic, supporting only numerical values
…ate _mpi_one_step
…g a gradient based boundary detection
|
🔍 Algorithm explanation This snippet tags the surface of solid regions by computing the gradient magnitude of a scalar field (e.g. material mask) and converting it to a boolean mask. It uses PyVista's Gradient filter: def _mark_cells_in_surface(self):
# Modify the STL mask to account only for the surface
for key in self.stl_solids.keys():
if len(self.stl_materials[key]) == 3 and self.stl_materials[key][2] > 1e3:
grad = np.array(self.grid.compute_derivative(scalars=key)['gradient']) #bool STL mask
grad = np.sqrt(grad[:, 0]**2 + grad[:, 1]**2 + grad[:, 2]**2) #from 0 to 255
self.grid[key] = grad.astype(bool)The surface is identified where the gradient of the scalar field is non-zero: Cells where
|
Maximum Conductivity Resolvable Without a Leontovich BoundaryTo accurately model a conducting material volumetrically in FIT/FDTD, the skin depth must be resolved by the grid. A common requirement is at least 3 cells per skin depth, i.e. where Materials with |
Surface Parameters for the Leontovich (SIBC) BoundaryFor a good conductor, the Leontovich surface impedance has the form meaning that the resistive and reactive parts are equal (a and define an equivalent surface admittance To embed this into the time-domain FIT update, we convert
Both appear with the same magnitude because the |



📝 Pull Request Summary
This pull request introduces several improvements and refactorings to the handling of STL-based materials and the solver infrastructure for the 3D grid simulation package. The main changes focus on enhancing flexibility in material assignment, supporting the Surface Impedance Boundary Condition (SIBC) for high-conductivity materials, and refactoring solver methods for better code organization and maintainability.
🔧 Changes Made
STL Material Handling and SIBC Support
GridFIT3D, which is automatically applied to STL solids with conductivity greater than 1e3 S/m. This involves marking only the surface cells for such materials. (wakis/gridFIT3D.py) [1] [2] [3]material_lib, and all STL material data is normalized to dictionary format for consistency. (wakis/gridFIT3D.py)'vacuum'to[1.0, 1.0]for consistency and improved opacity handling in plotting. (tests/test_007_mpi_lossy_cavity.py,wakis/gridFIT3D.py) [1] [2]Solver Infrastructure Refactoring
_one_step,_mpi_one_step, etc.), improving code clarity and encapsulation. Public methods now delegate to these internal implementations. (wakis/solverFIT3D.py) [1] [2] [3] [4] [5] [6]_apply_stl_materialsmethod in the solver, ensuring correct assignment of permittivity, permeability, and conductivity to grid cells. (wakis/solverFIT3D.py) [1] [2]Other Improvements
wakis/solverFIT3D.py) [1] [2] [3]one_stepmethod instead of the old MPI-specific method for improved compatibility. (tests/test_007_mpi_lossy_cavity.py)✅ Checklist
docs/or included inexamples/andnotebooks/)📌 Related Issues / PRs
Closes #45