|
|
## MPHYS API
|
|
|
[MPHYS](https://github.com/openMDAO/MPHYS) (Multi-PHYSics) is a framework designed to perform multi-physics analysis and optimization, and is built on top of [openMDAO](https://openmdao.org/). The API allows to interface DART with other software through MPHYS, and is implemented under [api/mphys](https://gitlab.uliege.be/am-dept/dartflo/blob/master/dart/api/mphys.py).
|
|
|
## MPhys API
|
|
|
[MPhys](https://github.com/openMDAO/MPHYS) (Multi-Physics) is a framework designed to perform multi-physics analysis and optimization, and is built on top of [OpenMDAO](https://openmdao.org/). The API allows to interface DART with other software through MPhys, and is implemented under [api/mphys](https://gitlab.uliege.be/am-dept/dartflo/blob/master/dart/api/mphys.py).
|
|
|
|
|
|
**0. Importing the API**
|
|
|
Since MPHYS couples multiple software, it is required to install them before using MPHYS. As such, DART cannot be used from a development environment (it must be installed), and must be imported by calling,
|
|
|
Since MPhys couples multiple software, it is required to install them before using MPhys. As such, DART cannot be used from a development environment (it must be installed), and must be imported by calling,
|
|
|
```python
|
|
|
from dartflo.dart.api.mphys import DartBuilder
|
|
|
```
|
|
|
|
|
|
**1. Initializing the interface**
|
|
|
In practise, the MPHYS API uses the [Core API](use_api_core) to initialize DART. Note that the interface must be setup in an MPHYS class,
|
|
|
In practise, the MPhys API uses the [Core API](use_api_core) to initialize DART. Note that the interface must be setup in an MPhys class,
|
|
|
```python
|
|
|
from mphys import Multipoint
|
|
|
class Top(Multipoint):
|
|
|
# ...
|
|
|
dart = DartBuilder(cfg, scenario='aerodynamic', task='analysis', saveAll=False, raiseError=False)
|
|
|
```
|
|
|
where `cfg` is a dictionary of parameters (available choices are listed in [core](use_api_core)), and where valid choices for `scenario` are `'aerodynamic'` or `'aerostructural'`, and valid choices for `task` are `'analysis'` or `'optimization'`. Additonally, `saveAll` is a boolean indicating whether to write results to different files at each (major) iteration, and `raiseError` is a boolean indicating whether to raise an `openMDAO.AnalysisError` when the solver does not fully converge.
|
|
|
where `cfg` is a dictionary of parameters (available choices are listed in [core](use_api_core)), and where valid choices for `scenario` are `'aerodynamic'` or `'aerostructural'`, and valid choices for `task` are `'analysis'` or `'optimization'`. Additionally, `saveAll` is a boolean indicating whether to write results to different files at each (major) iteration, and `raiseError` is a boolean indicating whether to raise an `OpenMDAO.AnalysisError` when the solver does not fully converge.
|
|
|
|
|
|
*Note* DART can be coupled with [pyGeo](https://github.com/mdolab/pyGeo), which uses the free-form deformation technique, to perform aerodynamic shape optimization. Since pyGeo only handles 3D geometries, users wanting to perform 2D shape optimization must provide a so-called 2.5D geometry, which consists of an extruded 2D geometry enclosed between two symmetry walls. In such a case, the parameters `'WakeTips'` MUST NOT be given.
|
|
|
|
|
|
**2. Using the interface**
|
|
|
Users should refer to the MPHYS documentation to connect the interface through MPHYS. In version 1.0.0, this is done by calling,
|
|
|
Users should refer to the MPhys documentation to connect the interface through MPhys. In version 1.3.0, this is done by calling,
|
|
|
```python
|
|
|
# for pure aerodynamic computations...
|
|
|
from mphys.scenario_aerodynamic import ScenarioAerodynamic
|
... | ... | |