Skip to content

Commit a020481

Browse files
tizianrotRobPasMueSMoraisAnsyspre-commit-ci[bot]MaxJPRey
authored
pyAEDTM2D_Lum (#79)
Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com> Co-authored-by: Sébastien Morais <sebastien.morais@ansys.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com>
1 parent 6495683 commit a020481

File tree

15 files changed

+1035
-11
lines changed

15 files changed

+1035
-11
lines changed

.github/workflows/docs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ jobs:
4747
with:
4848
doc-build: true
4949

50+
maxwell2d-lumerical:
51+
uses: ./.github/workflows/maxwell2d-lumerical.yml
52+
secrets: inherit
53+
with:
54+
doc-build: true
55+
5056
compile-docs:
5157
runs-on: ubuntu-latest
5258
# TODO: enable when issues in PyMechanical are resolved
@@ -106,6 +112,12 @@ jobs:
106112
name: mapdl-dpf-docs
107113
path: doc/
108114

115+
- name: Download artifacts for maxwell2d-lumerical
116+
uses: actions/download-artifact@v7
117+
with:
118+
name: maxwell2d-lumerical-docs
119+
path: doc/
120+
109121
- name: Build the documentation
110122
run: |
111123
cd doc
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Maxwell2D Lumerical Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
doc-build:
7+
required: false
8+
default: false
9+
type: boolean
10+
description: 'Whether to build the documentation'
11+
workflow_call:
12+
inputs:
13+
doc-build:
14+
required: false
15+
default: false
16+
type: boolean
17+
description: 'Whether to build the documentation'
18+
push:
19+
branches:
20+
- main
21+
pull_request:
22+
paths:
23+
- 'maxwell2d-lumerical/**'
24+
25+
env:
26+
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER )}}
27+
ANSYS_RELEASE_FOR_DOCS: 25.2
28+
ANSYSEM_ROOT252: 'C:\Program Files\ANSYS Inc\v252\AnsysEM'
29+
MAIN_PYTHON_VERSION: '3.12'
30+
ON_CI: true
31+
32+
jobs:
33+
34+
is-only-docs-required:
35+
uses: ./.github/workflows/check-docs-required.yml
36+
with:
37+
doc-build: ${{ inputs.doc-build || false }}
38+
39+
maxwell2d-lumerical:
40+
name: Maxwell2D Lumerical
41+
runs-on: [self-hosted, Windows, pyansys-workflows]
42+
needs: is-only-docs-required
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
ansys-release: ${{ needs.is-only-docs-required.outputs.only-docs == 'true' && fromJSON('[25.2]') || fromJSON('[25.2]') }}
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
50+
with:
51+
sparse-checkout: |
52+
maxwell2d-lumerical
53+
doc
54+
55+
- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
56+
uses: actions/setup-python@2e3e4b15a884dc73a63f962bff250a855150a234 # v5.6.0
57+
with:
58+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
59+
60+
- name: Install dependencies
61+
shell: bash
62+
run: |
63+
python -m pip install --upgrade pip
64+
python -m venv .venv
65+
source .venv/Scripts/activate
66+
pip install -r maxwell2d-lumerical/requirements_${{ matrix.ansys-release }}.txt
67+
68+
- name: Run the workflow script
69+
env:
70+
AEDT_VERSION: ${{ matrix.ansys-release }}
71+
shell: bash
72+
run: |
73+
source .venv/Scripts/activate
74+
python maxwell2d-lumerical/wf_ml_01_ion_trap_modelling.py
75+
76+
- name: (DOCS) Build the documentation (only on ${{ env.ANSYS_RELEASE_FOR_DOCS}})
77+
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
78+
env:
79+
BUILD_DOCS_SCRIPT: 'maxwell2d-lumerical/wf_ml_01_ion_trap_modelling.py'
80+
shell: bash
81+
run: |
82+
source .venv/Scripts/activate
83+
cd doc
84+
pip install -r requirements.txt
85+
./make.bat html
86+
87+
- name: (DOCS) Adapt the documentation paths
88+
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
89+
shell: bash
90+
run: |
91+
find doc/_build -type f -exec sed -i 's|C:\\Users\\ansys\\actions-runner\\_work\\pyansys-workflows\\pyansys-workflows\\doc\\source\\examples\\maxwell2d-lumerical\\images\\|./images/|g' {} +
92+
93+
- name: (DOCS) Upload docs artifacts
94+
if: needs.is-only-docs-required.outputs.only-docs == 'true' && matrix.ansys-release == env.ANSYS_RELEASE_FOR_DOCS
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: maxwell2d-lumerical-docs
98+
path: |
99+
doc/_build/
100+
doc/source/examples/maxwell2d-lumerical/
101+
overwrite: true

