voxcity.simulator_gpu.solar.svf.SVFCalculator¶
- 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.
- domain¶
- nx¶
- ny¶
- nz¶
- dx¶
- dy¶
- dz¶
- n_azimuth = 80¶
- n_elevation = 40¶
- n_directions = 3200¶
- max_dist¶
- directions¶
- solid_angles¶
- total_solid_angle¶
- 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.
- Parameters:
surf_pos – Surface positions (n_surf, 3)
surf_dir – Surface directions (n_surf,)
is_solid – 3D field of solid cells
n_surf – Number of surfaces
svf – Output SVF values (n_surf,)
- 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)
- Parameters:
surf_pos – Surface positions
surf_dir – Surface directions
is_solid – 3D solid field
lad – 3D Leaf Area Density field
n_surf – Number of surfaces
ext_coef – Extinction coefficient
svf – Output SVF with canopy (n_surf,)
svf_urban – Output SVF without canopy (n_surf,)