feat: 調整網格細化參數。
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,7 +6,8 @@
|
||||
|
||||
Mesh.CharacteristicLengthExtendFromBoundary = 0;
|
||||
Mesh.Algorithm = 5;
|
||||
Mesh.CharacteristicLengthMax = 2.5e-5;
|
||||
Mesh.CharacteristicLengthMin = 2.0e-6; // 2 µm (for refinement)
|
||||
Mesh.CharacteristicLengthMax = 2.5e-5; // 25 µm (initial mesh)
|
||||
|
||||
cl = 2.5e-5;
|
||||
sf = 1.0e-4;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -49,12 +49,12 @@ RESULT_3DF = opto_3df_out
|
||||
# -----------------------------------------------------------------------------
|
||||
# 細化設定
|
||||
# -----------------------------------------------------------------------------
|
||||
LOOPS ?= 1
|
||||
LOOPS ?= 3
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# PHONY 目標宣告
|
||||
# -----------------------------------------------------------------------------
|
||||
.PHONY: help 2d 2df 3d 3df clean
|
||||
.PHONY: help 2d 3d clean
|
||||
|
||||
# =============================================================================
|
||||
# HELP - 顯示可用指令
|
||||
@@ -64,13 +64,9 @@ help:
|
||||
@echo " DEVSIM Optocoupler Simulation Makefile"
|
||||
@echo "=============================================================="
|
||||
@echo ""
|
||||
@echo " 完整模擬 (含網格細化):"
|
||||
@echo " make 2d 執行 2D 完整模擬"
|
||||
@echo " make 3d 執行 3D 完整模擬"
|
||||
@echo ""
|
||||
@echo " 快速模擬 (無網格細化):"
|
||||
@echo " make 2df 執行 2D 快速模擬"
|
||||
@echo " make 3df 執行 3D 快速模擬"
|
||||
@echo " 模擬指令:"
|
||||
@echo " make 2d 執行 2D 模擬 (含網格細化)"
|
||||
@echo " make 3d 執行 3D 模擬 (含網格細化)"
|
||||
@echo ""
|
||||
@echo " 其他:"
|
||||
@echo " make clean 清除所有生成檔案"
|
||||
@@ -196,23 +192,6 @@ sim2d: $(REFINED_MESH_2D)
|
||||
@echo " 結果檔案: $(RESULT_2D).msh, $(RESULT_2D).tec"
|
||||
@echo "=========================================="
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# 2df: 2D 快速模擬 (無網格細化)
|
||||
# 流程: mesh2d → 直接模擬
|
||||
# 指令:
|
||||
# 1. gmsh -nt N -2 -format msh2 opto_simplified.geo -o opto_simplified.msh
|
||||
# 2. python3 opto_simplified_run.py opto_simplified.msh
|
||||
# -----------------------------------------------------------------------------
|
||||
2df: mesh2d
|
||||
@echo ">>> [2df] 執行 2D 快速模擬 (無細化)..."
|
||||
@echo " 指令: $(PYTHON) opto_simplified_run.py $(MESH_2D) $(RESULT_2DF)"
|
||||
$(PYTHON) opto_simplified_run.py $(MESH_2D) $(RESULT_2DF)
|
||||
@echo ""
|
||||
@echo "=========================================="
|
||||
@echo ">>> [2DF] 快速模擬完成!"
|
||||
@echo " 網格檔案: $(MESH_2D)"
|
||||
@echo " 結果檔案: $(RESULT_2DF).msh, $(RESULT_2DF).tec"
|
||||
@echo "=========================================="
|
||||
|
||||
# =============================================================================
|
||||
# 3D 模擬流程
|
||||
@@ -328,23 +307,6 @@ sim3d: $(REFINED_MESH_3D)
|
||||
@echo " 結果檔案: $(RESULT_3D).msh, $(RESULT_3D).tec"
|
||||
@echo "=========================================="
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# 3df: 3D 快速模擬 (無網格細化)
|
||||
# 流程: mesh3d → 直接模擬
|
||||
# 指令:
|
||||
# 1. gmsh -nt N -3 -format msh2 opto_simplified_3d.geo -o opto_simplified_3d.msh
|
||||
# 2. python3 opto_3d_run.py opto_simplified_3d.msh
|
||||
# -----------------------------------------------------------------------------
|
||||
3df: mesh3d
|
||||
@echo ">>> [3df] 執行 3D 快速模擬 (無細化)..."
|
||||
@echo " 指令: $(PYTHON) opto_3d_run.py $(MESH_3D) $(RESULT_3DF)"
|
||||
$(PYTHON) opto_3d_run.py $(MESH_3D) $(RESULT_3DF)
|
||||
@echo ""
|
||||
@echo "=========================================="
|
||||
@echo ">>> [3DF] 快速模擬完成!"
|
||||
@echo " 網格檔案: $(MESH_3D)"
|
||||
@echo " 結果檔案: $(RESULT_3DF).msh, $(RESULT_3DF).tec"
|
||||
@echo "=========================================="
|
||||
|
||||
# =============================================================================
|
||||
# CLEAN - 清除所有生成檔案
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -136,8 +136,9 @@ Physical Curve("interface_encap_di_r") = {ifc_enc_di_r()};
|
||||
Physical Curve("interface_encap_led_l") = {ifc_enc_led_l()};
|
||||
Physical Curve("interface_encap_led_r") = {ifc_enc_led_r()};
|
||||
|
||||
/* === Mesh Settings (Uniform Size) === */
|
||||
// Use uniform mesh size for initial mesh, refinement handled by Python
|
||||
Mesh.CharacteristicLengthMin = lc_base;
|
||||
/* === Mesh Settings === */
|
||||
// Initial mesh uses lc_base, refinement can go down to lc_fine
|
||||
Mesh.CharacteristicLengthMin = lc_fine;
|
||||
Mesh.CharacteristicLengthMax = lc_base;
|
||||
|
||||
|
||||
|
||||
@@ -213,8 +213,7 @@ ifc_enc_led_z_front() = Surface In BoundingBox{x_led_l-d, y_led_bot-d, z_led-d,
|
||||
ifc_enc_led_z_back() = Surface In BoundingBox{x_led_l-d, y_led_bot-d, -z_led-d, x_led_r+d, y_led_top+d, -z_led+d};
|
||||
Physical Surface("interface_encap_led_z") = {ifc_enc_led_z_front(), ifc_enc_led_z_back()};
|
||||
|
||||
/* === Mesh Settings (Uniform Size) === */
|
||||
// Use uniform mesh size for initial mesh, refinement handled by Python
|
||||
Mesh.CharacteristicLengthMin = lc_base;
|
||||
/* === Mesh Settings === */
|
||||
// Initial mesh uses lc_base, refinement can go down to lc_fine
|
||||
Mesh.CharacteristicLengthMin = lc_fine;
|
||||
Mesh.CharacteristicLengthMax = lc_base;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user