.github/workflows/speos-optislang.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
BUILD_DOCS_SCRIPT: 'speos-optislang/wf_so_01_light_guide_robustness_study.py'
9999
shell: bash
100100
run: |
101-
.venv/Scripts/activate
101+
source .venv/Scripts/activate
102102
cd doc
103103
pip install -r requirements.txt
104104
./make.bat html

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,37 @@ for every part of the simulation process. The available workflows are:
2626
- For geometry: Ansys SpaceClaim / Ansys Discovery / Ansys Geometry Service
2727
- For meshing: Ansys Fluent Meshing
2828
- For simulation: Ansys Fluent Solver
29-
- [Geometry, mechanical and post-processing](https://github.com/ansys/pyansys-workflows/tree/main/geometry-mechanical-dpf): this workflow demonstrates how to
29+
30+
- [Geometry, mechanical and postprocessing](https://github.com/ansys/pyansys-workflows/tree/main/geometry-mechanical-dpf): this workflow demonstrates how to
3031
create a printed circuit board (PCB) geometry, mesh, run steady state and transient thermal analysis,
31-
and post-process using DPF. The geometry generated is a simple PCB with multiple chips.
32+
and postprocess using DPF. The geometry generated is a simple PCB with multiple chips.
3233
The exported CAD file (PMDB format) is then imported inside Ansys Mechanical
3334
to run a steady-state thermal analysis followed by transient analysis.
3435
All temperature results in different chips are displayed using DPF. The involved Ansys products are:
3536
- For geometry: Ansys SpaceClaim / Ansys Discovery / Ansys Geometry Service
3637
- For simulation: Ansys Mechanical
37-
- For post-procesing: Ansys Data Processing Framework
38-
- [Fluent and mechanical analysis](https://github.com/ansys/pyansys-workflows/tree/main/fluent-mechanical): this workflow demonstrates how to perform a Conjugate Heat Transfer (CHT) analysis for an exhaust manifold to simulate heat transfer between solid and fluid domains, calculate heat transfer coefficients (HTCs) and temperature distribution, and export results for thermo-mechanical analysis. The thermo-mechanical assessment is then performed to evaluate the exhaust manifold's performance under thermal cycling, aiding in design optimization for durability
39-
The involved Ansys products are:
38+
- For postprocesing: Ansys Data Processing Framework
39+
40+
- [Fluent and mechanical analysis](https://github.com/ansys/pyansys-workflows/tree/main/fluent-mechanical): this workflow demonstrates how to perform a Conjugate Heat Transfer (CHT) analysis for an exhaust manifold to simulate heat transfer between solid and fluid domains, calculate heat transfer coefficients (HTCs) and temperature distribution, and export results for thermo-mechanical analysis. The workflow then performs thermo-mechanical assessment to evaluate the exhaust manifold's performance under thermal cycling, aiding in design optimization for durability
41+
These Ansys products are used:
4042
- For fluids analysis: Ansys Fluent
4143
- For thermal analysis: Ansys Mechanical
42-
- [Speos and optiSLang robustness analysis](https://github.com/ansys/pyansys-workflows/tree/main/speos-optislang): this workflow performs a robustness
43-
study to evaluate how variations in LED source power and position influence lightguide performance using PySpeos and PyOptiSLang. The analysis quantifies performance
44-
through key metrics such as RMS contrast, average luminance, and the number of failed regulations.
45-
The involved Ansys products are:
44+
45+
- [Speos and optiSLang robustness analysis](https://github.com/ansys/pyansys-workflows/tree/main/speos-optislang): this workflow performs a robustness study to evaluate how variations in LED source power and position influence lightguide performance. The analysis quantifies performance through key metrics such as RMS contrast, average luminance, and the number of failed regulations.
46+
47+
These Ansys products are used:
4648
- For optical analysis: Ansys Speos
4749
- For robustness analysis: Ansys optiSLang
4850

51+
- [Maxwell2D and Lumerical ion trap modelling](https://github.com/ansys/pyansys-workflows/tree/main/maxwell2d-lumerical): this workflow
52+
is fully automated and models a chip-based ion trap that incorporates optical antennas with surface electrodes.
53+
Ansys Maxwell computes the electrostatic response of a three-rail surface electrode design, while Ansys Lumerical retrieves the data
54+
from Maxwell to optimize the grating coupler design that operates as an optical antenna for tightly focused laser beams.
55+
For additional information, see this article:
56+
https://optics.ansys.com/hc/en-us/articles/20715978394131-Integrated-Ion-Traps-using-Surface-Electrodes-and-Grating-Couplers
57+
In this article is also shown how multiple grating couplers can provide a platform for more complex field distributions and optical force calculation
58+
over various nano-objects.
59+
4960
## How to run the workflows
5061

5162
All workflows are structured in the same way, with a Python script for each part of the simulation process.

doc/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def examples_gallery_dirs_and_filename_pattern():
145145
"../../geometry-mesh",
146146
"../../geometry-mesh-fluent",
147147
"../../speos-optislang",
148+
"../../maxwell2d-lumerical",
148149
]
149150
gallery_dirs = [
150151
"examples/fluent-mechanical",
@@ -153,6 +154,7 @@ def examples_gallery_dirs_and_filename_pattern():
153154
"examples/geometry-mesh",
154155
"examples/geometry-mesh-fluent",
155156
"examples/speos-optislang",
157+
"examples/maxwell2d-lumerical",
156158
]
157159

158160
return examples_dirs, gallery_dirs, filename_pattern

doc/source/examples.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ Workflow examples
1212
examples/geometry-mesh-fluent/index
1313
examples/mapdl-dpf/index
1414
examples/speos-optislang/index
15+
examples/maxwell2d-lumerical/index
1516
.. TODO: enable when issues in PyMechanical are resolved
1617
examples/geometry-mechanical-dpf/index
1718

19+
1820
.. include:: examples/fluent-mechanical/index.rst
1921
:start-line: 1
2022
:end-before: .. toctree
@@ -36,6 +38,10 @@ Workflow examples
3638
:start-line: 1
3739
:end-before: .. toctree
3840

41+
.. include:: examples/maxwell2d-lumerical/index.rst
42+
:start-line: 1
43+
:end-before: .. toctree
44+
3945
.. include:: examples/speos-optislang/index.rst
4046
:start-line: 1
41-
:end-before: .. toctree
47+
:end-before: .. toctree

maxwell2d-lumerical/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
outputs

0 commit comments

Comments
 (0)