voxcity.simulator_gpu.solar.svf.SVFCalculator ============================================= .. py:class:: voxcity.simulator_gpu.solar.svf.SVFCalculator(domain, n_azimuth: int = 80, n_elevation: int = 40) GPU-accelerated Sky View Factor calculator. Computes SVF by tracing rays from each surface to the hemisphere. SVF = fraction of hemisphere visible from surface. .. py:attribute:: domain .. py:attribute:: nx .. py:attribute:: ny .. py:attribute:: nz .. py:attribute:: dx .. py:attribute:: dy .. py:attribute:: dz .. py:attribute:: n_azimuth :value: 80 .. py:attribute:: n_elevation :value: 40 .. py:attribute:: n_directions :value: 3200 .. py:attribute:: max_dist .. py:attribute:: directions .. py:attribute:: solid_angles .. py:attribute:: total_solid_angle .. py:method:: compute_svf(surf_pos: ti.template(), surf_dir: ti.template(), is_solid: ti.template(), n_surf: taichi.i32, svf: ti.template()) Compute Sky View Factor for all surfaces. Uses PALM's methodology (radiation_model_mod.f90): - For upward surfaces: vffrac_up = (cos(2*elev_low) - cos(2*elev_high)) / (2*n_azim) - For vertical surfaces: vffrac_vert = (sin(az2) - sin(az1)) * elev_terms / (2*pi) where az is measured relative to surface normal and elev_terms accounts for the elevation integration. :param surf_pos: Surface positions (n_surf, 3) :param surf_dir: Surface directions (n_surf,) :param is_solid: 3D field of solid cells :param n_surf: Number of surfaces :param svf: Output SVF values (n_surf,) .. py:method:: compute_svf_with_canopy(surf_pos: ti.template(), surf_dir: ti.template(), is_solid: ti.template(), lad: ti.template(), n_surf: taichi.i32, ext_coef: taichi.f32, svf: ti.template(), svf_urban: ti.template()) Compute SVF including canopy absorption. Uses PALM's methodology (radiation_model_mod.f90): - For upward surfaces: vffrac_up = (cos(2*elev_low) - cos(2*elev_high)) / (2*n_azim) - For vertical surfaces: vffrac_vert = (sin(az2) - sin(az1)) * elev_terms / (2*pi) :param surf_pos: Surface positions :param surf_dir: Surface directions :param is_solid: 3D solid field :param lad: 3D Leaf Area Density field :param n_surf: Number of surfaces :param ext_coef: Extinction coefficient :param svf: Output SVF with canopy (n_surf,) :param svf_urban: Output SVF without canopy (n_surf,)