Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: PyFluent - PyMechanical exhaust manifold workflow #44

Merged
merged 74 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4a13f82
exhaust manifold ini
dipinknair Dec 13, 2024
c3c9651
update ci cd
dipinknair Dec 13, 2024
5732980
doc cicd update
dipinknair Dec 13, 2024
8fda778
update ci cd title
dipinknair Dec 13, 2024
5d49167
readme tbd
dipinknair Dec 13, 2024
53399e5
update ci cd for mechanical
dipinknair Dec 13, 2024
d38123b
updated pymech script
dipinknair Dec 13, 2024
33fc66b
deleted copy file
dipinknair Dec 13, 2024
675776b
rename
dipinknair Dec 13, 2024
73fe27a
Update fluent-mechanical/wf_fm_02_mechanical.py
dipinknair Dec 13, 2024
44072e4
Update fluent-mechanical/wf_fm_02_mechanical.py
dipinknair Dec 13, 2024
67fa31f
Pyfluent CHT workflow
abhishekchitwar Dec 16, 2024
fe8d7d9
defined the working dir
abhishekchitwar Dec 16, 2024
6b7e98a
update output folder
dipinknair Dec 16, 2024
092d904
Merge branch 'feat/add-pymech-fluent' of https://github.com/ansys-int…
dipinknair Dec 16, 2024
227e34f
update working dir
dipinknair Dec 16, 2024
24409bf
add matplotlib
dipinknair Dec 16, 2024
01a9a5e
fluent container change
dipinknair Dec 16, 2024
3e855a3
update container_dic
dipinknair Dec 16, 2024
84886c6
udpate download file
dipinknair Dec 16, 2024
3213ae5
minor
dipinknair Dec 16, 2024
3e83030
test
dipinknair Dec 16, 2024
a52d85a
fix
dipinknair Dec 17, 2024
de1e9c3
Merge branch 'main' into feat/add-pymech-fluent
RobPasMue Dec 17, 2024
c334ca5
fix: fluent launcher method
RobPasMue Dec 17, 2024
beaba2f
fix: missing dir
RobPasMue Dec 17, 2024
815e120
chore: add logging
RobPasMue Dec 17, 2024
d998041
fix: download file to shared folder
RobPasMue Dec 17, 2024
ebede03
Revert "fix: download file to shared folder"
RobPasMue Dec 17, 2024
2f6c30a
fix: store in dedicated location
RobPasMue Dec 17, 2024
ef2967d
fix: paths
RobPasMue Dec 17, 2024
c223ad2
changes to support 24r1 & 24r2
abhishekchitwar Dec 17, 2024
4448909
16 cores
dipinknair Dec 17, 2024
6cf2596
missing name in cicd
dipinknair Dec 17, 2024
a2a989f
revert to 8 cores
RobPasMue Dec 18, 2024
9bdedc7
ci: attempt to use PyFluent runners
RobPasMue Dec 18, 2024
22fb3cc
Merge branch 'feat/add-pymech-fluent' of https://github.com/ansys/pya…
RobPasMue Dec 18, 2024
e20ea5c
feat: use venv
RobPasMue Dec 18, 2024
4fcd454
revert: usage of self-hosted runners
RobPasMue Dec 18, 2024
7a20c8f
fix: typo
RobPasMue Dec 18, 2024
a217760
test only 242
dipinknair Jan 2, 2025
ca503f3
update license
dipinknair Jan 2, 2025
8e70784
test 242 only
dipinknair Jan 2, 2025
fb7cde1
remove version
dipinknair Jan 2, 2025
016fa8f
update run script action
dipinknair Jan 2, 2025
6fd7049
update cicd
dipinknair Jan 2, 2025
2b5ccc1
update processor count 2
dipinknair Jan 8, 2025
23a301a
making path host-system independent
raph-luc Jan 8, 2025
a72cd6b
cleaning up unused and unnecessary arguments
raph-luc Jan 8, 2025
6aae41d
2 processors didn't work, reverting back to 4
raph-luc Jan 8, 2025
0c59dbd
suggestion: removing unnecessary container config dict specification
raph-luc Jan 8, 2025
ea38b03
Update fluent-mechanical/wf_fm_02_mechanical.py
dipinknair Jan 8, 2025
a4876b0
set pymechanical start instance false
dipinknair Jan 8, 2025
78e06cc
Merge branch 'main' into feat/add-pymech-fluent
RobPasMue Jan 9, 2025
9e160b5
test coarse mesh
dipinknair Jan 13, 2025
70bcfe6
update mechancial image version
dipinknair Jan 14, 2025
460333c
test: working in local
dipinknair Jan 21, 2025
a15546d
till meshing
dipinknair Jan 21, 2025
0ecdb37
add prints and rectify name
dipinknair Jan 22, 2025
1a2387d
display image conditionally
dipinknair Jan 22, 2025
ab89fba
fix style
dipinknair Jan 22, 2025
9df1930
Update .github/workflows/docs.yml
dipinknair Jan 22, 2025
ccb2f0f
enable doc build
dipinknair Jan 22, 2025
ba9bfcb
fix doc build
dipinknair Jan 22, 2025
08183bc
change unitsystem
dipinknair Jan 22, 2025
8a96e95
update description
dipinknair Jan 22, 2025
53f0462
Merge branch 'main' into feat/add-pymech-fluent
dipinknair Jan 22, 2025
db1c143
revert readme
dipinknair Jan 22, 2025
4ed2f2f
update readme
dipinknair Jan 22, 2025
b175bbf
update pymech
dipinknair Jan 22, 2025
2e672af
readme and description
dipinknair Jan 24, 2025
4f0d2c7
review changes
dipinknair Jan 27, 2025
d95da1d
Merge branch 'main' into feat/add-pymech-fluent
dipinknair Jan 27, 2025
5f48364
Update README.md
RobPasMue Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,29 @@ jobs:
uses: ./.github/workflows/geometry-mesh.yml
secrets: inherit
with:
doc-build: true
doc-build: false #testing
dipinknair marked this conversation as resolved.
Show resolved Hide resolved
dipinknair marked this conversation as resolved.
Show resolved Hide resolved

