diff --git a/core.py b/core.py index a012a85..7aeda86 100644 --- a/core.py +++ b/core.py @@ -215,10 +215,10 @@ def thunder_density(i, td, ip_a, ip_b): # 雷电流幅值密度函数 ) return r else: - if td == 20: + if td <= 20: r = -(10 ** (-i / 44)) * math.log(10) * (-1 / 44) # 雷暴日20d return r - if td == 40: + if td <= 40 and td>20: r = -(10 ** (-i / 88)) * math.log(10) * (-1 / 88) # 雷暴日40d return r raise Exception("检查雷电参数!") diff --git a/main.py b/main.py index 2dc286a..114500b 100644 --- a/main.py +++ b/main.py @@ -290,7 +290,7 @@ def run_egm(para: Parameter) -> dict: ** 0.5 ) if distance > rc: - logger.info(f"电流为{i_bar}kV时,暴露弧已经完全被屏蔽") + logger.info(f"电流为{i_bar}kA时,暴露弧已经完全被屏蔽") exposed_curve_shielded = True break animate.pause() diff --git a/webui/src/components/ParameterForm.vue b/webui/src/components/ParameterForm.vue index 82e98e8..c8d28b6 100644 --- a/webui/src/components/ParameterForm.vue +++ b/webui/src/components/ParameterForm.vue @@ -668,6 +668,11 @@ declare global { // 注册全局日志接收函数,供后端实时调用 onMounted(() => { + // 程序启动时,根据雷暴日初始化地闪密度 + if (params.parameter.td > 0 && params.advance.ng < 0) { + params.advance.ng = Math.round(0.023 * Math.pow(params.parameter.td, 1.3) * 100) / 100 + } + // 实时日志推送 window.addLogFromBackend = (log: { level: string; time: string; message: string }) => { logRef.value?.addLog(log.level as any, log.message)