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

Updates from main #12

Merged
merged 25 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: FENIAX tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.11, 3.12]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f ./tests/requirements.txt ]; then pip install -r ./tests/requirements.txt; fi

- name: Run tests
run: |
pip install .
pytest tests
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# To install the git pre-commit hooks run:
# pre-commit install --install-hooks
# To update the versions:
# pre-commit autoupdate
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.4
hooks:
# Run the linter.
- id: ruff
args: [--fix, --show-fixes]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.5.2"
hooks:
- id: pyproject-fmt
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: '.*\.pth$'
- id: debug-statements
60 changes: 53 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Finite Element models 4 Intrinsic Nonlinear Aeroelastics in JAX [FENIAX]

FEM4INAS is an aeroelastic toolbox written and parallelized in Python, which acts as a post-processor of commercial software such as MSC Nastran.
FENIAX is an aeroelastic toolbox written and parallelized in Python, which acts as a post-processor of commercial software such as MSC Nastran.
Arbitrary FE models built for linear aeroelastic analysis are enhanced with geometric nonlinear effects, flight dynamics and linearized state-space solutions about nonlinear equilibrium.

![XRF1](./docs/images/xrf1-model3.jpg)

## Installation

- Currently the code has been tested and is developed in Linux and MacOS.
Expand All @@ -23,7 +21,7 @@ pip install -e .[all]
Although it is not necessary, If conda is being used as package manager, one can make a specific environment as,

```
conda create -n fem4inas python=3.11
conda create -n feniax python=3.11
conda activate fem4inas
```

Expand All @@ -35,13 +33,61 @@ pytest tests

- Thus a typical installation would comprise of these 4 steps:
```
conda create -n fem4inas python=3.11
conda create -n feniax.python=3.11
conda activate fem4inas
pip install -e .[all]
pytest tests
```

## Examples
## Documentation
Available at https://acea15.github.io/FENIAX/
## Simulation Examples

The most relevant examples in the code base are shown here, these and more can be found in the folder `/examples`
They are also part of a large test suite that is integrated into the development using CI/CD.

!!! tip
Navigate to the code of the various examples, including the simulation input settings and postprocessing of the simulation --exactly as it was used for the articles backing the software.


### Nonlinear structural static results
!!! success
Validated with MSC Nastran nonlinear solution (sol 400)

[Notebook](./docs/documentation/examples/SailPlane/sailplane_nb.md)

### Wing free dynamics
!!! success
Validated with MSC Nastran nonlinear solution (sol 400)

[Notebook](./docs/documentation/examples/wingSP/wingSP_nb.md)


![Wing free dynamics](./docs/media/wingSP_optimized.gif)


### Free flying structure

[Bio](https://mechanics.stanford.edu/simo)

[Notebook](./docs/documentation/examples/wingSP/wingSP_nb.md)

#### 2D dynamics
![Free flying structure 2D](./docs/media/SimoFFB2D_optimized.gif)
#### 3D dynamics
![Free flying structure 3D](./docs/media/SimoFFB3D_optimized.gif)

### Industrial Aircraft model
!!! success
Linear response validated with MSC Nastran linear aeroelastic solution (sol 146)

#### Gust clamped model

[Notebook](./docs/documentation/examples/XRF1/xrf1_nb.md)


![XRF1-gustclamped](./docs/media/xrf1_gust_optimized.gif)

The folder examples contains various instances with models, input files and postprocessing of the results. See each README.org for for more info.

#### Gust trimmed flight
![XRF1-Trim+gust](./docs/media/xrf1_trimgust_optimized.gif)
3 changes: 3 additions & 0 deletions docs/documentation/JAX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# JAX

![Jax logo](./img/jaxlogo.png)
1 change: 1 addition & 0 deletions docs/documentation/LICENSE.md
72 changes: 72 additions & 0 deletions docs/documentation/UML.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# example

```mermaid
classDiagram
class Driver {
+pre_simulation()
+run_cases()
}

class IntrinsicDriver {
#integration: IntrinsicIntegration
#simulation: Simulation
#opt: Optimisation
#systems: [System]
-__init__(config: Config)
#_set_case()
#_set_integration()
#_set_simulation()
#_set_systems()
}

class XLoads {
+q: [jnp.ndarray]
+Rab: [jnp.ndarray]
+GAFs: [jnp.ndarray]
+followerF()
+deadF()
+gravityF()
+modalAero()
}

class IntrinsicIntegration {
+ <math>phi_1, phi_2, psi_1, psi_2</math>
+ <math>Gamma_1, Gamma_2 </math>
-__init__(X, Ka, Ma)
+run()
#compute_modalshapes()
#compute_modalcouplings()
}

class Simulation {
+systems: [System]
#workflow: dict
#opt: Optimisation
+trigger()
#run_systems()
#post_run()
}
class SerialSimulation {
}
class ParallelSimulation {
}
class SingleSimulation {
}
class CoupledSimulation {
}

class IntrinsicSystem {
-dq: callable
-solver: callable
+sol: obj
#set_generator() -> dq
#set_solver() -> solver

}
Driver <|-- IntrinsicDriver
Simulation <|-- SingleSimulation
SingleSimulation -- SerialSimulation
SerialSimulation -- ParallelSimulation
ParallelSimulation -- CoupledSimulation

```
1 change: 1 addition & 0 deletions docs/documentation/api/couplings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: intrinsic.couplings
5 changes: 5 additions & 0 deletions docs/documentation/api/inputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Input containers

## Intrinsic modal solution

::: preprocessor.containers.intrinsicmodal
1 change: 1 addition & 0 deletions docs/documentation/api/modes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: intrinsic.modes
2 changes: 2 additions & 0 deletions docs/documentation/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Examples

1 change: 1 addition & 0 deletions docs/documentation/examples/SailPlane/figs
1 change: 1 addition & 0 deletions docs/documentation/examples/SailPlane/figs_ext
Loading
Loading