geometry-mesh-fluent:
uses: ./.github/workflows/geometry-mesh-fluent.yml
secrets: inherit
with:
doc-build: true
doc-build: false #testing

geometry-mechanical-dpf:
uses: ./.github/workflows/geometry-mechanical-dpf.yml
secrets: inherit
with:
doc-build: false #testing

fluent-mechanical:
uses: ./.github/workflows/fluent-mechanical.yml
secrets: inherit
with:
doc-build: true

compile-docs:
runs-on: ubuntu-latest
needs: [geometry-mesh, geometry-mesh-fluent, geometry-mechanical-dpf]
needs: [geometry-mesh, geometry-mesh-fluent, geometry-mechanical-dpf, fluent-mechanical]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -66,6 +72,12 @@ jobs:
name: geometry-mechanical-dpf-docs
path: doc/

- name: Download artifacts for fluent-mechanical
uses: actions/download-artifact@v4
with:
name: fluent-mechanical-docs
path: doc/

- name: Build the documentation
run: |
cd doc
Expand Down
233 changes: 233 additions & 0 deletions .github/workflows/fluent-mechanical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
name: Fluent - Mechanical Exhaust Manifold Workflow

on:
workflow_dispatch:
inputs:
doc-build:
required: false
default: false
type: boolean
description: 'Whether to build the documentation'
workflow_call:
inputs:
doc-build:
required: false
default: false
type: boolean
description: 'Whether to build the documentation'
push:
branches:
- main
pull_request:
paths:
- 'fluent-mechanical/**'

env:
MAIN_PYTHON_VERSION: '3.12'
FLUENT_DOCKER_IMAGE: 'ghcr.io/ansys/pyfluent'
MECHANICAL_DOCKER_IMAGE: 'ghcr.io/ansys/mechanical'
DOCKER_MECH_CONTAINER_NAME: mechanical
PYMECHANICAL_PORT: 10000
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER )}}
PYANSYS_WORKFLOWS_CI: true
ANSYS_RELEASE_FOR_DOCS: 24.2
RUN_DOC_BUILD: false

jobs:
fluent:
name: Fluent
runs-on: public-ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
ansys-release: [24.1, 24.2]
steps:

- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: |
fluent-mechanical
doc

- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r fluent-mechanical/requirements_${{ matrix.ansys-release }}.txt

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download Fluent service container
run: docker pull ${{ env.FLUENT_DOCKER_IMAGE }}:v${{ matrix.ansys-release }}.0

- name: Run the Fluent script
env:
FLUENT_IMAGE_TAG: v${{ matrix.ansys-release }}.0
run: |
python fluent-mechanical/wf_fm_01_fluent.py

- name: Store the outputs
uses: actions/upload-artifact@v4
with:
name: fluent-mechanical-workflow-fluent-outputs-${{ matrix.ansys-release }}
path: |
fluent-mechanical/outputs/htc_temp_mapping_LOW_TEMP.csv
fluent-mechanical/outputs/htc_temp_mapping_MEDIUM_TEMP.csv
fluent-mechanical/outputs/htc_temp_mapping_HIGH_TEMP.csv

- name: Stop all containers (if any)
run: |
if [ -n "$(docker ps -a -q)" ]; then
docker rm -f $(docker ps -a -q)
fi

- name: (DOCS) Check if docs should be built
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && inputs.doc-build
run: |
echo "Requested to build docs..."
if [ "${{ matrix.ansys-release }}" == "${{ env.ANSYS_RELEASE_FOR_DOCS }}" ]; then
echo "Building docs"
echo "RUN_DOC_BUILD=true" >> $GITHUB_ENV
else
echo "Not building docs - since not primary release"
echo "RUN_DOC_BUILD=false" >> $GITHUB_ENV
fi

- name: (DOCS) Download the docs artifacts
uses: actions/download-artifact@v4
if: ${{ env.RUN_DOC_BUILD == 'true' }}
with:
name: fluent-mechanical-docs-stage-fluent
path: doc

