18 lines
768 B
Python
18 lines
768 B
Python
"""User-facing wording shared by live events and saved result diagnostics."""
|
||
|
||
|
||
def format_property_warning(warning: dict) -> dict:
|
||
domains = {
|
||
"equation-of-state": "状态方程及热力性质的真实气体修正项",
|
||
"ideal-caloric": "理想气体热容、焓和内能",
|
||
"dynamic-viscosity": "动力黏度",
|
||
}
|
||
high = warning["direction"] == "high"
|
||
message = (
|
||
f"氦气物性有效温度越界:{domains[warning['property']]},"
|
||
f"t = {warning['time']:.9g} s,T = {warning['temperature']:.9g} K "
|
||
f"{'>' if high else '<'} {'Tmax' if high else 'Tmin'} = {warning['limit']:.9g} K。"
|
||
"仿真继续计算,超范围物性不保证有效性。"
|
||
)
|
||
return {**warning, "message": message}
|