- name: (DOCS) Build the documentation (only on ${{ env.ANSYS_RELEASE_FOR_DOCS}})
if: ${{ env.RUN_DOC_BUILD == 'true' }}
env:
FLUENT_IMAGE_TAG: v${{ matrix.ansys-release }}.0
BUILD_DOCS_SCRIPT: 'fluent-mechanical/wf_fm_01_fluent.py'
run: |
cd doc
find . -type f -exec sed -i 's|C:\\Users\\ansys\\actions-runner\\_work\\pyansys-workflows\\pyansys-workflows\\doc\\source\\examples\\fluent-mechanical\\images\\|./images/|g' {} +
pip install -r requirements.txt
make html

- name: (DOCS) Upload docs artifacts
if: ${{ env.RUN_DOC_BUILD == 'true' }}
uses: actions/upload-artifact@v4
with:
name: fluent-mechanical-docs-stage-fluent
path: |
doc/_build/
doc/source/examples/fluent-mechanical/
overwrite: true

mechanical:
name: Mechanical
runs-on: [public-ubuntu-latest-8-cores]
needs: fluent
strategy:
fail-fast: false
matrix:
ansys-release: [24.1, 24.2]
steps:

- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: |
fluent-mechanical
doc

- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y nodejs npm graphviz
npm install -g @mermaid-js/mermaid-cli

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m venv .venv
. .venv/bin/activate
pip install -r fluent-mechanical/requirements_${{ matrix.ansys-release }}.txt

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download (if needed) launch, and validate Mechanical service
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
run: |
docker pull ${{ env.MECHANICAL_DOCKER_IMAGE }}
docker run --restart always --name ${{ env.DOCKER_MECH_CONTAINER_NAME }} -e ANSYSLMD_LICENSE_FILE=1055@${{ env.LICENSE_SERVER }} -p ${{ env.PYMECHANICAL_PORT }}:10000 ${{ env.MECHANICAL_DOCKER_IMAGE }} > log.txt &
grep -q 'WB Initialize Done' <(timeout 60 tail -f log.txt)

- name: Check out the fluent outputs
uses: actions/download-artifact@v4
with:
name: fluent-mechanical-workflow-fluent-outputs-${{ matrix.ansys-release }}
path: fluent-mechanical/outputs

- name: Run the PyMechanical script
env:
ANSYS_MECHANICAL_RELEASE: ${{ matrix.ansys-release }}
run: |
. .venv/bin/activate
xvfb-run python fluent-mechanical/wf_fm_02_mechanical.py

- name: Store the outputs
uses: actions/upload-artifact@v4
with:
name: fluent-mechanical-workflow-mechanical-outputs-${{ matrix.ansys-release }}
path: fluent-mechanical/outputs

- name: (DOCS) Check if docs should be built
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && inputs.doc-build
run: |
echo "Requested to build docs..."
if [ "${{ matrix.ansys-release }}" = "${{ env.ANSYS_RELEASE_FOR_DOCS }}" ]; then
echo "Building docs"
echo "RUN_DOC_BUILD=true" >> $GITHUB_ENV
else
echo "Not building docs - since not primary release"
echo "RUN_DOC_BUILD=false" >> $GITHUB_ENV
fi

- name: (DOCS) Build the documentation (only on ${{ env.ANSYS_RELEASE_FOR_DOCS }})
if: ${{ env.RUN_DOC_BUILD == 'true' }}
env:
ANSYS_MECHANICAL_RELEASE: ${{ matrix.ansys-release }}
BUILD_DOCS_SCRIPT: 'geometry-mechanical-dpf/wf_gmd_02_mechanical.py'
run: |
. .venv/bin/activate
find . -type f -exec sed -i 's|C:\\Users\\ansys\\actions-runner\\_work\\pyansys-workflows\\pyansys-workflows\\doc\\source\\examples\\fluent-mechanical\\images\\|./images/|g' {} +
pip install -r ./doc/requirements.txt
xvfb-run make -C doc html

- name: (DOCS) Upload docs artifacts
if: ${{ env.RUN_DOC_BUILD == 'true' }}
uses: actions/upload-artifact@v4
with:
name: fluent-mechanical-docs-stage-mechanical
path: |
doc/_build/
doc/source/examples/fluent-mechanical/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 ANSYS, Inc. and/or its affiliates.
Copyright (c) 2024 - 2025 ANSYS, Inc. and/or its affiliates.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2024 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
4 changes: 4 additions & 0 deletions fluent-mechanical/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fluent - Mechanical workflow
============================

TBD
3 changes: 3 additions & 0 deletions fluent-mechanical/requirements_24.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ansys-mechanical-core==0.11.10
ansys-fluent-core==0.26.1
matplotlib==3.10.0
3 changes: 3 additions & 0 deletions fluent-mechanical/requirements_24.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ansys-mechanical-core==0.11.10
ansys-fluent-core==0.26.1
matplotlib==3.10.0
Loading
Loading